private void DeleteToolStripButton_Click(object sender, EventArgs e) { if (productsListBox.SelectedValue != null) { currentSource.DeleteProduct(productsBindingSource, (int)productsListBox.SelectedValue); } }
private void DeleteToolStripButton_Click(object sender, EventArgs e) { if (productsListBox.SelectedValue != null) { var productId = Convert.ToInt32(productsListBox.SelectedValue); var rebindIsNeeded = currentSource.DeleteProduct(productId); if (rebindIsNeeded) { BindProducts(); } } }
private void DeletetoolStripButton_Click(object sender, EventArgs e) { var productID = (int)ProductsListBox.SelectedValue; _currentSource.DeleteProduct(_productBindingSource, productID); }