Dim Result As DialogResult Result = MessageBox.Show("慎!!!是否删除选定数据!"& vbcrlf &"是---将一并删除此案之前录入的送达信息"& vbcrlf &"否---仅删除选中行数据保留之前录入的送达信息", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) If Result = DialogResult.Yes Then With Tables("EMS编辑_Table1") For i As Integer = .BottomPosition To .TopPosition Step -1 Dim r As Row = .rows(i) If r("收件人_单位名称") = "" Then '单位名称为空,就找姓名 If r("收件人_姓名") <> "" Then Dim dr2 As DataRow = DataTables("送达管理").find("案号 = '" & r("案号") & "' and 一审_原告 like '%" & r("收件人_姓名") & "%'") If dr2 IsNot Nothing Then dr2("一审_原告_送达方式") = "" dr2("一审_原告_送达日期") = Nothing End If Else '姓名为空 Return End If Else '单位名称不为空,就找单位名称 Dim dr2 As DataRow = DataTables("送达管理").find("案号 = '" & r("案号") & "' and 一审_原告 like '%" & r("收件人_单位名称") & "%'") If dr2 IsNot Nothing Then dr2("一审_原告_送达方式") = "" dr2("一审_原告_送达日期") = Nothing End If End If .Rows(i).Delete() Next End With Else '直接删除当前行 With Tables("EMS编辑_Table1") For i As Integer = .BottomPosition To .TopPosition Step -1 .Rows(i).Delete() Next End With End If
|