public Order GetOrderByCode(string order_header_code, string company_code)
        {
            Log.Info("Accessing OrderBusinessEngine GetOrderByCode function");
            return(ExecuteFaultHandledOperation(() =>
            {
                var order_header_data = _order_header_repo.GetByCode(order_header_code, company_code);
                Log.Info("OrderHeaderBusinessEngine GetOrderHeaderByCode function completed");

                if (order_header_data.OrderKey != 0)
                {
                    var order_header = Map(order_header_data);
                    return order_header;
                }
                else
                {
                    NotFoundException ex = new NotFoundException(string.Format("Order with code {0} is not in database", order_header_code));
                    throw new FaultException <NotFoundException>(ex, ex.Message);
                }
            }));
        }
コード例 #2
0
 public Task <Order> GetOrderAsync(string orderCode)
 {
     return(Task.Factory.StartNew(() => {
         return new Order(_orderRepository.GetByCode(orderCode, string.Empty)); // _accountRepository.GetAll();
     }));
 }