Beispiel #1
0
        protected void statusButton_Click(object sender, ImageClickEventArgs e)
        {
            string     sStatus = ((ImageButton)sender).CommandName;
            UserStatus status  = (UserStatus)Enum.Parse(typeof(UserStatus), sStatus, true);

            // chanhe user status
            try
            {
                int result = PortalUtils.ChangeUserStatus(PanelSecurity.SelectedUserId, status);

                if (result < 0)
                {
                    ShowResultMessage(result);
                    return;
                }
            }
            catch (Exception ex)
            {
                ShowErrorMessage("USER_CHANGE_STATUS", ex);
                return;
            }

            // re-bind user
            BindAccount();
        }