If e.form.Controls("ComboBox1").Value Is Nothing Then
MsgBox("请选择患者住院号!",64,"提示")
Return
End If
If e.Form.Controls("DateTimePicker1").Value Is Nothing And e.Form.Controls("ComboBox5").Value IsNot Nothing Then
Dim r As Row = CurrentTable.AddNew
r("住院号") =e.Form.Controls("ComboBox1").value.split(":")(2)
r("开嘱日期") =Date.Today
r("医生") =e.Form.Controls("ComboBox5").value.split(":")(1)
End If
If e.Form.Controls("DateTimePicker1").Value Is Nothing And e.Form.Controls("ComboBox5").Value Is Nothing Then
Dim r As Row = CurrentTable.AddNew
r("住院号") =e.Form.Controls("ComboBox1").value.split(":")(2)
r("开嘱日期") =Date.Today
End If
If e.Form.Controls("DateTimePicker1").Value IsNot Nothing And e.Form.Controls("ComboBox5").Value Is Nothing Then
Dim r As Row = CurrentTable.AddNew
r("住院号") =e.Form.Controls("ComboBox1").value.split(":")(2)
r("开嘱日期") =e.Form.Controls("DateTimePicker1").value
End If
If e.Form.Controls("DateTimePicker1").Value IsNot Nothing And e.Form.Controls("ComboBox5").Value IsNot Nothing Then
Dim r As Row = CurrentTable.AddNew
r("住院号") =e.Form.Controls("ComboBox1").value.split(":")(2)
r("开嘱日期") =e.Form.Controls("DateTimePicker1").value
r("医生") =e.Form.Controls("ComboBox5").value.split(":")(1)
End If
说明:主要是对"开嘱日期"、"医生"进行判断:
1、"开嘱日期"等于 "空 "、"医生"不等于 "空 " 则
2、"开嘱日期"等于 "空 "、"医生"等于 "空 ",则
1、"开嘱日期"不等于"空 "、"医生"等于 "空 " 则
2、"开嘱日期"不等于 "空 "、"医生"不等于 "空 ",则
判断条件太多,能不能简化?
因为我还存在一个三联式判断,那就更复杂了。
[此贴子已经被作者于2011-8-3 10:27:25编辑过]