示例#1
0
        public static int CreateEmployee(int employeeId, string firstName, string lastName, string email)
        {
            Employee data = new Employee
            {
                EmployeeId  = employeeId,
                FirstName   = firstName,
                LastName    = lastName,
                EmailAdress = email
            };

            string sqlQuery = @"INSERT INTO Employees(EmployeeId, FirstName, LastName, EmailAdress) VALUES 
                                (@EmployeeId, @FirstName, @LastName, @EmailAdress)";

            return(SQLDataAcess.SaveData(sqlQuery, data));
        }
示例#2
0
        public static List <Employee> LoadEmployees()
        {
            string SQL = @"SELECT Id, EmployeeId, FirstName, LastName, EmailAdress FROM Employees";

            return(SQLDataAcess.LoadData <Employee>(SQL));
        }