yangle
2025-04-02 cee055eb7cdecf5d995cc65d379494e471bde9c8
DAL/³µ¼ä¹ÜÀí/ClsSc_StationEntrustOutBill.cs
@@ -1042,7 +1042,7 @@
        }
        public bool DeleteBill(long HInterID, long HProcExchInterID, long HProcExchEntryID, ref string sReturn)
        public bool DeleteBill(long HInterID, long HProcExchInterID, long HProcExchEntryID, string HBillNo, string procName, string user, ref string sReturn)
        {
            try
            {
@@ -1050,7 +1050,6 @@
                //删除关联
                //////
                oCn.RunProc("exec h_p_Mes_ProcessExchangeRelationQty_Out " + HInterID.ToString() + ",-1");
                oCn.RunProc("exec h_p_WW_EntrustWorkOrderRelationQty_Out " + HInterID.ToString() + ",-1");
                //
@@ -1058,8 +1057,26 @@
                //删除单据
                oCn.RunProc("delete Sc_StationOutBillMain   where HInterID=" + HInterID);
                oCn.RunProc("delete Sc_StationOutBillSub   where HInterID=" + HInterID);
               // oCn.RunProc("delete Sc_StationOutBillSub_Item   where HInterID=" + HInterID);
              //oCn.RunProc("update Sc_ProcessExchangeBillsub set HRelEndDate=null where HInterID=" + HProcExchInterID + " and HEntryID=" + HProcExchEntryID);
                // oCn.RunProc("delete Sc_StationOutBillSub_Item   where HInterID=" + HInterID);
                //oCn.RunProc("update Sc_ProcessExchangeBillsub set HRelEndDate=null where HInterID=" + HProcExchInterID + " and HEntryID=" + HProcExchEntryID);
                //删除后控制==================================================================================
                string sql2 = "exec " + procName + " " + HInterID + ",'" + HBillNo + "','" + user + "'";
                DataSet 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;
                }
                //==============================================================================================
                oCn.Commit();
                return true;