YL
2022-02-21 a905b3df0d0c9ae045b51d1299fbb2f2dcbc2e2d
WebAPI/DLL/ClsSc_ICMOReportBill.cs
@@ -307,6 +307,90 @@
            }
        }
        //审核
        public bool CheckBill(Int64 lngBillKey, ref string sReturn)
        {
            try
            {
                string HChecker = DBUtility.ClsPub.CurUserName;
                string HCheckDate = DBUtility.ClsPub.GetServerDate(-1);
                oCn.BeginTran();
                oCn.RunProc(" Update " + MvarItemKey + " set HBillStatus='2',HChecker='" + HChecker + "',HCheckDate='" + HCheckDate + "' Where HInterID=" + lngBillKey.ToString());
                sReturn = "审核单据成功!";
                oCn.Commit();
                sReturn = "";
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                throw (e);
            }
        }
        //反审核
        public bool AbandonCheck(Int64 lngBillKey, ref string sReturn)
        {
            try
            {
                string HChecker = DBUtility.ClsPub.CurUserName;
                string HCheckDate = DBUtility.ClsPub.GetServerDate(-1);
                oCn.BeginTran();
                //还原单据状态为未审核状态
                oCn.RunProc(" Update " + MvarItemKey + " set HBillStatus='1',HChecker='',HCheckDate='' Where HInterID=" + lngBillKey.ToString());
                sReturn = "反审核单据成功!";
                oCn.Commit();
                sReturn = "";
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                throw (e);
            }
        }
        //删除单据
        public virtual bool DeleteBill(Int64 lngBillKey, ref string sReturn)
        {
            try
            {
                oCn.BeginTran();
                //查询生产汇报单表数量
                DataSet ds = oCn.RunProcReturn("select a.HBillNo,b.HSourceInterID,b.HSourceEntryID  from Sc_ICMOReportBillMain a inner join Sc_ICMOReportBillSub b on a.HInterID = b.HInterID where a.HInterID = '" + lngBillKey + "'", "Sc_ICMOReportBillMain");
                string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString();
                string HSourceInterID = ds.Tables[0].Rows[0]["HSourceInterID"].ToString();
                string HSourceEntryID = ds.Tables[0].Rows[0]["HSourceEntryID"].ToString();
                //
                //更新产量汇报临时表是否报检申请状态
                string sql1 = string.Format(@"update Sc_ICMOBillWorkQtyStatus_Tmp set HRelationInterID='0' where HICMOReportBillNo='"+ HBillNo + "' and HICMOInterID='"+ HSourceInterID + "' and HICMOEntryID='"+ HSourceEntryID + "'");
                oCn.RunProc(sql1);
                //删除关联
                DeleteRelation(ref sReturn, lngBillKey);
                //删除明细表
                DeleteBillSub(lngBillKey);
                //删除主表
                DeleteBillMain(lngBillKey);
                sReturn = "删除单据成功!";
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                oCn.RollBack();
                throw (e);
            }
        }
        //扫码生成产量汇报单(无条码出入库记录)
        public bool AddBill_PDA2(ref string sReturn)
        {