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