public ActionResult DeleteConfirmed(string id) { TopicAssign topicAssign = db.TopicAssigns.Find(id); db.TopicAssigns.Remove(topicAssign); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "TopicAssignID,TopicID,CourseID")] TopicAssign topicAssign) { if (ModelState.IsValid) { db.Entry(topicAssign).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CourseID = new SelectList(db.Courses, "CourseID", "CourseName", topicAssign.CourseID); ViewBag.TopicID = new SelectList(db.Topics, "TopicID", "TopicName", topicAssign.TopicID); return(View(topicAssign)); }
// GET: TopicAssigns/Details/5 public ActionResult Details(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TopicAssign topicAssign = db.TopicAssigns.Find(id); if (topicAssign == null) { return(HttpNotFound()); } return(View(topicAssign)); }
// GET: TopicAssigns/Edit/5 public ActionResult Edit(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TopicAssign topicAssign = db.TopicAssigns.Find(id); if (topicAssign == null) { return(HttpNotFound()); } ViewBag.CourseID = new SelectList(db.Courses, "CourseID", "CourseName", topicAssign.CourseID); ViewBag.TopicID = new SelectList(db.Topics, "TopicID", "TopicName", topicAssign.TopicID); return(View(topicAssign)); }