public ActionResult DeleteConfirmed(int id) { KeywordsDepartment keywordsDepartment = db.KeywordsDepartments.Find(id); db.KeywordsDepartments.Remove(keywordsDepartment); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "KeywordID,Keyword,DepartmentID")] KeywordsDepartment keywordsDepartment) { if (ModelState.IsValid) { db.Entry(keywordsDepartment).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.DepartmentID = new SelectList(db.Departments, "DepartmentId", "DepartmentName", keywordsDepartment.DepartmentID); return(View(keywordsDepartment)); }
public ActionResult Create([Bind(Include = "KeywordID,Keyword,DepartmentID")] KeywordsDepartment keywordsDepartment) { if (ModelState.IsValid) { db.KeywordsDepartments.Add(keywordsDepartment); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.DepartmentID = new SelectList(db.Departments, "DepartmentId", "DepartmentName", keywordsDepartment.DepartmentID); return(View(keywordsDepartment)); }
public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } KeywordsDepartment keywordsDepartment = db.KeywordsDepartments.Find(id); if (keywordsDepartment == null) { return(HttpNotFound()); } return(View(keywordsDepartment)); }
public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } KeywordsDepartment keywordsDepartment = db.KeywordsDepartments.Find(id); if (keywordsDepartment == null) { return(HttpNotFound()); } ViewBag.DepartmentID = new SelectList(db.Departments, "DepartmentId", "DepartmentName", keywordsDepartment.DepartmentID); return(View(keywordsDepartment)); }