private void btnDecrypt_Click(object sender, EventArgs e)
        {
            Decrypt decrypt = new Decrypt();

            this.Hide();
            decrypt.Show();
        }
Beispiel #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Decrypt decrypt = new Decrypt();

            decrypt.Show();
            P_communications.Hide();
        }
Beispiel #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            string      Username = txtUsername.Text;
            string      Pw       = txtPassword.Text;
            bool        found    = false;
            List <User> lUsers   = UserCls.GetUsers(); //  Method used for populating the list<User> with the DBA method for PopulateUsers method that returns a list of Users

            foreach (User user in lUsers)
            {
                if (Username == user.Username && Pw == user.Password) // Need to find out if High-Ranking or low-ranking to display appropriate form
                {
                    found = true;
                    if (user.Rank >= 5)  // High ranking officers gain access to button for adding additonal officers
                    {
                        comms.btnOfficers.Enabled  = true;
                        decrypt.btnOfficer.Enabled = true;
                    }
                    else  // Low ranking are not able to see the button specifically for high ranking officers
                    {
                        comms.btnOfficers.Enabled  = false;
                        decrypt.btnOfficer.Enabled = false;
                    }
                    userid = user.IdNumber;
                    break;
                }
                else
                {
                    found = false;
                }
            }
            if (found == true)
            {
                decrypt.Show();
                this.Hide();
            }
            else
            {
                txtUsername.Clear();
                txtPassword.Clear();
                txtUsername.Focus();
                MessageBox.Show("Invalid Log in details.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }