Ejemplo n.º 1
0
        private void btnAddVendor_Click(object sender, EventArgs e)
        {
            frmAddModifyVendor addModifyVendorForm = new frmAddModifyVendor();

            addModifyVendorForm.addVendor = true;
            DialogResult result = addModifyVendorForm.ShowDialog();

            if (result == DialogResult.OK)
            {
                vendor           = addModifyVendorForm.vendor;
                txtVendorID.Text = vendor.VendorID.ToString();
                vendorBindingSource.Clear();
                vendorBindingSource.Add(vendor);
                invoiceList = new List <Invoice>();
                invoiceDataGridView.DataSource = invoiceList;
                cm = (CurrencyManager)invoiceDataGridView.BindingContext[invoiceList];
                btnModifyVendor.Enabled = true;
            }
        }
Ejemplo n.º 2
0
        private void btnModifyVendor_Click(object sender, EventArgs e)
        {
            frmAddModifyVendor addModifyVendorForm = new frmAddModifyVendor();

            addModifyVendorForm.addVendor = false;
            addModifyVendorForm.vendor    = vendor;
            DialogResult result = addModifyVendorForm.ShowDialog();

            if (result == DialogResult.OK)
            {
                vendor = addModifyVendorForm.vendor;
                vendorBindingSource.Clear();
                vendorBindingSource.Add(vendor);
            }
            else
            {
                this.GetVendor(vendor.VendorID);
                this.GetVendorInvoices(vendor.VendorID);
            }
        }