コード例 #1
0
ファイル: ModuleController.cs プロジェクト: radtek/yiqixicai
        //结果分析
        public ActionResult TalExaminationResult()
        {
            var list =
                new TalExaminationManager().GetAllExaminationByTenantId(CurrentTenant.TenantId)
                .Where(
                    p =>
                    p.PublishResult == 1 && p.ExamEndTime.ToLocalTime() <= DateTime.Now &&
                    p.ScoreCalculationStatus == 2)
                .OrderByDescending(p => p.ExamBeginTime.ToLocalTime());

            ViewBag.total = list.Count();
            //  list = list.Take(5);
            return(View(list.Take(5)));
        }
コード例 #2
0
        public JsonResult CatalogsTree(int exid, int reportId = 0)
        {
            var        template  = _templateManager.GetById(reportId);
            List <int> selecteds = new List <int>();

            if (template != null)
            {
                selecteds.AddRange(template.Catalogs);
            }
            var list = new TalExaminationManager().GetExaminationQuestionIndexList(exid);

            var root = new EasyuiTreeNode()
            {
                id = "0", text = "目录", @checked = selecteds.Contains(0)
            };
            var leadNode = new EasyuiTreeNode()
            {
                id = "-1", text = "导语", @checked = true
            };

            leadNode.children.Add(new EasyuiTreeNode()
            {
                id = "-2", text = "简介", @checked = true
            });
            leadNode.children.Add(new EasyuiTreeNode()
            {
                id = "-3", text = "阅读建议", @checked = true
            });
            root.children.Add(leadNode);

            var result = new EasyuiTreeNode()
            {
                id = "-4", text = "测评结果", @checked = selecteds.Contains(-4)
            };

            result.children.Add(new EasyuiTreeNode()
            {
                id = "-5", text = "答题情况", @checked = selecteds.Contains(-5)
            });
            result.children.Add(new EasyuiTreeNode()
            {
                id = "-6", text = "一级指标数据图", @checked = selecteds.Contains(-6)
            });
            result.children.Add(new EasyuiTreeNode()
            {
                id = "-7", text = "二级指标数据图", @checked = selecteds.Contains(-7)
            });
            root.children.Add(result);

            root.children.Add(new EasyuiTreeNode()
            {
                id = "-8", text = "典型特征描述", @checked = selecteds.Contains(-8)
            });


            var explanation = new EasyuiTreeNode()
            {
                id = "-9", text = "详细解释", @checked = selecteds.Contains(-9)
            };

            foreach (var sort in list.Where(p => p.FatherID == 0))
            {
                explanation.children.Add(new EasyuiTreeNode()
                {
                    id = sort._id.ToString(), text = sort.Title, @checked = selecteds.Contains(sort._id)
                });
            }
            root.children.Add(explanation);
            root.children.Add(new EasyuiTreeNode()
            {
                id = "-10", text = "关于报告", @checked = true
            });
            return(Json(new[] { root }, JsonRequestBehavior.AllowGet));
        }