예제 #1
0
        //Return to previous menu
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            EmployeeInterface window = new EmployeeInterface(k);

            this.Close();
            window.Top  = 100;
            window.Left = 400;
            window.Show();
        }
        // password verification on user input verses server info
        private void button_Click(object sender, RoutedEventArgs e)
        {
            string userEnteredName     = textBox.Text;
            string userEnteredPassword = Employee.Encrypt(textBox1.Text);

            Employee user = new Employee();

            user = DBConnection.VerifyEmployeeLogin(userEnteredName, userEnteredPassword);

            //user.Print();
            if (user != null)
            {
                EmployeeInterface employee = new EmployeeInterface(user);
                employee.Top  = 100;
                employee.Left = 400;
                employee.Show();
                this.Close();
            }
            else
            {
                textBox.Text  = "Try again";
                textBox1.Text = "invalid password";
            }
        }