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


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

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

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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/7/24 16:15:00 [显示全部帖子]

以下是引用lisheng7177在2015/7/24 15:53:00的发言:

 

上述代码是“资格审核”全部为Ture的人员导出按钮代码,如果是Ture和False的全部导出,该怎么写?是不是可以不要这句?请版主指教?

 

 

For Each dr1 As DataRow In DataTables("报名登记表").Select("")


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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/7/24 16:16:00 [显示全部帖子]

以下是引用lisheng7177在2015/7/24 15:58:00的发言:
另外我发现随着批次的增多,哪怕我选定的是其中一个批次导过去,时间都很长,这是什么原因?

 

1、停止事件触发;

 

http://www.foxtable.com/help/topics/2218.htm

 

2、http://www.foxtable.com/help/topics/2225.htm

 


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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/7/28 10:21:00 [显示全部帖子]

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 = {"工作单位","县公司","姓名","性别","身份证号码","文化程度","现岗位名称","参加工作时间","现工种工作时间","原技术资格等级","原等级取得时间","原资格证书工种","原资格证书编号","鉴定等级","申报鉴定工种","鉴定批次","申报性质","用工性质","原人才当量值","备注","照片","是否合格","资格审核","鉴定时间"}
   
    Dim dic As new Dictionary(Of DataRow, DataRow)
    For Each dr1 As DataRow In DataTables("报名登记表").Select("[资格审核] = True ")
        Dim dr As DataRow = DataTables("审核合格表").Find("身份证号码 = '" & dr1("身份证号码") & "' And 鉴定批次 = '" & dr1("鉴定批次") & "'")
        If dr Is Nothing Then
            dr = DataTables("审核合格表").AddNew
        End If
       
        dic.Add(dr, dr1)
    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
End If

 


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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/7/28 10:28:00 [显示全部帖子]

无语,不行要说报什么错啊。

 

上传实例


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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/7/28 10:33:00 [显示全部帖子]

这种问题,做例子发上来测试。

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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/7/28 10:47:00 [显示全部帖子]

前后加入,不行,就上传实例测试啊。

 

SystemReady = False

 

'------------

 

SystemReady = True


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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/7/28 11:21:00 [显示全部帖子]

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


 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  8楼 | 信息 | 搜索 | 邮箱 | 主页 | 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


 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  9楼 | 信息 | 搜索 | 邮箱 | 主页 | 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

 


 回到顶部