Rev 9 | Blame | Last modification | View Log | Download | RSS feed
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;namespace SWAT_Office_App{public partial class DeleteUserVerify_Form : Form{private List<string> selectedUsers = new List<string>();public DeleteUserVerify_Form(List<string> users){selectedUsers = users;InitializeComponent();this.txt_Password.Focus();// Monitors the text in each textbox, triggering changes when certain criteria is metthis.txt_Password.TextChanged += new EventHandler(this.txt_Password_TextChanged);}private void txt_Password_TextChanged(object sender, EventArgs e){TextBox tb = (TextBox)sender;if (tb.Text == "tr33b3@rd"){bool error = false;// Checks if any of the selected items are system accountsforeach (string user in selectedUsers){foreach (string systemUser in Settings_Form.systemAccounts){if (user.ToLower() == systemUser.ToLower()){MessageBox.Show("Cannot delete the " + systemUser + " (system) account", "Error");error = true;}}}if (error == false)ManageUserAccounts.DeleteUser(selectedUsers);this.Close();}}private void btn_Cancel_Click(object sender, EventArgs e){this.Close();}}}