Dim Cols1() As String = {"姓名","现任职务","级别","个人状态","基本工资_保留奖金","补贴_保留福补","特岗津补贴","基本养老金","享受职务","单位性质","单位名称","年度","已休假天数","级别档次","个人类别","职务区分","岗位等级","薪级","身份证号","是否省级文明单位","是否全国文明城市","离休干部月均生活补贴","性别","参加工作时间"} Dim Cols2() As String = {"姓名","现任职务","级别","个人状态","基本工资_保留奖金","补贴_保留福补","特岗津补贴","基本养老金","享受职务","单位性质","单位名称","年度","已休假天数","级别档次","个人类别","职务区分","岗位等级","薪级","身份证号","是否省级文明单位","是否全国文明城市","离休干部月均生活补贴","性别","参加工作时间"} For Each dr1 As DataRow In DataTables("人员情况表").Select("[身份证号] is not null") Dim dr2 As DataRow = DataTables("工资总表").find("年度 = '" & dr1("年度") & "'") If dr2 IsNot Nothing Then MessageBox.Show("本年度已导入,不能再导入!","温馨提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) Exit For End If If dr2 Is Nothing Then dr2 = DataTables("工资总表").AddNew() For i As Integer = 0 To Cols1.Length -1 dr2(Cols2(i)) = dr1(Cols1(i)) Next End If Next
|