Ejemplo n.º 1
0
 private void OnAccountClosed(AccountClosed evt)
 {
     try
     {
         var accountsTracks = new List <AccountTrackInfo>();
         var adGroupIds     = new List <int>();
         AccountTrackInfo accountTrackInfo = null;
         foreach (var pair in evt.AccountsSpends)
         {
             accountTrackInfo = new AccountTrackInfo
             {
                 AccountID   = Utilities.GetAccountID(pair.Key),
                 LastSpend   = pair.Value,
                 SpendDate   = evt.ClosedDate,
                 AccountType = Utilities.GetAccountType(pair.Key)
             };
             accountsTracks.Add(accountTrackInfo);
             if (accountTrackInfo.AccountType == AccountType.AdGroup)
             {
                 adGroupIds.Add(accountTrackInfo.AccountID);
             }
         }
         _repository.PersistAccountTrackInfos(accountsTracks);
         TriggerUpdateAdStatusEvents(adGroupIds, evt.ClosedReason);
     }
     catch (Exception ex)
     {
         _log.Error(ex);
     }
 }
Ejemplo n.º 2
0
        private void OnAccountClosed(AccountClosed evt)
        {
            if (AdGroupDeactivated == null)
            {
                return;
            }
            var adgroupsIds = new List <int>();

            foreach (var pair in evt.AccountsSpends)
            {
                var adgroupId = Utilities.TryGetAdgroupId(pair.Key);
                if (adgroupId.HasValue)
                {
                    adgroupsIds.Add(adgroupId.Value);
                }
            }
            AdGroupDeactivated(adgroupsIds);
        }
Ejemplo n.º 3
0
        public void EnactCommand(CloseAccount command)
        {
            var created = new AccountClosed();

            RecordEvent(created);
        }
Ejemplo n.º 4
0
        public void Handle(AccountClosed c)
        {
            var account = _search.SelectAccountSummary(c.AggregateIdentifier);

            _store.UpdateAccountStatus(account.AccountIdentifier, "Closed");
        }
 private void Apply(AccountClosed @event)
 {
     _status = Closed;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Apply account closed state changes.
 /// </summary>
 /// <param name="e">The account closed event.</param>
 protected void Apply(AccountClosed e)
 {
     Status = e.Status;
 }
Ejemplo n.º 7
0
 public void Handle(AccountClosed e)
 {
 }
Ejemplo n.º 8
0
 private static void accountClosedHandler()
 {
     AccountClosed?.Invoke(account, new EventArgs());
     //if (AccountClosed != null)
     //    AccountClosed(account, new EventArgs());
 }
Ejemplo n.º 9
0
 private static void accountClosedHandler()
 {
     AccountClosed?.Invoke(account, new EventArgs());
 }