예제 #1
0
        public ActionResult Create(CreateCrimeRateInfo createModel)
        {
            var service = new CountryInfoService();
            var model   = AutoMapper.Mapper.Map <CreateCrimeRateInfo, CrimeRateInfo>(createModel);

            Session["CreateTxt"] = service.CreateCrimeRate(model);
            return(RedirectToAction("Index"));
        }
예제 #2
0
        public ActionResult Create(int?countryInfoId, string type)
        {
            ViewBag.PriceType = type;
            var userService = new UserService();
            var service     = new CountryInfoService();

            var model = new CreateCrimeRateInfo();

            model.CountryInfoID     = (int)countryInfoId;
            model.CrimeRateTypeID   = service.GetCrimeRateType(type).Id;
            model.ApplicationUserId = userService.GetUser(User.Identity.Name).Id;
            return(View("CreateCrimeRate", model));
        }