示例#1
0
        /// <summary>
        /// When admin clicks on valid button
        /// </summary>
        /// <param name="sender">System.Windows.Forms.Button</param>
        /// <param name="e">System.Windows.Forms.MouseEventArgs</param>
        private void ValidBtn_Click(object sender, EventArgs e)
        {
            if (StatusLabel.Text.IndexOf("Suppression") != -1)
            {
                UpdateUtils.DeleteUser(ComboBoxId.SelectedItem.ToString(), ref connection);
            }
            else if (StatusLabel.Text.IndexOf("Modification") != -1)
            {
                UpdateUtils.UpdatePassword(ComboBoxId.SelectedItem.ToString(), PassTextBox.Text, ConfPassTextBox.Text, ref connection);
            }
            else
            {
                MessageBox.Show("Choisissez une action : \n-Suppression\n-Modification", "Choisir une action", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

            UsersListView.Items.Clear();
            AddUsersInListView();
        }