Пример #1
0
        static public IEnumerable <DataRow> Status(DataBaseExecutor db, int p)
        {
            return(db.GetTable(@"SELECT Answer.QuestionID, Answer.Username, 
Answer.Status, Answer.Addtime, Answer.Complier, Answer.UseTime, 
Answer.UseMemory, Question.Title, Answer.ID,Answer.Guid
FROM Answer INNER JOIN Question ON Answer.QuestionID = Question.ID 
order by answer.id desc").AsEnumerable().Skip(20 * (p - 1)).Take(20));
        }
Пример #2
0
        static public IEnumerable <DataRow> MySatus(DataBaseExecutor db, string username)
        {
            return(db.GetTable(@"SELECT Answer.QuestionID, Answer.Username, 
Answer.Status, Answer.Addtime, Answer.Complier, Answer.UseTime, 
Answer.UseMemory, Question.Title, Answer.ID,Answer.Guid
FROM Answer INNER JOIN Question ON Answer.QuestionID = Question.ID 
where answer.username=@un
order by answer.id desc", "@un", username).AsEnumerable().ToList());
        }
Пример #3
0
        static DataTable AllQuestion(DataBaseExecutor db)
        {
            string    key = QUESTIONLIST;
            DataTable dt  = null;

            if (CHCache.Contains(key))
            {
                dt = CHCache.Get <DataTable>(key);
            }
            else
            {
                dt = db.GetTable(@"SELECT * FROM [Question]");                // where istrue=1
                CHCache.Add(key, dt);
            }
            return(dt);
        }
Пример #4
0
        static DataTable GroupTable(DataBaseExecutor db)
        {
            string    key = GROUP;
            DataTable dt  = null;

            if (CHCache.Contains(key))
            {
                dt = CHCache.Get <DataTable>(key);
            }
            else
            {
                dt = db.GetTable(@"SELECT * FROM [Group]");
                CHCache.Add(key, dt);
            }
            return(dt);
        }