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