private void SellButton_Click(object sender, EventArgs e) { bool status = true; foreach (var cartItem in itemsCart) { if (!itemBll.DecreaseItemQuantity(cartItem.Id, cartItem.Quantity, "sold")) { MessageBox.Show("Operation failed"); status = false; break; } } itemsCart = null; itemGridView.DataSource = itemsCart; if (status) { MessageBox.Show("Operation successfull..."); } }