コード例 #1
0
        public ActionResult Index(ReaderViewModel model)
        {
            var repo       = new GeoRepository();
            var repoReader = new ReaderRepository();

            model.CountryOptions     = repo.GetCountries();
            model.StateOptions       = (!string.IsNullOrWhiteSpace(model.Country)) ? repo.GetStates(model.Country) : defaultListItem;
            model.CityOptions        = (!string.IsNullOrWhiteSpace(model.State)) ? repo.GetCities(model.State) : defaultListItem;
            model.CategoryOptions    = repo.GetCategory();
            model.SubCategoryOptions = defaultListItem;
            model.information        = repoReader.GetRecords(model);

            return(View(model));
        }
コード例 #2
0
        // GET: Search
        public ActionResult Index()
        {
            var repo = new GeoRepository();

            var model = new ReaderViewModel()
            {
                CountryOptions     = repo.GetCountries(),
                StateOptions       = defaultListItem,
                CityOptions        = defaultListItem,
                CategoryOptions    = repo.GetCategory(),
                SubCategoryOptions = defaultListItem
            };

            return(View(model));
        }