//Controls private void dgv_products_SelectionChanged(object sender, EventArgs e) { //Display the product prices in the product type data grid ClsProduct copyOfSelectedProduct = (ClsProduct)dgv_products.CurrentRow.DataBoundItem; if (ClsDataManager.Products.ContainsKey(copyOfSelectedProduct.UID)) { _selectedProduct = ClsDataManager.Products[copyOfSelectedProduct.UID]; } }
private void btn_newProduct_Click(object sender, EventArgs e) { ClsProduct newProduct = new ClsProduct(); if (newProduct != null && _editProductForm.ShowDialog(newProduct)) { newProduct.UpdateLastModified(); ClsDataManager.SetProduct(newProduct); updateDisplay(); } }
public bool ShowDialog(ClsProduct pProduct) { _product = pProduct; UpdateDisplay(); return(ShowDialog() == DialogResult.OK); }