Exemplo n.º 1
0
 private void ResolveUserDelta(DeltaAction action)
 {
     if (action.OldDelta.IsDelete)
     {
         //...and final is delete, delete AD (update sql)
         if (action.NewDelta.IsDelete)
         {
             DeleteUser(action.OldDelta);
         }
         //...and final is insert, update AD (if AD entry exists for username)
         else
         {
             UpdateUser(action.NewDelta);
         }
     }
     //if root is insert...
     else
     {
         //...and final is insert, insert AD
         if (!action.NewDelta.IsDelete)
         {
             CreateUser(action.NewDelta);
         }
         //...and final is delete, there's nothing to do
     }
 }
Exemplo n.º 2
0
        public void Process()
        {
            int now = EB.Time.Now;

            if (now > end)
            {
                need_dispose = true;
            }
            if (now < start)
            {
                return;
            }
            if (now >= next_action_time)
            {
                next_action_time = EB.Time.Now + delta;
                try
                {
                    Type        type   = Type.GetType(action);
                    object      obj    = Activator.CreateInstance(type);
                    DeltaAction Action = (DeltaAction)obj;
                    Action.Excute(data);
                }
                catch (Exception e)
                {
                    EB.Debug.Log(e.StackTrace);
                    need_dispose = true;
                }
            }
        }
 public List <TransactionDelta> GetDeltaByAction(DeltaAction action)
 {
     return(_deltas.Where(t => t.Action == action).ToList());
 }
        private void SetAction(BasicTransaction transaction, BasicTransaction targetTransaction, DeltaAction action)
        {
            var transactionLookupKey = (transaction ?? targetTransaction).GetBankTransactionLookupKey();
            var transactionDelta     = new TransactionDelta
            {
                DeltaKey     = transactionLookupKey,
                Source       = transaction,
                Target       = targetTransaction,
                Action       = action,
                CreationDate = DateTime.Now
            };

            AddDelta(transactionDelta);
        }