public ActionResult DeleteConfirmed(int id) { ResortLocation resortLocation = db.ResortLocations.Find(id); db.ResortLocations.Remove(resortLocation); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ResortLocationID,ResortName,Address,City,State,ZipCode,Phone")] ResortLocation resortLocation) { if (ModelState.IsValid) { db.Entry(resortLocation).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(resortLocation)); }
public ActionResult Create([Bind(Include = "ResortLocationID,ResortName,Address,City,State,ZipCode,Phone")] ResortLocation resortLocation) { if (ModelState.IsValid) { db.ResortLocations.Add(resortLocation); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(resortLocation)); }
public ActionResult DeleteConfirmed(int id) { //ResortLocation resortLocation = db.ResortLocations.Find(id); //db.ResortLocations.Remove(resortLocation); //db.SaveChanges(); ResortLocation resortLocation = uow.ResortRepository.Find(id); uow.ResortRepository.Remove(resortLocation); uow.Save(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ResortLocationID,ResortName,Address,City,State,ZipCode,ReservationLimit")] ResortLocation resortLocation) { if (ModelState.IsValid) { //db.Entry(resortLocation).State = System.Data.Entity.EntityState.Modified; //db.SaveChanges(); uow.ResortRepository.Update(resortLocation); uow.Save(); return(RedirectToAction("Index")); } return(View(resortLocation)); }
public ActionResult Create([Bind(Include = "ResortLocationID,ResortName,Address,City,State,ZipCode,ReservationLimit")] ResortLocation resortLocation) { if (ModelState.IsValid) { //db.ResortLocations.Add(resortLocation); //db.SaveChanges(); uow.ResortRepository.Add(resortLocation); uow.Save(); return(RedirectToAction("Index")); } return(View(resortLocation)); }
// GET: ResortLocations/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ResortLocation resortLocation = db.ResortLocations.Find(id); if (resortLocation == null) { return(HttpNotFound()); } return(View(resortLocation)); }
// GET: ResortLocations/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } //ResortLocation resortLocation = db.ResortLocations.Find(id); ResortLocation resortLocation = uow.ResortRepository.Find(id); if (resortLocation == null) { return(HttpNotFound()); } return(View(resortLocation)); }
public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } //ResortLocation resortLocation = db.ResortLocations.Find(id); ViewBag.PetID = new SelectList(uow.PetRepository.Get(), "PetID", "Name"); ViewBag.ReservationID = new SelectList(uow.ReservationRepository.Get(), "ReservationID", "ReservationID"); ResortLocation resortLocation = uow.ResortRepository.Find(id); if (resortLocation == null) { return(HttpNotFound()); } return(View(resortLocation)); }