示例#1
0
        private void mnuAddNewVendor_Click(object sender, EventArgs e)
        {
            frmAddModifyVendor frmChild = new frmAddModifyVendor();

            this.AddOwnedForm(frmChild);
            if (frmChild.ShowDialog() == DialogResult.OK)
            {
                vendorBindingSource.DataSource = VendorDB.GetAllVendors();
            }
        }
示例#2
0
        private void mnuModifyVendor_Click(object sender, EventArgs e)
        {
            // retrieve the current Vendor
            Vendor vendor = (Vendor)vendorBindingSource.Current;

            // display vendor form
            frmAddModifyVendor frmChild = new frmAddModifyVendor();

            frmChild.vendor = vendor;
            this.AddOwnedForm(frmChild);
            if (frmChild.ShowDialog() == DialogResult.OK)
            {
                vendorBindingSource.DataSource = VendorDB.GetAllVendors();
            }
        }
示例#3
0
        private void btnAddVendor_Click(object sender, EventArgs e)
        {
            frmAddModifyVendor addModifyVendorForm = new frmAddModifyVendor();
            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;
            }
        }
示例#4
0
        private void btnModifyVendor_Click(object sender, EventArgs e)
        {
            frmAddModifyVendor addModifyVendorForm = new frmAddModifyVendor();

            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);
            }
        }