Diplom_B/FormLogin.cs

40 lines
723 B
C#

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 Diplom_B
{
public partial class FormLogin : Form
{
public FormLogin()
{
InitializeComponent();
this.CenterToScreen();
label3.Text = "";
}
private void button1_Click(object sender, EventArgs e)
{
label3.Text = "";
var usr = new User(textBox1.Text, textBox2.Text);
if (!usr.CheckUser())
{
label3.Text = "Пользователя нет";
return;
}
if (!usr.Login())
{
label3.Text = "Неверный пароль";
return;
}
}
}
}