Example #1
0
        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;
            });
        }
Example #2
0
 private void UpdateFullfillmentToInProgess(FulfillmentInfo info)
 {
     info.FulfillmentStatus = FulfillmentStatus.InProgress;
     fulfillRepository.UpdateFulfillment(info);
 }
Example #3
0
 public void UpdateFulfillmentToCompleted(FulfillmentInfo info, KeyStoreContext context)
 {
     info.FulfillmentStatus = FulfillmentStatus.Completed;
     fulfillRepository.UpdateFulfillment(info, context);
 }