private void btnCancel_Click(object sender, EventArgs e) { DialogResult dialogResult = MessageBox.Show("Are u Really Want To Cancel Your Order ?", "Cancel Order", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { OnlineBookStore.Menu.itemsOnCart.Clear(); ShopCart myform = new ShopCart(username); myform.Show(); this.Hide(); } }
private void btnRemove_Click(object sender, EventArgs e) { if (listwiewCart.SelectedIndices.Count > 0) { int selectedIndex = listwiewCart.SelectedIndices[0]; OnlineBookStore.Menu.itemsOnCart.RemoveAt(selectedIndex); ShopCart myform = new ShopCart(username); myform.Show(); this.Hide(); } else { MessageBox.Show("Please Select An Item To Remove"); } }