Diplom_B/LoginForm.cs

46 lines
864 B
C#
Raw Normal View History

2021-07-15 12:21:22 +05:00
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
{
2021-07-16 16:43:55 +05:00
public partial class LoginForm : Form
2021-07-15 12:21:22 +05:00
{
2021-07-16 16:43:55 +05:00
public LoginForm()
2021-07-15 12:21:22 +05:00
{
InitializeComponent();
this.CenterToScreen();
label3.Text = "";
}
private void button1_Click(object sender, EventArgs e)
{
label3.Text = "";
2021-07-15 16:58:51 +05:00
var usr = new User(comboBox1.Text, comboBox1.Text);
2021-07-15 12:21:22 +05:00
if (!usr.CheckUser())
{
label3.Text = "Пользователя нет";
return;
}
if (!usr.Login())
{
label3.Text = "Неверный пароль";
return;
}
2021-07-17 09:33:09 +05:00
Program.user = usr;
2021-07-15 16:58:51 +05:00
this.Hide();
var izdForm = new IzdForm();
izdForm.Closed += (s, args) => this.Close();
izdForm.Show();
2021-07-15 12:21:22 +05:00
}
}
}