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 AutoMaster { public partial class Form1 : Form { private Database db = new Database(); public Form1() { InitializeComponent(); } private void btnLogin_Click(object sender, EventArgs e) { string username = txtUsername.Text; string password = txtPassword.Text; if (db.AuthenticateUser(username, password)) { MessageBox.Show("Успешный вход!"); this.Hide(); MainForm mainForm = new MainForm(); mainForm.Show(); } else { MessageBox.Show("Неправильный логин или пароль."); } } private void pictureBox1_Click(object sender, EventArgs e) { } private void pictureBox1_Click_1(object sender, EventArgs e) { } } }