示例#1
0
        public ActionResult ExamPapers()
        {
            var examPapers = new List <ExamPaper>();

            examPapers             = examPaperService.GetAll().ToList();
            ViewBag.CountExamPaper = examPapers.Count();
            foreach (var item in examPapers)
            {
                item.NumberOfQuestion = examPaperService.GetNumberOfQuestionByExamPaperId(item.ExamPaperID);
            }
            return(View(examPapers));
        }
示例#2
0
        public ActionResult Edit(int id)
        {
            ViewBag.listAllExamPaper = examPaperService.GetAll();
            var listExamPaperByExamID = examService.GetExamPaperByExamID(id);

            foreach (var item in listExamPaperByExamID)
            {
                item.NumberOfQuestion = examPaperService.GetNumberOfQuestionByExamPaperId(item.ExamPaperID);
            }
            ViewBag.listExamPaperByExamID = listExamPaperByExamID;
            var exam = examService.GetExamsByID(id);

            return(View(exam));
        }