Esempio n. 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
                });
            }
        }
Esempio n. 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
                });
            }
        }
Esempio n. 3
0
 public void RemoveItem(SaleItemViewModel item)
 {
     UpdateQuantity(item, -1);
 }
Esempio n. 4
0
 public void AddItem(SaleItemViewModel item)
 {
     UpdateQuantity(item, 1);
 }
Esempio n. 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 });
        }
Esempio n. 6
0
 public void RemoveItem(SaleItemViewModel item)
 {
     UpdateQuantity(item, -1);
 }
Esempio n. 7
0
 public void AddItem(SaleItemViewModel item)
 {
     UpdateQuantity(item, 1);
 }
Esempio n. 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 });
        }