public JsonResult GetCities(string state) { JsonResult result = new JsonResult(); result.JsonRequestBehavior = JsonRequestBehavior.AllowGet; ReaderRepository repo = new ReaderRepository(); result.Data = repo.GetCity(state); return(result); }
public ActionResult Index(ReaderViewModel model) { var repoReader = new ReaderRepository(); CategoryRepository catRepo = new CategoryRepository(); model.CountryOptions = repoReader.GetCountry(); model.StateOptions = (!string.IsNullOrWhiteSpace(model.Country)) ? repoReader.GetStates(model.Country) : defaultListItem; model.CityOptions = (!string.IsNullOrWhiteSpace(model.State)) ? repoReader.GetCity(model.State) : defaultListItem; model.CategoryOptions = catRepo.GetCategory(); model.SubCategoryOptions = defaultListItem; model.information = repoReader.GetRecords(model); return(View(model)); }