Пример #1
0
 private void SignInButton_Click(object sender, EventArgs e)
 {
     if (!isFieldsEmpty())
     {
         if (LoginTextBox.Text == "Admin" && PasswordTextBox.Text == "admin")
         {
             Hide();
             AdminMenu menu = new AdminMenu();
             menu.Show();
         }
         else
         {
             if (authorization.isAuthorized(LoginTextBox.Text, PasswordTextBox.Text))
             {
                 Hide();
                 _reader = readerBL.GetReaderByLogin(LoginTextBox.Text);
                 UserForm form = new UserForm(_reader);
                 form.Show();
             }
             else
             {
                 MessageBox.Show("Error, wrong data" + Environment.NewLine + "Check Login or Password");
             }
         }
     }
     else
     {
         MessageBox.Show("Fill in empty fields");
     }
 }