yangle
2024-02-02 c0cee04d997030777bd85d198d82cc2567f4773f
WebAPI/DLL/ClsSc_ICMOReportBill.cs
@@ -672,14 +672,14 @@
        }
        //删除单据
        public virtual bool DeleteBill(Int64 lngBillKey, ref string sReturn)
        public virtual bool DeleteBill(Int64 lngBillKey, string HBillNo, string procName, string user, ref string sReturn)
        {
            try
            {
                oCn.BeginTran();
                //查询生产汇报单表数量
                DataSet ds = oCn.RunProcReturn("select a.HBillNo,b.HICMOInterID,b.HICMOEntryID  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();
                HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString();
                string HICMOInterID = ds.Tables[0].Rows[0]["HICMOInterID"].ToString();
                string HICMOEntryID = ds.Tables[0].Rows[0]["HICMOEntryID"].ToString();
                //
@@ -706,6 +706,24 @@
                //删除主表
                DeleteBillMain(lngBillKey);
                //删除后控制==================================================================================
                string sql2 = "exec " + procName + " " + lngBillKey + ",'" + HBillNo + "','" + user + "'";
                ds = oCn.RunProcReturn(sql2, 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;