public ActionResult ChangeIsAdmin(Guid idUserAuthorization) { UserAuthorizationViewModel userAuthorizationViewModel = _application.GetByIdAsNoTracking(idUserAuthorization); userAuthorizationViewModel.IsAdmin = !userAuthorizationViewModel.IsAdmin; _application.Update(userAuthorizationViewModel); return(Json(new { success = true }, JsonRequestBehavior.AllowGet)); }
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); } }
public void Update(UserAuthorizationViewModel userAuthorizationViewModel) { var userAuthorization = Mapper.Map <UserAuthorization>(userAuthorizationViewModel); _repository.Update(userAuthorization); }
public void Add(UserAuthorizationViewModel userAuthorizationViewModel) { _repository.Add(Mapper.Map <UserAuthorization>(userAuthorizationViewModel)); }