Beispiel #1
0
        protected void UpdateQuantity(SaleItemViewModel item, int value)
        {
            var totalQuantity = TotalQuantity;

            item.Quantity += value;

            NotifyOfPropertyChange(() => CanCheckout);
            NotifyOfPropertyChange(() => TotalQuantity);
            NotifyOfPropertyChange(() => Total);
            NotifyOfPropertyChange(() => TotalText);

            if (totalQuantity == 0 && value > 0)
            {
                EventAggregator.Publish(new TransactionStarted {
                    Source = this
                });
            }

            if (TotalQuantity == 0)
            {
                EventAggregator.Publish(new TransactionStopped {
                    Source = this
                });
            }
        }
Beispiel #2
0
        protected void UpdateQuantity(SaleItemViewModel item, int value)
        {
            var canComplete = CanComplete;

            item.Quantity += value;

            NotifyOfPropertyChange(() => CanComplete);
            NotifyOfPropertyChange(() => TotalQuantity);
            NotifyOfPropertyChange(() => Total);
            NotifyOfPropertyChange(() => TotalText);

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

            if (canComplete && !CanComplete)
            {
                EventAggregator.Publish(new TransactionStopped {
                    Source = this
                });
            }
        }
Beispiel #3
0
 public void RemoveItem(SaleItemViewModel item)
 {
     UpdateQuantity(item, -1);
 }
Beispiel #4
0
 public void AddItem(SaleItemViewModel item)
 {
     UpdateQuantity(item, 1);
 }
Beispiel #5
0
        protected void UpdateQuantity(SaleItemViewModel item, int value)
        {
            var totalQuantity = TotalQuantity;

            item.Quantity += value;

            NotifyOfPropertyChange(() => CanCheckout);
            NotifyOfPropertyChange(() => TotalQuantity);
            NotifyOfPropertyChange(() => Total);
            NotifyOfPropertyChange(() => TotalText);

            if (totalQuantity == 0 && value > 0)
                EventAggregator.Publish(new TransactionStarted { Source = this });

            if (TotalQuantity == 0)
                EventAggregator.Publish(new TransactionStopped { Source = this });
        }
Beispiel #6
0
 public void RemoveItem(SaleItemViewModel item)
 {
     UpdateQuantity(item, -1);
 }
Beispiel #7
0
 public void AddItem(SaleItemViewModel item)
 {
     UpdateQuantity(item, 1);
 }
Beispiel #8
0
        protected void UpdateQuantity(SaleItemViewModel item, int value)
        {
            var canComplete = CanComplete;

            item.Quantity += value;

            NotifyOfPropertyChange(() => CanComplete);
            NotifyOfPropertyChange(() => TotalQuantity);
            NotifyOfPropertyChange(() => Total);
            NotifyOfPropertyChange(() => TotalText);

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

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