Esempio n. 1
0
        private void LoginFormSubmitButton_Click(object sender, EventArgs e)
        {
            ChapooDatabaseLogic.AuthenticationService AuthenticationService = new ChapooDatabaseLogic.AuthenticationService();
            string email    = LoginFormEmailTextBox.Text;
            string password = LoginFormPasswordTextBox.Text;

            if (string.IsNullOrEmpty(email))
            {
                MessageBox.Show("Fill in the email field");
                return;
            }
            if (string.IsNullOrEmpty(password))
            {
                MessageBox.Show("Fill in the password field");
                return;
            }

            if (AuthenticationService.CheckUserLogin(email, password))
            {
                setUserWithEmail(email);
                showNewForm(new DashboardForm(), this, getCurrentUser());
            }
            else
            {
                MessageBox.Show("Wrong email or password!");
                return;
            }
        }