示例#1
0
 public void Add(Alert pAlert)
 {
     AddAlert(pAlert);
 }
示例#2
0
        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;
            }
        }