public JsonResult ReservasPorViviendaSolicitado(FormCollection collection) { ReservaDAL bd = new ReservaDAL(); int vivienda = int.Parse(collection["Vivienda"].ToString()); int espacio = int.Parse(collection["Espacio"].ToString()); var model = bd.ObtenerVistaReservasPorViviendaSolicitado(vivienda, espacio); if (model != null) { var result = new { Success = true, Message = "Succes Message", model }; return(Json(result, JsonRequestBehavior.AllowGet)); } else { var result = new { Success = false, Message = "Error Message" }; return(Json(result, JsonRequestBehavior.AllowGet)); } }