public ActionResult DeleteConfirmed(int id) { BranchCourses branchCourses = db.BranchCourses.Find(id); db.BranchCourses.Remove(branchCourses); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,BranchesId,CoursesId,StartTime")] BranchCourses branchCourses) { if (ModelState.IsValid) { db.Entry(branchCourses).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.BranchesId = new SelectList(db.Branches, "Id", "Name", branchCourses.BranchesId); ViewBag.CoursesId = new SelectList(db.Courses, "Id", "Name", branchCourses.CoursesId); return(View(branchCourses)); }
// GET: BranchCourses/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } BranchCourses branchCourses = db.BranchCourses.Find(id); if (branchCourses == null) { return(HttpNotFound()); } return(View(branchCourses)); }
// GET: BranchCourses/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } BranchCourses branchCourses = db.BranchCourses.Find(id); if (branchCourses == null) { return(HttpNotFound()); } ViewBag.BranchesId = new SelectList(db.Branches, "Id", "Name", branchCourses.BranchesId); ViewBag.CoursesId = new SelectList(db.Courses, "Id", "Name", branchCourses.CoursesId); return(View(branchCourses)); }