private void m_btnFrequente_Click(object sender, EventArgs e) { CFormListeAlarms form = new CFormListeAlarms(GetFrequentAlarms()); m_navigateur.AffichePage(form); }
private void m_lnkHistoriqueEvenements_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { List <CReferenceObjetDonnee> lst = CBasePourVueAnimee.GetTousLesConcernesSpv(SchemaReseau); Dictionary <int, bool> dicIdsSitesSpv = new Dictionary <int, bool>(); Dictionary <int, bool> dicIdsLiaisons = new Dictionary <int, bool>(); Dictionary <int, bool> dicIdsEquips = new Dictionary <int, bool>(); foreach (CReferenceObjetDonnee reference in lst) { Dictionary <int, bool> dic = null; if (reference.TypeObjet == typeof(CSpvSite)) { dic = dicIdsSitesSpv; } if (reference.TypeObjet == typeof(CSpvLiai)) { dic = dicIdsLiaisons; } if (reference.TypeObjet == typeof(CSpvEquip)) { dic = dicIdsEquips; } if (dic != null) { dic[(int)reference.ClesObjet[0]] = true; } } StringBuilder blIdsSites = new StringBuilder(); foreach (int nId in dicIdsSitesSpv.Keys) { blIdsSites.Append(nId); blIdsSites.Append(','); } StringBuilder blIdsLiens = new StringBuilder(); foreach (int nId in dicIdsLiaisons.Keys) { blIdsLiens.Append(nId); blIdsLiens.Append(','); } StringBuilder blIdsEquip = new StringBuilder(); foreach (int nId in dicIdsEquips.Keys) { blIdsEquip.Append(nId); blIdsEquip.Append(','); } string strFiltre = ""; if (blIdsSites.Length > 0) { blIdsSites.Remove(blIdsSites.Length - 1, 1); strFiltre = CSpvAlarmeDonnee.c_champSITE_ID + " in (" + blIdsSites.ToString() + ")"; } if (blIdsLiens.Length > 0) { blIdsLiens.Remove(blIdsLiens.Length - 1, 1); if (strFiltre.Length > 0) { strFiltre += " or "; } strFiltre += CSpvAlarmeDonnee.c_champLIAI_ID + " in (" + blIdsLiens.ToString() + ")"; } if (blIdsEquip.Length > 0) { blIdsEquip.Remove(blIdsEquip.Length - 1, 1); if (strFiltre.Length > 0) { strFiltre += " or "; } strFiltre += CSpvAlarmeDonnee.c_champEQUIP_ID + " in (" + blIdsEquip.ToString() + ")"; } CFiltreData filtre = null; if (strFiltre.Length == 0) { filtre = new CFiltreDataImpossible(); } else { filtre = new CFiltreData(strFiltre); } CListeObjetsDonnees lstAlarmes = new CListeObjetsDonnees(SchemaReseau.ContexteDonnee, typeof(CSpvAlarmeDonnee), filtre); IFormNavigable formNavigable = FindForm() as IFormNavigable; if (formNavigable != null && formNavigable.Navigateur != null) { CFormListeAlarms form = new CFormListeAlarms(lstAlarmes); formNavigable.Navigateur.AffichePage(form); } }