コード例 #1
0
        // GET: Program
        public ActionResult Index()
        {
            List <ProgramModel> programsList = new List <ProgramModel>();

            programsList = programRepository.GetAllPrograms();

            return(View("Index", programsList));
        }
コード例 #2
0
        public ActionResult Create()
        {
            var        programs    = programRepository.GetAllPrograms();
            SelectList programList = new SelectList(programs, "ProgramId", "Name");

            ViewData["program"] = programList;

            var        teachers    = teacherRepository.GetAllTeachers();
            SelectList teacherList = new SelectList(teachers, "TeacherId", "Name");

            ViewData["teacher"] = teacherList;

            var        parents    = parentRepository.GetAllParents();
            SelectList parentList = new SelectList(parents, "ParentId", "Name");

            ViewData["parent"] = parentList;

            return(View("Create"));
        }