/// <summary> /// /// </summary> /// <param name="temp"></param> private void setLevel(Messaggio temp) { switch (temp.Livello) { case LivelloMessaggio.CRITICAL: CriticalNumber++; break; case LivelloMessaggio.WARNING: WarningNumber++; break; case LivelloMessaggio.INFO: InfoNumber++; break; case LivelloMessaggio.ERROR: ErrorNumber++; break; case LivelloMessaggio.APPLICATION: ApplicationNumber++; break; case LivelloMessaggio.MAPPER_ERROR: MapperErrorNumber++; break; case LivelloMessaggio.DETAILS: DetailsNumber++; break; default: throw new Exception("Errore Nella codifica del messaggio"); } if (temp.Livello != LivelloMessaggio.MAPPER_ERROR && temp.Livello != LivelloMessaggio.APPLICATION) { if (mostCriticalLevel > temp.Livello) { mostCriticalLevel = temp.Livello; } if (lessCriticalLevel < temp.Livello) { mostCriticalLevel = temp.Livello; } } if (temp.Livello == LivelloMessaggio.APPLICATION) { if (mostCriticalLevel > temp.Livello) { mostCriticalLevel = LivelloMessaggio.CRITICAL; } if (lessCriticalLevel < temp.Livello) { mostCriticalLevel = LivelloMessaggio.CRITICAL; } } }
/*---------------------------------------*/ /// <summary> /// /// </summary> /// <param name="rowsMessaggi"></param> protected void fill(object[] rowMessaggi) { messageNumber = rowMessaggi.Length; this.messaggi = new List <Messaggio>(); foreach (object r in rowMessaggi) { Messaggio temp = buildMessaggio(r); this.messaggi.Add(temp); setLevel(temp); } }
/*---------------------------------------*/ #endregion #region Protected Methods /* temporaneo da mettere a posto sui crab*/ /// <summary> /// /// </summary> /// <param name="rowsMessaggi"></param> protected internal void fill(System.Data.DataRow[] rowsMessaggi) { messageNumber = rowsMessaggi.Length; List <Messaggio> resp = new List <Messaggio>(); foreach (System.Data.DataRow r in rowsMessaggi) { Messaggio temp = new Messaggio(r); resp.Add(new Messaggio(r)); setLevel(temp); } this.messaggi = resp; }
/// <summary> /// /// </summary> /// <param name="messaggio"></param> /// <returns></returns> public bool getFirstMessage(out Messaggio messaggio) { messaggio = null; foreach (Messaggio m in messaggi) { if (!(m.Codice == "000373" && m.Livello == LivelloMessaggio.APPLICATION)) { messaggio = m; return(true); } } return(false); }
/// <summary> /// /// </summary> /// <param name="codice"></param> /// <param name="messaggio"></param> /// <returns></returns> public bool getFirstMessage(string codice, out Messaggio messaggio) { messaggio = null; foreach (Messaggio m in messaggi) { if (m.Codice == codice) { messaggio = m; return(true); } } return(false); }
/// <summary> /// /// </summary> /// <param name="m"></param> /// <param name="l"></param> public void AddMessage(Com.Delta.Messaging.MapperMessages.Messaggio m, Com.Delta.Messaging.MapperMessages.LivelloMessaggio l) { messageList.Add(new message(decodeMapperMessage(m), l)); }