以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  我想把复制的内容调动添加的内容新增在“在编人员调动记录”一行,怎么改代码?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=133207)

--  作者:xhydxs
--  发布时间:2019/4/9 16:53:00
--  我想把复制的内容调动添加的内容新增在“在编人员调动记录”一行,怎么改代码?

\'以下是将在编人员信息表的相关数据复制到在编人员调动记录----------------------------
If e.DataCol.Name = "是否调动" Then
    If e.DataRow("是否调动") = True Then
        Dim nma() As String = {"姓名","身份证号码","性别","年龄","籍贯","政治面貌","婚姻状况","现任职务","现任教学段","现任教学科","所在村小","全日制学历_学历","全日制学历_所学专业","全日制学历_毕业院校","最高学历_学历","最高学历_所学专业","最高学历_毕业院校","是否师范类","参加工作时间","连续工龄计算时间","岗位等级","薪级","进入本单位时间","进入本单位形式","联系电话","备注"} \'A表数据来源列
        Dim nmb() As String = {"姓名","身份证号码","性别","年龄","籍贯","政治面貌","婚姻状况","原任职务","曾任教学段","曾任教学科","所在村小","全日制学历_学历","全日制学历_所学专业","全日制学历_毕业院校","最高学历_学历","最高学历_所学专业","最高学历_毕业院校","是否师范类","参加工作时间","连续工龄计算时间","岗位等级","薪级","进入原单位时间","进入原单位形式","联系电话","备注"}  \'B表数据接收列
        Dim dr As DataRow = DataTables("在编人员调动记录").AddNew
        For i As Integer = 0 To nma.Length - 0
            dr(nmb(i)) = e.DataRow(nma(i))
        Next
    Else
        DataTables("在编人员调动记录").deletefor("身份证号码=\'" & e.DataRow("身份证号码") & "\'")
    End If
End If
\'以上是将在编人员信息表的相关数据复制到在编人员调动记录----------------------------

 

\'以下是人员调动记录窗口确定代码----------------------------

Dim ydw As WinForm.TextBox = e.Form.Controls("原工作单位")
Dim yrj As WinForm.TextBox = e.Form.Controls("原任教学科")
Dim xdw As WinForm.ComboBox = e.Form.Controls("新调单位")
Dim xrj As WinForm.ComboBox = e.Form.Controls("任教学科")
Dim ddsj As WinForm.DateTimePicker = e.Form.Controls("调动时间")
Dim ddlx As WinForm.ComboBox = e.Form.Controls("调动类型")
Dim ddyy As WinForm.TextBox = e.Form.Controls("调动原因")
Dim pzdw As WinForm.TextBox = e.Form.Controls("批准单位")
Dim ddbz As WinForm.TextBox = e.Form.Controls("备注")
If xdw.Value = ydw.Value Then   \'若新工作单位与原工作单位的值均相同
    MessageBox.Show("兄弟,工作单位未发生变化,不需要调动!")
ElseIf xdw.Value = "" AndAlso xrj.Value = "" Then   \'若新工作单位/新任教均为输入内容
    MessageBox.Show("兄弟,未输入新调单位和任教学科!")
Else
    Dim r0 As Row = Tables("在编人员信息").Current
    Dim r As Row = Tables("在编人员调动记录").AddNew
    r("序号") = r0("_identify")
    r("原工作单位") = r0("单位简称")
    r("任教学科") = r0("现任教学科")
    r("新调单位") = xdw.Value
    r("任教学科") = xrj.Value
    r("调动类型") = ddlx.Value
    r("调动时间") = ddsj.Value
    r("调动原因") = ddyy.Value
    r("批准单位") = pzdw.Value
    r("备注") = ddbz.Value
    r0("单位简称") = xdw.Value
    r0("现任教学科") = xrj.Value
    e.Form.Close
End If

\'以上是人员调动记录窗口确定代码----------------------------


--  作者:有点甜
--  发布时间:2019/4/9 19:04:00
--  
没看懂你的问题。上传实例测试。
--  作者:xhydxs
--  发布时间:2019/4/16 11:46:00
--  
以下是引用有点甜在2019/4/9 19:04:00的发言:
没看懂你的问题。上传实例测试。

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:人事管理系统.rar

有点甜老师,在办理调动后,在“在编人员调动记录”中就新增了两条记录,我想整合为一条记录,谢谢。
--  作者:有点色
--  发布时间:2019/4/16 12:37:00
--  

你datacolchanged事件的代码,删除。确定按钮的代码改成,如

 

Dim ydw As WinForm.TextBox = e.Form.Controls("原工作单位")
Dim yrj As WinForm.TextBox = e.Form.Controls("原任教学科")
Dim xdw As WinForm.ComboBox = e.Form.Controls("新调单位")
Dim xrj As WinForm.ComboBox = e.Form.Controls("任教学科")
Dim ddsj As WinForm.DateTimePicker = e.Form.Controls("调动时间")
Dim ddlx As WinForm.ComboBox = e.Form.Controls("调动类型")
Dim ddyy As WinForm.TextBox = e.Form.Controls("调动原因")
Dim pzdw As WinForm.TextBox = e.Form.Controls("批准单位")
Dim ddbz As WinForm.TextBox = e.Form.Controls("备注")
If xdw.Value = ydw.Value Then   \'若新工作单位与原工作单位的值均相同
    MessageBox.Show("兄弟,工作单位未发生变化,不需要调动!")
ElseIf xdw.Value = "" AndAlso xrj.Value = "" Then   \'若新工作单位/新任教均为输入内容
    MessageBox.Show("兄弟,未输入新调单位和任教学科!")
Else
    Dim r0 As Row = Tables("在编人员信息").Current
    Dim r As Row = Tables("在编人员调动记录").AddNew
    r("序号") = r0("_identify")
    r("原工作单位") = r0("单位简称")
    r("任教学科") = r0("现任教学科")
    r("新调单位") = xdw.Value
    r("任教学科") = xrj.Value
    r("调动类型") = ddlx.Value
    r("调动时间") = ddsj.Value
    r("调动原因") = ddyy.Value
    r("批准单位") = pzdw.Value
    r("备注") = ddbz.Value
    r0("单位简称") = xdw.Value
    r0("现任教学科") = xrj.Value
   
   
    Dim nma() As String = {"姓名","身份证号码","性别","年龄","籍贯","政治面貌","婚姻状况","现任职务","现任教学段","现任教学科","所在村小","全日制学历_学历","全日制学历_所学专业","全日制学历_毕业院校","最高学历_学历","最高学历_所学专业","最高学历_毕业院校","是否师范类","参加工作时间","连续工龄计算时间","岗位等级","薪级","进入本单位时间","进入本单位形式","联系电话","备注"} \'A表数据来源列
    Dim nmb() As String = {"姓名","身份证号码","性别","年龄","籍贯","政治面貌","婚姻状况","原任职务","曾任教学段","曾任教学科","所在村小","全日制学历_学历","全日制学历_所学专业","全日制学历_毕业院校","最高学历_学历","最高学历_所学专业","最高学历_毕业院校","是否师范类","参加工作时间","连续工龄计算时间","岗位等级","薪级","进入原单位时间","进入原单位形式","联系电话","备注"}  \'B表数据接收列
    For i As Integer = 0 To nma.Length - 1
        r(nmb(i)) = r0(nma(i))
    Next
   
   
    e.Form.Close
End If