Exemplo n.º 1
0
        private void AddProductButton_Click(object sender, EventArgs e)
        {
            Product       product       = null;
            ProductWindow productWindow = new ProductWindow(product, _inventory.GetNewProductId, _inventory);

            productWindow.ShowDialog();
            productWindow.Dispose();
        }
Exemplo n.º 2
0
 private void ModifyProductButton_Click(object sender, EventArgs e)
 {
     if (prodDataView.SelectedRows.Count == 1)
     {
         var           selected      = (int)prodDataView.SelectedRows[0].Cells[0].Value;
         Product       product       = _inventory.FindProductById(selected);
         ProductWindow productWindow = new ProductWindow(product, product.ProductId, _inventory);
         productWindow.ShowDialog();
         prodDataView.Refresh();
         productWindow.Dispose();
     }
     else
     {
         MessageBox.Show(SELECT_ITEM);
     }
 }