Subversion Repositories Code-Repo

Rev

Rev 63 | Blame | Compare with Previous | Last modification | View Log | 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 Toggle_User_Verify_Form : Form
    {
        private string selectedUser;
        public Toggle_User_Verify_Form(string user)
        {
            selectedUser = user;
            InitializeComponent();
            this.txt_Password.Focus();

            // Monitors the text in each textbox, triggering changes when certain criteria is met
            this.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 == Settings_Form.globalAdminPassword)
            {
                if (!Manage_User_Accounts.ToggleShare(selectedUser))
                {
                    Debug.appendText("Error in toggling share");
                    MessageBox.Show("Error in toggling share", "Error");
                }
                this.Close();
            }
        }
        private void btn_Cancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}