public ActionResult Create(AuditCourse auditcourse) { auditcourse.setNextCourseNumber(); if (ModelState.IsValid) { db.Courses.Add(auditcourse); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ProgramId = new SelectList(db.Programs, "ProgramID", "ProgramAcronym", auditcourse.ProgramId); return(View(auditcourse)); }
public ActionResult Create([Bind(Include = "CourseId,ProgramId,CourseNumber,Title,CreditHours,TuitionAmount,Notes")] AuditCourse auditCourse) { auditCourse.setNextCourseNumber(); if (ModelState.IsValid) { db.AuditCourses.Add(auditCourse); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ProgramId = new SelectList(db.Programs, "ProgramId", "Description", auditCourse.ProgramId); return(View(auditCourse)); }