using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Data.SqlClient; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace project { public class Testovik { DataBase dataBase = new DataBase(); public string autoRization(string login, string password) { if (login == null) return "Введите логин"; if (password == null) return "Введите пароль"; SqlConnection sqlconn = new SqlConnection(@"Data Source=ngknn.ru;Initial Catalog=Project_GorodskoiSpravochnik;Persist Security Info=True;User ID=31П;Password=12357"); string query = $"Select *from Employee where login = '{login}' and password = '{password}'"; SqlDataAdapter sda = new SqlDataAdapter(query, sqlconn); DataTable dtbl = new DataTable(); sda.Fill(dtbl); if (dtbl.Rows.Count == 1) { Login.login = login; return "Вы успешно вошли"; } else { return "Неверный логин и/или пароль"; } } } }