private void buttonOK_Click(object sender, EventArgs e) { if (textBoxLogin.Text == " " && textBoxPassword.Text == " ") { MessageBox.Show("введите данные", "ошибка", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { bool key = false; foreach (Users user in Program.libDb.Users) { 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 { FormClients clients = new FormClients(); clients.Show(); this.Hide(); } } }
private void buttonClients_Click(object sender, EventArgs e) { Form formClient = new FormClients(); formClient.Show(); }