public ActionResult Create(quarto quarto) { if (ModelState.IsValid) { db.quartos.Add(quarto); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.status_Id = new SelectList(db.status_quarto, "status_Id", "Descridao", quarto.status_Id); return View(quarto); }
public ActionResult Edit(quarto quarto) { if (ModelState.IsValid) { db.Entry(quarto).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.status_Id = new SelectList(db.status_quarto, "status_Id", "Descridao", quarto.status_Id); return View(quarto); }