Ejemplo n.º 1
0
        public ActionResult Delete()
        {
            if (!Service.IsActive(CurrentAccountId))
            {
                return(RedirectToAction("Logout", "Auth"));
            }

            Alerts.AddWarning(Message.For <AccountView>("ProfileDeleteDisclaimer"));

            return(View());
        }
Ejemplo n.º 2
0
        public ActionResult Delete()
        {
            if (!Service.IsActive(CurrentAccountId))
            {
                return(RedirectIfAuthorized("Logout", "Auth"));
            }

            Alerts.AddWarning(Messages.ProfileDeleteDisclaimer);

            return(View());
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        public ActionResult Delete()
        {
            if (!Service.IsActive(User.Id()))
            {
                return(RedirectToAction(nameof(Auth.Logout), nameof(Auth)));
            }

            Alerts.AddWarning(Message.For <AccountView>("ProfileDeleteDisclaimer"));

            return(View());
        }
Ejemplo n.º 5
0
        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"));
        }
Ejemplo n.º 6
0
        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"));
        }
Ejemplo n.º 7
0
        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)));
        }