Exemplo n.º 1
0
        public static void ModifyPaperQuestions(int courseId)
        {
            int              totalCount = 0;
            Stopwatch        sw         = new Stopwatch();
            List <dto_Paper> papers     = D_Paper.SearchPapers(courseId, 0, 0, 0, 0, 1, 20000, out totalCount);

            LogHelper.Error("---------------CourseId:" + courseId + ",转化T_Paper表的QuestionIds开始,总数:" + totalCount + "个----------------");
            sw.Start();
            if (papers != null)
            {
                for (int i = 0; i < papers.Count; i++)
                {
                    if (i % 100 == 0)
                    {
                        LogHelper.Error("---------------第" + (i + 1) + "题开始----------------");
                    }

                    if (!string.IsNullOrEmpty(papers[i].QuestionIds))
                    {
                        string[] qids = JsonConvert.DeserializeObject <string[]>(papers[i].QuestionIds);
                        int[]    l    = D_Ques.GetQuestionsBySourceId(papers[i].CourseId, string.Join(",", qids));
                        D_Paper.UpdatePaperQIds(papers[i].PaperId, string.Join(",", l));
                    }
                }
            }
            sw.Stop();
            LogHelper.Error("---------------CourseId:" + courseId + ",转化结束,用时:" + sw.Elapsed + "秒----------------");
        }
Exemplo n.º 2
0
        public static List <dto_Paper> SearchPapers(int courseId, int gradeId, int typeId, int paperYear, int areaId, int pageIndex, int pageSize, out int totalCount)
        {
            List <dto_Paper> list = D_Paper.SearchPapers(courseId, gradeId, typeId, paperYear, areaId, pageIndex, pageSize, out totalCount);

            return(list);
        }