コード例 #1
0
        public ActionResult ChangeIsAdmin(Guid idUserAuthorization)
        {
            UserAuthorizationViewModel userAuthorizationViewModel = _application.GetByIdAsNoTracking(idUserAuthorization);

            userAuthorizationViewModel.IsAdmin = !userAuthorizationViewModel.IsAdmin;
            _application.Update(userAuthorizationViewModel);
            return(Json(new { success = true }, JsonRequestBehavior.AllowGet));
        }
コード例 #2
0
 public ActionResult SignIn(UserAuthorizationViewModel model)
 {
     try
     {
         if (!Membership.ValidateUser(model.Email, model.Password))
             return this.RedirectToAction("Index");
         FormsAuthentication.SetAuthCookie(model.Email, false);
         return this.RedirectToAction("Index", "Home", new { area = "Common" });
     }
     catch (Exception exception)
     {
         return this.View(model);
     }
 }
コード例 #3
0
        public void Update(UserAuthorizationViewModel userAuthorizationViewModel)
        {
            var userAuthorization = Mapper.Map <UserAuthorization>(userAuthorizationViewModel);

            _repository.Update(userAuthorization);
        }
コード例 #4
0
 public void Add(UserAuthorizationViewModel userAuthorizationViewModel)
 {
     _repository.Add(Mapper.Map <UserAuthorization>(userAuthorizationViewModel));
 }