public ActionResult DeleteConfirmed(int id) { quarto_hotel quarto_hotel = db.quarto_hotel.Find(id); db.quarto_hotel.Remove(quarto_hotel); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id_hotel,tipo,preco,id")] quarto_hotel quarto_hotel) { if (ModelState.IsValid) { db.Entry(quarto_hotel).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.id_hotel = new SelectList(db.hotel, "id", "nome", quarto_hotel.id_hotel); return(View(quarto_hotel)); }
public ActionResult Create([Bind(Include = "id_hotel,tipo,preco,id")] quarto_hotel quarto_hotel) { if (ModelState.IsValid) { db.quarto_hotel.Add(quarto_hotel); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.id_hotel = new SelectList(db.hotel, "id", "nome", quarto_hotel.id_hotel); return(View(quarto_hotel)); }
// GET: quarto_hotel/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } quarto_hotel quarto_hotel = db.quarto_hotel.Find(id); if (quarto_hotel == null) { return(HttpNotFound()); } return(View(quarto_hotel)); }
// GET: quarto_hotel/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } quarto_hotel quarto_hotel = db.quarto_hotel.Find(id); if (quarto_hotel == null) { return(HttpNotFound()); } ViewBag.id_hotel = new SelectList(db.hotel, "id", "nome", quarto_hotel.id_hotel); return(View(quarto_hotel)); }