From 2bc84b72f4cf693673716ef722a6bb19a8bf3f6f Mon Sep 17 00:00:00 2001 From: duhe <226547893@qq.com> Date: 星期一, 22 一月 2024 15:56:42 +0800 Subject: [PATCH] 通用审核、反审核:增加审核、反审核方法,并进行审核、反审核后判定 --- DBUtility/业务单据/ClsXt_BaseBill.cs | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 100 insertions(+), 0 deletions(-) diff --git "a/DBUtility/\344\270\232\345\212\241\345\215\225\346\215\256/ClsXt_BaseBill.cs" "b/DBUtility/\344\270\232\345\212\241\345\215\225\346\215\256/ClsXt_BaseBill.cs" index 4b7bcc9..f8731e0 100644 --- "a/DBUtility/\344\270\232\345\212\241\345\215\225\346\215\256/ClsXt_BaseBill.cs" +++ "b/DBUtility/\344\270\232\345\212\241\345\215\225\346\215\256/ClsXt_BaseBill.cs" @@ -132,6 +132,63 @@ throw (e); } } + //鍙嶅鏍�(鍖呭惈鍙嶅鏍稿悗鎺у埗) + public bool AbandonCheck(Int64 lngBillKey, string HBillNo, string procName, string sUser, ref string sReturn) + { + string sql = ""; + DataSet ds; + + if (isUse(lngBillKey, ref sReturn)) + { + return false; + } + try + { + //寮�鍚簨鍔� + oCn.BeginTran(); + + ds = oCn.RunProcReturn("select * from " + MvarItemKey + " where HInterID=" + lngBillKey.ToString(), MvarItemKey); + if (ds.Tables[0].Rows[0]["HDeleteMan"].ToString() != "") + { + oCn.RunProc(" Update " + MvarItemKey + " set HChecker='',HCheckDate=null,HBillStatus=4 Where HInterID=" + lngBillKey.ToString()); + } + else if (ds.Tables[0].Rows[0]["HCloseMan"].ToString() != "") + { + oCn.RunProc(" Update " + MvarItemKey + " set HChecker='',HCheckDate=null,HBillStatus=3 Where HInterID=" + lngBillKey.ToString()); + } + else + { + oCn.RunProc(" Update " + MvarItemKey + " set HChecker='',HCheckDate=null,HBillStatus=1 Where HInterID=" + lngBillKey.ToString()); + } + + //鍙嶅鏍稿悗鎺у埗 + sql = "exec " + procName + " " + lngBillKey + ",'" + HBillNo + "','" + sUser + "'"; + ds = oCn.RunProcReturn(sql, procName); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + sReturn = "鍙嶅鏍歌繃绋嬩腑鍑洪敊锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�"; + oCn.RollBack(); + return false; + } + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + sReturn = ds.Tables[0].Rows[0]["HRemark"].ToString(); + oCn.RollBack(); + return false; + } + + sReturn = ""; + oCn.Commit(); + return true; + } + catch (Exception e) + { + oCn.RollBack(); + sReturn = e.Message; + throw (e); + } + } + //瀹℃牳 public bool CheckBill(Int64 lngBillKey, ref string sReturn) { @@ -168,6 +225,49 @@ throw (e); } } + //瀹℃牳(鍖呭惈鍙嶅鏍稿悗鎺у埗) + public bool CheckBill(Int64 lngBillKey, string HBillNo,string procName , string sUser, ref string sReturn) + { + string sql = ""; + DataSet ds; + try + { + string HChecker = sUser; + string HCheckDate = ClsPub.GetServerDate(-1); + + //寮�鍚簨鍔� + oCn.BeginTran(); + + //鏇存柊鍗曟嵁鐘舵�� + oCn.RunProc(" Update " + MvarItemKey + " set HChecker='" + HChecker + "',HCheckDate='" + HCheckDate + "' Where HInterID=" + lngBillKey.ToString()); + + //瀹℃牳鍚庢帶鍒� + sql = "exec " + procName + " " + lngBillKey + ",'" + HBillNo + "','" + sUser + "'"; + ds = oCn.RunProcReturn(sql, procName); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + sReturn = "瀹℃牳杩囩▼涓嚭閿欙紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴"; + oCn.RollBack(); + return false; + } + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + sReturn = ds.Tables[0].Rows[0]["HRemark"].ToString(); + oCn.RollBack(); + return false; + } + + sReturn = ""; + oCn.Commit(); + return true; + } + catch (Exception e) + { + oCn.RollBack(); + sReturn = e.Message; + throw (e); + } + } //鍏抽棴 public bool CloseBill(Int64 lngBillKey, ref string sReturn) { -- Gitblit v1.9.1