Foxtable(狐表)用户栏目专家坐堂 → 代码问题求教版主?


  共有3443人关注过本帖树形打印复制链接

主题:代码问题求教版主?

帅哥哟,离线,有人找我吗?
lisheng7177
  21楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:二尾狐 帖子:531 积分:3216 威望:0 精华:0 注册:2014/12/2 9:23:00
  发帖心情 Post By:2015/7/28 11:25:00 [只看该作者]

以下是引用大红袍在2015/7/28 11:21:00的发言:

导出一两个表,少量代码测试就行啊。

图片点击可在新窗口打开查看图片点击可在新窗口打开查看图片点击可在新窗口打开查看这个真不懂怎么做?我已上传,请版主看看!


 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  22楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/7/28 11:36:00 [只看该作者]

Dim Result As DialogResult
Result = MessageBox.Show("确定导出?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question,MessageBoxDefaultButton.Button2)
If result = DialogResult.Yes Then
    SystemReady = False
    DataTables("审核合格表").StopRedraw
    Dim Cols1() As String = {"工作单位","县公司","姓名","性别","身份证号码","文化程度","现岗位名称","参加工作时间","现工种工作时间","原技术资格等级","原等级取得时间","原资格证书工种","原资格证书编号","鉴定等级","申报鉴定工种","鉴定批次","申报性质","用工性质","原人才当量值","备注","照片","是否合格","资格审核","鉴定时间"}
    Dim Cols2() As String = {"工作单位","县公司","姓名","性别","身份证号码","文化程度","现岗位名称","参加工作时间","现工种工作时间","原技术资格等级","原等级取得时间","原资格证书工种","原资格证书编号","鉴定等级","申报鉴定工种","鉴定批次","申报性质","用工性质","原人才当量值","备注","照片","是否合格","资格审核","鉴定时间"}
   
    Dim dic As new Dictionary(Of DataRow, DataRow)
    Dim ls As new List(Of DataRow)
    For Each dr1 As DataRow In DataTables("报名登记表").Select("[资格审核] = True ")
        Dim dr As DataRow = DataTables("审核合格表").Find("身份证号码 = '" & dr1("身份证号码") & "' And 鉴定批次 = '" & dr1("鉴定批次") & "'")
        If dr Is Nothing Then
            ls.add(dr1)
        Else
            dic.Add(dr, dr1)
        End If
              
    Next

    For Each key As DataRow In dic.Keys
        For i As Integer = 0 To Cols1.Length -1
            key(Cols2(i)) = dic(key)(Cols1(i))
        Next
    Next

    For Each l As DataRow In ls
        Dim ndr As DataRow = DataTables("审核合格表").AddNew
        For i As Integer = 0 To Cols1.Length -1
            ndr(Cols2(i)) = l(Cols1(i))
        Next
    Next
    DataTables("审核合格表").ResumeRedraw
    SystemReady = True
End If


 回到顶部
帅哥哟,离线,有人找我吗?
lisheng7177
  23楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:二尾狐 帖子:531 积分:3216 威望:0 精华:0 注册:2014/12/2 9:23:00
  发帖心情 Post By:2015/7/28 11:42:00 [只看该作者]

图片点击可在新窗口打开查看图片点击可在新窗口打开查看图片点击可在新窗口打开查看谢谢版主!现在快多了!虽然没有说明中的1万行才0.8秒,但比以前快的不是一点!

 回到顶部
帅哥哟,离线,有人找我吗?
lisheng7177
  24楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:二尾狐 帖子:531 积分:3216 威望:0 精华:0 注册:2014/12/2 9:23:00
  发帖心情 Post By:2015/7/28 11:46:00 [只看该作者]

再麻烦您一下:

我发现点击按钮好象不和选择批次有关,只要一点击就是整个报名表中合要求的导一次,是不是可以在下面这句代码中加入条件,让选择批次起作用?

For Each dr1 As DataRow In DataTables("报名登记表").Select("[资格审核] = True ")

 

比如再加入批次?



 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  25楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/7/28 12:04:00 [只看该作者]

Dim Result As DialogResult
Result = MessageBox.Show("确定导出?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question,MessageBoxDefaultButton.Button2)
If result = DialogResult.Yes Then
    SystemReady = False
    DataTables("审核合格表").StopRedraw
    Dim Cols1() As String = {"工作单位","县公司","姓名","性别","身份证号码","文化程度","现岗位名称","参加工作时间","现工种工作时间","原技术资格等级","原等级取得时间","原资格证书工种","原资格证书编号","鉴定等级","申报鉴定工种","鉴定批次","申报性质","用工性质","原人才当量值","备注","照片","是否合格","资格审核","鉴定时间"}
    Dim Cols2() As String = {"工作单位","县公司","姓名","性别","身份证号码","文化程度","现岗位名称","参加工作时间","现工种工作时间","原技术资格等级","原等级取得时间","原资格证书工种","原资格证书编号","鉴定等级","申报鉴定工种","鉴定批次","申报性质","用工性质","原人才当量值","备注","照片","是否合格","资格审核","鉴定时间"}
   
    Dim dic As new Dictionary(Of DataRow, DataRow)
    Dim ls As new List(Of DataRow)
    Dim filter As String = "[资格审核] = True"
    If e.Form.Controls("鉴定批次").Text > "" Then
        filter &= " And 鉴定批次 = '" & e.Form.Controls("鉴定批次").Text & "'"
    End If
    For Each dr1 As DataRow In DataTables("报名登记表").Select(filter)
        Dim dr As DataRow = DataTables("审核合格表").Find("身份证号码 = '" & dr1("身份证号码") & "' And 鉴定批次 = '" & dr1("鉴定批次") & "'")
        If dr Is Nothing Then
            ls.add(dr1)
        Else
            dic.Add(dr, dr1)
        End If
       
    Next
   
    For Each key As DataRow In dic.Keys
        For i As Integer = 0 To Cols1.Length -1
            key(Cols2(i)) = dic(key)(Cols1(i))
        Next
    Next
   
    For Each l As DataRow In ls
        Dim ndr As DataRow = DataTables("审核合格表").AddNew
        For i As Integer = 0 To Cols1.Length -1
            ndr(Cols2(i)) = l(Cols1(i))
        Next
    Next
    DataTables("审核合格表").ResumeRedraw
    SystemReady = True
End If

 


 回到顶部
帅哥哟,离线,有人找我吗?
lisheng7177
  26楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:二尾狐 帖子:531 积分:3216 威望:0 精华:0 注册:2014/12/2 9:23:00
  发帖心情 Post By:2015/7/28 12:27:00 [只看该作者]

图片点击可在新窗口打开查看图片点击可在新窗口打开查看图片点击可在新窗口打开查看谢谢版主!!!!!!现在效率真快!!!!!!

 回到顶部
总数 26 上一页 1 2 3