⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frm_outpat.vb

📁 application file which contains the notes on Ado.net
💻 VB
📖 第 1 页 / 共 5 页
字号:
            TextBox20.Text = MyReader("examc")
            TextBox19.Text = MyReader("othersc")
            TextBox12.Text = MyReader("ino")
            TextBox13.Text = MyReader("icomp")
            TextBox21.Text = MyReader("cheno")
            TextBox22.Text = MyReader("chedate")
            TextBox23.Text = MyReader("chename")
            ComboBox5.Text = MyReader("ccardtype")
            TextBox14.Text = MyReader("cardno")
            TextBox25.Text = MyReader("exdate")
        End While
        MyConnection.Close()
        MyReader.Close()
        MyCommand.dispose()
    End Function
    Function getslipno() As String
        Dim some As String = TextBox15.Text
        Dim another As Integer
        Dim newslip2 As String = "OSS-0"
        Dim number As String
        another = CInt(some.TrimStart("O", "S", "-"))
        another += 1
        number = another.ToString()
        Return newslip2 + number
    End Function
    Function getpat12()
        MyConnection.Open()
        MyCommand = New OleDbCommand("SELECT * FROM outpat", MyConnection)
        MyReader = MyCommand.ExecuteReader()
        While MyReader.Read
            TextBox26.Text = MyReader("outcode")
        End While
        MyConnection.Close()
        MyReader.Close()
        MyCommand.dispose()
    End Function
    Function getpatcode() As String
        Dim some As String = TextBox26.Text
        Dim another As Integer
        Dim newslip2 As String = "OUT-0"
        Dim number As String

        another = CInt(some.TrimStart("O", "U", "T", "-"))
        another += 1
        number = another.ToString()
        Return newslip2 + number
    End Function
    Function validslip() As Boolean
        Dim some As String = TextBox11.Text
        If some.StartsWith("SS-0") = True Then
            Return True
        Else
            Return False
        End If
    End Function
    Function addpat()
        MyConnection.Open()
        MyCommand = New OleDbCommand("INSERT INTO outpat VALUES ('" & TextBox6.Text & "','" & TextBox1.Text & "','" & TextBox2.Text & "','" & ComboBox1.Text & "','" & ComboBox3.Text & "','" & TextBox3.Text & "','" & TextBox4.Text & "','" & TextBox7.Text & "','" & TextBox5.Text & "','" & TextBox10.Text & "','" & TextBox9.Text & "','" & ComboBox2.Text & "','" & ComboBox4.Text & "')", MyConnection)
        Try
            MyCommand.ExecuteNonQuery()
        Catch c As Exception
            MsgBox(c.ToString())
        End Try
        MyConnection.Close()
        MyCommand.dispose()
    End Function
    Function delpat()
        MyConnection.Open()
        MyCommand = New OleDbCommand("DELETE FROM outpat WHERE outcode = '" & TextBox6.Text & "'", MyConnection)
        MyCommand.ExecuteNonQuery()
        MyConnection.Close()
        MyCommand.dispose()
    End Function
    Function editpat()
        MyConnection.Open()
        MyCommand = New OleDbCommand("UPDATE outpat SET fname ='" & TextBox1.Text & "', lname ='" & TextBox2.Text & "', gender = '" & ComboBox1.Text & "', status ='" & ComboBox3.Text & "', address = '" & TextBox3.Text & "', phone = '" & TextBox4.Text & "', birthday = '" & TextBox5.Text & "', age = '" & TextBox7.Text & "', religion = '" & TextBox10.Text & "', nationality = '" & TextBox9.Text & "', ward = '" & ComboBox2.Text & "', physician ='" & ComboBox4.Text & "' WHERE outcode = '" & TextBox6.Text & "'", MyConnection)
        Try
            MyCommand.ExecuteNonQuery()
        Catch c As Exception
            MsgBox(c.ToString)
        End Try
        MyConnection.Close()
        MyCommand.Dispose()
    End Function
    Function addslip()
        MyConnection.Open()
        MyCommand = New OleDbCommand(" INSERT INTO outbill VALUES ('" & TextBox11.Text & "','" & ptype & "','" & TextBox16.Text & "','" & TextBox17.Text & "','" & TextBox18.Text & "','" & TextBox20.Text & "','" & TextBox19.Text & "','" & TextBox12.Text & "','" & TextBox13.Text & "','" & TextBox21.Text & "','" & TextBox22.Text & "','" & TextBox23.Text & "','" & ComboBox5.Text & "','" & TextBox14.Text & "','" & TextBox25.Text & "','" & TextBox6.Text & "') ", MyConnection)
        Try
            MyCommand.ExecuteNonQuery()
        Catch c As Exception
            MsgBox(c.ToString)
        End Try
        MyConnection.Close()
        MyCommand.dispose()
    End Function
    Function delslip()
        MyConnection.Open()
        MyCommand = New OleDbCommand("DELETE FROM outbill WHERE slipno = '" & TextBox11.Text & "'", MyConnection)
        MyCommand.ExecuteNonQuery()
        MyConnection.Close()
        MyCommand.dispose()
    End Function
    Function editslip()
        MyConnection.Open()
        MyCommand = New OleDbCommand("UPDATE outbill SET ptype = '" & ptype & "', wardc = '" & TextBox16.Text & "', phyc = '" & TextBox17.Text & "',carec = '" & TextBox18.Text & "', examc = '" & TextBox20.Text & "', othersc = '" & TextBox19.Text & "', ino = '" & TextBox12.Text & "', icomp = '" & TextBox13.Text & "', cheno = '" & TextBox21.Text & "',chedate = '" & TextBox22.Text & "', chename = '" & TextBox23.Text & "', ccardtype = '" & ComboBox5.Text & "', cardno = '" & TextBox14.Text & "', exdate =  '" & TextBox25.Text & "' WHERE slipno ='" & TextBox11.Text & "'", MyConnection)
        MyCommand.ExecuteNonQuery()
        MyConnection.Close()
        MyCommand.dispose()
    End Function
    Private Sub frm_outpat_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        disablebuttons()
        disablefields()
        MyConnection.Open()
        MyCommand = New OleDbCommand("SELECT * FROM Physicians", MyConnection)
        MyReader = MyCommand.ExecuteReader()
        While MyReader.Read
            ComboBox4.Items.Add(MyReader("Phyname"))
        End While
        MyReader.Close()
        MyCommand.dispose()
        MyCommand = New OleDbCommand("SELECT * FROM Ward", MyConnection)
        MyReader = MyCommand.ExecuteReader()
        While MyReader.Read
            ComboBox2.Items.Add(MyReader("wardname"))
        End While
        MyConnection.Close()
        MyReader.Close()
        MyCommand.Dispose()
    End Sub
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Label2.Text = currentTime.Now.ToShortTimeString + " , " + Now.ToShortDateString
    End Sub
    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        Me.Close()
    End Sub
    Private Sub ContextMenu1_Popup(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub
    Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged
        GroupBox4.Visible = True
        GroupBox6.Visible = False
        TextBox21.Text = "CREDIT CARD"
        TextBox22.Text = "CREDIT CARD"
        TextBox23.Text = "CREDIT CARD"
    End Sub
    Private Sub RadioButton5_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton5.CheckedChanged
        GroupBox4.Visible = False
        GroupBox6.Visible = True
        ComboBox5.Text = "CHEQUE"
        TextBox14.Text = "CHEQUE"
        TextBox25.Text = "CHEQUE"
    End Sub
    Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
        GroupBox4.Visible = False
        GroupBox6.Visible = False
        TextBox21.Text = "CASH"
        TextBox22.Text = "CASH"
        TextBox23.Text = "CASH"
        ComboBox5.Text = "NONE"
        TextBox14.Text = "CASH"
        TextBox25.Text = "NONE"
    End Sub
    Private Sub RadioButton4_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton4.CheckedChanged
        TextBox13.Enabled = True
        ptype = "COMPANY"
    End Sub
    Private Sub RadioButton3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton3.CheckedChanged
        TextBox13.Enabled = False
        ptype = "PRIVATE"
        TextBox13.Text = "NONE"
    End Sub
    Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs)

    End Sub
    Private Sub GroupBox1_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GroupBox1.Enter

    End Sub
    Function check1() As Boolean
        If TextBox6.Text = "" Then
            Return True
        Else
            Return False
        End If
    End Function
    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
        Button10.Enabled = True
        Button6.Enabled = False
        Button7.Enabled = False
        Button8.Enabled = False
        getpat12()
        getno()
        TextBox6.Text = getpatcode()
        TextBox11.Text = getslipno()
        enablefields()
    End Sub
    Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
        addpat()
        addslip()
        Button10.Enabled = False
        Button6.Enabled = True
        Button7.Enabled = True
        Button8.Enabled = True
        MsgBox("New Slip Has Been Added", MsgBoxStyle.Information, "PrisLogix's PIS")
        clearfields()
    End Sub
    Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
        If check1() = True Then
            MsgBox("Please enter the out patient code for the slip you want to edit", MsgBoxStyle.Information, "PrisLogix's PIS")
        Else
            enablefields()
            Button6.Enabled = False
            Button7.Enabled = False
            Button8.Enabled = False
            Button12.Enabled = True
            fillform()
        End If
    End Sub
    Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click
        editpat()
        editslip()
        disablefields()
        clearfields()
        MsgBox("Slip Has Been Updated", MsgBoxStyle.Information, "PrisLogix's PIS")
    End Sub
    Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
        If check1() = True Then
            MsgBox("Please enter the out patient code for which you want to view the slip", MsgBoxStyle.Information, "PrisLogix's PIS")
        Else
            fillform()
        End If
    End Sub
    Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
        If check1() = True Then
            MsgBox("Please enter the out patient code for the slip you want to Delete", MsgBoxStyle.Information, "PrisLogix's PIS")
        Else
            enablefields()
            Button6.Enabled = False
            Button7.Enabled = False
            Button8.Enabled = False
            Button13.Enabled = True
            fillform()
        End If
    End Sub
    Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button13.Click
        delpat()
        delslip()
        clearfields()
        MsgBox("The patient record has been deleted", MsgBoxStyle.Information, "PrisLogix's PIS")
    End Sub
