duhe
2023-10-26 493c053a3fbc2db47c46ca46944ed911de84b0a9
WebAPI/DLL/ClsOA_ErrMsgBackBill.cs
@@ -14,7 +14,7 @@
        public ClsOA_ErrMsgBackBill()
        {
            base.MvarItemKeySub = "OA_ErrMsgBackBillSub";
            base.MvarItemKeySub2 = "";
            base.MvarItemKeySub2 = "OA_ErrMsgBackBillSub2";
            base.MvarItemKeySub3 = "";
            base.MvarItemKeySub4 = "";
            base.MvarItemKey="OA_ErrMsgBackBillMain";
@@ -70,6 +70,7 @@
                DeleteRelation(ref sReturn, lngBillKey);
                //删除子表
                DeleteBillSub(lngBillKey);
                DeleteBillSub2(lngBillKey);
                //插入子表
                omodel.HInterID = lngBillKey;
                foreach (Models.ClsOA_ErrMsgBackBillSub oSub in DetailColl)
@@ -88,12 +89,10 @@
                foreach (Models.ClsOA_ErrMsgBackBillSub2 oSubSec in DetailColl2)
                {
                    oCn.RunProc("Insert into OA_ErrMsgBackBillSub2 " +
                      " (HInterID,HEntryID" +
                      ",HReceiveMan,HReadFlag" +
                      " (HInterID,HEntryID,HReceiveMan,HReadFlag" +
                      ")" +
                      " values("
                      + omodel.HInterID.ToString() + "," + oSubSec.HEntryID.ToString() + ",'" + oSubSec.HRemark + "'" +
                      ",'" + oSubSec.HReceiveMan + "'," + Convert.ToString(oSubSec.HReadFlag ? 1 : 0) +
                      + omodel.HInterID.ToString() + "," + oSubSec.HEntryID.ToString() + ",'" + oSubSec.HReceiveMan + "'," + Convert.ToString(oSubSec.HReadFlag ? 1 : 0) +
                      ") ");
                }
@@ -135,7 +134,7 @@
                ",HContext,HDeptID,HDescription,HSendMan,HReceiveMan" +
                ",HCopyMan,HHasten,HLevel,HReTransmitMan,HBillTypeName"+
                ",HPlanBillNo,HMaterName,HMaterModel,HQty,HSendType"+
                ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" +
                ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRecDeptID,HMaterNumber" +
                ") " +
                " values('" + this.BillType + "','"  + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" +
                "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" +
@@ -143,6 +142,7 @@
                ",'" + omodel.HCopyMan + "'," + omodel.HHasten.ToString() + ",'" + omodel.HLevel + "','" + omodel.HReTransmitMan + "','" + omodel.HBillTypeName + "'" +
                ",'" + omodel.HPlanBillNo + "','" + omodel.HMaterName + "','" + omodel.HMaterModel + "'," + omodel.HQty.ToString() + ",'" + omodel.HSendType + "'" +
                ",'" + omodel.HMainSourceInterID + "','" + omodel.HMainSourceEntryID + "','" + omodel.HMainSourceBillNo + "','" + omodel.HMainSourceBillType + "'" +
                "," + omodel.HRecDeptID + ",'" + omodel.HMaterNumber + "'" +
                ") ");
                //插入子表
                //foreach (Models.ClsOA_ErrMsgBackBillSub oSub in DetailColl)
@@ -192,6 +192,37 @@
                throw (e);
            }
        }
        //删除单据
        public virtual bool DeleteBill(Int64 lngBillKey,string HEntryID, ref string sReturn)
        {
            try
            {
                oCn.BeginTran();
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                string sql = string.Format(@"select *  from "+MvarItemKeySub+ " where HInterID=" + lngBillKey.ToString() + " and HEntryID='" + HEntryID + "'");
                var dataSet = oCN.RunProcReturn(sql, ""+ MvarItemKeySub + "");
                //删除关联
                DeleteRelation(ref sReturn, lngBillKey);
                //删除明细表
                oCn.RunProc("Delete From " + MvarItemKeySub + "  where HInterID=" + lngBillKey.ToString()+" and HEntryID='"+HEntryID+"'");
                //删除主表
                if (dataSet == null || dataSet.Tables[0].Rows.Count == 0)
                {
                    DeleteBillMain(lngBillKey);
                }
                sReturn = "删除单据成功!";
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                oCn.RollBack();
                throw (e);
            }
        }
        //显示单据
        public override bool ShowBill(Int64 lngBillKey, ref string sReturn)
        {