private void invoiceDataGrid_Click(object sender, RoutedEventArgs e)
        {
            DataGrid dg = (DataGrid)sender;
            if(dg.CurrentCell.Column.DisplayIndex == 11)
            {       
                List<Invoice> selectedInvoiceList = new List<Invoice>();
                selectedInvoiceList.Add((Invoice)dg.SelectedItem);
                PaymentEntryWindow pew = new PaymentEntryWindow(vendorList, selectedInvoiceList);
                bool? result = pew.ShowDialog();
                //if(result)
            }

        }
 private void enterPaymentButton_Click(object sender, RoutedEventArgs e)
 {
     int rij = invoiceDataGrid.SelectedIndex;
     Invoice invoice = invoiceList[rij];
     PaymentEntryWindow pew = new PaymentEntryWindow(vendorList,invoiceList);
     pew.ShowDialog();
     if (pew.DialogResult.HasValue && pew.DialogResult.Value)
     {
         if (invoiceList[0].BalanceDue == 0)
         {
             invoiceViewSource.Source = invoiceList;
         }
         else
         {
             this.GetVendorList();
             this.GetVendorData();
         }
     }
 }