Ejemplo n.º 1
0
        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);
                    }
                }
            }
        }
Ejemplo n.º 2
0
 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("Введите корректные данные");
         }
     }
 }
Ejemplo n.º 3
0
        private void returnToMenu_Click(object sender, EventArgs e)
        {
            this.Hide();
            MainMenuForm m = new MainMenuForm();

            m.Closed += (s, args) => this.Close();
            m.Show();
        }
Ejemplo n.º 4
0
        private void mainMenuButton_Click(object sender, EventArgs e)
        {
            gb.Hide();
            this.Hide();
            MainMenuForm m = new MainMenuForm();

            m.Closed += (s, args) => this.Close();
            m.Show();
        }
Ejemplo n.º 5
0
        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();
            }
        }
Ejemplo n.º 6
0
 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");
     }
 }
Ejemplo n.º 7
0
 private void TetrisMainForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     backgroundWorker1.CancelAsync();
     mainMenu.Show();
 }
Ejemplo n.º 8
0
 private void SnakeGame_FormClosing(object sender, FormClosingEventArgs e)
 {
     startGame = false;
     snakeBackgroundWorker.CancelAsync();
     mainMenu.Show();
 }
Ejemplo n.º 9
0
 private void TennisMainForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     GameStatus = GAME_STATUS.END;
     mainMenu.Show();
 }
Ejemplo n.º 10
0
 private void TanksMainForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     mainMenu.Show();
 }
Ejemplo n.º 11
0
 protected void ShowForm()
 {
     _mainMenu.Show();
 }