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