示例#1
0
        //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];
            }
        }
示例#2
0
        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();
            }
        }
示例#3
0
 public bool ShowDialog(ClsProduct pProduct)
 {
     _product = pProduct;
     UpdateDisplay();
     return(ShowDialog() == DialogResult.OK);
 }