Esempio n. 1
0
        /// <summary>
        /// Jorge: Opens form for modifying product supplier info and displays new data on main form
        /// </summary>
        private void btnModProdSup_Click(object sender, EventArgs e)
        {
            frmAddModifyProdSupplier addForm = new frmAddModifyProdSupplier();

            addForm.addProductSupplier = false;
            addForm.currentProdSup     = currentProdSup;

            DialogResult result = addForm.ShowDialog(); //display frmAddModifySupplier

            if (result == DialogResult.OK)
            {
                Console.WriteLine(addForm.productSupplier.ProdName);
                currentProdSup = addForm.currentProdSup;
                MessageBox.Show("Successfully modified product supplier: " + currentProdSup.ProductSupplierId.ToString());
            }
            this.DisplayCurrentProdSupData();
        }
Esempio n. 2
0
        /// <summary>
        /// Katrina: Opens form for adding new product supplier info and displays added product supplier on main form
        /// </summary>
        private void btnAddProdSup_Click(object sender, EventArgs e)
        {
            frmAddModifyProdSupplier addForm = new frmAddModifyProdSupplier();

            addForm.addProductSupplier = true;
            addForm.prodSupId          = productSupplierIds;
            DialogResult result = addForm.ShowDialog(); // displays new modal form

            if (result == DialogResult.OK)
            {
                currentProdSup = addForm.productSupplier;
                prodSupplierIdComboBox.Text = currentProdSup.ProductSupplierId.ToString();
                DisplayCurrentProdSupData();
                RefreshProdSupComboBox(true);
                MessageBox.Show("New product supplier has been added.");
            }
        }