Exemplo n.º 1
0
        private void btnDelete_Click(object sender, System.EventArgs e)
        {
            int i = lstProducts.SelectedIndex;

            if (i != -1)
            {
                Product product = products[i];
                string  message = "Are you sure you want to delete "
                                  + product.Description + "?";
                DialogResult button = MessageBox.Show(message, "Confirm Delete",
                                                      MessageBoxButtons.YesNo);
                if (button == DialogResult.Yes)
                {
                    products -= product;
                    products.Save();
                    FillProductListBox();
                }
            }
        }
Exemplo n.º 2
0
 internal static void SaveProducts(ProductList productList)
 {
     throw new NotImplementedException();
 }
 private void HandleChange(ProductList products)
 {
     products.Save();
     FillProductListBox();
 }
 public frmMain()
 {
     products = new ProductList();
     InitializeComponent();
 }