public ActionResult DeleteConfirmed(int id) { DepartmentTypes departmentTypes = db.DepartmentTypes.Find(id); db.DepartmentTypes.Remove(departmentTypes); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,Type")] DepartmentTypes departmentTypes) { if (ModelState.IsValid) { db.Entry(departmentTypes).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(departmentTypes)); }
public ActionResult Create([Bind(Include = "ID,Type")] DepartmentTypes departmentTypes) { if (ModelState.IsValid) { db.DepartmentTypes.Add(departmentTypes); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(departmentTypes)); }
// GET: DepartmentTypes/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } DepartmentTypes departmentTypes = db.DepartmentTypes.Find(id); if (departmentTypes == null) { return(HttpNotFound()); } return(View(departmentTypes)); }
public BooksType(DepartmentTypes BookType, string department) { this.departmentType = BookType; this.Department = department; }