//******************************************************************* //* * //* JUSTIN ALEX MIKE AYI * //* * //******************************************************************* // STEP 1 private void btnAdd_Click(object sender, EventArgs e) { frmAddModifyProductsSuppliers addProductSupplierForm = new frmAddModifyProductsSuppliers(); addProductSupplierForm.addProductsSuppler = true; DialogResult result = addProductSupplierForm.ShowDialog(); if (result == DialogResult.OK) { productsupplier = addProductSupplierForm.productsupplier; this.GetProductsSuppliers(); cboProductsSupplierrId.SelectedValue = productsupplier.ProductSupplierId; MessageBox.Show("New Products Suppliers were added"); } }
// STEP 2 private void btnModify_Click(object sender, EventArgs e) { frmAddModifyProductsSuppliers modifyProductSupplierForm = new frmAddModifyProductsSuppliers(); productsupplier = SelectedPS; modifyProductSupplierForm.addProductsSuppler = false; modifyProductSupplierForm.productsupplier = productsupplier; DialogResult result = modifyProductSupplierForm.ShowDialog(); if (result == DialogResult.OK) { this.GetProductsSuppliers(); cboProductsSupplierrId.SelectedValue = productsupplier.ProductSupplierId; } else if (result == DialogResult.Retry) { this.GetProductsSuppliers(); cboProductsSupplierrId.SelectedValue = productsupplier.ProductSupplierId; } MessageBox.Show("Products Suppliers was updated"); }