#End Region
    Dim refg
    Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
        refg = New frm_outviewer
        refg.show()
    End Sub
#Region "GLOW CODE"
    Private Sub MouseEnterEvent(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.MouseEnter, Button3.MouseEnter, Button4.MouseEnter, Button5.MouseEnter, Button6.MouseEnter, Button7.MouseEnter, Button8.MouseEnter, Button9.MouseEnter, Button10.MouseEnter, Button11.MouseEnter, Button12.MouseEnter, Button13.MouseEnter
        ' A simple event handler that fires when the user's mouse arrow rolls 
        ' over any of the buttons.  It passes the button's identity to the Glow sub.

        Dim ctrl As Control = CType(sender, Control)
        Glow(ctrl, True)

    End Sub

    Private Sub MouseLeaveEvent(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.MouseLeave, Button3.MouseLeave, Button4.MouseLeave, Button5.MouseLeave, Button6.MouseLeave, Button7.MouseLeave, Button8.MouseLeave, Button9.MouseLeave, Button10.MouseLeave, Button11.MouseLeave, Button12.MouseLeave, Button13.MouseLeave

        ' A simple event handler that fires when the user's mouse arrow leaves the
        ' area of any of the buttons.  It passes the button's identity to the Glow sub.

        Dim ctrl As Control = CType(sender, Control)
        Glow(ctrl, False)

    End Sub

    Private Sub Glow(ByVal ctrl As Control, ByVal Hovering As Boolean)

        Dim Sb_R, Sb_G, Sb_B As Int16 '           <--- RGB values for the starting backcolor
        Dim Sf_R, Sf_G, Sf_B As Int16 '           <--- RGB values for the starting forecolor
        Dim Eb_R, Eb_G, Eb_B As Int16 '           <--- RGB values for the ending backcolor
        Dim Ef_R, Ef_G, Ef_B As Int16 '           <--- RGB values for the ending forecolor

        Select Case Hovering  ' True for MouseEnter, False for MouseLeave
            Case True
                Sb_R = SystemColors.Control.R           ' Assign the variables the 
                Sb_G = SystemColors.Control.G           ' appropriate values based
                Sb_B = SystemColors.Control.B           ' on system-defined colors
                '                                         for control and control
                Sf_R = SystemColors.ControlText.R       ' text.
                Sf_G = SystemColors.ControlText.G
                Sf_B = SystemColors.ControlText.B

                Eb_R = SystemColors.ActiveCaption.R     ' Assign the variables the
                Eb_G = SystemColors.ActiveCaption.G     ' appropriate values based
                Eb_B = SystemColors.ActiveCaption.B     ' on system-defined colors
                '                                         for the title bar and the
                Ef_R = SystemColors.ActiveCaptionText.R ' title bar's text.
                Ef_G = SystemColors.ActiveCaptionText.G
                Ef_B = SystemColors.ActiveCaptionText.B
            Case False
                Sb_R = SystemColors.ActiveCaption.R     ' Assign the variables the
                Sb_G = SystemColors.ActiveCaption.G     ' appropriate values based
                Sb_B = SystemColors.ActiveCaption.B     ' on system-defined colors
                '                                         for 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -