保存上次点击的日期
static pdate As Date = Nothing
Dim MyDate As Date
Dim t As Table = Tables("医生排班表")
Dim dt As DataTable = DataTables("医生排班表")
If (DateTime.TryParse(e.Row(e.Col.Name) ,MyDate)) Then
e.Form.Controls("BL_日历_当前选择年月").text = Format(MyDate,"yyyy-MM-dd")
If dt.HasChanges AndAlso MyDate <> pdate Then
Dim Result As DialogResult
Result = MessageBox.Show("排班表已经修改,是否需要保存?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If Result = DialogResult.Yes Then
dt.Save
Else
dt.RejectChanges
End If
End If
pdate = mydate
t.Filter="日期=#" & MyDate & "#"
t.AllowEdit=False
End If