コード例 #1
0
        public bool Login(string user, string pass)
        {
            bool     ok = false;
            DataFile db = GetDF(typeof(USER).Name);

            if (db != null && db.Opened)
            {
                ok = db.Exist("Username == @0 && Password == @1", user, pass);
            }
            return(ok);
        }
コード例 #2
0
        public LOGIN_STATUS Login(string user, string pass)
        {
            LOGIN_STATUS ok = LOGIN_STATUS.USERNAME_PASS_WRONG;
            DataFile     db = GetDF(typeof(USER).Name);

            if (db != null && db.Opened)
            {
                if (db.Count == 0)
                {
                    ok = LOGIN_STATUS.MODEL_USER_IS_EMPTY;
                }
                else
                {
                    bool v = db.Exist("Username == @0 && Password == @1", user, pass);
                    if (v)
                    {
                        ok = LOGIN_STATUS.LOGIN_SUCCESSFULLY;
                    }
                }
            }
            return(ok);
        }