public void AddSuccess_Message() { alerts.AddSuccess("Message", 1); Alert actual = alerts.Single(); Assert.Equal(AlertType.Success, actual.Type); Assert.Equal("Message", actual.Message); Assert.Equal(1, actual.Timeout); Assert.Null(actual.Id); }
public ActionResult Reset(AccountResetView account) { if (Service.IsLoggedIn(User)) { return(RedirectToDefault()); } if (!Validator.CanReset(account)) { return(RedirectIfAuthorized("Recover")); } Service.Reset(account); Alerts.AddSuccess(Messages.SuccessfulReset, 4000); return(RedirectIfAuthorized("Login")); }
public ActionResult Edit([Bind(Exclude = "Id")] ProfileEditView profile) { if (!Service.IsActive(CurrentAccountId)) { return(RedirectIfAuthorized("Logout", "Auth")); } if (!Validator.CanEdit(profile)) { return(View(profile)); } Service.Edit(profile); Alerts.AddSuccess(Messages.ProfileUpdated, 4000); return(RedirectIfAuthorized("Edit")); }
public ActionResult Edit(ProfileEditView profile) { if (!Service.IsActive(CurrentAccountId)) { return(RedirectToAction("Logout", "Auth")); } if (!Validator.CanEdit(profile)) { return(View(profile)); } Service.Edit(User, profile); Alerts.AddSuccess(Message.For <AccountView>("ProfileUpdated"), 4000); return(RedirectToAction("Edit")); }
public ActionResult Reset(AccountResetView account) { if (Service.IsLoggedIn(User)) { return(RedirectToDefault()); } if (!Validator.CanReset(account)) { return(RedirectToAction(nameof(Recover))); } Service.Reset(account); Alerts.AddSuccess(Message.For <AccountView>("SuccessfulReset"), 4000); return(RedirectToAction(nameof(Login))); }
public ActionResult Edit(ProfileEditView profile) { profile.Id = User.Id(); if (!Service.IsActive(profile.Id)) { return(RedirectToAction(nameof(Auth.Logout), nameof(Auth))); } if (!Validator.CanEdit(profile)) { return(View(profile)); } Service.Edit(User, profile); Alerts.AddSuccess(Message.For <AccountView>("ProfileUpdated"), 4000); return(RedirectToAction(nameof(Edit))); }