public ActionResult DeleteConfirmed(int id) { tstDepartment tstDepartment = db.tstDepartments.Find(id); db.tstDepartments.Remove(tstDepartment); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,Name,Description,ISActive")] tstDepartment tstDepartment) { if (ModelState.IsValid) { db.Entry(tstDepartment).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tstDepartment)); }
public ActionResult Create([Bind(Include = "ID,Name,Description,ISActive")] tstDepartment tstDepartment) { if (ModelState.IsValid) { db.tstDepartments.Add(tstDepartment); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tstDepartment)); }
// GET: tstDepartments/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tstDepartment tstDepartment = db.tstDepartments.Find(id); if (tstDepartment == null) { return(HttpNotFound()); } return(View(tstDepartment)); }