Example #1
0
 public void SubmitDelivery(DeliveryCo.Business.Entities.DeliveryInfo pDeliveryInfo)
 {
     using(TransactionScope lScope = new TransactionScope())
     using(DeliveryDataModelContainer lContainer = new DeliveryDataModelContainer())
     {
         //pDeliveryInfo.DeliveryIdentifier = Guid.NewGuid();
         pDeliveryInfo.Status = 0;
         lContainer.DeliveryInfoes.AddObject(pDeliveryInfo);
         lContainer.SaveChanges();
         ThreadPool.QueueUserWorkItem(new WaitCallback((pObj) => ScheduleDelivery(pDeliveryInfo)));
         lScope.Complete();
     }
     //return pDeliveryInfo.DeliveryIdentifier;
 }
Example #2
0
 private DeliveryStatus GetDeliveryStatusFromDeliveryCoDeliveryStatus(DeliveryCo.Business.Entities.DeliveryStatus pStatus)
 {
     if (pStatus == DeliveryCo.Business.Entities.DeliveryStatus.Delivered)
     {
         return DeliveryStatus.Delivered;
     }
     else if (pStatus == DeliveryCo.Business.Entities.DeliveryStatus.Failed)
     {
         return DeliveryStatus.Failed;
     }
     else if (pStatus == DeliveryCo.Business.Entities.DeliveryStatus.Submitted)
     {
         return DeliveryStatus.Submitted;
     }
     else
     {
         throw new Exception("Unexpected delivery pStatus received");
     }
 }
Example #3
0
 public void NotifyDeliveryCompletion(Guid pDeliveryId, DeliveryCo.Business.Entities.DeliveryStatus pStatus)
 {
     Provider.NotifyDeliveryCompletion(pDeliveryId, GetDeliveryStatusFromDeliveryCoDeliveryStatus(pStatus));
 }
Example #4
0
 //[OperationBehavior(TransactionScopeRequired = true)]
 public void SubmitDelivery(DeliveryCo.Business.Entities.DeliveryInfo pDeliveryInfo)
 {
     DeliveryProvider.SubmitDelivery(pDeliveryInfo);
 }