Example #1
0
        protected void UpdateQuantity(TransactionItemViewModel item, int value)
        {
            var canComplete = CanCompleteLoan;

            item.Quantity += value;

            NotifyOfPropertyChange(() => CanCompleteLoan);
            NotifyOfPropertyChange(() => Total);
            NotifyOfPropertyChange(() => TotalText);

            if (!canComplete && CanCompleteLoan)
            {
                EventAggregator.Publish(new TransactionStarted {
                    Source = this
                });
            }

            if (canComplete && !CanCompleteLoan)
            {
                EventAggregator.Publish(new TransactionStopped {
                    Source = this
                });
            }
        }
Example #2
0
 public void AddItem(TransactionItemViewModel item)
 {
     UpdateQuantity(item, 1);
 }
Example #3
0
 public void RemoveItem(TransactionItemViewModel item)
 {
     UpdateQuantity(item, -1);
 }
Example #4
0
        protected void UpdateQuantity(TransactionItemViewModel item, int value)
        {
            var canComplete = CanCompleteLoan;

            item.Quantity += value;

            NotifyOfPropertyChange(() => CanCompleteLoan);
            NotifyOfPropertyChange(() => Total);
            NotifyOfPropertyChange(() => TotalText);

            if (!canComplete && CanCompleteLoan)
                EventAggregator.Publish(new TransactionStarted { Source = this });

            if (canComplete && !CanCompleteLoan)
                EventAggregator.Publish(new TransactionStopped { Source = this });
        }
Example #5
0
 public void RemoveItem(TransactionItemViewModel item)
 {
     UpdateQuantity(item, -1);
 }
Example #6
0
 public void AddItem(TransactionItemViewModel item)
 {
     UpdateQuantity(item, 1);
 }