示例#1
0
        public ActionResult Index()
        {
            var service = new CountryInfoService();
            var model   = new MainView();

            model.Countries = service.GetCountries();

            return(View(model));
        }
示例#2
0
        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));
        }
示例#3
0
 // 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"]));
     }
 }
示例#4
0
        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));
        }
示例#5
0
        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));
        }