public ProgramRequirementModel(ProgramRequirement p) { _programRequirement = p; populate(); }
partial void DeleteProgramRequirement(ProgramRequirement instance);
partial void InsertProgramRequirement(ProgramRequirement instance);
partial void UpdateProgramRequirement(ProgramRequirement instance);
public void registCourses(List<Course> demcourses) { ProgramRequirement pr = new ProgramRequirement(); DegreeProgramRequirement dpr = new DegreeProgramRequirement(); dpr.ProgramRequirement = pr; foreach (Course currentcourse in demcourses) { ProgramRequirementCourse drc = new ProgramRequirementCourse(); drc.Course = currentcourse; pr.ProgramRequirementCourses.Add(drc); _context.ProgramRequirementCourses.InsertOnSubmit(drc); _context.Courses.InsertOnSubmit(currentcourse); _context.SubmitChanges(); } _context.ProgramRequirements.InsertOnSubmit(pr); _context.DegreeProgramRequirements.InsertOnSubmit(dpr); }