예제 #1
0
        protected internal override void ToggleNiveisSupportPanel(bool showIt)
        {
            if (showIt)
            {
                // Make sure the button is pushed
                ToolBarButtonAuxList.Pushed = true;

                // Indicação que um painel está a ser usado como suporte
                ((frmMain)this.TopLevelControl).isSuportPanel = true;

                // Show the panel with all unidades fisicas
                ((frmMain)this.TopLevelControl).PushMasterPanel(typeof(MasterPanelPermissoesPlanoClassificacao));

                MasterPanelPermissoesPlanoClassificacao mpPPC = (MasterPanelPermissoesPlanoClassificacao)(((frmMain)this.TopLevelControl).MasterPanel);

                // é necessário actualizar o estado dos botões neste ponto uma vez que
                // nenhuma unidade física é definida como contexto automaticamente (a primeira a
                // ser apresentada na lista)
                mpPPC.lblFuncao.Text = "Estrutura orgânica";
                mpPPC.coluna_Requisitado_Visible(false);
                mpPPC.UpdateToolBarButtons();
                mpPPC.nivelNavigator1.MultiSelect = true;
                ApplyNDocListFilter(mpPPC.nivelNavigator1);
                mpPPC.nivelNavigator1.MovimentoID = CurrentMovimento.ID;
                if (mpPPC.nivelNavigator1.PanelToggleState == NivelNavigator.ToggleState.Documental)
                {
                    mpPPC.nivelNavigator1.ReloadList();
                }
            }
            else
            {
                // Make sure the button is not pushed
                ToolBarButtonAuxList.Pushed = false;

                // Remove the panel with all unidades fisicas
                if (this.TopLevelControl != null)
                {
                    if (((frmMain)this.TopLevelControl).MasterPanel is MasterPanelPermissoesPlanoClassificacao)
                    {
                        MasterPanelPermissoesPlanoClassificacao mpPPC = (MasterPanelPermissoesPlanoClassificacao)(((frmMain)this.TopLevelControl).MasterPanel);
                        ClearNDocListFilter(mpPPC.nivelNavigator1);

                        // Indicação que nenhum painel está a ser usado como suporte
                        ((frmMain)this.TopLevelControl).isSuportPanel = false;
                        ((frmMain)this.TopLevelControl).PopMasterPanel(typeof(MasterPanelPermissoesPlanoClassificacao));
                    }
                }
            }
        }
예제 #2
0
        private string GetCodigoCompleto(object element)
        {
            MasterPanelPermissoesPlanoClassificacao mpPPC = (MasterPanelPermissoesPlanoClassificacao)(((frmMain)this.TopLevelControl).MasterPanel);
            string nCod = null;

            if (element is GISATreeNode)
            {
                GISATreeNode node       = (GISATreeNode)element;
                ArrayList    pathEstrut = ControloNivelList.GetCodigoCompletoCaminhoUnico(node);
                if (pathEstrut.Count == 0)
                {
                    nCod = node.NivelRow.Codigo;
                }
                else
                {
                    nCod = Nivel.buildPath(pathEstrut);
                }
            }
            else if (element is ListViewItem)
            {
                ListViewItem item = (ListViewItem)element;
                GISADataset.RelacaoHierarquicaRow rhRow = (GISADataset.RelacaoHierarquicaRow)(GisaDataSetHelper.GetInstance().RelacaoHierarquica.Select(string.Format("ID={0} AND IDUpper={1}", ((GISADataset.NivelRow)item.Tag).ID, mpPPC.nivelNavigator1.ContextBreadCrumbsPathID))[0]);

                GISADataset.TipoNivelRelacionadoRow tnrRow = TipoNivelRelacionado.GetTipoNivelRelacionadoFromRelacaoHierarquica(rhRow);

                ArrayList pathEstrut = ControloNivelList.GetCodigoCompletoCaminhoUnico(mpPPC.nivelNavigator1.SelectedNode);

                ArrayList pathDoc = mpPPC.nivelNavigator1.GetCodigoCompletoCaminhoUnico(item);
                if (pathDoc.Count == 0 && pathEstrut.Count == 0)
                {
                    nCod = tnrRow.Designacao;
                }
                else
                {
                    nCod = string.Format("{0}/{1}", Nivel.buildPath(pathEstrut), Nivel.buildPath(pathDoc));
                }
            }
            return(nCod);
        }