Exemplo n.º 1
0
        public List <ListItem> GenerateList(ParameterType typeRequested, Dictionary <DictionaryParameter, string> parameters
                                            , bool addAllItem = true, bool checkOutLogic = false)
        {
            List <ListItem> returned;

            switch (typeRequested)
            {
            case ParameterType.OwningCountry:
                returned = ParameterDataAccess.GetOwningCountryListItems(_dataContext);
                break;

            case ParameterType.CountryCheckOut:
                returned = ParameterDataAccess.GetReservationOutCountryListItems(_dataContext);
                break;

            case ParameterType.LocationCountry:
                returned = ParameterDataAccess.GetLocationCountryListItems(_dataContext);
                break;

            case ParameterType.Pool:
                returned = ParameterDataAccess.GetPoolListItems(parameters, _dataContext, checkOutLogic);
                break;

            case ParameterType.LocationGroup:
                returned = ParameterDataAccess.GetLocationGroupListItems(parameters, _dataContext, checkOutLogic);
                break;

            case ParameterType.Area:
                returned = ParameterDataAccess.GetAreaListItems(parameters, _dataContext, checkOutLogic);
                break;

            case ParameterType.Region:
                returned = ParameterDataAccess.GetRegionListItems(parameters, _dataContext, checkOutLogic);
                break;

            case ParameterType.Location:
                returned = ParameterDataAccess.GetLocationListItems(parameters, _dataContext, checkOutLogic);
                break;

            case ParameterType.CarSegment:
                returned = ParameterDataAccess.GetCarSegmentListItems(parameters, _dataContext);
                break;

            case ParameterType.CarClass:
                returned = ParameterDataAccess.GetCarClassListItems(parameters, _dataContext);
                break;

            case ParameterType.CarGroup:
                returned = ParameterDataAccess.GetCarCarGroupListItems(parameters, _dataContext);
                break;

            default:
                throw new ArgumentOutOfRangeException("typeRequested");
            }
            if (addAllItem)
            {
                returned.RemoveAll(d => d.Value == string.Empty);
                returned.Insert(0, new ListItem("***All***", string.Empty));
            }

            return(returned);
        }
Exemplo n.º 2
0
        public List <ListItem> GetOwningCounries()
        {
            var countries = ParameterDataAccess.GetOwningCountryListItems(DataContext);

            return(countries);
        }