public bool IncludeMeasure(AlertMeasure am, MeasuredParameter mp) { if (am == null) { throw new ArgumentNullException("Invalid alert measure parameter. Cannot be null."); } if (mp == null) { throw new ArgumentNullException("Invalid measured parameter argument. Cannot be null."); } IDictionaryEnumerator ide = GetEnumerator(); while (ide.MoveNext()) { AccountAlertFilter aaf = (AccountAlertFilter)ide.Value; if (aaf.MeasureID == am.AlertMeasureID) { //This is the measure we want to check the filter of. if (aaf.MatchesFilter(am, mp)) { return(true); } } } return(false); }
private void Fill(int accountID) { DataManager.ConnectionString = AppSettings.GetAbsolute("Easynet.Edge.Core.Workflow.AlertConnectionString"); //Create the command. using (DataManager.Current.OpenConnection()) { string sql = "SELECT * FROM AccountMeasureFilters"; if (accountID > 0) { sql += " WHERE AccountID = " + accountID.ToString(); } SqlCommand filters = DataManager.CreateCommand(sql); SqlDataReader dr = filters.ExecuteReader(); while (dr.Read()) { AccountAlertFilter aaf = new AccountAlertFilter(dr); Add(aaf.RowID, aaf); } dr.Close(); dr.Dispose(); } }
public AccountAlertFilter GetFilter(AlertMeasure am) { IDictionaryEnumerator ide = GetEnumerator(); while (ide.MoveNext()) { AccountAlertFilter aaf = (AccountAlertFilter)ide.Value; if (aaf.MeasureID == am.AlertMeasureID) { return(aaf); } } return(null); }
public bool ContainsMeasure(AlertMeasure am) { if (am == null) { throw new ArgumentNullException("Invalid alert measure parameter. Cannot be null."); } IDictionaryEnumerator ide = GetEnumerator(); while (ide.MoveNext()) { AccountAlertFilter aaf = (AccountAlertFilter)ide.Value; if (aaf.MeasureID == am.AlertMeasureID) { return(true); } } return(false); }