12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- using Servise.Classes;
- using Servise.Forms;
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Data.SqlClient;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace Servise
- {
- public partial class Form1 : Form
- {
- DataBase conect = new DataBase();
- public Form1()
- {
- InitializeComponent();
- }
- private void Avtorization_Click(object sender, EventArgs e)
- {
- string query = "Select *from employees where login = '" + Login.Text.Trim() + "' and password = '" + Password.Text.Trim() + "'";
- SqlDataAdapter sda = new SqlDataAdapter(query, conect.getConect());
- DataTable dtbl = new DataTable();
- sda.Fill(dtbl);
- if (dtbl.Rows.Count == 1)
- {
- UserInform.Login = Login.Text.Trim();
- UserInform.Password = Password.Text.Trim();
- if (Login.Text.Trim() == "admin")
- {
- UserInform.AdminLi = true;
- }
- this.Hide();
- Main goMain = new Main();
- goMain.Show();
- }
- else
- {
- MessageBox.Show("Неверный логин и/или пароль");
- }
- }
- private void FomClose(object sender, FormClosedEventArgs e)
- {
- Application.Exit();
- }
- }
- }
|