コード例 #1
0
        /// <summary>
        /// Gets the high score of the everyone in the list
        /// </summary>
        /// <returns></returns>
        public List <Userdata> getHighScore()
        {
            List <Userdata> result = new List <Userdata>();

            if (Check())
            {
                string UserQuery = "SELECT users.Users_id, users.Name, highscoure.Score FROM users, highscore WHERE users.Users_id == highscore.Users_id;";
                using (SQLiteCommand command = new SQLiteCommand(UserQuery, dbc))
                {
                    try
                    {
                        using (SQLiteDataReader rdq = command.ExecuteReader())
                        {
                            while (rdq.Read())
                            {
                                Userdata record = new Userdata(rdq.GetInt32(0), 0, rdq.GetString(1), 0, rdq.GetInt32(2));
                                result.Add(record);
                            }
                        }
                    }
                    catch (Exception ex) { Console.WriteLine("Error " + ex); }
                }
            }
            return(result);
        }
コード例 #2
0
        /// <summary>
        /// Gets the Session values for a user
        /// </summary>
        /// <returns>User_id, Session_id, Name</returns>
        public List <Userdata> getSessionNum()
        {
            List <Userdata> result = new List <Userdata>();

            if (Check())
            {
                string Query = "SELECT users.Users_id, sessions.Session_id, users.Name FROM users, sessions WHERE users.Users_id == sessions.Users_id";
                using (SQLiteCommand command = new SQLiteCommand(Query, dbc))
                {
                    try
                    {
                        using (SQLiteDataReader rdq = command.ExecuteReader())
                        {
                            while (rdq.Read())
                            {
                                Userdata record = new Userdata(rdq.GetInt32(0), rdq.GetInt32(1), rdq.GetString(2), 0, 0);
                                result.Add(record);
                            }
                        }
                    }
                    catch (Exception ex) { Console.WriteLine("Error " + ex); }
                }
            }

            return(result);
        }
コード例 #3
0
        public List <Userdata> getSessionNum()
        {
            List <Userdata> result = new List <Userdata>();
            Userdata        record = new Userdata(0, 1, "2", 3, 4, 5);

            result.Add(record);

            return(result);
        }
コード例 #4
0
        public List <Userdata> getUser()
        {
            List <Userdata> result = new List <Userdata>();
            Userdata        record = new Userdata(0, 1, "2", 3, 4);

            result.Add(record);

            return(result);
        }
コード例 #5
0
        public List <Userdata> getHightScore()
        {
            List <Userdata> result = new List <Userdata>();
            Userdata        record = new Userdata(0, 1, "2", 3, 4, 0);

            result.Add(record);

            return(result);
        }