Esempio n. 1
0
        public List <Dictionary <String, Object> > getMyTwitter(int uid)
        {
            List <Dictionary <String, Object> > list = new List <Dictionary <string, object> >();
            var context = new LOJEntities3();
            var marks   = from e in context.MarkProblems where e.uid == uid select e;

            foreach (var t in marks)
            {
                Dictionary <String, Object> hash = new Dictionary <string, object>();
                User        user     = UserInfoController.getUser((int)t.uid);
                QuestionSet question = ProblemController.GetProblemByQueId((int)t.queid);
                hash.Add("uid", user.id);
                hash.Add("name", user.name);
                hash.Add("markid", t.markid);
                hash.Add("phone", user.phone);
                hash.Add("queid", question.id);
                hash.Add("avator", user.avator);
                hash.Add("queTitle", question.title);
                hash.Add("queSource", question.source);
                hash.Add("queCategory", question.category);
                hash.Add("queDifficulty", question.difficulty);
                list.Add(hash);
            }
            return(list);
        }
Esempio n. 2
0
        public List <Dictionary <String, Object> > GetRecordListByQid(int qid)
        {
            List <Dictionary <String, Object> > list = new List <Dictionary <string, object> >();
            var context = new LOJEntities3();
            var records = from e in context.Records where e.questionid == qid select e;

            foreach (var t in records)
            {
                Dictionary <String, Object> hash = new Dictionary <string, object>();
                User user = UserInfoController.getUser((int)t.userid);
                hash.Add("uid", user.id);
                hash.Add("name", user.name);
                hash.Add("phone", user.phone);
                hash.Add("avator", user.avator);
                hash.Add("time", t.submittime);
                hash.Add("qid", t.questionid);
                hash.Add("recordid", t.recordid);
                hash.Add("qname", ProblemController.GetProblemByQueId((int)t.questionid).title);
                hash.Add("status", t.status);
                //  hash.Add("commentNum", getReplyListNum((int)t.discussid));
                list.Add(hash);
            }
            return(list);
        }