| | |
| | | } |
| | | |
| | | //删除单据 |
| | | public override bool DeleteBill(Int64 lngBillKey, ref string sReturn) |
| | | public bool DeleteBill(Int64 lngBillKey, string HBillNo, string procName, string user, ref string sReturn) |
| | | { |
| | | try |
| | | { |
| | |
| | | //删除主表 |
| | | oCn.RunProc("Delete From " + MvarItemKey + " where HInterID=" + lngBillKey.ToString()); |
| | | |
| | | //删除后控制================================================================================== |
| | | string sql2 = "exec " + procName + " " + lngBillKey + ",'" + HBillNo + "','" + user + "'"; |
| | | 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; |
| | | } |
| | | //============================================================================================== |
| | | |
| | | sReturn = "删除单据成功!"; |
| | | oCn.Commit(); |
| | | return true; |