private void ToggleControloAutoridade(bool showIt) { if (showIt) { if (! (((frmMain)this.TopLevelControl).isSuportPanel)) { // Make sure the button is pushed MultiPanel.ToolBarButtonAuxList.Pushed = true; // Indicação que um painel está a ser usado como suporte ((frmMain)this.TopLevelControl).isSuportPanel = true; // Show the panel with all controlos autoridade ((frmMain)this.TopLevelControl).PushMasterPanel(typeof(MasterPanelControloAut)); MasterPanelControloAut master = (MasterPanelControloAut)(((frmMain)this.TopLevelControl).MasterPanel); master.caList.AllowedNoticiaAut(TipoNoticiaAut.Ideografico, TipoNoticiaAut.Onomastico, TipoNoticiaAut.ToponimicoGeografico); master.caList.AllowedNoticiaAutLocked = true; master.caList.ReloadList(); master.UpdateSupoortPanelPermissions("GISA.FRDCATipologiaInformacional"); master.UpdateToolBarButtons(); } } else { // Make sure the button is not pushed MultiPanel.ToolBarButtonAuxList.Pushed = false; // Remove the panel with all controlos autoridade if (this.TopLevelControl != null) { if (((frmMain)this.TopLevelControl). MasterPanel is MasterPanelControloAut) { // Indicação que um painel está a ser usado como suporte ((frmMain)this.TopLevelControl).isSuportPanel = false; //TODO: INSTANT C# TODO TASK: The return type of the tempWith2 variable must be corrected. //ORIGINAL LINE: With DirectCast(DirectCast(this.TopLevelControl, frmMain). MasterPanel, MasterPanelControloAut) MasterPanelControloAut tempWith2 = (MasterPanelControloAut)(((frmMain)this.TopLevelControl).MasterPanel); tempWith2.caList.AllowedNoticiaAutLocked = false; ((frmMain)this.TopLevelControl).PopMasterPanel(typeof(MasterPanelControloAut)); } } } }
private void ToggleControloAutoridade(bool showIt) { if (showIt) { if (!(((frmMain)this.TopLevelControl).isSuportPanel)) { // Make sure the button is pushed MultiPanel.ToolBarButtonAuxList.Pushed = true; // Indicação que um painel está a ser usado como suporte ((frmMain)this.TopLevelControl).isSuportPanel = true; // Show the panel with all notícias autoridade ((frmMain)this.TopLevelControl).PushMasterPanel(typeof(MasterPanelControloAut)); MasterPanelControloAut master = (MasterPanelControloAut)(((frmMain)this.TopLevelControl).MasterPanel); master.caList.AllowedNoticiaAut(TipoNoticiaAut.TipologiaInformacional); master.caList.AllowedNoticiaAutLocked = true; master.caList.ReloadList(); master.UpdateSupoortPanelPermissions("GISA.FRDCAConteudo"); master.UpdateToolBarButtons(); } } else { // Make sure the button is not pushed MultiPanel.ToolBarButtonAuxList.Pushed = false; // Remove the panel with all notícias autoridade if (this.TopLevelControl != null) { if (((frmMain)this.TopLevelControl).MasterPanel is MasterPanelControloAut) { // Indicação que um painel está a ser usado como suporte ((frmMain)this.TopLevelControl).isSuportPanel = false; MasterPanelControloAut tempWith2 = (MasterPanelControloAut)(((frmMain)this.TopLevelControl).MasterPanel); tempWith2.caList.AllowedNoticiaAutLocked = false; ((frmMain)this.TopLevelControl).PopMasterPanel(typeof(MasterPanelControloAut)); } } } }
public override void ModelToView() { IsPopulated = false; lstVwRelacoes.Items.Clear(); // Apresentar relações não hierarquicas string carId = CurrentControloAut.ID.ToString(); QueryFilter = "IDControloAut=" + carId + " OR IDControloAutAlias=" + carId; foreach (GISADataset.ControloAutRelRow caRel in GisaDataSetHelper.GetInstance().ControloAutRel.Select(QueryFilter, "InicioAno, InicioMes, InicioDia, FimAno, FimMes, FimDia")) { if (caRel.TipoControloAutRelRow.ID != Convert.ToInt64(TipoControloAutRel.Instituicao)) //System.Enum.Format(GetType(TipoControloAutRel), TipoControloAutRel.Instituicao, "D") Then { GISADataset.ControloAutRow OtherControloAut = null; if (caRel.ControloAutRowByControloAutControloAutRelAlias.ID != CurrentControloAut.ID) { OtherControloAut = caRel.ControloAutRowByControloAutControloAutRelAlias; } else { OtherControloAut = caRel.ControloAutRowByControloAutControloAutRel; } foreach (GISADataset.ControloAutDicionarioRow cad in OtherControloAut.GetControloAutDicionarioRows()) { if (cad.IDTipoControloAutForma == Convert.ToInt64(TipoControloAutForma.FormaAutorizada)) { ListViewItem tempWith1 = lstVwRelacoes.Items.Add(cad.DicionarioRow.Termo); tempWith1.Tag = caRel; if (cad.ControloAutRow.IsChaveColectividadeNull()) { tempWith1.SubItems.Add(string.Empty); } else { tempWith1.SubItems.Add(cad.ControloAutRow.ChaveColectividade); } string rezDesTipoRel = null; if (caRel.ControloAutRowByControloAutControloAutRelAlias.ID != CurrentControloAut.ID) { rezDesTipoRel = caRel.TipoControloAutRelRow.DesignacaoInversa; } else { rezDesTipoRel = caRel.TipoControloAutRelRow.Designacao; } tempWith1.SubItems.Add(rezDesTipoRel); tempWith1.SubItems.Add(GUIHelper.GUIHelper.FormatStartDate(caRel)); tempWith1.SubItems.Add(GUIHelper.GUIHelper.FormatEndDate(caRel)); tempWith1.SubItems.Add(GUIHelper.GUIHelper.ClipText(caRel.Descricao)); } } } } // Apresentar relações hierarquicas GISADataset.NivelRow nRow = null; GISADataset.NivelControloAutRow[] ncaRows = null; GISADataset.NivelControloAutRow ncaRow = null; ncaRows = CurrentControloAut.GetNivelControloAutRows(); if (ncaRows.Length == 0) { MasterPanelControloAut.CreateAssociatedNivel(CurrentControloAut, ref nRow, ref ncaRow); try { PersistencyHelper.save(); PersistencyHelper.cleanDeletedData(); } catch (Exception ex) { Trace.WriteLine(ex); throw; } } else { ncaRow = ncaRows[0]; nRow = ncaRow.NivelRow; } foreach (GISADataset.RelacaoHierarquicaRow rhRow in GisaDataSetHelper.GetInstance().RelacaoHierarquica.Select(string.Format("ID={0} OR IDUpper={0}", nRow.ID), "InicioAno, InicioMes, InicioDia, FimAno, FimMes, FimDia")) { // Só adicionar relações hierárquicas existentes entre níveis estruturais. Este teste não seria suficiente no caso de existirem níveis estruturais orgânicos relacionados com níveis estruturais temático-funcionais, mas tal não poderá acontecer em qualquer situação. if (rhRow.NivelRowByNivelRelacaoHierarquica.TipoNivelRow.ID == TipoNivel.ESTRUTURAL && rhRow.NivelRowByNivelRelacaoHierarquicaUpper.TipoNivelRow.ID == TipoNivel.ESTRUTURAL) { GISADataset.ControloAutRow caRow = null; caRow = rhRow.NivelRowByNivelRelacaoHierarquica.GetNivelControloAutRows()[0].ControloAutRow; // Se estivermos a ver o extremo errado da relação hierarquica trocamos para o outro extremo if (CurrentControloAut == caRow) { caRow = rhRow.NivelRowByNivelRelacaoHierarquicaUpper.GetNivelControloAutRows()[0].ControloAutRow; } GISADataset.ControloAutDicionarioRow cadRow = null; cadRow = ControloAutHelper.getFormaAutorizada(caRow); ListViewItem newItem = lstVwRelacoes.Items.Add(cadRow.DicionarioRow.Termo); newItem.Tag = rhRow; AddRelacaoHierarquicaToList(newItem); } } RefreshButtonState(); PopulateDescricaoText(); IsPopulated = true; }