📄 frm_prb.vb
字号:
Imports System.Data.OleDb
Imports System.DateTime
Imports System.Math
Public Class frm_prb
Inherits System.Windows.Forms.Form
Dim MyConnection As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\PIS.mdb")
Dim MyConnection2 As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\PIS.mdb")
Dim MyConnection3 As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\PIS.mdb")
Dim MyConnection4 As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\PIS.mdb")
Dim currentDate As Date
Dim MyCommand
Dim e As Exception
Dim MyCommand2
Dim MyCommand3
Dim MyReader As OleDbDataReader
Dim MyReader2 As OleDbDataReader
Dim MyReader3 As OleDbDataReader
Dim MyReader4 As OleDbDataReader
Dim dbset As New DataSet
Dim dataA 'As OleDbDataAdaptor
Dim dataB
#Region "CODE STARTS HERE"
Function insertpatient()
MyConnection4.Open()
MyCommand = New OleDbCommand("INSERT INTO drugissued VALUES ('" & TextBox3.Text & "','" & TextBox1.Text & "','" & Label10.Text & "','" & ComboBox1.Text & "','" & ComboBox3.Text & "','" & TextBox4.Text & "','" & TextBox2.Text & "')", MyConnection4)
Try
MyCommand.ExecuteNonQuery()
Catch c As Exception
MsgBox(c.ToString)
End Try
MyConnection4.Close()
MyCommand.Dispose()
End Function
Function clearfields()
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
ComboBox1.Text = ""
ComboBox2.Text = ""
ComboBox3.Text = ""
End Function
Function getdrugcode()
Dim some As String = TextBox5.Text
Dim another As Integer
Dim newslip2 As String = "DS-0"
Dim number As String
another = CInt(some.TrimStart("D", "S", "-"))
another += 1
number = another.ToString()
Return newslip2 + number
End Function
Function checkslip()
If TextBox2.Text.StartsWith("DS-0") = False Or TextBox2.Text = "" Then
MsgBox("Please Enter the correct Slip number", MsgBoxStyle.Information, "PrisLogix's PIS")
End If
End Function
Function getpid()
MyConnection.Open()
MyCommand = New OleDbCommand("SELECT * FROM drugissued", MyConnection)
MyReader = MyCommand.ExecuteReader()
While MyReader.Read
TextBox5.Text = MyReader("slip")
End While
MyConnection.Close()
MyReader.Close()
MyConnection.Dispose()
End Function
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents Label6 As System.Windows.Forms.Label
Friend WithEvents Label7 As System.Windows.Forms.Label
Friend WithEvents Label8 As System.Windows.Forms.Label
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents Button3 As System.Windows.Forms.Button
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
Friend WithEvents ComboBox1 As System.Windows.Forms.ComboBox
Friend WithEvents ComboBox2 As System.Windows.Forms.ComboBox
Friend WithEvents ComboBox3 As System.Windows.Forms.ComboBox
Friend WithEvents Button4 As System.Windows.Forms.Button
Friend WithEvents Label9 As System.Windows.Forms.Label
Friend WithEvents TextBox4 As System.Windows.Forms.TextBox
Friend WithEvents Label10 As System.Windows.Forms.Label
Friend WithEvents Timer1 As System.Windows.Forms.Timer
Friend WithEvents Button5 As System.Windows.Forms.Button
Friend WithEvents ListBox1 As System.Windows.Forms.ListBox
Friend WithEvents Button6 As System.Windows.Forms.Button
Friend WithEvents TextBox3 As System.Windows.Forms.TextBox
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents TextBox5 As System.Windows.Forms.TextBox
Friend WithEvents Button7 As System.Windows.Forms.Button
Friend WithEvents Button8 As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(frm_prb))
Me.Label1 = New System.Windows.Forms.Label
Me.PictureBox1 = New System.Windows.Forms.PictureBox
Me.Label2 = New System.Windows.Forms.Label
Me.Label3 = New System.Windows.Forms.Label
Me.Label4 = New System.Windows.Forms.Label
Me.Label6 = New System.Windows.Forms.Label
Me.Label7 = New System.Windows.Forms.Label
Me.Label8 = New System.Windows.Forms.Label
Me.Button1 = New System.Windows.Forms.Button
Me.Button2 = New System.Windows.Forms.Button
Me.Button3 = New System.Windows.Forms.Button
Me.TextBox1 = New System.Windows.Forms.TextBox
Me.TextBox2 = New System.Windows.Forms.TextBox
Me.ComboBox1 = New System.Windows.Forms.ComboBox
Me.ComboBox2 = New System.Windows.Forms.ComboBox
Me.ComboBox3 = New System.Windows.Forms.ComboBox
Me.Button4 = New System.Windows.Forms.Button
Me.Label9 = New System.Windows.Forms.Label
Me.TextBox4 = New System.Windows.Forms.TextBox
Me.Label10 = New System.Windows.Forms.Label
Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
Me.Button5 = New System.Windows.Forms.Button
Me.ListBox1 = New System.Windows.Forms.ListBox
Me.Button6 = New System.Windows.Forms.Button
Me.TextBox3 = New System.Windows.Forms.TextBox
Me.Label5 = New System.Windows.Forms.Label
Me.TextBox5 = New System.Windows.Forms.TextBox
Me.Button7 = New System.Windows.Forms.Button
Me.Button8 = New System.Windows.Forms.Button
Me.SuspendLayout()
'
'Label1
'
Me.Label1.Font = New System.Drawing.Font("Arial Black", 20.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label1.Location = New System.Drawing.Point(56, 8)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(280, 40)
Me.Label1.TabIndex = 0
Me.Label1.Text = "Priscription List"
'
'PictureBox1
'
Me.PictureBox1.Image = CType(resources.GetObject("PictureBox1.Image"), System.Drawing.Image)
Me.PictureBox1.Location = New System.Drawing.Point(24, 16)
Me.PictureBox1.Name = "PictureBox1"
Me.PictureBox1.Size = New System.Drawing.Size(24, 32)
Me.PictureBox1.TabIndex = 1
Me.PictureBox1.TabStop = False
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(416, 208)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(56, 16)
Me.Label2.TabIndex = 2
Me.Label2.Text = "Drug List"
'
'Label3
'
Me.Label3.Location = New System.Drawing.Point(8, 120)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(64, 16)
Me.Label3.TabIndex = 4
Me.Label3.Text = "Drug Name"
'
'Label4
'
Me.Label4.Location = New System.Drawing.Point(8, 88)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(64, 16)
Me.Label4.TabIndex = 5
Me.Label4.Text = "Slip No"
'
'Label6
'
Me.Label6.Location = New System.Drawing.Point(312, 88)
Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(96, 16)
Me.Label6.TabIndex = 7
Me.Label6.Text = "Physician Name"
'
'Label7
'
Me.Label7.Location = New System.Drawing.Point(312, 120)
Me.Label7.Name = "Label7"
Me.Label7.Size = New System.Drawing.Size(88, 16)
Me.Label7.TabIndex = 8
Me.Label7.Text = "Physician Code"
'
'Label8
'
Me.Label8.Location = New System.Drawing.Point(320, 160)
Me.Label8.Name = "Label8"
Me.Label8.Size = New System.Drawing.Size(72, 16)
Me.Label8.TabIndex = 9
Me.Label8.Text = "Patient No"
'
'Button1
'
Me.Button1.BackColor = System.Drawing.SystemColors.ControlLight
Me.Button1.Enabled = False
Me.Button1.Location = New System.Drawing.Point(120, 264)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(96, 23)
Me.Button1.TabIndex = 10
Me.Button1.Text = "Issued Drug"
'
'Button2
'
Me.Button2.BackColor = System.Drawing.SystemColors.ControlLight
Me.Button2.Location = New System.Drawing.Point(224, 264)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(96, 23)
Me.Button2.TabIndex = 11
Me.Button2.Text = "Add new Drug"
'
'Button3
'
Me.Button3.BackColor = System.Drawing.SystemColors.ControlLight
Me.Button3.Location = New System.Drawing.Point(440, 328)
Me.Button3.Name = "Button3"
Me.Button3.Size = New System.Drawing.Size(96, 23)
Me.Button3.TabIndex = 12
Me.Button3.Text = "Cancel"
'
'TextBox1
'
Me.TextBox1.BackColor = System.Drawing.SystemColors.Info
Me.TextBox1.Location = New System.Drawing.Point(80, 120)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(96, 20)
Me.TextBox1.TabIndex = 13
Me.TextBox1.Text = ""
'
'TextBox2
'
Me.TextBox2.BackColor = System.Drawing.SystemColors.Info
Me.TextBox2.Location = New System.Drawing.Point(80, 88)
Me.TextBox2.Name = "TextBox2"
Me.TextBox2.Size = New System.Drawing.Size(96, 20)
Me.TextBox2.TabIndex = 14
Me.TextBox2.Text = ""
'
'ComboBox1
'
Me.ComboBox1.BackColor = System.Drawing.SystemColors.Info
Me.ComboBox1.Location = New System.Drawing.Point(400, 88)
Me.ComboBox1.Name = "ComboBox1"
Me.ComboBox1.Size = New System.Drawing.Size(136, 21)
Me.ComboBox1.TabIndex = 16
'
'ComboBox2
'
Me.ComboBox2.BackColor = System.Drawing.SystemColors.Info
Me.ComboBox2.Location = New System.Drawing.Point(448, 120)
Me.ComboBox2.Name = "ComboBox2"
Me.ComboBox2.Size = New System.Drawing.Size(88, 21)
Me.ComboBox2.TabIndex = 17
'
'ComboBox3
'
Me.ComboBox3.BackColor = System.Drawing.SystemColors.Info
Me.ComboBox3.Location = New System.Drawing.Point(448, 152)
Me.ComboBox3.Name = "ComboBox3"
Me.ComboBox3.Size = New System.Drawing.Size(88, 21)
Me.ComboBox3.TabIndex = 18
'
'Button4
'
Me.Button4.BackColor = System.Drawing.SystemColors.ControlLight
Me.Button4.Location = New System.Drawing.Point(16, 296)
Me.Button4.Name = "Button4"
Me.Button4.Size = New System.Drawing.Size(96, 23)
Me.Button4.TabIndex = 19
Me.Button4.Text = "Find Drug"
'
'Label9
'
Me.Label9.Location = New System.Drawing.Point(8, 184)
Me.Label9.Name = "Label9"
Me.Label9.Size = New System.Drawing.Size(56, 16)
Me.Label9.TabIndex = 20
Me.Label9.Text = "Drug Cost"
'
'TextBox4
'
Me.TextBox4.BackColor = System.Drawing.SystemColors.Info
Me.TextBox4.Location = New System.Drawing.Point(104, 184)
Me.TextBox4.Name = "TextBox4"
Me.TextBox4.Size = New System.Drawing.Size(72, 20)
Me.TextBox4.TabIndex = 21
Me.TextBox4.Text = ""
'
'Label10
'
Me.Label10.Location = New System.Drawing.Point(440, 24)
Me.Label10.Name = "Label10"
Me.Label10.Size = New System.Drawing.Size(80, 16)
Me.Label10.TabIndex = 23
'
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -