Esempio n. 1
0
        public JsonResult GetCities(string country, string state)
        {
            var result = new JsonResult();

            result.JsonRequestBehavior = JsonRequestBehavior.AllowGet;

            var repo = new GeoRepository();

            result.Data = repo.GetCities(state);
            return(result);
        }
Esempio n. 2
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));
        }