Exemplo n.º 1
0
        private void AddObjetoDigital(GISADataset.ObjetoDigitalRow odRow)
        {
            var node = new TreeNode();
            node.ImageIndex = 3;
            node.SelectedImageIndex = 3;
            node.Text = odRow.Titulo;
            node.Tag = odRow;
            var odRowsSimples = odRow.GetObjetoDigitalRelacaoHierarquicaRowsByObjetoDigitalObjetoDigitalRelacaoHierarquicaUpper().Select(r => r.ObjetoDigitalRowByObjetoDigitalObjetoDigitalRelacaoHierarquica).ToList();
            if (odRowsSimples.Count > 0)
            {
                foreach (var odRowSimples in odRowsSimples.OrderBy(r => r.GUIOrder))
                {
                    var perm = PermissoesHelper.CalculateEffectivePermissions(odRowSimples, SessionHelper.GetGisaPrincipal().TrusteeUserOperator.TrusteeRow, CurrentFRDBase.NivelRow, PermissoesHelper.ObjDigOpREAD.TipoOperationRow);
                    if (perm == PermissoesHelper.PermissionType.ExplicitDeny || perm == PermissoesHelper.PermissionType.ImplicitDeny) continue;

                    var subDocNode = new TreeNode();
                    subDocNode.Text = odRowSimples.Titulo;
                    subDocNode.Tag = odRowSimples;
                    subDocNode.ImageIndex = 3;
                    subDocNode.SelectedImageIndex = 3;

                    node.Nodes.Add(subDocNode);
                }

                if (node.Nodes.Count == 0) return;

                node.ForeColor = Color.Gray;
                node.Expand();
            }
            else
            {
                var perm = PermissoesHelper.CalculateEffectivePermissions(odRow, SessionHelper.GetGisaPrincipal().TrusteeUserOperator.TrusteeRow, CurrentFRDBase.NivelRow, PermissoesHelper.ObjDigOpREAD.TipoOperationRow);
                if (perm == PermissoesHelper.PermissionType.ExplicitDeny || perm == PermissoesHelper.PermissionType.ImplicitDeny) return;
            }

            trvODsFedora.Nodes.Add(node);
        }