| | |
| | | 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) |
| | | { |