zzr99
2021-12-07 56270ee3a189c0dbd42446fbd726341c9f4e8efd
WebAPI/DLL/ClsOA_ErrMsgBackBill.cs
@@ -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)
        {