コード例 #1
0
ファイル: DeliveryProvider.cs プロジェクト: agaw/aurora
 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;
 }
コード例 #2
0
ファイル: NotificationService.cs プロジェクト: agaw/aurora
 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");
     }
 }
コード例 #3
0
ファイル: NotificationService.cs プロジェクト: agaw/aurora
 public void NotifyDeliveryCompletion(Guid pDeliveryId, DeliveryCo.Business.Entities.DeliveryStatus pStatus)
 {
     Provider.NotifyDeliveryCompletion(pDeliveryId, GetDeliveryStatusFromDeliveryCoDeliveryStatus(pStatus));
 }
コード例 #4
0
ファイル: DeliveryService.cs プロジェクト: agaw/aurora
 //[OperationBehavior(TransactionScopeRequired = true)]
 public void SubmitDelivery(DeliveryCo.Business.Entities.DeliveryInfo pDeliveryInfo)
 {
     DeliveryProvider.SubmitDelivery(pDeliveryInfo);
 }