Пример #1
0
        private void StaffMainScreenButton_Click(object sender, EventArgs e)
        {
            this.Hide();
            StaffMainScreen akadScreen = new StaffMainScreen(staff);

            akadScreen.Show();
        }
        private void StaffLogin_Click(object sender, EventArgs e)
        {
            Staff staff = repository.LoginStaffUser(StaffUsernameTextbox.Text, StaffPasswordTextbox.Text); //LoginUser will return Staff object if it is succesful Login

            if (staff.FirstName != null)                                                                   //if staff is not equal to null means it returned user
            {
                Console.WriteLine(staff.FirstName);

                this.Hide();
                StaffMainScreen akadScreen = new StaffMainScreen(staff);
                akadScreen.Show();
            }
            else
            {
                MessageBox.Show("Wrong username or password");
            }
        }