Пример #1
0
        public ChangeAgreementEvent CreateChangeAgreementEvent(int agrId, Dictionary <string, int> changes, int valeur)
        {
            if (!Agreements.Any(x => x.Id.Equals(agrId)))
            {
                return(null);
            }
            var ce = new ChangeAgreementEvent(agrId, changes, valeur);

            AgreementEvents.Add(ce);
            return(ce);
        }
Пример #2
0
 private static void HandleMessage(object sender, NotifyCollectionChangedEventArgs e)
 {
     foreach (var msg in e.NewItems)
     {
         var changeEvent = AgreementEvents.Single(x => x.Id.Equals(((Message)msg).EventId));
         var ccs         = CoverCollections.Where(x => x.AgreementId.Equals(changeEvent.AgreementId));
         foreach (var cc in ccs)
         {
             DoCalculations(cc.Id, changeEvent.ValeurDate);
         }
     }
 }