示例#1
0
        public List <State> GetAllStates()
        {
            var business = StateBusiness.Instance;
            var request  = new GetAllStatesRequest(this.Context);
            var states   = business.GetAllStates(request);

            return(states);
        }
        public override List <string> GetStatesForCountry(string country)
        {
            var proxy    = ServiceClientProvider.GetMexicoShippingServiceProxy();
            var request  = new GetAllStatesRequest();
            var response = proxy.GetAllStates(request);
            var result   = response.GetAllStatesResult as AllStatesResponse_V01;

            return(result.StateNames.ToList());
        }
示例#3
0
        public GetAllStatesResponse GetAllStates(GetAllStatesRequest request)
        {
            GetAllStatesResponse response = new GetAllStatesResponse();
            IEnumerable <State>  states;

            states = repository.GetAllStates();
            if (states == null)
            {
                throw new ResourceNotFoundException("The requested states list was not found.");
            }
            response.States = states;
            return(response);
        }
示例#4
0
        public List <State> GetAllStates(GetAllStatesRequest request)
        {
            List <State> states = null;

            if (request != null)
            {
                var dataAccess = new StateDataAccess(request.Context);

                var statesQuery = dataAccess.GetAll();

                statesQuery = statesQuery.Include(s => s.Country);

                states = statesQuery.ToList();
            }

            return(states);
        }