public ActionResult Delete() { if (!Service.IsActive(CurrentAccountId)) { return(RedirectToAction("Logout", "Auth")); } Alerts.AddWarning(Message.For <AccountView>("ProfileDeleteDisclaimer")); return(View()); }
public ActionResult Delete() { if (!Service.IsActive(CurrentAccountId)) { return(RedirectIfAuthorized("Logout", "Auth")); } Alerts.AddWarning(Messages.ProfileDeleteDisclaimer); return(View()); }
public void AddWarning_Message() { alerts.AddWarning("Message", 1); Alert actual = alerts.Single(); Assert.Equal(AlertType.Warning, actual.Type); Assert.Equal("Message", actual.Message); Assert.Equal(1, actual.Timeout); Assert.Null(actual.Id); }
public ActionResult Delete() { if (!Service.IsActive(User.Id())) { return(RedirectToAction(nameof(Auth.Logout), nameof(Auth))); } Alerts.AddWarning(Message.For <AccountView>("ProfileDeleteDisclaimer")); return(View()); }
public ActionResult DeleteConfirmed([Bind(Exclude = "Id")] ProfileDeleteView profile) { if (!Service.IsActive(CurrentAccountId)) { return(RedirectIfAuthorized("Logout", "Auth")); } if (!Validator.CanDelete(profile)) { Alerts.AddWarning(Messages.ProfileDeleteDisclaimer); return(View()); } Service.Delete(CurrentAccountId); return(RedirectIfAuthorized("Logout", "Auth")); }
public ActionResult DeleteConfirmed(ProfileDeleteView profile) { if (!Service.IsActive(CurrentAccountId)) { return(RedirectToAction("Logout", "Auth")); } if (!Validator.CanDelete(profile)) { Alerts.AddWarning(Message.For <AccountView>("ProfileDeleteDisclaimer")); return(View()); } Service.Delete(CurrentAccountId); Authorization?.Refresh(); return(RedirectToAction("Logout", "Auth")); }
public ActionResult DeleteConfirmed(ProfileDeleteView profile) { if (!Service.IsActive(CurrentAccountId)) { return(RedirectToAction(nameof(Auth.Logout), nameof(Auth))); } if (!Validator.CanDelete(profile)) { Alerts.AddWarning(Message.For <AccountView>("ProfileDeleteDisclaimer")); return(View()); } Service.Delete(CurrentAccountId); Authorization.Refresh(HttpContext.RequestServices); return(RedirectToAction(nameof(Auth.Logout), nameof(Auth))); }