private void btnLogin_Click(object sender, EventArgs e) { if (txtUsername.Text == null) { MessageBox.Show(SportRegistrationSystem.lblInvalidLogin); } else { if (txtPassword.Text == null) { MessageBox.Show(SportRegistrationSystem.lblInvalidPassword); } else { List <StaffClass> loginStatus = StaffBll.Login(txtUsername.Text, txtPassword.Text); if (loginStatus.Count() == 1) { MainMenuForm form = new MainMenuForm(loginStatus); form.Show(); this.Hide(); } else { MessageBox.Show(SportRegistrationSystem.lblLoginFailed); } } } }
private void button2_Click(object sender, EventArgs e) { if (String.IsNullOrEmpty(LoginBox.Text) || String.IsNullOrEmpty(PasswordBox.Text)) { MessageBox.Show("Заполните все поля"); return; } else { string query = $"SELECT * FROM Users WHERE Login = '******' and Password = '******'"; DatabaseConnection dc = new DatabaseConnection(); loginAccess = dc.SqlCheck(query); if (loginAccess != null) { Saver.Role = loginAccess; MainMenuForm mainMenuForm = new MainMenuForm(); mainMenuForm.Show(); Hide(); } else { MessageBox.Show("Введите корректные данные"); } } }
private void returnToMenu_Click(object sender, EventArgs e) { this.Hide(); MainMenuForm m = new MainMenuForm(); m.Closed += (s, args) => this.Close(); m.Show(); }
private void mainMenuButton_Click(object sender, EventArgs e) { gb.Hide(); this.Hide(); MainMenuForm m = new MainMenuForm(); m.Closed += (s, args) => this.Close(); m.Show(); }
private void LoginButton_Click(object sender, EventArgs e) { var login = LoginTextBox.Text; var password = PasswordTextBox.Text; var task = new Task <bool>(() => Аuthorization(login, password)); task.Start(); if (!task.Result) { RadMessageBox.Show(@"Пользователь с таким логином не найден"); } else { var frm = new MainMenuForm(); frm.Closed += (s, args) => this.Show(); frm.Show(); this.Hide(); } }
private void ButtonLogin_Click(object sender, EventArgs e) { //Adding the Username and Password to a static Class ////UserPresenter.SetUserLoginData(TextBoxUsername.Text, TextBoxPassword.Text); //Logging in to the Main Menu Form // bool exists = LoginService.CheckIf(TextBoxUsername.Text, TextBoxPassword.Text); if (NetTest()) { if (LoginService.LoginUser(TextBoxUsername.Text, TextBoxPassword.Text)) { MainMenuForm mainMenuForm = new MainMenuForm(); mainMenuForm.Show(); this.Hide(); } else { LabelMessage.Text = "Username or password is wrong! Please enter the correct credentials!"; } } else { MessageBox.Show("Please secure an internet connections before using GNA"); } }
private void TetrisMainForm_FormClosed(object sender, FormClosedEventArgs e) { backgroundWorker1.CancelAsync(); mainMenu.Show(); }
private void SnakeGame_FormClosing(object sender, FormClosingEventArgs e) { startGame = false; snakeBackgroundWorker.CancelAsync(); mainMenu.Show(); }
private void TennisMainForm_FormClosed(object sender, FormClosedEventArgs e) { GameStatus = GAME_STATUS.END; mainMenu.Show(); }
private void TanksMainForm_FormClosed(object sender, FormClosedEventArgs e) { mainMenu.Show(); }
protected void ShowForm() { _mainMenu.Show(); }