Пример #1
0
        private void PopulateDefaultItems()
        {
            using (var dataAccess = new MappingListSelect())
            {
                var countryParams = ucCountryParameter.GetParameters();
                var countries     = dataAccess.GetAllCountries(countryParams);

                //var poolParams = ucPoolParameter.GetParameters();
                //var pools = dataAccess.GetPools(poolParams);

                //var locationGroupParams = ucLocationGroupParameters.GetParameters();
                //var locationGroups = dataAccess.GetLocationGroups(locationGroupParams);

                //var regionParams = ucRegionParameters.GetParameters();
                //var regions = dataAccess.GetRegions(regionParams);

                //var areaParams = ucAreaParameters.GetParameters();
                //var areas = dataAccess.GetAreas(areaParams);

                //var locationParams = ucLocationParameters.GetParameters();
                //var locations = dataAccess.GetLocations(locationParams);

                //var carSegmentParams = ucCarSegmentParameters.GetParameters();
                //var segments = dataAccess.GetCarSegments(carSegmentParams);

                //var carClassParams = ucCarClassParamters.GetParameters();
                //var classes = dataAccess.GetCarClasses(carClassParams);

                //var carGroupParams = ucCarGroupParameters.GetParameters();
                //var groups = dataAccess.GetCarGroups(carGroupParams);

                ucCountryGrid.BindGrid(countries);
                //ucPoolGrid.BindGrid(pools);
                //ucLocationGroupGrid.BindGrid(locationGroups);
                //ucRegionGrid.BindGrid(regions);
                //ucAreaGrid.BindGrid(areas);
                //ucLocationGrid.BindGrid(locations);
                //ucCarSegmentGrid.BindGrid(segments);
                //ucCarClassGrid.BindGrid(classes);
                //ucCarGroupGrid.BindGrid(groups);
            }
        }
Пример #2
0
        private void RefreshData(AdminMappingEnum dataType)
        {
            using (var dataAccess = new MappingListSelect())
            {
                Dictionary <DictionaryParameter, string> dictionaryParameters;
                switch (dataType)
                {
                case AdminMappingEnum.Country:
                    dictionaryParameters = ucCountryParameter.GetParameters();
                    var countries = dataAccess.GetAllCountries(dictionaryParameters);
                    ucCountryGrid.BindGrid(countries);
                    break;

                case AdminMappingEnum.CmsPool:
                    dictionaryParameters = ucPoolParameter.GetParameters();
                    var pools = dataAccess.GetPools(dictionaryParameters);
                    ucPoolGrid.BindGrid(pools);
                    break;

                case AdminMappingEnum.CmsLocationGroup:
                    dictionaryParameters = ucLocationGroupParameters.GetParameters();
                    var locationGroups = dataAccess.GetLocationGroups(dictionaryParameters);
                    ucLocationGroupGrid.BindGrid(locationGroups);
                    break;

                case AdminMappingEnum.OpsRegion:
                    dictionaryParameters = ucRegionParameters.GetParameters();
                    var regions = dataAccess.GetRegions(dictionaryParameters);
                    ucRegionGrid.BindGrid(regions);
                    break;

                case AdminMappingEnum.OpsArea:
                    dictionaryParameters = ucAreaParameters.GetParameters();
                    var areas = dataAccess.GetAreas(dictionaryParameters);
                    ucAreaGrid.BindGrid(areas);
                    break;

                case AdminMappingEnum.Location:
                    dictionaryParameters = ucLocationParameters.GetParameters();
                    var locations = dataAccess.GetLocations(dictionaryParameters);
                    ucLocationGrid.BindGrid(locations);
                    break;

                case AdminMappingEnum.CarSegment:
                    dictionaryParameters = ucCarSegmentParameters.GetParameters();
                    var carSegments = dataAccess.GetCarSegments(dictionaryParameters);
                    ucCarSegmentGrid.BindGrid(carSegments);
                    break;

                case AdminMappingEnum.CarClass:
                    dictionaryParameters = ucCarClassParamters.GetParameters();
                    var carClasses = dataAccess.GetCarClasses(dictionaryParameters);
                    ucCarClassGrid.BindGrid(carClasses);
                    break;

                case AdminMappingEnum.CarGroup:
                    dictionaryParameters = ucCarGroupParameters.GetParameters();
                    var carGroups = dataAccess.GetCarGroups(dictionaryParameters);
                    ucCarGroupGrid.BindGrid(carGroups);
                    break;

                default:
                    throw new ArgumentOutOfRangeException("dataType");
                }
            }
        }