//------------------------------------- private void m_lnkReset_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { if (MessageBox.Show(I.T("This action will reset the entire survey. Are you sure ?|20042"), "", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { CListeEntitesDeMemoryDb <CReleveEquipement> lstEqpts = m_releve.RelevesEquipement; lstEqpts.Filtre = new CFiltreMemoryDb(CReleveEquipement.c_champIdContenant + " is null"); CResultAErreur result = CResultAErreur.True; foreach (CReleveEquipement releve in lstEqpts.ToArray()) { result = releve.Delete(); if (!result) { break; } } if (!result) { CFormAlerte.Afficher(result.Erreur); } else { m_releve.DateReleve = DateTime.Now; m_releve.InitEquipementsReleves(); InitForm(); } } }
//------------------------------------------------------- public void ClearRelevesEquipements() { CListeEntitesDeMemoryDb <CReleveEquipement> lst = RelevesEquipement; lst.Filtre = new CFiltreMemoryDb(CReleveEquipement.c_champIdContenant + " is null"); foreach (CReleveEquipement releve in lst.ToArray()) { releve.Delete(); } }
//------------------------------------------------------------------ public CAgentSnmpPourSupervision[] GetAgentsFromKey(CTrapInstance trap) { CListeEntitesDeMemoryDb <CAgentSnmpPourSupervision> lstAgents = new CListeEntitesDeMemoryDb <CAgentSnmpPourSupervision>(Database); if (FormuleCleSpecifique != null) { CContexteEvaluationExpression ctx = new CContexteEvaluationExpression(trap); CResultAErreur result = FormuleCleSpecifique.Eval(ctx); if (result && result.Data != null && result.Data is string) { lstAgents.Filtre = new CFiltreMemoryDb( CAgentSnmpPourSupervision.c_champTrapsIp + " like @1", "%," + (string)result.Data + ",%"); return(lstAgents.ToArray()); } } return(new CAgentSnmpPourSupervision[] { }); }
private void m_btnAficherMasque_Click(object sender, EventArgs e) { CListeEntitesDeMemoryDb <CLocalCategorieMasquageAlarme> listeCategoriesMask = new CListeEntitesDeMemoryDb <CLocalCategorieMasquageAlarme>(m_dataBase); listeCategoriesMask.Sort = CLocalCategorieMasquageAlarme.c_champPriorite; CFiltreMemoryDb filtre = GetFiltreMasquage(null); CFormSelectNiveauMasquagePopup form = new CFormSelectNiveauMasquagePopup(); form.Init(listeCategoriesMask.ToArray(), m_lastCategorieMasquage); form.Left = MousePosition.X; form.Top = MousePosition.Y; DialogResult reponse = form.ShowDialog(); switch (reponse) { case DialogResult.OK: m_lastCategorieMasquage = form.ElementSelectionne; filtre = GetFiltreMasquage(m_lastCategorieMasquage); m_btnAficherMasque.Text = m_lastCategorieMasquage.Libelle; break; case DialogResult.No: m_lastCategorieMasquage = null; filtre = GetFiltreMasquage(null); m_btnAficherMasque.Text = I.T("Masked Alarms|10312"); break; case DialogResult.Cancel: return; default: return; } m_tableauAlarmesEnCours.FiltreAlarmes = filtre; m_tableauAlarmesRetombees.FiltreAlarmes = filtre; }
private void m_btnAficherMasque_Click(object sender, EventArgs e) { CListeEntitesDeMemoryDb <CLocalCategorieMasquageAlarme> listeCategoriesMask = new CListeEntitesDeMemoryDb <CLocalCategorieMasquageAlarme>(m_basePourVue.DataBase); listeCategoriesMask.Sort = CLocalCategorieMasquageAlarme.c_champPriorite; CFormSelectNiveauMasquagePopup form = new CFormSelectNiveauMasquagePopup(); form.Init(listeCategoriesMask.ToArray(), m_lastCategorieSelectionnee); form.Left = MousePosition.X; form.Top = MousePosition.Y; DialogResult reponse = form.ShowDialog(); switch (reponse) { case DialogResult.OK: // Masquer jusqu'au niveau demandé m_lastCategorieSelectionnee = form.ElementSelectionne; m_btnAficherMasque.Text = m_lastCategorieSelectionnee.Libelle; m_controleSchema.NiveauMasquageMaxAffiche = m_lastCategorieSelectionnee.Priorite; break; case DialogResult.No: // Masquer tout m_lastCategorieSelectionnee = null; m_btnAficherMasque.Text = I.T("Masked Alarms|10312"); m_controleSchema.NiveauMasquageMaxAffiche = 0; break; case DialogResult.Cancel: return; default: return; } }