public JsonResult GetStates(string country) { var result = new JsonResult(); result.JsonRequestBehavior = JsonRequestBehavior.AllowGet; var repo = new GeoRepository(); result.Data = repo.GetStates(country); return(result); }
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)); }