コード例 #1
0
 private void MasterPanelNivelImagensIlustracao_StackChanged(frmMain.StackOperation stackOperation, bool isSupport)
 {
     switch (stackOperation)
     {
         case frmMain.StackOperation.Push:
             if (!isSupport)
                 nivelGrupoArquivosList1.ReloadList();
             break;
         case frmMain.StackOperation.Pop:
             break;
     }
 }
コード例 #2
0
        private void MasterPanelSeries_StackChanged(frmMain.StackOperation stackOperation, bool isSupport)
        {
            switch (stackOperation)
            {
                case frmMain.StackOperation.Push:
                    this.nivelNavigator1.MultiSelect = false;
                    this.nivelNavigator1.IsParentSupport = isSupport;
                    if (actualizaEstrutura)
                    {
                        resetEstrutura();
                        actualizaEstrutura = false;
                    }

                    if (isSupport)
                    {
                        AddDragHandlers();
                        groupBox1.Visible = false;
                    }
                    //ToolBarButtonFiltro.Pushed = false;
                    //ToolBar_ButtonClick(this, new System.Windows.Forms.ToolBarButtonClickEventArgs(ToolBarButtonFiltro));

                    //this.nivelNavigator1.ClearFiltro();
                    if (this.nivelNavigator1.PanelToggleState == NivelNavigator.ToggleState.Documental && this.nivelNavigator1.ContextBreadCrumbsPathID > 0)
                        this.nivelNavigator1.ReloadList();
                    break;

                case frmMain.StackOperation.Pop:
                    if (isSupport)
                    {
                        RemoveDragHandlers();
                        groupBox1.Visible = true;
                    }
                    //ToolBarButtonFiltro.Pushed = false;
                    //ToolBar_ButtonClick(this, new System.Windows.Forms.ToolBarButtonClickEventArgs(ToolBarButtonFiltro));

                    //this.nivelNavigator1.ClearFiltro();

                    currentUser = null;
                    txtSelectedUser.Text = string.Empty;

                    break;
            }
        }
コード例 #3
0
ファイル: NavigatorHelper.cs プロジェクト: aureliopires/gisa
        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;
            }
        }
コード例 #4
0
 private void MasterPanelAutoEliminacao_StackChanged(frmMain.StackOperation stackOperation, bool isSupport) {
     switch (stackOperation) {
         case frmMain.StackOperation.Push:
             if (!isSupport) {
                 aeList.ReloadList();
             }
             UpdateToolBarButtons();
             break;
         case frmMain.StackOperation.Pop:
             break;
     }
 }
コード例 #5
0
		private void MasterPanelUnidadesFisicas_StackChanged(frmMain.StackOperation stackOperation, bool isSupport)
		{
			switch (stackOperation)
			{
				case frmMain.StackOperation.Push:
					this.ufList.MultiSelectListView = false;
					if (! isSupport)
						ufList.ReloadList();
					this.ufList.ContextNivelRow = null;
					break;
				case frmMain.StackOperation.Pop:
					/*if (! isSupport)
						ufList.reloadList();*/
					break;
			}
		}
