public List <VerTipoValorDeclaradoModelView> VerTiposValoresDeclarados() { List <VerTipoValorDeclaradoModelView> TVD = null; short Activo = 1; try { TVD = (from t in context.SP_S_TipoValorDeclarado().ToList() select new VerTipoValorDeclaradoModelView() { IdTipoValorDeclarado = t.IdTipoValorDeclarado, Nombre = t.Nombre, Descripcion = t.Descripcion, AfectaCantidad = t.AfectaCantidad == Activo ? true : false, AfectaImporte = t.AfectaImporte == Activo ? true : false, PermiteCargaDetalle = t.PermiteCargaDetalle == Activo ? true : false, //IdEstado = t.IdEstado == 1 ? true : false, Estado = t.EstadoNombre }).OrderByDescending(x => x.IdTipoValorDeclarado).ToList(); } catch (Exception ex) { TVD = null; throw ex; } return(TVD); }