Beispiel #1
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            if (txtUsername.Text == string.Empty || txtPassword.Text == string.Empty)
            {
                MessageBox.Show(@"Please fill username and password");
            }
            else
            {
                try
                {
                    LoggedInUser = _presenter.DoLogin();

                    MessageBox.Show(@"Login success", @"Success");

                    Hide();

                    LoginSuccess(this, new EventArgs());
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);

                    txtUsername.Text = string.Empty;
                    txtPassword.Text = string.Empty;

                    txtUsername.Focus();
                }
            }
        }