コード例 #6
0
ファイル: frmLogin.cs プロジェクト: anvpires/gisa
		private void btnAccept_Click(object sender, System.EventArgs e)
		{

			// A 1ª instancia demora sempre mais tempo, é necessário carregar uma série de dados
			this.Cursor = Cursors.WaitCursor;
			GISADataset ds = GisaDataSetHelper.GetInstance();
			this.Cursor = Cursors.Arrow;

			if (ds == null)
			{
				MessageBox.Show("A base de dados não se encontra disponível, por favor " + Environment.NewLine + "contacte o administrador de sistema.", "Acesso à base de dados", MessageBoxButtons.OK, MessageBoxIcon.Error);
				return;
			}

			frmMain main = null;
			try
			{
				string username = txtUser.Text.Replace("'", "''");
				string assemblyVersion = null;

                string modules = string.Empty;
                foreach(GISADataset.ModulesRow mRow in SessionHelper.AppConfiguration.GetCurrentAppconfiguration().Modules)
                {
                    modules += mRow.ID + ",";
                }
                modules = modules.TrimEnd(',');

                assemblyVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().FullName;
                
                // Validar utilizador
                TrusteeRule.IndexErrorMessages messageIndex = TrusteeRule.IndexErrorMessages.InvalidUser;

                // Carregar o utilizador 
				GISADataset.TrusteeUserRow tuRow = null;
				tuRow = LoadCurrentOperator(username);

                // LDAP Authentication
                string ldapServerName = SessionHelper.AppConfiguration.GetCurrentAppconfiguration().LDAPServerName;
                string ldapSettings = SessionHelper.AppConfiguration.GetCurrentAppconfiguration().LDAPServerSettings;

                if (ldapServerName != null && tuRow != null && tuRow.IsLDAPUser)
                {
                    LDAPHandler ldapH = new LDAPHandler(ldapServerName, ldapSettings, username, txtPassword.Text);
                    ldapH.ConnectToLDAP();

                    if (ldapH.IsLoggedIn)
                    {
                        messageIndex = 0;                        
                    }
                    else
                    {
                        messageIndex = TrusteeRule.IndexErrorMessages.InvalidUser;
                    }
                 
                }
                else
                {
                    messageIndex = Trustee.validateUser(username, CryptographyHelper.GetMD5(txtPassword.Text));
                }
				
				//verificar se ocorreu algum erro no processo de login
				if (messageIndex != 0)
				{
                    GUIHelper.GUIHelper.MessageBoxLoginErrorMessages(Convert.ToInt32(messageIndex));
					throw new LoginException();
				}
				
                // Adicionar o GisaPrincipal
                System.Threading.Thread.CurrentPrincipal = new GisaPrincipal(tuRow);
                                 
                if (SessionHelper.GetGisaPrincipal().TrusteePrivileges.Rows.Count == 0)
                {
                    GUIHelper.GUIHelper.MessageBoxLoginErrorMessages(Convert.ToInt32(DBAbstractDataLayer.DataAccessRules.TrusteeRule.IndexErrorMessages.UserWithoutPermissions));
                    throw new LoginException();
                }
                

				main = new frmMain(username);
			}
			catch (LoginException)
			{
				return;
			}
			catch (Exception ex)
			{
				Trace.WriteLine(ex);
				MessageBox.Show("Ocorreu um erro durante o processo de início da sessão, " + Environment.NewLine + "por favor contacte o administrador de sistema.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
				return;
			}
			this.Hide();
			main.ShowDialog();
			this.Close();
		}
コード例 #7
0
		private void MasterPanelTrustee_StackChanged(frmMain.StackOperation stackOperation, bool isSupport)
		{
			UpdateTrustees();
			UpdateContext();
		}
コード例 #8
0
ファイル: MasterPanel.cs プロジェクト: aureliopires/gisa
		public void DoStackChanged(frmMain.StackOperation stackOperation, bool isSupport)
		{
			if (StackChanged != null)
				StackChanged(stackOperation, isSupport);
		}
コード例 #9
0
		private void MasterPanelControloAut_StackChanged(frmMain.StackOperation stackOperation, bool isSupport)
		{
			switch (stackOperation)
			{
				case frmMain.StackOperation.Push:
                    if (!isSupport)
                    {
                        //caList.ClearFiltro();
                        caList.AllowedNoticiaAutLocked = false;
                        //btnFiltro.Pushed = false;
                        Toolbar_ButtonClick(this, new System.Windows.Forms.ToolBarButtonClickEventArgs(btnFiltro));
                        caList.ReloadList();
                    }
					UpdateToolBarButtons();
					break;
				case frmMain.StackOperation.Pop:
					break;
			}
		}
コード例 #10
0
        private void MasterPanelSeries_StackChanged(frmMain.StackOperation stackOperation, bool isSupport)
        {
            switch (stackOperation)
            {
                case frmMain.StackOperation.Push:
                    this.nivelNavigator1.MultiSelect = true;

                    if (this.nivelNavigator1.PanelToggleState == NivelNavigator.ToggleState.Documental && this.nivelNavigator1.ContextBreadCrumbsPathID > 0)
                        this.nivelNavigator1.ReloadList();
                    break;
                case frmMain.StackOperation.Pop:
                    this.nivelNavigator1.MultiSelect = false;
                    break;
            }
        }