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!"); } }
protected virtual void OnPurchaseCreated() { CreateNotification(EventActionType.Created); PurchaseCreated?.Invoke(this, new NewNotificationEventArgs(this)); }
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); } }