Esempio n. 1
0
        public static void AddNewEmployee(Employee newEmployee)
        {
            EmployeeClassesDataContext employeeTableConnection = new EmployeeClassesDataContext();

            employeeTableConnection.AddNewEmployee(
                newEmployee.Name,
                newEmployee.EmpID,
                newEmployee.EmpPass,
                newEmployee.Rank,
                newEmployee.DateHired);
        }
Esempio n. 2
0
        public static bool IsFullAdmin(string emplIDNumber)
        {
            EmployeeClassesDataContext theObject = new EmployeeClassesDataContext();

            var query = theObject.GetTable <Employee>().Where(emp => emp.EmpID == emplIDNumber).First();

            if (query.Rank == 5)
            {
                return(true);
            }
            return(false);
        }
Esempio n. 3
0
        public static string Login(string emplIDNumber, string emplPassword)
        {
            EmployeeClassesDataContext theObject = new EmployeeClassesDataContext();
            var query = theObject.GetTable <Employee>().Where(emp => emp.EmpID == emplIDNumber && emp.EmpPass == emplPassword).FirstOrDefault();

            if (query != null)
            {
                return("Successfully!");
            }
            else
            {
                return("Incorrect information!");
            }
        }