예제 #1
0
        protected virtual void updateContextStatusBar(GISATreeNode node)
        {
            if (!(MasterPanel.isContextPanel(this)))
            {
                return;
            }
            if (node == null || node.NivelRow.RowState == DataRowState.Detached)
            {
                ((frmMain)TopLevelControl).StatusBarPanelHint.Text = string.Empty;
            }
            else
            {
                GISADataset.RelacaoHierarquicaRow   rhRow  = ((GISATreeNode)node).RelacaoHierarquicaRow;
                GISADataset.TipoNivelRelacionadoRow tnrRow = TipoNivelRelacionado.GetTipoNivelRelacionadoFromRelacaoHierarquica(rhRow);

                ArrayList pathEstrut = ControloNivelList.GetCodigoCompletoCaminhoUnico(node);
                if (pathEstrut.Count == 0)
                {
                    ((frmMain)TopLevelControl).StatusBarPanelHint.Text = string.Format("  {0}: {1}", tnrRow.Designacao, node.NivelRow.Codigo);
                }
                else
                {
                    ((frmMain)TopLevelControl).StatusBarPanelHint.Text = string.Format("  {0}: {1}", tnrRow.Designacao, Nivel.buildPath(pathEstrut));
                }
            }
        }
예제 #2
0
        public static void ForceRefresh(GISADataset.RelacaoHierarquicaRowChangeEvent e, MasterPanel mp, frmMain topLevelControl)
        {
            try
            {
                if (!(e.Action == DataRowAction.Add || (e.Action == DataRowAction.Change) || e.Action == DataRowAction.Delete))
                    return;

                // verificar se a row foi realmente editada
                if (e.Action == DataRowAction.Change && !Concorrencia.isModifiedRow(e.Row))
                    return;

                // descartar modificações intermédias de rows (por exemplo, a atribuição de um ID uma nivelRow quando gravada para a BD)
                if (e.Row.NivelRowByNivelRelacaoHierarquica == null || e.Row.NivelRowByNivelRelacaoHierarquicaUpper == null)
                    return;

                // garantir que a alteração occoreu entre duas entidades produtoras
                if (!(e.Row.NivelRowByNivelRelacaoHierarquica.IDTipoNivel == TipoNivel.ESTRUTURAL && (e.Row.NivelRowByNivelRelacaoHierarquicaUpper.IDTipoNivel == TipoNivel.LOGICO || e.Row.NivelRowByNivelRelacaoHierarquicaUpper.IDTipoNivel == TipoNivel.ESTRUTURAL)))
                    return;

                if (!topLevelControl.IsFirstMasterPanelInStack(mp) && topLevelControl.MasterPanelCount == 1)
                {
                    if (mp is INivelNavigatorProvider)
                    {
                        mp.lblFuncao.Text = "Estrutura orgânica";
                        var nav = mp as INivelNavigatorProvider;
                        nav.NivelNavigator.PanelToggleState = NivelNavigator.ToggleState.Estrutural;
                        nav.NivelNavigator.CollapseAllNodes();
                        nav.NivelNavigator.ToggleView(false);
                    }
                    else if (mp is IControloNivelListProvider)
                    {
                        var cnl = mp as IControloNivelListProvider;
                        cnl.ControloNivelList.CollapseAllNodes();
                    }
                }
            }
            catch (Exception ex)
            {
                Debug.Assert(false, ex.ToString());
                Trace.WriteLine(ex);
                throw ex;
            }
        }
예제 #3
0
        protected virtual void updateContextStatusBar(ListViewItem listViewItem)
        {
            if (!(MasterPanel.isContextPanel(this)))
            {
                return;
            }

            if (listViewItem == null || (listViewItem != null && listViewItem.ListView == null) || ((GISADataset.NivelRow)listViewItem.Tag).RowState == DataRowState.Detached)
            {
                ((frmMain)TopLevelControl).StatusBarPanelHint.Text = string.Empty;
            }
            else
            {
                // prever a situação onde, concorrentemente, outro utilizador fez cut/paste do nível em(questão)
                // mudando assim, o caminho actual do mesmo
                if (GisaDataSetHelper.GetInstance().RelacaoHierarquica.Select(string.Format("ID={0} AND IDUpper={1}", ((GISADataset.NivelRow)listViewItem.Tag).ID, this.nivelNavigator1.ContextBreadCrumbsPathID)).Length > 0)
                {
                    GISADataset.RelacaoHierarquicaRow rhRow = (GISADataset.RelacaoHierarquicaRow)(GisaDataSetHelper.GetInstance().RelacaoHierarquica.Select(string.Format("ID={0} AND IDUpper={1}", ((GISADataset.NivelRow)listViewItem.Tag).ID, this.nivelNavigator1.ContextBreadCrumbsPathID))[0]);

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

                    ArrayList pathEstrut = ControloNivelList.GetCodigoCompletoCaminhoUnico(this.nivelNavigator1.SelectedNode);
                    ArrayList pathDoc    = this.nivelNavigator1.GetCodigoCompletoCaminhoUnico(listViewItem);
                    if (pathDoc.Count == 0 && pathEstrut.Count == 0)
                    {
                        ((frmMain)TopLevelControl).StatusBarPanelHint.Text = string.Format("  {0}", tnrRow.Designacao);
                    }
                    else
                    {
                        ((frmMain)TopLevelControl).StatusBarPanelHint.Text = string.Format("  {0}: {1}/{2}", tnrRow.Designacao, Nivel.buildPath(pathEstrut), Nivel.buildPath(pathDoc));
                    }
                }
                else
                {
                    ((frmMain)TopLevelControl).StatusBarPanelHint.Text = string.Empty;
                }
            }
        }
