public virtual void Add(TurnoverDbRow r) { r.WriteToLog(this.log); TurnoverTargetMetaData t = FindTarget(r); t.Add(r, 1, 3, 6, 12); if (OnNewDataAdded != null) { OnNewDataAdded(); } } // Add
} // IsValid public static void Add(this TurnoverTargetMetaData meta, TurnoverDbRow row, params int[] monthCountList) { if (!meta.IsValid()) { return; } foreach (int monthCount in monthCountList) { if (row.MonthCount > monthCount) { continue; } if (meta.Target.ContainsKey(monthCount)) { meta.Target[monthCount].Add(row); } else { meta.Target[monthCount] = meta.CreateItem(row); } } // for } // Add
public static bool IsValid(this TurnoverTargetMetaData meta) { return((meta != null) && (meta.Target != null) && meta.HasItemCreator); } // IsValid