Dim Val As string
Val= e.Form.Controls("职务变动人员姓名").Value
Dim Vbl As string
Vbl= e.Form.Controls("职务变动人员身份证号").Value
Dim dr As DataRow
dr = DataTables("职务变动基础信息").Find("身份证号= '" & vbl & "'")
if Val = "" then
MessageBox.Show("你未录入需要变动职务人员的姓名!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information)
Return '终止代码的执行
Else
if Vbl = "" then
MessageBox.Show("你未录入需要变动职务人员的身份证号!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information)
Return '终止代码的执行
End If
if Val > "" AndAlso DataTables("调资基础数据").Select("[姓名] = '" & val & "'").Count > 0 then
if Vbl > "" AndAlso DataTables("调资基础数据").Select("[身份证号] = '" & vbl & "'").Count > 0 then
if Val > "" AndAlso DataTables("职务变动基础信息").Select("[姓名] = '" & val & "'").Count > 0 then
if Vbl > "" AndAlso DataTables("职务变动基础信息").Select("[身份证号] = '" & vbl & "'").Count > 0 then
MessageBox.Show("在职务变动基础信息表中已有该人员的基础信息,不需要你重新录入!!!","提示",MessageBoxButtons.OK,MessageBoxIcon. Information)
Dim cme As WinForm.TextBox = e.Form.Controls("职务变动人员姓名")
cme.value=""
Dim cmf As WinForm.TextBox = e.Form.Controls("职务变动人员身份证号")
cmf.value=""
Forms("职务变动人员基础信息录入").Open()
If Vbl IsNot Nothing Then
Dim wz As long = Tables("职务变动基础信息").FindRow(dr)
If wz >= 0 Then
Tables("职务变动基础信息").Position = wz
End If
End If
Return '终止代码的执行
End If
MessageBox.Show("在职务变动基础数据表中没有查询到该姓名的人员,我们将在调资基础数据表中查询读入该人员的基础信息!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
dim f As New Filler
f.SourceTable = DataTables("调资基础数据") '指定数据来源
f.SourceCols = "序号,单位名称,姓名,身份证号,性别,出生时间,参加工作时间,职务" '指定数据来源列
f.DataTable = DataTables("职务变动基础信息") '指定数据接收表
f.DataCols = "序号,单位名称,姓名,身份证号,性别,出生日期,参加工作时间,变动前职务" '指定数据接收列
f.ExcludeExistValue = "true"
f.ExcludeNullValue = "true"
With e.Form.Controls("职务变动人员身份证号")
If .Value IsNot Nothing Then
f.Filter= "[身份证号]= '" & .Value & "'"
End If
End With
f.Fill() '填充数据
MessageBox.Show("你录入的职务变动人员,其基础信息已从调资基础数据表读入到职务变动基础信息表!!!", "提示")
Forms("职务变动人员基础信息录入").Open()
If Vbl IsNot Nothing Then
Dim wz As long = Tables("职务变动基础信息").FindRow(dr)
If wz >= 0 Then
End If
End If
Dim cmb As WinForm.TextBox = e.Form.Controls("职务变动人员姓名")
cmb.value=""
Dim cmd As WinForm.TextBox = e.Form.Controls("职务变动人员身份证号")
cmd.value=""
else
MessageBox.Show("请认真核对你录入的职务需要变动人员的身份证号,在数据库中不存在该身份证号人员的数据!!!","提示",MessageBoxButtons.OK,MessageBoxIcon. Information)
Return '终止代码的执行
End if
Else
MessageBox.Show("请认真核对你录入的职务需要变动人员的姓名,在数据库中不存在该姓名人员的数据!!!","提示",MessageBoxButtons.OK,MessageBoxIcon. Information)
Return '终止代码的执行
End if
End If