public ActionResult Create([Bind(Include = "courseOutcomes_ID,syllabus_FK,codeName,outcomeDescription,domainLearningLVL")] Course_Outcomes course_Outcomes) { if (ModelState.IsValid) { db.Course_Outcomes.Add(course_Outcomes); db.SaveChanges(); db.Entry(course_Outcomes).GetDatabaseValues(); int newID = course_Outcomes.courseOutcomes_ID; int numOfPO = db.Program_Outcomes.Select(d => d.code_outcome).Distinct().Count(); int syllabusID = course_Outcomes.syllabus_FK; PopulateModels(numOfPO, newID); return(RedirectToAction("ShowResults", "Active_Values", new { id = syllabusID })); } ViewBag.syllabus_FK = new SelectList(db.Syllabus, "syllabus_ID", "title", course_Outcomes.syllabus_FK); return(View(course_Outcomes)); }
public ActionResult Edit([Bind(Include = "activeValues_ID,columnName,programOutcomeAbbr,activeStatus,courseOutcomes_FK")] Active_Values active_Values) { if (ModelState.IsValid) { db.Entry(active_Values).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.courseOutcomes_FK = new SelectList(db.Course_Outcomes, "courseOutcomes_ID", "codeName", active_Values.courseOutcomes_FK); return(View(active_Values)); }