Example #1
0
        public bool LoginUser(String userName, String userPassword)
        {
            bool ret = false;

            string sql = @"SELECT 
                            UserGUID  
                            ,FirstName
                            ,LastName
                            ,UserName
                            ,UserPassword
                         FROM User
                         WHERE UserName = @UserName AND UserPassword = @UserPassword";

            List <System.Data.SQLite.SQLiteParameter> paramList = new List <System.Data.SQLite.SQLiteParameter>();

            paramList.Add(new SQLiteParameter("@UserName", userName));
            paramList.Add(new SQLiteParameter("@UserPassword", GlobalVariables.GetMD5(userPassword)));

            NGSConnector     connector = new NGSConnector();
            SQLiteDataReader reader    = connector.execSQLWithResult(sql, paramList);

            if (reader.HasRows)
            {
                ret = true;
                FillData(reader);
            }

            return(ret);
        }
Example #2
0
        public void SavePassword(string userGUID, string userPassword)
        {
            string sql = @"UPDATE User 
                            SET UserPassword = @UserPassword
                         WHERE UserGUID = @UserGUID";

            List <System.Data.SQLite.SQLiteParameter> paramList = new List <System.Data.SQLite.SQLiteParameter>();

            paramList.Add(new SQLiteParameter("@UserGUID", userGUID));
            paramList.Add(new SQLiteParameter("@UserPassword", GlobalVariables.GetMD5(userPassword)));

            NGSConnector connector = new NGSConnector();

            connector.execSQL(sql, paramList);
        }