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)); }
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()); }
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); }
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); }