Beispiel #1
0
        public static async Task <LG.Data.Models.Orders.OrderInProcess> FindConsultationInProcess(
            LG.Data.Models.Orders.OrderInProcess entity)
        {
            var client = ClientConnection.GetOMS_Connection();

            try
            {
                client.Open();
                switch (entity.OrderAction)
                {
                case OrderAction.FindOrdersInProcessState:

                    var response = await client.FindOrdersInProcessStateAsync(new FindOrdersInProcessStateRequest()
                    {
                        AccountID    = entity.AccountID,
                        MessageGuid  = Guid.NewGuid(),
                        ProcessState = entity.ProcessState
                    });

                    entity.OrderResult = OrderActionResult.Success;
                    entity.OrdersFound = response.OrdersFound.ToList();
                    break;

                case OrderAction.FindConsultationsInProcessState:
                    var response2 =
                        await
                        client.FindConsultationsInProcessStateAsync(new FindConsultationsInProcessStateRequest()
                    {
                        ConsultationRecipientAccountID = entity.AccountID,
                        MessageGuid  = Guid.NewGuid(),
                        ProcessState = entity.ProcessState
                    });

                    entity.OrderResult        = OrderActionResult.Success;
                    entity.ConsultationsFound = response2.ConsultationsFound.ToList();
                    break;
                }
            }
            catch (Exception ex)
            {
                client.Abort();
                entity.IsError     = true;
                entity.Message     = ex.ToString();
                entity.OrderResult = OrderActionResult.Failed;
            }
            finally
            {
                if (client.State != CommunicationState.Closed)
                {
                    client.Close();
                }
            }
            return(entity);
        }
Beispiel #2
0
 public static async Task <LG.Data.Models.Orders.OrderInProcess> FindItemsInProcess(LG.Data.Models.Orders.OrderInProcess entity)
 {
     return(await LG.Data.Core.Orders.OrderDataService.FindItemsInProcess(entity));
 }