Exemplo n.º 1
0
        private void EditInvoiceButton_Click(object sender, RoutedEventArgs e)
        {
            InvoiceWindow invoiceWindow = new InvoiceWindow(this.invoice);

            invoiceWindow.ShowDialog();
            GetInvoiceWithCildren();
        }
        public EDITEditInvoiceItemWindow(InvoiceItem invoiceItem, InvoiceWindow invoiceWindow)
        {
            InitializeComponent();

            this.invoiceItem   = invoiceItem;
            this.invoiceWindow = invoiceWindow;
            this.DataContext   = this.invoiceItem;

            quantityBox.KeyDown           += QuantityBox_KeyDown;
            deleteInvoiceItemButton.Click += DeleteInvoiceItemButton_Click;
            updateQuantityButton.Click    += UpdateQuantityButton_Click;
        }
Exemplo n.º 3
0
 private void AddToInvoiceButton_Click(object sender, RoutedEventArgs e)
 {
     foreach (Window window in Application.Current.Windows)
     {
         if (window.GetType() == typeof(InvoiceWindow))
         {
             this.invoiceWindow = (window as InvoiceWindow);
         }
     }
     invoiceItem = new InvoiceItem()
     {
         ItemId   = this.itemToAdd.Id,
         Item     = this.itemToAdd,
         Quantity = int.Parse(quantityBox.Text)
     };
     invoiceWindow.invoice.InvoiceItems.Add(invoiceItem);
     Close();
 }