public void Execute(int pasportNumber, int age, string adres, int accsesLevel) { string cmdText = $"INSERT INTO Employees ([Логин], [Пароль], [Должность], [Полное имя], [Номер паспорта], [Возраст], [Адрес], [Уровень доступа]) VALUES ('" + Login + "', '" + Password + "', '" + Position + "', '" + FullName + "', '" + pasportNumber + "', '" + age + "','" + adres + "','" + accsesLevel + "')"; OleDbCommand cmd = new OleDbCommand(cmdText, OleDbConnect); OleDbConnect.Open(); cmd.ExecuteNonQuery(); OleDbConnect.Close(); }
public void Execute() { OleDbConnect.Open(); string query = $"SELECT * FROM Employees WHERE Логин = '{Login}' AND Пароль = '{Password}'"; OleDbCommand command = new OleDbCommand(query, OleDbConnect); OleDbDataReader reader = command.ExecuteReader(); while (reader.Read()) { loadLogin = reader.GetString(0); Position = reader.GetString(2); FullName = reader.GetString(3); } OleDbConnect.Close(); reader.Close(); }