public JsonResult ReservasPorVivienda(FormCollection collection) { ReservaDAL bd = new ReservaDAL(); int vivienda = int.Parse(collection["Vivienda"].ToString()); var model = bd.ObtenerVistaReservasPorVivienda(vivienda); 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)); } }