public ActionResult Delete(int?id) { RentInformation rentInformation = db.RenstInformations.Find(id); db.RenstInformations.Remove(rentInformation); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit(RentInformation rentInformation) { if (ModelState.IsValid) { db.Entry(rentInformation).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(rentInformation)); }
public ActionResult Create(RentInformation rentInformation) { if (ModelState.IsValid) { db.RenstInformations.Add(rentInformation); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(rentInformation)); }
public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } RentInformation rentInformation = db.RenstInformations.Find(id); if (rentInformation == null) { return(HttpNotFound()); } return(View(rentInformation)); }