public ActionResult Index(ReaderViewModel model) { model.CountryOptions = defaultListItem; model.StateOptions = defaultListItem; model.CityOptions = defaultListItem; model.CategoryOptions = defaultListItem; model.SubCategoryOptions = defaultListItem; EditorRepository repo = new EditorRepository(); repo.AddAssistData(model); CategoryRepository catRepo = new CategoryRepository(); ReaderRepository repoReader = new ReaderRepository(); //CategoryRepository catRepo = new CategoryRepository(); //ReaderViewModel models = new ReaderViewModel(); model.CountryOptions = repoReader.GetCountry(); model.CategoryOptions = catRepo.GetCategory(); model.SubCategoryOptions = catRepo.GetSubCategory(); model.save = true; model.information[0].Description = ""; return(View(model)); }
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)); }
// GET: Reader public ActionResult Index() { ReaderRepository repo = new ReaderRepository(); CategoryRepository catRepo = new CategoryRepository(); ReaderViewModel model = new ReaderViewModel(); model.CountryOptions = repo.GetCountry(); model.StateOptions = defaultListItem; model.CityOptions = defaultListItem; model.CategoryOptions = catRepo.GetCategory(); model.SubCategoryOptions = catRepo.GetSubCategory(); return(View(model)); }