using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace BB_Zdanovich { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void label1_Click(object sender, EventArgs e) { } private void Form1_Load(object sender, EventArgs e) { } private void button2_Click(object sender, EventArgs e) { this.Close(); } private void button1_Click(object sender, EventArgs e) { // Реализация авторизации пользователя if (string.IsNullOrEmpty(TextBoxLogin.Text) || string.IsNullOrEmpty(PasswordBox.Text)) { MessageBox.Show("Введите логин и пароль"); return; } using (var db = new BB_ZdanovichEntities()) { var user = db.Auth .AsNoTracking() .FirstOrDefault(u => u.Login == TextBoxLogin.Text && u.Password == PasswordBox.Text); if (user == null) { MessageBox.Show("Пользователь с такими данными не найден"); return; } MessageBox.Show("Пользователь найден"); Form2 f2 = new Form2(); f2.Show(); } } } }