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);
        }