123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- 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_Azizova
- {
- public partial class FAvtoriz : Form
- {
- public FAvtoriz()
- {
- InitializeComponent();
- }
- private void b1Vhod_Click(object sender, EventArgs e)
- {
- {
- if (string.IsNullOrEmpty(LogintextBox1.Text) || string.IsNullOrEmpty(PasswordtextBox2.Text))
- {
- MessageBox.Show("Введите логин и пароль!");
- }
- using (var db = new BB_AzizovaEntities())
- {
- var user = db.Administrator
- .AsNoTracking()
- .FirstOrDefault(u => u.Login == LogintextBox1.Text && u.Password == PasswordtextBox2.Text);
- if (user == null)
- {
- MessageBox.Show("Пользователь с такими данными не найден!");
- return;
- }
- F2Client f = new F2Client();
- f.Show();
- this.Hide();
- }
- }
- }
-
- private void b2Vahod_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- }
- }
|