private void addInvoiceToolStripMenuItem_Click(object sender, EventArgs e) { // retrieve the current Vendor Vendor vendor = (Vendor)vendorBindingSource.Current; // display add Invoice form frmAddInvoice frmChild = new frmAddInvoice(); frmChild.vendor = vendor; this.AddOwnedForm(frmChild); frmChild.ShowDialog(); }
private void btnAddInvoice_Click(object sender, EventArgs e) { if (txtVendorID.Text == "") { MessageBox.Show("You must select a vendor.", "Entry Error"); } else { frmAddInvoice addInvoiceForm = new frmAddInvoice(); addInvoiceForm.vendor = vendor; DialogResult result = addInvoiceForm.ShowDialog(); if (result == DialogResult.OK) { invoiceList.Add(addInvoiceForm.payable.Invoice); cm.Refresh(); } } }