Dim qsr As WinForm.DateTimePicker = e.Form.Controls("合同起始日")
Dim zzr As WinForm.DateTimePicker = e.Form.Controls("合同终止日")
Dim syq As WinForm.ComboBox = e.Form.Controls("试用期")
Dim qx As WinForm.ComboBox = e.Form.Controls("合同期限")
Dim bm As WinForm.ComboBox = e.Form.Controls("聘用部门")
Dim gw As WinForm.ComboBox = e.form.Controls("聘用岗位")
Dim fr As WinForm.TextBox = e.Form.Controls("法人")
If qsr.Value = zzr.Value Then '若合同起始日与合同终止日的值均相同
MessageBox.Show("合同起始日与合同终止日不能是同一天!")
ElseIf qsr.Value Is Nothing Then '若合同起始日为空
MessageBox.Show("合同起始日未录入日期!")
ElseIf zzr.Value Is Nothing Then '若合同终止日为空
MessageBox.Show("合同终止日未录入日期!")
ElseIf bm.Value = "" Then '若聘用部门为空
MessageBox.Show("未输入聘用部门!")
ElseIf gw.Value = "" Then '若聘用岗位为空
MessageBox.Show("未输入聘用岗位!")
ElseIf fr.Value = "" Then '若法人为空
MessageBox.Show("未输入法人!")
Else
Dim r0 As Row = Tables("基础信息").Current
Dim r As Row = Tables("签订合同").AddNew
r("姓名") = r0("姓名")
r("身份证号码") = r0("身份证号码")
r("性别") = r0("性别")
r("住址") = r0("住址")
r("电话") = r0("联系电话")
r("合同期限") = qx.Value
r("合同起始日") = qsr.Value
r("合同终止日") = zzr.Value
r("试用期") = syq.Value
r("聘用部门") = bm.Value
r("聘用岗位") = gw.Value
r("法人") = fr.Value
r0("工作部门") = bm.Value
r0("合同到期日") = zzr.Value
e.Form.Close
End If