/// <summary> /// fetches an access level by employee name /// </summary> /// <param name="firstName"></param> /// <param name="lastName"></param> /// <returns></returns> public static string RetrieveAccessLevel(string firstName, string lastName) { DataTable dt = EmployeeSQL.RetrieveAccessLevel(firstName, lastName); string accessLevel = dt.Rows[0]["AccessLevel"].ToString(); return(accessLevel); }
/// <summary> /// looks up employees by either id or last name /// </summary> /// <param name="id"></param> /// <param name="lname"></param> /// <returns></returns> public static List <Lookup> Search(int id = 0, String lname = "") { if (id != 0) { return(LookupFactory.Create(EmployeeSQL.RetrieveLookup(dbTable.employee, id))); } else if (lname != "") { return(LookupFactory.Create(EmployeeSQL.RetrieveLookup(dbTable.employee, id, '%' + lname + '%'))); } else { throw new Exception("Must have a search peramater"); } }
/// <summary> /// fetches a job record from the db /// </summary> /// <param name="Id"></param> /// <returns></returns> public static Job Retrieve(int Id) { DataRow dt = EmployeeSQL.Retrieve(dbTable.job, Id).Rows[0]; return(RePackager(dt)); }
/// <summary> /// fetches a department object by employee id /// </summary> /// <param name="EmployeeId"></param> /// <returns></returns> public static Department RetrieveByEmployeeId(int EmployeeId) { DataRow dt = EmployeeSQL.DepartmentByEmployeeId(EmployeeId).Rows[0]; return(RePackager(dt)); }
/// <summary> /// fetches a department object /// </summary> /// <param name="Id"></param> /// <returns></returns> public static Department Retrieve(int Id) { DataRow dt = EmployeeSQL.Retrieve(dbTable.department, Id).Rows[0]; return(RePackager(dt)); }
/// <summary> /// fetches an employe by order number /// </summary> /// <param name="OrderNumber"></param> /// <returns></returns> public static Employee RetrieveByOrderNumber(int OrderNumber) { DataRow dt = EmployeeSQL.RetrieveByOrderNumber(OrderNumber).Rows[0]; return(RePackager(dt)); }
/// <summary> /// creates a look up from a database table /// </summary> /// <param name="t"></param> /// <returns></returns> public static List <Lookup> Create(dbTable t) { DataTable dt = EmployeeSQL.Retrieve(t); return(RePackage(dt)); }
public static int Insert(Employee employee, String password) { return(EmployeeSQL.Insert(employee, password)); }
/// <summary> /// updates variouse information for an employee /// </summary> /// <param name="cus">employee info</param> /// <param name="type">type of information being updated</param> public static void Modify(Employee cus, updateType type) { EmployeeSQL.Update(cus, type); }
public static List <Employee> GetAll() { return(Employee.RePackage(EmployeeSQL.GetAll())); }
/// <summary> /// inserts a employee recoird to the db /// </summary> /// <param name="cus"></param> /// <returns></returns> public static int Insert(Employee cus) { return(EmployeeSQL.Insert(cus)); }
public static List <Employee> GetEmployeeLookup(Department department) { return(Employee.RePackage(EmployeeSQL.GetEmployeeLookup(department), EmployeeGetType.Lookup)); }
public static List <Employee> GetByName(string firstName = null, string lastName = null) { return(Employee.RePackage(EmployeeSQL.GetByName(firstName, lastName))); }
public static List <Employee> GetByDept(Department dept) { return(Employee.RePackage(EmployeeSQL.GetByDept(dept))); }
public static int Login(int employeeId, string password) { return(EmployeeSQL.Login(employeeId, password)); }
/// <summary> /// fetches employee by name /// </summary> /// <param name="firstName"></param> /// <param name="lastName"></param> /// <returns></returns> public static Employee RetrieveByName(string firstName, string lastName) { DataRow dt = EmployeeSQL.RetrieveByName(firstName, lastName).Rows[0]; return(RePackager(dt)); }
public static Employee Create(int employeeId) { return(RePackage(EmployeeSQL.GetById(employeeId))[0]); }
/// <summary> /// fetches a list of employees /// </summary> /// <returns></returns> public static List <Employee> RetrieveList() { DataTable dt = EmployeeSQL.RetrieveList(); return(RepackagerList(dt)); }
public static bool UpdateStatus(Employee employee) { return(EmployeeSQL.UpdateStatus(employee)); }
public static List <SickDay> GetSickDays(int employeeId) { return(SickDay.RePackage(EmployeeSQL.GetSickDays(employeeId))); }