医院挂号划价管理信息系统 第5页
InitDataTalbe()
End Sub
Private Sub txbPY_KeyDown(ByVal sender As Object, _
ByVal e As System.Windows.Forms.KeyEventArgs) _
Handles txbPY.KeyDown
If e.KeyCode = Keys.Enter Then
Dim dlg As frmSelectHuaJiaMX = New frmSelectHuaJiaMX
dlg.strPY = Me.txbPY.Text.Trim
dlg.ShowDialog()
Dim strId As String = dlg.GetInfo()
Dim db As DataBase = New DataBase
Dim dv As DataView = _
db.RunSelectSQL("select * from v收费项目及药品 where 编号='" _
+ strId + "'")
Me.txbMXId.Text = dv(0)("编号")
Me.txbPY.Text = dv(0)("拼音码")
Me.txbMName.Text = dv(0)("名称")
Me.txbGuiGe.Text = dv(0)("规格")
Me.txbUnit.Text = dv(0)("单位")
Me.txbPrice.Text = dv(0)("单价")
Me.txbNumber.Text = "1"
db.Dispose()
End If
End Sub
Private Sub btnDel_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnDel.Click
Try
'获得DataGrid当前被选中的行号
Dim iRow = dgdList.CurrentRowIndex
'弹出对话框让用户确认要删除记录
'如果用户确认要删除记录
If MessageBox.Show("你确认要删除此条记录吗?", _
"Confirm", MessageBoxButtons.YesNo) = DialogResult.Yes Then
'从商品清单表删除当前被选中记录()
dtDetail.Rows(iRow).Delete()
' SetTaxForDelOrUpgrade()
If dtDetail.Rows.Count = 0 Then
iCurrentLine = -1
End If
ClearMX()
Else
Exit Sub
End If
Catch ex As Exception
MessageBox.Show("删除数据出错")
End Try
CalTotalMoney()
End Sub
Private Sub dgdList_CurrentCellChanged(ByVal sender As Object, _
iCurrentLine = dgdList.CurrentCell.RowNumber
End If
Dim iRow As Integer = dgdList.CurrentRowIndex
txbMXId.Text = dtDetail.Rows(iRow)("编号")
txbMName.Text = dtDetail.Rows(iRow)("名称")
txbGuiGe.Text = dtDetail.Rows(iRow)("规格")
txbUnit.Text = dtDetail.Rows(iRow)("单位")
txbPrice.Text = dtDetail.Rows(iRow)("单价")
txbNumber.Text = dtDetail.Rows(iRow)("数量")
txbMMoney.Text = dtDetail.Rows(iRow)("金额")
txbPY.Text = dtDetail.Rows(iRow)("拼音码")
End Sub
Private Sub btnSave_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnSave.Click
If dgdList.CurrentRowIndex = -1 Then
Return
dtDetail.Rows(iCurrentLine)("数量") = txbNumber.Text
dtDetail.Rows(iCurrentLine)("金额") = txbMMoney.Text
dtDetail.Rows(iCurrentLine)("拼音码") = txbPY.Text
ClearMX()
CalTotalMoney()
End Sub
Private Sub btnCancel_Click(ByVal sender As System.Object, _
上一页 [1] [2] [3] [4] [5] [6] [7] 下一页