using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace WindowsFormsAppGrishina { public partial class Form3 : Form { public Form3() { InitializeComponent(); } private void textBox1_TextChanged(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(textBox1.Text) || string.IsNullOrEmpty(textBox2.Text)) { MessageBox.Show("Введите логин и пароль"); return; } using (var db = new grishinaEntities()) { var user = db.grishinaDataSet .AsNoTracking() .FirstOrDefault(u => u.Login == TextBox1.Text && u.Pass == TextBox2.Text); if (user == null) { MessageBox.Show("Пользователь с такими данными не найден"); return; } MessageBox.Show("Пользователь найден"); } } private void label1_Click(object sender, EventArgs e) { } private void label2_Click(object sender, EventArgs e) { } private void PasswordBox_TextChanged(object sender, EventArgs e) { } private void button2_Click(object sender, EventArgs e) { } } }