示例#1
0
        public ActionResult EditTeacher(long id)
        {
            var item = _academicGradeRepository.GetById(id);

            ViewBag.SectionTeacher = new SelectList(_teacherRepository.GetAllTeachers(), "Id", "FullName", item.SectionTeacher);
            var toReturn = Mapper.Map <AcademicGradeTeacherAssignModel>(item);

            return(View(toReturn));
        }
示例#2
0
        public ActionResult Index(long gradeId, int?page)
        {
            ViewBag.GradeId = gradeId;
            _viewMessageLogic.SetViewMessageIfExist();
            var       grade      = _academicGradeRepository.GetById(gradeId);
            const int pageSize   = 10;
            var       pageNumber = (page ?? 1);

            return(grade == null?View("Index") : View("Index", grade.Students.Select(n => new EnrollDisplayModel
            {
                AcademicGradeId = grade.Id,
                StudentId = n.Id,
                FullName = n.FullName,
                Photo = n.Photo,
                MyGender = n.MyGender.ToString("G"),
                AccountNumber = n.AccountNumber,
                Grade = grade.Grade.Name,
                Section = grade.Section
            }).ToPagedList(pageNumber, pageSize)));
        }