yusijie
2024-01-23 2095d4d4920f16a8b493c80bada80db5cedc8c31
DBUtility/ÒµÎñµ¥¾Ý/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)
        {