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