📄 frm_patinfo.vb
字号:
Me.TextBox14.Name = "TextBox14"
Me.TextBox14.TabIndex = 3
Me.TextBox14.Text = ""
'
'TextBox15
'
Me.TextBox15.BackColor = System.Drawing.SystemColors.Info
Me.TextBox15.Location = New System.Drawing.Point(344, 64)
Me.TextBox15.Name = "TextBox15"
Me.TextBox15.TabIndex = 4
Me.TextBox15.Text = ""
'
'Label19
'
Me.Label19.Location = New System.Drawing.Point(240, 32)
Me.Label19.Name = "Label19"
Me.Label19.Size = New System.Drawing.Size(80, 16)
Me.Label19.TabIndex = 0
Me.Label19.Text = "Insurance No"
'
'Label20
'
Me.Label20.Location = New System.Drawing.Point(240, 64)
Me.Label20.Name = "Label20"
Me.Label20.Size = New System.Drawing.Size(80, 16)
Me.Label20.TabIndex = 1
Me.Label20.Text = "Company"
'
'TextBox13
'
Me.TextBox13.Location = New System.Drawing.Point(328, 488)
Me.TextBox13.Name = "TextBox13"
Me.TextBox13.TabIndex = 42
Me.TextBox13.Text = "TextBox13"
'
'Button14
'
Me.Button14.BackColor = System.Drawing.SystemColors.ControlLight
Me.Button14.Location = New System.Drawing.Point(456, 400)
Me.Button14.Name = "Button14"
Me.Button14.Size = New System.Drawing.Size(88, 23)
Me.Button14.TabIndex = 43
Me.Button14.Text = "Get Patient!"
'
'Button15
'
Me.Button15.BackColor = System.Drawing.SystemColors.ControlLight
Me.Button15.Location = New System.Drawing.Point(552, 400)
Me.Button15.Name = "Button15"
Me.Button15.TabIndex = 44
Me.Button15.Text = "Clear"
'
'frm_patinfo
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.BackColor = System.Drawing.SystemColors.InactiveCaptionText
Me.ClientSize = New System.Drawing.Size(818, 440)
Me.Controls.Add(Me.Button15)
Me.Controls.Add(Me.Button14)
Me.Controls.Add(Me.TextBox13)
Me.Controls.Add(Me.TextBox11)
Me.Controls.Add(Me.TextBox10)
Me.Controls.Add(Me.TextBox9)
Me.Controls.Add(Me.TextBox8)
Me.Controls.Add(Me.TextBox7)
Me.Controls.Add(Me.TextBox6)
Me.Controls.Add(Me.TextBox5)
Me.Controls.Add(Me.TextBox4)
Me.Controls.Add(Me.GroupBox6)
Me.Controls.Add(Me.GroupBox5)
Me.Controls.Add(Me.Button10)
Me.Controls.Add(Me.GroupBox4)
Me.Controls.Add(Me.Label16)
Me.Controls.Add(Me.GroupBox3)
Me.Controls.Add(Me.Label15)
Me.Controls.Add(Me.ComboBox3)
Me.Controls.Add(Me.Label14)
Me.Controls.Add(Me.GroupBox2)
Me.Controls.Add(Me.ComboBox2)
Me.Controls.Add(Me.ComboBox1)
Me.Controls.Add(Me.Label9)
Me.Controls.Add(Me.GroupBox1)
Me.Controls.Add(Me.Label8)
Me.Controls.Add(Me.Label7)
Me.Controls.Add(Me.Label6)
Me.Controls.Add(Me.Label5)
Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.PictureBox1)
Me.Controls.Add(Me.Label1)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "frm_patinfo"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "PrisLogix'a PIS"
Me.GroupBox1.ResumeLayout(False)
Me.GroupBox2.ResumeLayout(False)
Me.GroupBox3.ResumeLayout(False)
Me.GroupBox4.ResumeLayout(False)
Me.GroupBox5.ResumeLayout(False)
Me.GroupBox6.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
#End Region
' The given my Connection that will be used for the Db access
Dim MyConnection As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\PIS.mdb")
Dim MyCommand
Dim e As Exception
Dim MyCommand2
Dim MyReader As OleDbDataReader
Dim MyReader2 As OleDbDataReader
Dim dbset As New DataSet
Dim dataA
Dim time As Date
Dim formref
Dim ref2
Dim ref3
Dim ref4
#Region "CODE STARTS HERE"
Private Sub frm_patinfo_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
dbset.Clear()
MyConnection.Open()
MyCommand = New OleDbCommand("Select patcode,patname,address,blood FROM Patients", MyConnection)
dataA = New OleDbDataAdapter(MyCommand)
dataA.Fill(dbset, "Patients")
'DataGrid1.ReadOnly = True
'DataGrid1.DataSource = dbset.Tables("Patients")
MyConnection.Close()
MyCommand.Dispose()
dataA.Dispose()
dbset.Dispose()
disablefields()
getward()
getphy()
End Sub
Function check()
If TextBox4.Text = "" Then
Return True
ElseIf ComboBox1.Text = "" Then
Return True
ElseIf ComboBox3.Text = "" Then
Return True
ElseIf ComboBox4.Text = "" Then
Return True
ElseIf ComboBox5.Text = "" Then
Return True
ElseIf ComboBox6.Text = "" Then
Return True
ElseIf TextBox5.Text = "" Then
Return True
ElseIf TextBox7.Text = "" Then
Return True
ElseIf TextBox8.Text = "" Then
Return True
ElseIf TextBox6.Text = "" Then
Return True
ElseIf TextBox9.Text = "" Then
Return True
ElseIf ComboBox2.Text = "" Then
Return True
ElseIf TextBox3.Text = "" Then
Return True
ElseIf TextBox2.Text = "" Then
Return True
ElseIf TextBox1.Text = "" Then
Return True
ElseIf TextBox10.Text = "" Then
Return True
ElseIf TextBox11.Text = "" Then
Return True
'ElseIf TextBox13.Text = "" Then
' Return True
ElseIf TextBox14.Text = "" Then
Return True
ElseIf TextBox15.Text = "" Then
Return True
ElseIf TextBox16.Text = "" Then
Return True
Else
Return False
End If
End Function
Function getid()
MyConnection.Open()
MyCommand = New OleDbCommand("SELECT * FROM Patients", MyConnection)
MyReader = MyCommand.ExecuteReader()
While MyReader.Read
TextBox13.Text = MyReader("patcode")
End While
MyConnection.Close()
MyReader.Close()
MyCommand.dispose()
End Function
Function saveclinicothers()
Dim filename As String = "C:\patinfo\" + TextBox4.Text + ".txt"
Try
Dim oFile As FileStream = New FileStream(filename, FileMode.OpenOrCreate, FileAccess.Write)
Dim oStream As StreamWriter = New StreamWriter(oFile)
oStream.Write(TextBox12.Text)
oStream.Flush()
oStream.Close()
oFile.Close()
Catch e As Exception
MsgBox(e.ToString)
End Try
End Function
Function getpatcode()
Dim some = TextBox13.Text
Dim another As Integer
Dim newslip2 As String = "pat-0"
Dim number As String
another = CInt(some.TrimStart("p", "a", "t", "-"))
another += 1
number = another.ToString()
Return newslip2 + number
End Function
Function getphy()
MyConnection.Open()
MyCommand = New OleDbCommand("SELECT * FROM physicians", MyConnection)
MyReader = MyCommand.ExecuteReader()
While MyReader.Read
ComboBox5.Items.Add(MyReader("phycode"))
End While
MyConnection.Close()
MyReader.Close()
MyCommand.dispose()
End Function
Function idcheck() As Boolean
If TextBox4.Text = "" Then
Return True
Else
Return False
End If
End Function
Function clear()
TextBox4.Text = ""
ComboBox1.Text = ""
TextBox5.Text = ""
TextBox7.Text = ""
TextBox10.Text = ""
TextBox8.Text = ""
TextBox6.Text = ""
TextBox9.Text = ""
ComboBox2.Text = ""
TextBox3.Text = ""
TextBox2.Text = ""
TextBox1.Text = ""
TextBox11.Text = ""
TextBox10.Text = ""
TextBox12.Text = ""
ComboBox4.Text = ""
ComboBox3.Text = ""
ComboBox5.Text = ""
ComboBox6.Text = ""
TextBox14.Text = ""
TextBox15.Text = ""
TextBox16.Text = ""
End Function
Function disablefields()
'TextBox4.Enabled() = False
ComboBox1.Enabled() = False
TextBox5.Enabled = False
TextBox7.Enabled = False
TextBox10.Enabled = False
TextBox8.Enabled = False
TextBox6.Enabled = False
TextBox9.Enabled = False
ComboBox2.Enabled = False
TextBox3.Enabled = False
TextBox2.Enabled = False
TextBox1.Enabled = False
TextBox11.Enabled = False
ComboBox3.Enabled = False
ComboBox4.Enabled = False
ComboBox5.Enabled = False
ComboBox6.Enabled = False
TextBox12.Enabled = False
TextBox14.Enabled = False
TextBox15.Enabled = False
TextBox16.Enabled = False
End Function
Function enablefields()
'TextBox4.Enabled() = True
ComboBox1.Enabled() = True
TextBox5.Enabled = True
TextBox7.Enabled = True
TextBox10.Enabled = True
TextBox8.Enabled = True
TextBox6.Enabled = True
TextBox9.Enabled = True
ComboBox2.Enabled = True
TextBox3.Enabled = True
TextBox2.Enabled = True
TextBox1.Enabled = True
TextBox11.Enabled = True
ComboBox3.Enabled = True
ComboBox4.Enabled = True
ComboBox5.Enabled = True
ComboBox6.Enabled = True
TextBox12.Enabled = True
TextBox14.Enabled = True
TextBox15.Enabled = True
TextBox16.Enabled = True
End Function
Function fresh()
'DataGrid1.Refresh()
End Function
Function fillform()
'patode ='" & TextBox4.Text & "'
MyConnection.Open()
MyCommand = New OleDbCommand("Select * FROM Patients WHERE patcode ='" & TextBox4.Text & "' ", MyConnection)
Try
MyReader = MyCommand.ExecuteReader()
Catch c As Exception
MsgBox(c.ToString)
Finally
End Try
While MyReader.Read
'TextBox4.Text = MyReader("patcode")
ComboBox1.Text = MyReader("gender")
TextBox5.Text = MyReader("patname")
TextBox7.Text = MyReader("address")
TextBox8.Text = MyReader("telno")
TextBox6.Text = MyReader("age")
TextBox9.Text = MyReader("nationality")
ComboBox2.Text = MyReader("status")
TextBox3.Text = MyReader("er_patname")
TextBox2.Text = MyReader("er_address")
TextBox1.Text = MyReader("er_telno")
TextBox11.Text = MyReader("bday")
ComboBox3.Text = MyReader("blood")
ComboBox4.Text = MyReader("wardid")
TextBox10.Text = MyReader("lastname")
ComboBox6.Text = MyReader("sponser")
TextBox14.Text = MyReader("inno")
TextBox15.Text = MyReader("companyname")
TextBox16.Text = MyReader("comin")
End While
MyConnection.Close()
MyReader.Close()
MyCommand.Dispose()
End Function
Function updatepatient()
MyConnection.Open()
Dim str2 As String = "UPDATE Patients SET patname ='" & TextBox5.Text & "' ,bday ='" & TextBox11.Text & "', address= '" & TextBox7.Text & "' , gender ='" & ComboBox1.Text & "', age ='" & TextBox6.Text & "', telno ='" & TextBox8.Text & "', status ='" & ComboBox2.Text & "', er_patname = '" & TextBox3.Text & "', er_address = '" & TextBox2.Text & "',er_telno ='" & TextBox1.Text & "',wardid ='" & ComboBox4.Text & "', lastname ='" & TextBox10.Text & "',sponser ='" & ComboBox6.Text & "',inno = '" & TextBox14.Text & "', companyname = '" & TextBox15.Text & "', comin ='" & TextBox16.Text & "' WHERE patcode ='" & TextBox4.Text & "' "
MyCommand = New OleDbCommand(str2, MyConnection)
MyCommand.ExecuteNonQuery()
MyConnection.Close()
MyCommand.Dispose()
End Function
Function fieldcodecheck() As Boolean
If TextBox4.Text = "" Then
Return True
Else
Return False
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -