예제 #1
0
        /// <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);
        }
예제 #2
0
 /// <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");
     }
 }
예제 #3
0
        /// <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));
        }
예제 #4
0
        /// <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));
        }
예제 #5
0
        /// <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));
        }
예제 #6
0
        /// <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));
        }
예제 #7
0
        /// <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));
        }
예제 #8
0
 public static int Insert(Employee employee, String password)
 {
     return(EmployeeSQL.Insert(employee, password));
 }
예제 #9
0
 /// <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);
 }
예제 #10
0
 public static List <Employee> GetAll()
 {
     return(Employee.RePackage(EmployeeSQL.GetAll()));
 }
예제 #11
0
 /// <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));
 }
예제 #12
0
 public static List <Employee> GetEmployeeLookup(Department department)
 {
     return(Employee.RePackage(EmployeeSQL.GetEmployeeLookup(department), EmployeeGetType.Lookup));
 }
예제 #13
0
 public static List <Employee> GetByName(string firstName = null, string lastName = null)
 {
     return(Employee.RePackage(EmployeeSQL.GetByName(firstName, lastName)));
 }
예제 #14
0
 public static List <Employee> GetByDept(Department dept)
 {
     return(Employee.RePackage(EmployeeSQL.GetByDept(dept)));
 }
예제 #15
0
 public static int Login(int employeeId, string password)
 {
     return(EmployeeSQL.Login(employeeId, password));
 }
예제 #16
0
        /// <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));
        }
예제 #17
0
 public static Employee Create(int employeeId)
 {
     return(RePackage(EmployeeSQL.GetById(employeeId))[0]);
 }
예제 #18
0
        /// <summary>
        /// fetches a list of employees
        /// </summary>
        /// <returns></returns>
        public static List <Employee> RetrieveList()
        {
            DataTable dt = EmployeeSQL.RetrieveList();

            return(RepackagerList(dt));
        }
예제 #19
0
 public static bool UpdateStatus(Employee employee)
 {
     return(EmployeeSQL.UpdateStatus(employee));
 }
예제 #20
0
 public static List <SickDay> GetSickDays(int employeeId)
 {
     return(SickDay.RePackage(EmployeeSQL.GetSickDays(employeeId)));
 }