//check if the product is out of stock and then open the comment form or display message private void SelectMenuItem(Item item) { if (item.Stock == 0) { MessageBox.Show("Product Out Of Stock!"); } else { addCommentToItemUI = new AddCommentToItemUI(item, order); addCommentToItemUI.ShowDialog(); Close(); } }
//check if the product is out of stock and then open the comment form private void SelectMenuItem(Item item) { //get the item amount item = service.GetItem(item.Name); if (item.Stock == 0) { MessageBox.Show("Product Out Of Stock!"); } else { addCommentToItemUI = new AddCommentToItemUI(item, order); addCommentToItemUI.ShowDialog(); Close(); } }