zrg
2025-03-25 5402ccf6d9f8bb3d75e837d457d74cbfc2243c3a
DAL/³µ¼ä¹ÜÀí/ClsSc_StationEntrustOutBill.cs
@@ -121,6 +121,7 @@
                ",HProcID=" + omodel.HProcID.ToString() +
                ",HBadPNL=" + omodel.HBadPNL.ToString() +
                ",HWasterQty=" + omodel.HWasterQty.ToString() +
                ",HBadCount=" + omodel.HBadCount.ToString() +
                //",HICMOQty=" + omodel.HICMOQty.ToString() +
                //",HPlanQty=" + omodel.HPlanQty.ToString() +
                //",HStationOutTime='" + omodel.HStationOutTime + "'" +
@@ -1041,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
            {
@@ -1049,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");
                //
@@ -1057,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;