예제 #1
0
        public static DataTable getAll()
        {
            DataTable table;

            adapter = getNewAdapter();
            table   = adapter.GetData();
            adapter.Dispose();

            return(table);
        }
예제 #2
0
        public static bool validCredentials(string userName, string password)
        {
            bool      valid;
            DataTable table;

            adapter = getNewAdapter();
            table   = adapter.GetDataBy(userName, password);
            adapter.Dispose();

            valid = (table.Select().Length > 0);

            return(valid);
        }
예제 #3
0
        public static bool hasEverHadEmployee(string userName)
        {
            bool      hasEmployee;
            DataTable table;

            adapter = getNewAdapter();
            table   = adapter.GetAllByUserName(userName);
            adapter.Dispose();

            hasEmployee = (table.Select().Length > 0);

            return(hasEmployee);
        }
예제 #4
0
        public static Object[] getEmployee(string userName, string password)
        {
            DataTable table;

            adapter = getNewAdapter();
            table   = adapter.GetDataBy(userName, password);
            adapter.Dispose();

            if (table.Select().Length > 0)
            {
                return(table.Select()[0].ItemArray);
            }
            else
            {
                return(null);
            }
        }
예제 #5
0
 private static void setDeleted(bool deleted, string userName)
 {
     adapter = new TechableDSTableAdapters.EmployeesTableAdapter();
     adapter.UpdateDeleted(deleted, userName);
     adapter.Dispose();
 }
예제 #6
0
 public static void add(string lName, string fName, bool isAdmin, string userName, string password)
 {
     adapter = getNewAdapter();
     adapter.Insert(userName, fName, lName, isAdmin, password, false);
     adapter.Dispose();
 }
예제 #7
0
 public static void setPassword(string password, string username)
 {
     adapter = getNewAdapter();
     adapter.UpdatePassword(password, username);
     adapter.Dispose();
 }