public ActionResult Create(alquileres alquileres) { try { if (ModelState.IsValid) { db.alquileres.Add(alquileres); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(alquileres)); } catch { return(View(alquileres)); } }
public ActionResult Edit(alquileres alquileres) { try { if (ModelState.IsValid) { db.Entry(alquileres).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(alquileres)); } catch { return(View(alquileres)); } }
public ActionResult Delete(int?id, alquileres alquileres) { try { if (ModelState.IsValid) { alquileres = db.alquileres.Find(id); if (alquileres == null) { return(HttpNotFound()); } db.alquileres.Remove(alquileres); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(alquileres)); } catch { return(View(alquileres)); } }