private void ScheduleDelivery(DeliveryInfo pDeliveryInfo) { Console.WriteLine("Delivering to" + pDeliveryInfo.DestinationAddress); Thread.Sleep(1000); //notifying of delivery completion using (TransactionScope lScope = new TransactionScope()) using (DeliveryDataModelContainer lContainer = new DeliveryDataModelContainer()) { pDeliveryInfo.Status = 1; /** INotificationService lService = DeliveryNotificationServiceFactory.GetDeliveryNotificationService(pDeliveryInfo.DeliveryNotificationAddress); lService.NotifyDeliveryCompletion(pDeliveryInfo.DeliveryIdentifier, DeliveryInfoStatus.Delivered); **/ NotificationService.NotificationServiceClient IClient = new NotificationService.NotificationServiceClient(); IClient.NotifyDeliveryCompletion(pDeliveryInfo.DeliveryIdentifier, DeliveryStatus.Delivered); lScope.Complete(); } }
/// <summary> /// Deprecated Method for adding a new object to the DeliveryInfoes EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToDeliveryInfoes(DeliveryInfo deliveryInfo) { base.AddObject("DeliveryInfoes", deliveryInfo); }
/// <summary> /// Create a new DeliveryInfo object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="sourceAddress">Initial value of the SourceAddress property.</param> /// <param name="destinationAddress">Initial value of the DestinationAddress property.</param> /// <param name="orderNumber">Initial value of the OrderNumber property.</param> /// <param name="deliveryIdentifier">Initial value of the DeliveryIdentifier property.</param> /// <param name="deliveryNotificationAddress">Initial value of the DeliveryNotificationAddress property.</param> /// <param name="status">Initial value of the Status property.</param> public static DeliveryInfo CreateDeliveryInfo(global::System.Int32 id, global::System.String sourceAddress, global::System.String destinationAddress, global::System.String orderNumber, global::System.Guid deliveryIdentifier, global::System.String deliveryNotificationAddress, global::System.Int32 status) { DeliveryInfo deliveryInfo = new DeliveryInfo(); deliveryInfo.Id = id; deliveryInfo.SourceAddress = sourceAddress; deliveryInfo.DestinationAddress = destinationAddress; deliveryInfo.OrderNumber = orderNumber; deliveryInfo.DeliveryIdentifier = deliveryIdentifier; deliveryInfo.DeliveryNotificationAddress = deliveryNotificationAddress; deliveryInfo.Status = status; return deliveryInfo; }