// GET: Program public ActionResult Index() { List <ProgramModel> programsList = new List <ProgramModel>(); programsList = programRepository.GetAllPrograms(); return(View("Index", programsList)); }
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")); }