Exemple #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            LeaseHistory leaseHistory = db.LeaseHistories.Find(id);

            db.LeaseHistories.Remove(leaseHistory);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
 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));
 }
Exemple #3
0
        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));
        }
Exemple #4
0
        // 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));
        }