public void Update(Invoice original_entity, Invoice entity) { var parcelsManager = new ParcelsManager(this); parcelsManager.UpdateParcels( parcelsManager.GetInvoiceParcels(original_entity.CompanyId, original_entity.InvoiceId), entity.Parcels.AsQueryable()); original_entity.CopyPropertiesFrom(entity); DbContext.SubmitChanges(); }
/// <summary> /// This method updates invoice's parcel /// </summary> /// <param name="original_entity"></param> /// <param name="entity"></param> /// <param name="parcels"></param> public void Update(Invoice original_entity, Invoice entity, IList<Parcel> parcels) { var parcelsManager = new ParcelsManager(this); original_entity.CopyPropertiesFrom(entity); original_entity.ModifiedDate = DateTime.Now; DbContext.SubmitChanges(); parcelsManager.UpdateParcels( parcelsManager.GetInvoiceParcels(original_entity.CompanyId, original_entity.InvoiceId), parcels); }
public void Update(Bill original_entity, Bill entity, IList<Parcel> parcels) { var parcelsManager = new ParcelsManager(this); entity.ModifiedDate = DateTime.Now; original_entity.CopyPropertiesFrom(entity); DbContext.SubmitChanges(); foreach (Parcel item in parcels) item.BillId = original_entity.BillId; parcelsManager.UpdateParcels( parcelsManager.GetBillParcels(original_entity.CompanyId, original_entity.BillId), parcels); }
public void Update(Bill original_entity, Bill entity) { var parcelsManager = new ParcelsManager(this); foreach (Parcel parcel in entity.Parcels) if (!parcel.BillId.HasValue) parcel.BillId = entity.BillId; DbContext.SubmitChanges(); parcelsManager.UpdateParcels( parcelsManager.GetBillParcels(original_entity.CompanyId, original_entity.BillId).AsQueryable(), entity.Parcels.AsQueryable()); original_entity.CopyPropertiesFrom(entity); DbContext.SubmitChanges(); }