Subversion Repositories Code-Repo

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
9 Kevin 1
using System;
2
using System.Collections.Generic;
3
using System.ComponentModel;
4
using System.Data;
5
using System.Drawing;
6
using System.Linq;
7
using System.Text;
8
using System.Windows.Forms;
9
 
10
namespace SWAT_Office_App
11
{
63 Kevin 12
    public partial class Toggle_User_Verify_Form : Form
9 Kevin 13
    {
14
        private string selectedUser;
63 Kevin 15
        public Toggle_User_Verify_Form(string user)
9 Kevin 16
        {
17
            selectedUser = user;
18
            InitializeComponent();
19
            this.txt_Password.Focus();
20
 
21
            // Monitors the text in each textbox, triggering changes when certain criteria is met
22
            this.txt_Password.TextChanged += new EventHandler(this.txt_Password_TextChanged);
23
        }
24
        private void txt_Password_TextChanged(object sender, EventArgs e)
25
        {
26
            TextBox tb = (TextBox)sender;
53 Kevin 27
            if (tb.Text == Settings_Form.globalAdminPassword)
9 Kevin 28
            {
63 Kevin 29
                if (!Manage_User_Accounts.ToggleShare(selectedUser))
53 Kevin 30
                {
63 Kevin 31
                    Debug.appendText("Error in toggling share");
53 Kevin 32
                    MessageBox.Show("Error in toggling share", "Error");
33
                }
9 Kevin 34
                this.Close();
35
            }
36
        }
37
        private void btn_Cancel_Click(object sender, EventArgs e)
38
        {
39
            this.Close();
40
        }
41
    }
42
}