Esempio n. 1
0
 private void ConfirmButton_Click(object sender, RoutedEventArgs e)
 {
     if (purchase.ItemsAmount > 0)
     {
         PurchaseDB.Add(purchase);
         PurchaseCreated?.Invoke(purchase);
         Close();
     }
     else
     {
         MessageBox.Show("Goods list is empty!");
     }
 }
Esempio n. 2
0
 protected virtual void OnPurchaseCreated()
 {
     CreateNotification(EventActionType.Created);
     PurchaseCreated?.Invoke(this, new NewNotificationEventArgs(this));
 }
Esempio n. 3
0
        private void When(PurchaseCreated e)
        {
            CustomerId = e.CustomerId;
            VoucherId = e.VoucherId;
            TotalPrice = e.TotalPrice;
            Status = PurchaseStatus.Created;
            _items = new List<PurchaseItem>();

            foreach(var item in e.Items)
            {
                _items.Add(item);
            }
        }