예제 #1
0
 private void ButtonLogin_Click(object sender, EventArgs e)
 {
     if (textBoxLogin.Text == "" && textBoxPassword.Text == "")
     {
         MessageBox.Show("Введите данные", "Ошибка!", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else
     {
         bool key = false;
         foreach (Autorization user in Program.pcDb.Autorization)
         {
             if (textBoxLogin.Text == user.Login && textBoxPassword.Text == user.Password)
             {
                 key            = true;
                 users.Login    = user.Login;
                 users.Password = user.Password;
                 users.Type     = user.Type;
             }
         }
         if (!key)
         {
             MessageBox.Show("Проверьте данные", "Пользователь не найден", MessageBoxButtons.OK, MessageBoxIcon.Information);
             textBoxLogin.Text    = "";
             textBoxPassword.Text = "";
         }
         else
         {
             FormBooks book = new FormBooks();
             book.Show();
             this.Hide();
         }
     }
 }
예제 #2
0
        private void ButtonBooks_Click(object sender, EventArgs e)
        {
            Form formBook = new FormBooks();

            formBook.Show();
        }