Пример #1
0
        public ViewResult Register()
        {
            RegisterCinemaModel model = new RegisterCinemaModel();

            //model.Cinema;
            model.CurrentUser = repository.GetUserById(User.Identity.GetUserId());
            return(View("RegisterCinema", model));
        }
Пример #2
0
        public ActionResult Register(RegisterCinemaModel model)
        {
            AppUser user = repository.GetUserById(User.Identity.GetUserId());

            if (user != null)
            {
                model.Cinema.Moderator = user;
            }
            repository.AddCinema(model.Cinema);
            UserManager.AddToRoleAsync(User.Identity.GetUserId(), "CinemaModerator");
            return(RedirectToAction("ViewUser", "UserPage", new { userId = User.Identity.GetUserId() }));
        }