-- 作者:lisheng7177
-- 发布时间:2015/7/21 10:36:00
-- 按钮代码问题求助版主!!!!!!
Dim Result As DialogResult Result = MessageBox.Show("确定导出?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question,MessageBoxDefaultButton.Button2) Dim Cols1() As String = {"工作单位","县公司","姓名","性别","身份证号码","文化程度","现岗位名称","参加工作时间","现工种工作时间","原技术资格等级","原等级取得时间","原资格证书工种","原资格证书编号","鉴定等级","申报鉴定工种","鉴定批次","申报性质","用工性质","原人才当量值","备注","照片","是否合格","资格审核","鉴定时间"} Dim Cols2() As String = {"工作单位","县公司","姓名","性别","身份证号码","文化程度","现岗位名称","参加工作时间","现工种工作时间","原技术资格等级","原等级取得时间","原资格证书工种","原资格证书编号","鉴定等级","申报鉴定工种","鉴定批次","申报性质","用工性质","原人才当量值","备注","照片","是否合格","资格审核","鉴定时间"} For Each dr1 As DataRow In DataTables("报名登记表").Select("[资格审核] = True ") Dim dr2 As DataRow = DataTables("审核合格表").Find("身份证号码 = \'" & dr1("身份证号码") & "\' And 鉴定批次 = \'" & dr1("鉴定批次") & "\'") If dr2 Is Nothing Then dr2 = DataTables("审核合格表").AddNew End If For i As Integer = 0 To Cols1.Length -1 dr2(Cols2(i)) = dr1(Cols1(i)) Next Next
上述代码有什么问题吗?为什么一点“按钮”就死机,没反应?
|
-- 作者:大红袍
-- 发布时间:2015/7/21 10:44:00
--
肯定是你Datacolchanged的代码写得有问题,暂时可以这样处理
Dim Result As DialogResult Result = MessageBox.Show("确定导出?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question,MessageBoxDefaultButton.Button2) If result = DialogResult.Yes Then Dim Cols1() As String = {"工作单位","县公司","姓名","性别","身份证号码","文化程度","现岗位名称","参加工作时间","现工种工作时间","原技术资格等级","原等级取得时间","原资格证书工种","原资格证书编号","鉴定等级","申报鉴定工种","鉴定批次","申报性质","用工性质","原人才当量值","备注","照片","是否合格","资格审核","鉴定时间"} Dim Cols2() As String = {"工作单位","县公司","姓名","性别","身份证号码","文化程度","现岗位名称","参加工作时间","现工种工作时间","原技术资格等级","原等级取得时间","原资格证书工种","原资格证书编号","鉴定等级","申报鉴定工种","鉴定批次","申报性质","用工性质","原人才当量值","备注","照片","是否合格","资格审核","鉴定时间"} SystemReady = False For Each dr1 As DataRow In DataTables("报名登记表").Select("[资格审核] = True ") Dim dr2 As DataRow = DataTables("审核合格表").Find("身份证号码 = \'" & dr1("身份证号码") & "\' And 鉴定批次 = \'" & dr1("鉴定批次") & "\'") If dr2 Is Nothing Then dr2 = DataTables("审核合格表").AddNew End If For i As Integer = 0 To Cols1.Length -1 dr2(Cols2(i)) = dr1(Cols1(i)) Next Next SystemReady = True End If
|
-- 作者:lisheng7177
-- 发布时间:2015/7/21 11:24:00
--
If e.DataRow("鉴定等级") = "高级技师" Then Dim fdr As DataRow = DataTables("证书编号表").Find("身份证号码 = \'" & e.DataRow("身份证号码") & "\' And 证书编号 = \'" & e.DataRow("原资格证书编号") & "\' And 鉴定等级 = \'" & e.DataRow("原技术资格等级") & "\' And 申报鉴定工种 = \'" & e.DataRow("原资格证书工种") & "\'") If fdr Is Nothing Then e.DataRow("是否合格") = False Else If fdr("鉴定等级") = "技师" AndAlso fdr("申报鉴定工种") = e.DataRow("申报鉴定工种") AndAlso Cdate(e.DataRow("原等级取得时间")).Year <= Date.Today.Year - 2 Then e.DataRow("是否合格") = True Else e.DataRow("是否合格") = False End If End If End If
If e.DataRow("鉴定等级") = "高级技师" Then If e.DataRow("是否合格") = True Then e.DataRow("资格审核") = True Else e.DataRow("资格审核") = False End If End If
If e.DataRow("鉴定等级") = "中级工" Then If e.DataRow("申报性质") = "正常申报" e.DataRow("是否合格") = True Else If e.DataRow("申报性质") = "补考实操" e.DataRow("是否合格") = True Else If e.DataRow("申报性质") = "补考理论" e.DataRow("是否合格") = True Else e.DataRow("是否合格") = False End If End If
If e.DataRow("鉴定等级") = "高级工" Then If e.DataRow("申报性质") = "正常申报" e.DataRow("是否合格") = True Else If e.DataRow("申报性质") = "补考实操" e.DataRow("是否合格") = True Else If e.DataRow("申报性质") = "补考理论" e.DataRow("是否合格") = True Else e.DataRow("是否合格") = False End If End If
If e.DataRow("鉴定等级") = "中级工" Then If e.DataRow("是否合格") = True Then e.DataRow("资格审核") = True Else e.DataRow("资格审核") = False End If End If
If e.DataRow("鉴定等级") = "高级工" Then If e.DataRow("是否合格") = True Then e.DataRow("资格审核") = True Else e.DataRow("资格审核") = False End If End If
这是Datacolchanged的后加的代码,就不正常了,请版主指教!
|