Subversion Repositories Code-Repo

Rev

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
{
12
    public partial class ToggleUserVerify_Form : Form
13
    {
14
        private string selectedUser;
15
        public ToggleUserVerify_Form(string user)
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
            {
53 Kevin 29
                if (!ManageUserAccounts.ToggleShare(selectedUser))
30
                {
31
                    DebugText.appendText("Error in toggling share");
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
}