public void UpdateFulfillment(FulfillmentInfo fulfillmentInfo, KeyStoreContext context = null) { UsingContext(ref context, () => { FulfillmentInfo info = context.FulfillmentInfoes.Single(i => i.FulfillmentNumber == fulfillmentInfo.FulfillmentNumber); if (!ValidateStatusTransition(info.FulfillmentStatus, fulfillmentInfo.FulfillmentStatus)) throw new ApplicationException(string.Format("Cannot change fulfillment {0} status from {1} to {2}.", info.FulfillmentNumber, info.FulfillmentStatus.ToString(), fulfillmentInfo.FulfillmentStatus.ToString())); context.Entry(info).CurrentValues.SetValues(fulfillmentInfo); info.ModifiedDateUtc = DateTime.UtcNow; }); }
private void UpdateFullfillmentToInProgess(FulfillmentInfo info) { info.FulfillmentStatus = FulfillmentStatus.InProgress; fulfillRepository.UpdateFulfillment(info); }
public void UpdateFulfillmentToCompleted(FulfillmentInfo info, KeyStoreContext context) { info.FulfillmentStatus = FulfillmentStatus.Completed; fulfillRepository.UpdateFulfillment(info, context); }