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 }); } }
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 }); } }
public void RemoveItem(SaleItemViewModel item) { UpdateQuantity(item, -1); }
public void AddItem(SaleItemViewModel item) { UpdateQuantity(item, 1); }
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 }); }
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 }); }