public void Add(Alert pAlert) { AddAlert(pAlert); }
private void AddAlert(Alert pAlert) { if(!_list.ContainsKey(pAlert.LoanId)) _list.Add(pAlert.LoanId,pAlert); else { Alert alert = _list[pAlert.LoanId] as Alert; decimal amount = alert.Amount.Value + pAlert.Amount.Value; if(alert.EffectDate > pAlert.EffectDate) { _list.Remove(pAlert.LoanId); pAlert.Amount = amount; _list.Add(pAlert.LoanId,pAlert); } else (_list[pAlert.LoanId] as Alert).Amount = amount; } }