private void btnLoginLogin_Click(object sender, EventArgs e) { string username = tbUsernameLogin.Text.Trim(); string password = tbPasswordLogin.Text.Trim(); if (username == "") { MessageBox.Show("Please, input an username!", "Oops!", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else if (password == "") { MessageBox.Show("Please, input a password!", "Oops!", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else if (pm.PlayerLogin(username, password) == null) { MessageBox.Show("Wrong credentials!", "Oops!", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { pm.PlayerLogin(username, password); MessageBox.Show($"Welcome to WallStreet Game, {PlayerManager.currentPlayerUsername}!"); var frmPr = new FormProfile(); frmPr.FormClosed += FormProfile_Closed; Hide(); frmPr.Show(); } }
private void btnExitBank_Click(object sender, EventArgs e) { var frmPr = new FormProfile(); frmPr.FormClosed += FormProfile_Closed; Hide(); frmPr.Show(); }