コード例 #1
0
        public ActionResult Create(AccountViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            var profile = _airportService.CreateProfile(model.Name, model.Surname, model.Age, false);
            var user    = _airportService.CreateUser(profile, model.Login, model.Password, model.Email);

            var cookie = new HttpCookie("AirportLogin", model.Login)
            {
                Expires = DateTime.Now.AddMinutes(10)
            };

            Response.SetCookie(cookie);

            return(RedirectToAction("Index", "Home"));
        }