57 lines
1.4 KiB
C#
57 lines
1.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Runtime.Remoting.Contexts;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
|
|
namespace Dem41
|
|
{
|
|
public partial class Autorization : Form
|
|
{
|
|
public Autorization()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void Autorization_Load(object sender, EventArgs e)
|
|
{
|
|
var user = context.Clients.Local.Where(x => x.Login == login && x.Password == password).FirstOrDefault();
|
|
if (user != null)
|
|
{
|
|
Hide();
|
|
new MainForm().Show();
|
|
}
|
|
|
|
else
|
|
{
|
|
MessageBox.Show("Неправильный логин или пароль");
|
|
}
|
|
}
|
|
|
|
private void button1_Click(object sender, EventArgs e)
|
|
{
|
|
Login(logintextBox.Text, passwordTextBox.Text);
|
|
}
|
|
|
|
private void label3_Click(object sender, EventArgs e)
|
|
{
|
|
|
|
}
|
|
|
|
private void AutorizationForm_Load(object sender, EventArgs e)
|
|
{
|
|
context = new();
|
|
context.Database.EnsureCreated();
|
|
context.Clients.Load();
|
|
|
|
clientBindingSource.DataSource = context.Clients.Local.ToBindingList();
|
|
}
|
|
}
|
|
}
|
|
|
|
|