Esempio n. 1
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            string username = tbUsername.Text;
            string password = tbPassword.Text;

            User user = userService.Login(username, password);

            // Change the Login State
            if (user.Username != null)
            {
                LoggedInUser.UserId   = user.UserId;
                LoggedInUser.Name     = user.Name;
                LoggedInUser.Email    = user.Email;
                LoggedInUser.Username = user.Username;
                LoggedInUser.Password = user.Password;

                Console.WriteLine(LoggedInUser.Username);
                MessageBox.Show("Successfully LoggedIn !", "Congrats", MessageBoxButtons.OK, MessageBoxIcon.Information);

                ChatChoiceForm choiceForm = new ChatChoiceForm();
                this.Hide();
                choiceForm.Show();
            }

            else
            {
                MessageBox.Show("Please enter Correct Username and Password", "Exit", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 private void btnBack_Click(object sender, EventArgs e)
 {
     this.Close();
     chref.Show();
 }