예제 #4
0
        private void updateContextStatusBar()
        {
            if (!(MasterPanel.isContextPanel(this)) || ((frmMain)TopLevelControl).isSuportPanel)
            {
                return;
            }

            if (CurrentContext.GrupoArquivo == null)
            {
                ((frmMain)TopLevelControl).StatusBarPanelHint.Text = "";
            }
            else
            {
                if (CurrentContext.GrupoArquivo.RowState == DataRowState.Detached)
                {
                    ((frmMain)TopLevelControl).StatusBarPanelHint.Text = string.Empty;
                }
                else
                {
                    ((frmMain)TopLevelControl).StatusBarPanelHint.Text = "  " + CurrentContext.GrupoArquivo.GetNivelDesignadoRows()[0].Designacao;
                }
            }
        }
예제 #5
0
        private void updateContextStatusBar()
        {
            if (!(MasterPanel.isContextPanel(this)) || ((frmMain)TopLevelControl).isSuportPanel)
            {
                return;
            }

            if (CurrentContext.Movimento == null)
            {
                ((frmMain)TopLevelControl).StatusBarPanelHint.Text = "";
            }
            else
            {
                if (CurrentContext.Movimento.RowState == DataRowState.Detached)
                {
                    ((frmMain)TopLevelControl).StatusBarPanelHint.Text = string.Empty;
                }
                else
                {
                    ((frmMain)TopLevelControl).StatusBarPanelHint.Text = "  " + this.NomeMovimento + ": " + CurrentContext.Movimento.MovimentoEntidadeRow.Entidade;
                }
            }
        }
예제 #6
0
        public static void ForceRefresh(GISADataset.RelacaoHierarquicaRowChangeEvent e, MasterPanel mp, frmMain topLevelControl)
        {
            try
            {
                if (!(e.Action == DataRowAction.Add || (e.Action == DataRowAction.Change) || e.Action == DataRowAction.Delete))
                {
                    return;
                }

                // verificar se a row foi realmente editada
                if (e.Action == DataRowAction.Change && !Concorrencia.isModifiedRow(e.Row))
                {
                    return;
                }

                // descartar modificações intermédias de rows (por exemplo, a atribuição de um ID uma nivelRow quando gravada para a BD)
                if (e.Row.NivelRowByNivelRelacaoHierarquica == null || e.Row.NivelRowByNivelRelacaoHierarquicaUpper == null)
                {
                    return;
                }

                // garantir que a alteração occoreu entre duas entidades produtoras
                if (!(e.Row.NivelRowByNivelRelacaoHierarquica.IDTipoNivel == TipoNivel.ESTRUTURAL && (e.Row.NivelRowByNivelRelacaoHierarquicaUpper.IDTipoNivel == TipoNivel.LOGICO || e.Row.NivelRowByNivelRelacaoHierarquicaUpper.IDTipoNivel == TipoNivel.ESTRUTURAL)))
                {
                    return;
                }

                if (!topLevelControl.IsFirstMasterPanelInStack(mp) && topLevelControl.MasterPanelCount == 1)
                {
                    if (mp is INivelNavigatorProvider)
                    {
                        mp.lblFuncao.Text = "Estrutura orgânica";
                        var nav = mp as INivelNavigatorProvider;
                        nav.NivelNavigator.PanelToggleState = NivelNavigator.ToggleState.Estrutural;
                        nav.NivelNavigator.CollapseAllNodes();
                        nav.NivelNavigator.ToggleView(false);
                    }
                    else if (mp is IControloNivelListProvider)
                    {
                        var cnl = mp as IControloNivelListProvider;
                        cnl.ControloNivelList.CollapseAllNodes();
                    }
                }
            }
            catch (Exception ex)
            {
                Debug.Assert(false, ex.ToString());
                Trace.WriteLine(ex);
                throw ex;
            }
        }
예제 #7
0
		public bool IsFirstMasterPanelInStack(MasterPanel panel)
		{
			return Array.IndexOf(MasterPanelStack.ToArray(), panel) == MasterPanelStack.Count - 1;
		}