示例#1
0
        private void frmListVendors_Load(object sender, EventArgs e)
        {
            List <Vendor> vendors = VendorDB.GetAllVendors();

            vendorBindingSource.DataSource = vendors;

            _cm = (CurrencyManager)
                  vendorDataGridView.BindingContext[vendors];
        }
示例#2
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();
            }
        }
示例#3
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();
            }
        }