Пример #1
0
        private void btn_Login_Click(object sender, EventArgs e)
        {
            User huidigeUser = new User();
            UserManagementController user_Service = new UserManagementController();


            string Email    = tb_Email.Text;
            string Password = tb_Password.Text;

            huidigeUser = user_Service.CheckEmailAndPassword(Email, Password);


            if (huidigeUser == null)
            {
                MessageBox.Show("Email or Password incorrect, Try again !", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (huidigeUser.type == UserType.Employee)
            {
                this.Hide();
                TopDesk TopDesk = new TopDesk(huidigeUser);
                TopDesk.Show();
            }

            else if (huidigeUser.type == UserType.ServiceDeskEmployee)
            {
                this.Hide();
                TopDesk TopDesk = new TopDesk(huidigeUser);
                TopDesk.Show();
            }
        }