Ejemplo n.º 1
0
 private void button4_Click(object sender, EventArgs e)
 {
     if (listBox1.SelectedItem != null)
     {
         string name = listBox1.SelectedItem.ToString();
         DBPassword.DeleteUser(name);
         showList();
     }
 }
Ejemplo n.º 2
0
        private void showList()
        {
            List <string> list = DBPassword.ReadUsers();

            listBox1.Items.Clear();
            foreach (var item in list)
            {
                if (item != "s")
                {
                    listBox1.Items.Add(item);
                }
            }
        }
Ejemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            switch (DBPassword.Query(tb_username.Text, tb_password.Text))
            {
            case "1":
                Global.myLevel = UserLevel.SuperAdmin;
                break;

            case "2":
                Global.myLevel = UserLevel.Admin;
                break;

            default:
                Global.myLevel = UserLevel.User;
                break;
            }
            DialogResult = DialogResult.OK;
        }
Ejemplo n.º 4
0
        private void button3_Click(object sender, EventArgs e)
        {
            if (tb_addUserName.Text.Trim() != "" && tb_addPassword.Text.Trim() != "")
            {
                string level = "";
                switch (comboBox1.SelectedIndex)
                {
                case 1:
                    level = "3";
                    break;

                case 0:
                    level = "2";
                    break;

                default:
                    level = "3";
                    break;
                }
                DBPassword.AddUser(tb_addUserName.Text, tb_addPassword.Text, level);
                showList();
            }
        }