yusijie
2024-10-31 aa163d95ef7e56aff066a11dad66083bcd373f95
DAL/³µ¼ä¹ÜÀí/ClsSc_StationOutBill.cs
@@ -349,7 +349,7 @@
                "," + omodel.HSupID.ToString() + "," + omodel.HQty.ToString() + "," + omodel.HPrice.ToString() + "," + omodel.HMoney.ToString() + "," + omodel.HBadCount.ToString() + "," + omodel.HCenterID.ToString() + "," + omodel.HProcNo.ToString() + ",'" + omodel.HOrderProcNO + "'" + ",'" + omodel.HSourceNameList + "'" +
                "," + omodel.HMainSourceInterID.ToString() + ",'" + omodel.HMainSourceBillNo + "','" + omodel.HMainSourceBillType + "'," + Convert.ToString(omodel.HLastSubProc ? 1 : 0) +
                "," + omodel.HEmpID2.ToString() + "," + omodel.HEmpID3.ToString() + "," + omodel.HEmpID4.ToString() + "," + omodel.HEmpID5.ToString() + "," + omodel.HDSQty.ToString() + "," + omodel.HChongQty.ToString() + "," + omodel.HPriceRate.ToString() + "," + omodel.HWorkTimes.ToString() + "," + omodel.HQCCheckID.ToString() +
                "," + omodel.HPersonNums.ToString() + "," + omodel.HMachineNums.ToString() + ",'" + omodel.HEmpNum.ToString() + "'" +
                "," + omodel.HPersonNums.ToString() + "," + omodel.HMachineNums.ToString() + ",'" + omodel.HEmpNum + "'" +
                ") ");
                //插入子表
                foreach (Model.ClsSc_StationOutBillSub oSub in DetailColl)
@@ -1061,6 +1061,53 @@
        }
        public bool DeleteBill(long HInterID, long HProcExchInterID, long HProcExchEntryID, string HBillNo, string procName, string user, ref string sReturn)
        {
            try
            {
                oCn.BeginTran();
                //删除关联
                //
                oCn.RunProc("exec h_p_Mes_ProcessExchangeRelationQty_Out " + HInterID.ToString() + ",-1");
                //
                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);
                //删除后控制==================================================================================
                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;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                oCn.RollBack();
                throw (e);
            }
        }
        public bool CheckCenterIDByUser(long HCenterID)
        {
            DataSet Ds;