Foxtable(狐表)用户栏目专家坐堂 → [求助]调试代码


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

主题:[求助]调试代码

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/8/2 17:35:00 [显示全部帖子]

1、确定是那一行有问题,弹出值看一下不就行了?

 

msgbox(e.DataRow("案号"))

msgbox(e.datacol.name)

 

2、

 

'''
If e.DataCol.name = "原审被告" Then
    Dim str As String = e.NewValue
    If str > "" Then
        'Dim ary() As String = str.Replace("被告", "@").split("@")
        Dim ary() As String = str.Replace("被上诉人", "@").replace("上诉人", "@").split("@")'
        For i As Integer = 0 To ary.length-1
           
            str = ary(i).trim()
            If str > "" Then

                Dim mc = System.Text.RegularExpressions.Regex.Matches(str, "(?<=^).*?(?=\.|。)")   '提取原告所在行
                Dim mc1 = System.Text.RegularExpressions.Regex.Matches(str, "(?<=法定代表人).*?(?=\.|。)")   '提取原告法定代表人
                Dim mc2 = System.Text.RegularExpressions.Regex.Matches(str, "(?<=委托代理人).*?(?=\.|。)")   '提取原告委托代理人

                Dim s As String = mc(0).value       '机关负责人出庭
                Dim dr1 = DataTables("机关负责人出庭").Find("[案号] = '" & e.DataRow("案号") & "' And [原审被告] = '" & s.split(",")(0) & "'")
                If dr1 Is Nothing Then               '拆分正确,才能注释代码.存在问题是立案时的被告名称与实际不符
                    dr1 = DataTables("机关负责人出庭").AddNew
                End If
                dr1("案号") = e.DataRow("案号")
                'dr1("当事人") = e.DataRow("当事人")
                dr1("原审被告") = s.split(",")(0)
                dr1("庭审笔录被告出庭") = str
                'Dim s As String = mc(0).value
                Dim dr = DataTables("机关维护").Find("[行政机关] = '" & s.split(",")(0) & "'")      '到信息表去找
                If dr Is Nothing Then
                    dr = DataTables("机关维护").AddNew
                    dr("更新时间") = Date.now
                End If

                '----------------------------------------------------
                dr("行政机关") = s.split(",")(0).Replace("被上诉人", "").Replace("上诉人", "")

                dr("住所地") = s.split(",")(1)
If mc1.count > 0 Then
                s = mc1(0).value
                dr("法定代表人") = s.split(",")(0)
                dr("职务") = s.split(",")(1)
                dr("更新时间") = Date.now
End If               
                '委托代理人--------------------------------
                If mc2.count >= 1 Then
                    s = mc2(0).value
                    Dim dr2 = DataTables("委托代理人").Find("[姓名] = '" & s.split(",")(0) & "'")      '到信息表去找
                    If dr2 Is Nothing Then
                        dr2 = DataTables("委托代理人").AddNew
                       
                        dr2("姓名") = s.split(",")(0)
                        dr2("单位") = s.split(",")(1)
                        dr2("更新时间") = Date.now
                    Else
                        dr2("姓名") = s.split(",")(0)
                        dr2("单位") = s.split(",")(1)
                        dr2("更新时间") = Date.now
                    End If
                End If
               
                If mc2.count >= 2 Then
                    s = mc2(1).value
                    Dim dr2 = DataTables("委托代理人").Find("[姓名] = '" & s.split(",")(0) & "'")      '到信息表去找
                    If dr2 Is Nothing Then
                        dr2 = DataTables("委托代理人").AddNew
                        dr2("姓名") = s.split(",")(0)
                        dr2("单位") = s.split(",")(1)
                        dr2("更新时间") = Date.now
                    Else
                        dr2("姓名") = s.split(",")(0)
                        dr2("单位") = s.split(",")(1)
                        dr2("更新时间") = Date.now
                    End If
                End If
            End If
        Next
    End If
End If


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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/8/2 22:50:00 [显示全部帖子]

实例发上来测试。

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/8/2 23:07:00 [显示全部帖子]

改成2楼代码啊。

 

                Dim mc = System.Text.RegularExpressions.Regex.Matches(str, "(?<=^).*?(?=\.|)")   '提取原告所在行
                Dim mc1 = System.Text.RegularExpressions.Regex.Matches(str, "(?<=法定代表人).*?(?=\.|)")   '提取原告法定代表人
                Dim mc2 = System.Text.RegularExpressions.Regex.Matches(str, "(?<=委托代理人).*?(?=\.|)")   '提取原告委托代理人

 

 


 回到顶部