Exemplo n.º 1
0
        public GetCustomersResponse GetCustomersByCriteria(GetCustomersRequest request)
        {
            GetCustomersResponse response = new GetCustomersResponse();
            CustomerBusinessComponent bc = DependencyInjectionHelper.GetCustomerBusinessComponent();

            IQueryable<Customer> customers = bc.GetCustomersByCriteria(request.SearchType, request.City, request.CustomerName);
            response.Customers = CustomerAdapter.CustomersToDtos(customers);

            return response;
        }
Exemplo n.º 2
0
 private IList<CustomerListDTO> getCustomers(CustomerSearchType searchType, string name, string city)
 {
     try
     {
         GetCustomersRequest request = new GetCustomersRequest();
         request.SearchType = searchType;
         request.CustomerName = name;
         request.City = city;
         GetCustomersResponse response = Service.GetCustomersByCriteria(request);
         return response.Customers;
     }
     catch (Exception ex)
     {
         if (ExceptionPolicy.HandleException(ex, "PL Policy")) throw;
         return new List<CustomerListDTO>();
     }
 }