Esempio n. 1
0
        void Handle(Input.Delete action)
        {
            SystemUser systemUser = Helper.GetCurrentSystemUser();

            if (systemUser.Equals(this.Data))
            {
                // TODO: Show error message "Can not delete yourself"
                return;
            }

            // TODO: Warning user with Yes/No dialog
            Db.Transact(() => {
                SystemUserAdmin.DeleteSystemUser(this.Data as Simplified.Ring3.SystemUser);
            });
        }
Esempio n. 2
0
        /// <summary>
        /// Delete user
        /// </summary>
        /// <param name="action"></param>
        void Handle(Input.Delete action)
        {
            var transaction = this.Transaction;

            SystemUser systemUser = Helper.GetCurrentSystemUser();

            if (systemUser.Equals(this.Data))
            {
                // TODO: Show error message "Can not delete yourself"
                return;
            }

            // TODO: Warn user with Yes/No dialog
            transaction.Rollback();

            transaction.Scope(() => {
                SystemUserAdmin.DeleteSystemUser(this.Data as Simplified.Ring3.SystemUser);
            });

            transaction.Commit();

            this.RedirectUrl = "/UserAdmin/admin/users";
        }