/// <summary> /// Delete ProductScrap by primary key. /// </summary> public void Delete(string productScrapId) { // // todo:add other logic here // try { BL.V.BeginTransaction(); Model.ProductScrap model = this.GetDetails(productScrapId); //accessorDetail.DeleteByPrimaryId(productScrapId); foreach (var item in model.Details) { accessorDetail.Delete(item.ProductScrapDetailId); accessorStock.Increment(new BL.DepotPositionManager().Get(item.DepotPositionId), item.Product, Convert.ToDouble(item.ScrapQuantity)); accessorProduct.UpdateProduct_Stock(item.Product); } accessor.Delete(productScrapId); string invoiceKind = this.GetInvoiceKind().ToLower(); string sequencekey_d = string.Format("{0}-d-{1}", invoiceKind, model.InsertTime.Value.ToString("yyyy-MM-dd")); SequenceManager.Decrement(sequencekey_d); BL.V.CommitTransaction(); } catch (Exception ex) { BL.V.RollbackTransaction(); throw ex; } }
public void Delete(Model.AtSummon atSummon) { try { BL.V.BeginTransaction(); _atSummonDetailManager.DeleteByHeadId(atSummon.SummonId); this.Delete(atSummon.SummonId); string invoiceKind = this.GetInvoiceKind().ToLower(); string sequencekey_y = string.Format("{0}-y-{1}", invoiceKind, atSummon.SummonDate.Value.Year); string sequencekey_m = string.Format("{0}-m-{1}-{2}", invoiceKind, atSummon.SummonDate.Value.Year, atSummon.SummonDate.Value.Month); string sequencekey_d = string.Format("{0}-d-{1}", invoiceKind, atSummon.SummonDate.Value.ToString("yyyy-MM-dd")); string sequencekey = string.Format(invoiceKind); SequenceManager.Decrement(sequencekey_y); SequenceManager.Decrement(sequencekey_m); SequenceManager.Decrement(sequencekey_d); SequenceManager.Decrement(sequencekey); BL.V.CommitTransaction(); } catch { BL.V.RollbackTransaction(); throw; } }
/// <summary> /// Delete DepotIn by primary key. /// </summary> public void Delete(string depotInId) { Model.DepotIn model = this.Get(depotInId); string invoiceKind = this.GetInvoiceKind().ToLower(); string sequencekey_d = string.Format("{0}-d-{1}", invoiceKind, model.InsertTime.Value.ToString("yyyy-MM-dd")); SequenceManager.Decrement(sequencekey_d); accessor.Delete(depotInId); }
/// <summary> /// Delete ProduceOtherExitMaterial by primary key. /// </summary> public void Delete(string produceOtherExitMaterialId) { // // todo:add other logic here // Model.ProduceOtherExitMaterial model = this.Get(produceOtherExitMaterialId); string invoiceKind = this.GetInvoiceKind().ToLower(); string sequencekey_d = string.Format("{0}-d-{1}", invoiceKind, model.InsertTime.Value.ToString("yyyy-MM-dd")); SequenceManager.Decrement(sequencekey_d); accessor.Delete(produceOtherExitMaterialId); }
/// <summary> /// Delete MRSHeader by primary key. /// </summary> public void Delete(string mRSHeaderID) { // // todo:add other logic here // Model.MRSHeader model = this.Get(mRSHeaderID); string invoiceKind = this.GetInvoiceKind().ToLower(); string sequencekey_d = string.Format("{0}-d-{1}", invoiceKind, model.InsertTime.Value.ToString("yyyy-MM-dd")); SequenceManager.Decrement(sequencekey_d); accessor.Delete(mRSHeaderID); }
/// <summary> /// Delete ProduceOtherInDepot by primary key. /// </summary> public void Delete(string produceOtherInDepotId) { try { BL.V.BeginTransaction(); Model.ProduceOtherInDepot model = this.Get(produceOtherInDepotId); string invoiceKind = this.GetInvoiceKind().ToLower(); string sequencekey_d = string.Format("{0}-d-{1}", invoiceKind, model.InsertTime.Value.ToString("yyyy-MM-dd")); SequenceManager.Decrement(sequencekey_d); CancelAffect(accessor.Get(produceOtherInDepotId), 1); accessor.Delete(produceOtherInDepotId); BL.V.CommitTransaction(); } catch { BL.V.RollbackTransaction(); throw; } }