-- 作者:cd_tdh
-- 发布时间:2020/5/26 13:45:00
-- 作废后代办事项
老师,以下代码在窗口的按钮中,作废后待办事项该条数据还在,那儿问题呢?
Dim r As Row = Tables(Vars("text")).Current Dim dr1 As DataRow = DataTables("审核流程管理").SQLFind("表名称 = \'" & Vars("text") & "\' and 审批状态=\'" & r("审批状态") & "\'") Dim dr2 As DataRow = DataTables("审核流程管理").SQLFind("表名称 = \'" & Vars("text") & "\' And 流程编号> \'" & dr1("流程编号") & "\'","流程编号") If _UserPost = dr2("审核人角色") Then Dim dt As DataTable = DataTables("待办事项") Dim dr As DataRow = dt.SQLFind("ID = \'" & r("ID") & "\'") If dr IsNot Nothing Then \'如果找到的话 Dim Result1 As DialogResult Result1 = MessageBox.Show("作废后该订单将从代办事项中删除,你确定作废吗?!", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) If Result1 = DialogResult.Yes Then dr.Delete dt.Save Dim st As String = e.Form.Controls("TextBox1").text If st IsNot Nothing Then r("审批状态") = "作废" r.Save Dim dw As Row = Tables("审核意见表").AddNew() dw("表名称")= Forms("主窗口").Controls("TabControl1").SelectedPage.name dw("审核部门")= _UserPost dw("审核人")= _UserXingMing dw("审核日期")= Functions.Execute("服务器时间") dw("审核意见")= st dw("ID")= r("ID") dw.Save Else MessageBox.Show("作废原因不能为空!","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning) Return End If End If End If Else MessageBox.Show("你没有作废权限,请联系审批状态的审批人作废!","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning) e.Form.Controls("TextBox1").text = Nothing Return End If
[此贴子已经被作者于2020/5/26 13:50:21编辑过]
|
-- 作者:有点蓝
-- 发布时间:2020/5/26 14:05:00
--
If _UserPost = dr2("审核人角色") Then Dim dt As DataTable = DataTables("待办事项") Dim dr As DataRow = dt.SQLFind("ID = \'" & r("ID") & "\'")msgbox(dr("id") & "," & dr("_Identify")) If dr IsNot Nothing Then \'如果找到的话 Dim Result1 As DialogResult Result1 = MessageBox.Show("作废后该订单将从代办事项中删除,你确定作废吗?!", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) If Result1 = DialogResult.Yes Then dr.Delete dt.Save dr = dt.SQLFind("ID = \'" & r("ID") & "\'") If dr IsNot Nothing Then msgbox(dr("id") & "," & dr("_Identify")) 能不能弹出,内容是否和上次弹出一样 end if
|
-- 作者:cd_tdh
-- 发布时间:2020/5/26 14:06:00
--
测试过,ID是一样的,用的GUIG,这样就没问题
Dim r As Row = Tables(Vars("text")).Current Dim dr1 As DataRow = DataTables("审核流程管理").SQLFind("表名称 = \'" & Vars("text") & "\' and 审批状态=\'" & r("审批状态") & "\'") Dim dr2 As DataRow = DataTables("审核流程管理").SQLFind("表名称 = \'" & Vars("text") & "\' And 流程编号> \'" & dr1("流程编号") & "\'","流程编号") If _UserPost = dr2("审核人角色") Then Dim Result1 As DialogResult Result1 = MessageBox.Show("作废后该订单将从代办事项中删除,你确定作废吗?!", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) If Result1 = DialogResult.Yes Then Dim st As String = e.Form.Controls("TextBox1").text If st IsNot Nothing Then r("审批状态") = "作废" r.Save Dim dw As Row = Tables("审核意见表").AddNew() dw("表名称")= Forms("主窗口").Controls("TabControl1").SelectedPage.name dw("审核部门")= _UserPost dw("审核人")= _UserXingMing dw("审核日期")= Functions.Execute("服务器时间") dw("审核意见")= st dw("ID")= r("ID") dw.Save Dim dt As DataTable = DataTables("待办事项") dt.sqlDeletefor ("ID = \'" & r("ID") & "\'") dt.save Else MessageBox.Show("作废原因不能为空!","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning) Return End If End If Else MessageBox.Show("你没有作废权限,请联系审批状态的审批人作废!","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning) e.Form.Controls("TextBox1").text = Nothing Return End If
|