Dim t As Table = Tables("排班窗口_table1")
t.Filter="日期=#" & e.Sender.Value & "#"
If t.count = 0 Then
Dim Result As DialogResult
Result = MessageBox.Show("需要排班吗?","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Information)
If Result = DialogResult.Yes Then
For Each dr As DataRow In DataTables("医生名单").DataRows
Dim nr As Row = t.AddNew
nr("医生姓名") = dr("医生姓名")
nr("日期") = e.Sender.Value
Next
Else
Return
End If
Else
Dim ys As String = t.DataTable.GetComboListString("医生姓名", t.Filter)
Dim drs As List (of DataRow) = DataTables("医生名单").Select("医生姓名 not in ('" & ys.Replace("|", "','") & "')")
If drs.count > 0 Then
Dim Result1 As DialogResult
Result1 = MessageBox.Show("还有医生没排班,需要补充吗?","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Information)
If Result1 = DialogResult.Yes Then
For Each dr As DataRow In drs
Dim nr As Row = t.AddNew
nr("医生姓名") = dr("医生姓名")
nr("日期") = e.Sender.Value
Next
Else
Return
End If
End If
End If