Esempio n. 1
0
        public void GetLeaders(DBEventHandler<User> completed)
        {
            var query = from u in Db.Dbc.Table<User>()
                        orderby u.Points descending
                        select u;

            Db.Execute(query, completed);
        }
Esempio n. 2
0
        public void GetRand(DBEventHandler<Question> completed)
        {
            var rand = new Random();
            var query = from q in Db.Dbc.Table<Question>()
                        where q.Text != null
                        select q;
            query = query.Skip(rand.Next(0, 7)).Take(1);

            Db.Execute(query, completed);
        }
Esempio n. 3
0
        void IDBCollection.SetEventHandler(enDBEventHandler which, DBEventHandler handler)
        {
            switch (which)
            {
            case enDBEventHandler.OnRecordRead:
                OnRecordRead += handler;
                break;

            case enDBEventHandler.OnRecordCollectionAdd:
                OnRecordCollectionAdd += handler;
                break;

            default:
                break;
            }
        }
Esempio n. 4
0
        public void GetAnswerById(int id, DBEventHandler<Answer> completed)
        {
            var rand = new Random();
            var query = from a in Db.Dbc.Table<Answer>()
                        where a.QuestionId == id
                        select a;

            Db.Execute(query, completed);

            /*return database.Table<Question>()
                    .Join(database.Table<Answer>().Where(t => t.ThemeId == ThemeID)
                        , (m, t) => new { mym = m, myt = t })
                    .Select(a => new Playlist
                    {
                        Name = a.mym.Name,
                        ResId = a.mym.ResId,
                        LoopStart = 0
                    })
                    .ToList();*/
        }
Esempio n. 5
0
 public void GetAll(DBEventHandler<User> completed)
 {
     Db.ExecuteList(completed);
 }
Esempio n. 6
0
 void IDBCollection.SetEventHandler(enDBEventHandler which, DBEventHandler handler)
 {
     OnRecordRead += handler;
 }