📄 frmguahao.vb
字号:
Me.Label7.TabIndex = 13
Me.Label7.Text = "挂号科室"
'
'cbbRegType
'
Me.cbbRegType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.cbbRegType.Items.AddRange(New Object() {"普通号", "专家号 20元", "专家号 5元"})
Me.cbbRegType.Location = New System.Drawing.Point(320, 69)
Me.cbbRegType.Name = "cbbRegType"
Me.cbbRegType.Size = New System.Drawing.Size(120, 20)
Me.cbbRegType.TabIndex = 12
'
'Label6
'
Me.Label6.Location = New System.Drawing.Point(256, 71)
Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(56, 16)
Me.Label6.TabIndex = 11
Me.Label6.Text = "挂号类型"
'
'cbbMoneyType
'
Me.cbbMoneyType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.cbbMoneyType.Items.AddRange(New Object() {"自费", "公费", "离休"})
Me.cbbMoneyType.Location = New System.Drawing.Point(88, 69)
Me.cbbMoneyType.Name = "cbbMoneyType"
Me.cbbMoneyType.Size = New System.Drawing.Size(120, 20)
Me.cbbMoneyType.TabIndex = 10
'
'Label5
'
Me.Label5.Location = New System.Drawing.Point(24, 71)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(56, 16)
Me.Label5.TabIndex = 9
Me.Label5.Text = "费用类型"
'
'cbbNation
'
Me.cbbNation.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.cbbNation.Items.AddRange(New Object() {"汉族", "回族", "满族", "朝鲜族", "蒙古族", "白族", "壮族", "苗族", "哈尼族", "独龙族", "土家族", "傣族", "哈萨克族", "维吾尔族"})
Me.cbbNation.Location = New System.Drawing.Point(360, 26)
Me.cbbNation.Name = "cbbNation"
Me.cbbNation.Size = New System.Drawing.Size(80, 20)
Me.cbbNation.TabIndex = 8
'
'Label4
'
Me.Label4.Location = New System.Drawing.Point(328, 31)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(32, 16)
Me.Label4.TabIndex = 7
Me.Label4.Text = "民族"
'
'Label3
'
Me.Label3.Location = New System.Drawing.Point(240, 31)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(32, 16)
Me.Label3.TabIndex = 5
Me.Label3.Text = "年龄"
'
'txbAge
'
Me.txbAge.Location = New System.Drawing.Point(272, 26)
Me.txbAge.Name = "txbAge"
Me.txbAge.Size = New System.Drawing.Size(48, 21)
Me.txbAge.TabIndex = 4
Me.txbAge.Text = ""
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(152, 31)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(32, 16)
Me.Label2.TabIndex = 3
Me.Label2.Text = "性别"
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(24, 31)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(32, 16)
Me.Label1.TabIndex = 1
Me.Label1.Text = "姓名"
'
'txbName
'
Me.txbName.Location = New System.Drawing.Point(64, 26)
Me.txbName.Name = "txbName"
Me.txbName.Size = New System.Drawing.Size(73, 21)
Me.txbName.TabIndex = 0
Me.txbName.Text = ""
'
'frmGuaHao
'
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.ClientSize = New System.Drawing.Size(464, 245)
Me.Controls.Add(Me.GroupBox1)
Me.Controls.Add(Me.ToolBar1)
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.Name = "frmGuaHao"
Me.Text = "门诊挂号管理"
Me.GroupBox1.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub ToolBar1_ButtonClick(ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.ToolBarButtonClickEventArgs) _
Handles ToolBar1.ButtonClick
Select Case e.Button.Text
Case "新增"
Clear()
Case "保存"
Save()
Case "取消"
Clear()
Case "退出"
'关闭本窗体
Me.Close()
End Select
End Sub
Private Sub Clear()
'清除页面信息
Me.txbName.Text = ""
Me.cbbSex.Text = "男"
Me.txbAge.Text = ""
Me.txbMoney.Text = "1"
Me.txbName.Text = ""
Me.txbTime.Text = Date.Now.ToString()
Me.cbbNation.Text = "汉族"
Me.cbbMoneyType.Text = "自费"
Me.cbbRegType.Text = "普通号"
Dim db As DataBase = New DataBase
Dim dv As DataView = _
db.RunSelectSQL("select 编号,名称 from 科室资料")
Me.cbbRoomType.DataSource = dv
Me.cbbRoomType.DisplayMember = "名称"
Me.cbbRoomType.ValueMember = "编号"
dv = db.RunSelectSQL("select 编号,姓名 from 医生资料")
Me.cbbDoctor.DataSource = dv
Me.cbbDoctor.DisplayMember = "姓名"
Me.cbbDoctor.ValueMember = "编号"
db.Dispose()
Me.txbName.Focus()
End Sub
Private Sub Save()
Dim iAge As Integer = 0
Try
iAge = CInt(txbAge.Text.Trim)
Catch ex As Exception
MessageBox.Show("数据格式不正确!")
Exit Sub
End Try
'获得病人信息库中本年度的最大编号
Dim strSQL As String = "select max(编号) as 编号 "
strSQL += " from 病人信息库 where 编号 like '"
strSQL += Date.Now.Year.ToString + "%'"
Dim db As DataBase = New DataBase
Dim dv As DataView = db.RunSelectSQL(strSQL)
Dim strId As String = "0000001"
Dim strTmp As String = "0000000"
Dim id As Integer = 0
If dv(0)(0).GetType.ToString <> "System.DBNull" Then
strId = dv(0)(0).ToString.Substring(4)
id = CInt(strId) + 1
strId = _
strTmp.Substring(0, strTmp.Length - id.ToString.Length)
strId += id.ToString
End If
strId = Date.Now.Year.ToString + strId
'向病人信息库插入信息
strSQL = "insert into 病人信息库(编号, 姓名, 性别, 年龄, "
strSQL += "民族, 费用类型) values('" + strId + "','"
strSQL += txbName.Text.Trim + "','" + cbbSex.Text.Trim + "','"
strSQL += txbAge.Text.Trim + "','" + cbbNation.Text.Trim + "','"
strSQL += cbbMoneyType.Text.Trim + "')"
db.RunDelOrInsSQL(strSQL)
'获得门诊挂号表本年度的最大的编号
Dim strPatientId As String = strId
strSQL = "select max(编号) as 编号 from 门诊挂号 where 编号 like '"
strSQL += Date.Now.Year.ToString + "%'"
strId = "0000001"
strTmp = "0000000"
id = 0
dv = db.RunSelectSQL(strSQL)
If dv(0)(0).GetType.ToString <> "System.DBNull" Then
strId = dv(0)(0).ToString.Substring(4)
id = CInt(strId) + 1
strId = _
strTmp.Substring(0, strTmp.Length - id.ToString.Length)
strId += id.ToString
End If
strId = Date.Now.Year.ToString + strId
'向门诊挂号表插入信息
strSQL = "insert into 门诊挂号(编号, 病人编号, 姓名, "
strSQL += "性别, 挂号科室,费用类型, 挂号类型, 挂号费用,医生,"
strSQL += "时间, 是否已划价) values('" + strPatientId + "','"
strSQL += strId + "','" + txbName.Text.Trim + "','"
strSQL += cbbSex.Text.Trim + "','" + cbbRoomType.Text.Trim
strSQL += "','" + cbbMoneyType.Text.Trim + "','"
strSQL += Me.cbbRegType.Text.Trim + "'," + Me.txbMoney.Text.Trim
strSQL += ",'" + Me.cbbDoctor.Text.Trim + "','"
strSQL += Me.txbTime.Text.Trim + "','否')"
db.RunDelOrInsSQL(strSQL)
db.Dispose()
Clear()
End Sub
Private Sub frmGuaHao_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Clear()
End Sub
Private Sub cbbRegType_SelectedIndexChanged( _
ByVal sender As Object, ByVal e As System.EventArgs) _
Handles cbbRegType.SelectedIndexChanged
'根据选择挂号类型设置金额
Select Case Me.cbbRegType.Text
Case "普通号"
Me.txbMoney.Text = "1"
Case "专家号 20元"
Me.txbMoney.Text = "20"
Case "专家号 5元"
Me.txbMoney.Text = "5"
End Select
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -