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