public static List <Employee> getList() { EmployeeTableGateway DataGateway = new EmployeeTableGateway(); DataTable TableData = DataGateway.Find(); List <Employee> tmp = new List <Employee>(); foreach (DataRow row in TableData.Rows) { tmp.Add(map(row)); } return(tmp); }
public static Employee GetByEmail(string email) { try { EmployeeTableGateway DataGateway = new EmployeeTableGateway(); DataTable TableData = DataGateway.FindByEmail(email); DataRow row = TableData.Rows[0]; return(map(row)); } catch { return(null); } }
public static Employee GetByID(int id) { //TableData = dataGateway.FindByID(id); try { EmployeeTableGateway DataGateway = new EmployeeTableGateway(); DataTable TableData = DataGateway.FindByID(id); DataRow row = TableData.Rows[0]; return(map(row)); } catch { return(null); } }