public ActionResult DeleteConfirmed(int id) { MasteryCourse masterycourse = (MasteryCourse)db.Courses.Find(id); db.Courses.Remove(masterycourse); db.SaveChanges(); return(RedirectToAction("Index")); }
// // GET: /MasteryCourse/Details/5 public ActionResult Details(int id = 0) { MasteryCourse masterycourse = db.MasteryCourses.Find(id); if (masterycourse == null) { return(HttpNotFound()); } return(View(masterycourse)); }
public ActionResult Edit(MasteryCourse masterycourse) { if (ModelState.IsValid) { db.Entry(masterycourse).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ProgramId = new SelectList(db.Programs, "ProgramID", "ProgramAcronym", masterycourse.ProgramId); return(View(masterycourse)); }
// // GET: /MasteryCourse/Edit/5 public ActionResult Edit(int id = 0) { MasteryCourse masterycourse = db.MasteryCourses.Find(id); if (masterycourse == null) { return(HttpNotFound()); } ViewBag.ProgramId = new SelectList(db.Programs, "ProgramID", "ProgramAcronym", masterycourse.ProgramId); return(View(masterycourse)); }
public ActionResult Edit([Bind(Include = "CourseId,ProgramId,CourseNumber,Title,CreditHours,TuitionAmount,Notes,MaximumAttempts")] MasteryCourse masteryCourse) { if (ModelState.IsValid) { db.Entry(masteryCourse).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ProgramId = new SelectList(db.Programs, "ProgramId", "Description", masteryCourse.ProgramId); return(View(masteryCourse)); }
public ActionResult DeleteConfirmed(int id) { MasteryCourse masteryCourse = db.MasteryCourses.Find(id); if (masteryCourse.registration != null) { masteryCourse.registration.Clear(); } db.MasteryCourses.Remove(masteryCourse); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Create(MasteryCourse masterycourse) { masterycourse.setNextCourseNumber(); if (ModelState.IsValid) { db.Courses.Add(masterycourse); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ProgramId = new SelectList(db.Programs, "ProgramID", "ProgramAcronym", masterycourse.ProgramId); return(View(masterycourse)); }
public ActionResult Create([Bind(Include = "CourseId,ProgramId,CourseNumber,Title,CreditHours,TuitionAmount,Notes,MaximumAttempts")] MasteryCourse masteryCourse) { masteryCourse.setNextCourseNumber(); if (ModelState.IsValid) { db.MasteryCourses.Add(masteryCourse); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ProgramId = new SelectList(db.Programs, "ProgramId", "Description", masteryCourse.ProgramId); return(View(masteryCourse)); }
// GET: MasteryCourses/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MasteryCourse masteryCourse = (MasteryCourse)db.Courses.Find(id); if (masteryCourse == null) { return(HttpNotFound()); } return(View(masteryCourse)); }
// GET: MasteryCourses/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MasteryCourse masteryCourse = (MasteryCourse)db.Courses.Find(id); if (masteryCourse == null) { return(HttpNotFound()); } ViewBag.ProgramId = new SelectList(db.Programs, "ProgramId", "Description", masteryCourse.ProgramId); return(View(masteryCourse)); }
// GET: MasteryCourses/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MasteryCourse masteryCourse = db.MasteryCourses.Find(id); if (masteryCourse == null) { return(HttpNotFound()); } ViewBag.AcademicProgramId = new SelectList(db.AcademicPrograms, "AcademicProgramId", "ProgramAcronym", masteryCourse.AcademicProgramId); return(View(masteryCourse)); }