private void button1_Click(object sender, EventArgs e) { try { int value = dataGridView.Rows.Count; if (dataGridView.Rows.Count != 0) { customerService.AddSales(new Contracts.Request.ShoppingBasket.AddShoppingBasketRequest(cust.CustomerID)); dataGridView.DataSource = customerService.ShoppingList(new Contracts.Request.ShoppingBasket.ShoppingListRequest(cust.CustomerID)); ShowAutoClosingMessageBoxInfo("Enjoy It!", "Successfully Bought"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }