public ActionResult Create(Alquiler alquiler) { try { repositorio.Alta(alquiler); Inmuebles.ActualizarDisponible(alquiler.IdInmueble, 0); TempData["Id"] = "creĆ³ el alquiler"; return(RedirectToAction(nameof(Index))); } catch (Exception ex) { ViewBag.propis = Inmuebles.ObtenerTodos(); ViewBag.inquis = Inquilinos.ObtenerTodos(); ViewBag.Error = ex.Message; ViewBag.StackTrate = ex.StackTrace; return(View(alquiler)); } }
public ActionResult Create() { ViewBag.propis = Inmuebles.ObtenerTodos(); ViewBag.inquis = Inquilinos.ObtenerTodos(); return(View()); }