コード例 #1
0
        protected void Page_PreRender(object sender, EventArgs e)
        {
            var user = accountUtil.GetUser(GetUserId());

            userForm.GetUserNameLabel().Text          = user.UserName;
            userForm.GetEmailTextBox().Text           = user.Email;
            userForm.GetIsAdminCheckBox().Checked     = accountUtil.IsUserAnAdmin(user.Id);
            userForm.GetIsSuperuserCheckBox().Checked = accountUtil.IsUserASuperuser(user.Id);

            if (!accountUtil.IsUserASuperuser())
            {
                userForm.GetIsSuperuserCheckBox().Enabled = false;

                if (accountUtil.IsUserASuperuser(user.Id))
                {
                    btnDelete.Enabled = false;
                }
            }
        }