Пример #1
0
 private void DeleteToolStripButton_Click(object sender, EventArgs e)
 {
     if (productsListBox.SelectedValue != null)
     {
         currentSource.DeleteProduct(productsBindingSource, (int)productsListBox.SelectedValue);
     }
 }
Пример #2
0
 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();
         }
     }
 }
Пример #3
0
        private void DeletetoolStripButton_Click(object sender, EventArgs e)
        {
            var productID = (int)ProductsListBox.SelectedValue;

            _currentSource.DeleteProduct(_productBindingSource, productID);
        }