Esempio n. 1
0
        public GetOrdersResponse GetOrdersByCriteria(GetOrdersRequest request)
        {
            GetOrdersResponse response = new GetOrdersResponse();
            OrderBusinessComponent bc = DependencyInjectionHelper.GetOrderBusinessComponent();

            IQueryable<Order> orders = bc.GetOrdersByCriteria(request.SearchType, request.CustomerId);
            response.Orders = OrderAdapter.OrdersToListDtos(orders);

            return response;
        }
Esempio n. 2
0
        public GetOrdersResponse GetOrdersByCriteria(GetOrdersRequest request)
        {
            if (!HttpContext.Current.User.Identity.IsAuthenticated)
                throw new FaultException<NotAuthenticatedFault>(new NotAuthenticatedFault());
            GetOrdersResponse response = new GetOrdersResponse();
            OrderBusinessComponent bc = DependencyInjectionHelper.GetOrderBusinessComponent();            
            IQueryable<Order> orders = bc.GetOrdersByCriteria(request.SearchType, request.CustomerId);
            response.Orders = OrderAdapter.OrdersToListDtos(orders);

            return response; ;
        }
Esempio n. 3
0
 private IList<OrderListDTO> getOrders(OrderSearchType searchType, int customerid)
 {
     try
     {
         GetOrdersRequest request = new GetOrdersRequest();
         request.SearchType = searchType;
         request.CustomerId = customerid;
         GetOrdersResponse response = Service.GetOrdersByCriteria(request);
         return response.Orders;
     }
     catch (Exception ex)
     {
         if (ExceptionPolicy.HandleException(ex, "PL Policy")) throw;
         return new List<OrderListDTO>();
     }
 }