Ejemplo n.º 1
0
 public static string getPassword(string uid)
 {
     if (isExistUser(uid) == true)
     {
         return(AccessDB.GetFieldValue("SELECT UserPWD FROM UserInfo WHERE UserID = '" + uid + "'"));
     }
     return("");
 }
Ejemplo n.º 2
0
 public static Boolean getBorrowAdmin(string uid)
 {
     if (isExistUser(uid) == true)
     {
         string qx = AccessDB.GetFieldValue("SELECT BorrowAdmin FROM UserInfo WHERE UserID = '" + uid + "'");
         return(Convert.ToBoolean(qx));
     }
     return(false);
 }
Ejemplo n.º 3
0
 public static bool deleteUser(string uid)
 {
     if (isExistUser(uid) == true)
     {
         AccessDB.ExecSQL("DELETE FROM UserInfo WHERE UserID='" + uid + "'");
         return(true);
     }
     return(false);
 }
Ejemplo n.º 4
0
        public static bool isExistUser(string uid)
        {
            string cnt = AccessDB.GetFieldValue("SELECT count(*) FROM UserInfo WHERE UserID = '" + uid + "'");

            if (cnt == "1")
            {
                return(true);
            }
            return(false);
        }
Ejemplo n.º 5
0
 public static bool newUser(string uid, string pwd, string userAdmin, string readerAdmin, string bookAdmin, string borrowAdmin, string regTime)
 {
     if (isExistUser(uid) == false)
     {
         string sql;
         sql  = "INSERT INTO UserInfo(UserID,UserPWD,UserAdmin,ReaderAdmin,BookAdmin,BorrowAdmin,RegisterTime)";
         sql += "Values('" + uid + "','" + pwd + "','" + userAdmin + "','" + readerAdmin + "','" + bookAdmin + "','" + borrowAdmin + "','" + regTime + "')";
         AccessDB.ExecSQL(sql);
         return(true);
     }
     return(false);
 }
Ejemplo n.º 6
0
 public static bool modifyUser(string uid, string pwd, string userAdmin, string readerAdmin, string bookAdmin, string borrowAdmin)
 {
     if (isExistUser(uid) == true)
     {
         string sql;
         sql  = "UPDATE UserInfo SET UserPWD='" + pwd + "',UserAdmin='" + userAdmin + "',ReaderAdmin='" + readerAdmin;
         sql += "',BookAdmin='" + bookAdmin + "',BorrowAdmin='" + borrowAdmin + "' WHERE UserID='" + uid + "'";
         AccessDB.ExecSQL(sql);
         return(true);
     }
     return(false);
 }
Ejemplo n.º 7
0
        public static Boolean IsBorrowAdmin;        //是否拥有借阅权限

        public static bool judgeUser(string uid, string pwd)
        {
            string sql;

            sql = "SELECT count(*) FROM UserInfo WHERE UserID='" + uid + "' and UserPWD='" + pwd + "'";
            string cnt = AccessDB.GetFieldValue(sql);

            if (cnt == "1")
            {
                return(true);
            }
            return(false);
        }