Ejemplo n.º 1
0
        /// <summary>
        /// event handler that gets called when the all user check box is checked.
        /// </summary>
        /// <param name="source"></param>
        /// <param name="e"></param>
        protected void OnAllUsersChecked(object source, EventArgs e)
        {
            CheckBox checkBox = source as CheckBox;

            foreach (DataGridItem item in Accounts.Items)
            {
                // in order to be checked, the row must not be empty.
                string userID = item.Cells[AccountsIDColumn].Text;
                if (userID != "&nbsp;" && !IsSuperAdmin(userID))
                {
                    if (checkBox.Checked)
                    {
                        CheckedUsers[userID] = item.Cells[AccountsDisabledColumn].Text == Boolean.FalseString;
                    }
                    else
                    {
                        // remove this user from the list.
                        CheckedUsers.Remove(userID);
                    }
                }
            }

            // set the action buttons appropriately.
            SetActionButtons();

            // rebind the data source with the new data.
            GetUsers();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Event handler that gets called when the user check box is checked.
        /// </summary>
        /// <param name="source"></param>
        /// <param name="e"></param>
        protected void OnUserChecked(object source, EventArgs e)
        {
            // Get the data grid row for this member.
            CheckBox     checkBox = source as CheckBox;
            DataGridItem item     = checkBox.Parent.Parent as DataGridItem;
            string       userID   = item.Cells[AccountsIDColumn].Text;

            if (userID != "&nbsp;")
            {
                // User is being added.
                if (checkBox.Checked)
                {
                    CheckedUsers[userID] = item.Cells[AccountsDisabledColumn].Text == Boolean.FalseString;
                }
                else
                {
                    // Remove this ifolder from the list.
                    CheckedUsers.Remove(userID);
                }
            }

            // Set the user action buttons.
            SetActionButtons();
        }