public ActionResult Index() { var service = new CountryInfoService(); var model = new MainView(); model.Countries = service.GetCountries(); return(View(model)); }
public ActionResult Search(string actionP, string controllerP) { var service = new CountryInfoService(); var model = new SearchView(); model.action = actionP; model.controller = controllerP; model.Countries = service.GetCountries(); model.CountryId = (int?)Session["countryId"]; return(PartialView("_PartialSearch", model)); }
// GET: CrimeRate public ActionResult Index() { if (Session["countryId"] == null) { var service = new CountryInfoService(); var model = new MainView(); model.Countries = service.GetCountries(); return(View("CrimeRate", model)); } else { return(Index((int)Session["countryId"])); } }
public ActionResult UserCrimeRateInput(string username = null, int?countryId = null, string countryName = null) { var service = new CountryInfoService(); var userService = new UserService(); var model = new UserCrimeRateInputView(); model.Countries = service.GetCountries(); if (username != null) { Session["selectedUser"] = username; model.CrimeRateList = userService.GetUserCrimeRateInfo(username, countryId); } else { model.CrimeRateList = userService.GetUserCrimeRateInfo(User.Identity.Name, countryId); } return(View("UserCrimeRateInput", model)); }
public ActionResult CostOfLiving(string username = null, int?countryId = null, string countryName = null) { var service = new CountryInfoService(); var userService = new UserService(); var model = new UserValueForCostView(); model.Countries = service.GetCountries(); if (username != null) { Session["selectedUser"] = username; model.CostList = userService.GetUserCostOfLiving(username, countryId); } else { model.CostList = userService.GetUserCostOfLiving(null, countryId); } return(View("CostOfLiving", model)); }