| | |
| | | } |
| | | } |
| | | |
| | | //删除单据 |
| | | public virtual bool DeleteBill(Int64 lngBillKey, ref string sReturn) |
| | | { |
| | | try |
| | | { |
| | | oCn.BeginTran(); |
| | | //查询生产汇报单表数量 |
| | | DataSet ds = oCn.RunProcReturn("select a.HBillNo,b.HSourceInterID,b.HSourceEntryID from Sc_ICMOReportBillMain a inner join Sc_ICMOReportBillSub b on a.HInterID = b.HInterID where a.HInterID = '" + lngBillKey + "'", "Sc_ICMOReportBillMain"); |
| | | string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); |
| | | string HSourceInterID = ds.Tables[0].Rows[0]["HSourceInterID"].ToString(); |
| | | string HSourceEntryID = ds.Tables[0].Rows[0]["HSourceEntryID"].ToString(); |
| | | // |
| | | //更新产量汇报临时表是否报检申请状态 |
| | | string sql1 = string.Format(@"update Sc_ICMOBillWorkQtyStatus_Tmp set HRelationInterID='0' where HICMOReportBillNo='"+ HBillNo + "' and HICMOInterID='"+ HSourceInterID + "' and HICMOEntryID='"+ HSourceEntryID + "'"); |
| | | oCn.RunProc(sql1); |
| | | |
| | | //删除关联 |
| | | DeleteRelation(ref sReturn, lngBillKey); |
| | | //删除明细表 |
| | | DeleteBillSub(lngBillKey); |
| | | //删除主表 |
| | | DeleteBillMain(lngBillKey); |
| | | |
| | | sReturn = "删除单据成功!"; |
| | | oCn.Commit(); |
| | | return true; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | sReturn = e.Message; |
| | | oCn.RollBack(); |
| | | throw (e); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | //扫码生成产量汇报单(无条码出入库记录) |
| | | public bool AddBill_PDA2(ref string sReturn) |