private void btnCheckout_Click(object sender, EventArgs e) { String dineOrTakeAway = ""; if (!radioBtnDine.Checked && !radioBtnTake.Checked) { MessageBox.Show("Please select one of the radio button.", "Error"); } else if (cartItems.CartList.Count() <= 0) { MessageBox.Show("Please add at least one item to cart.", "Error"); } else { if (radioBtnDine.Checked) { dineOrTakeAway = radioBtnDine.Text; } else if (radioBtnTake.Checked) { dineOrTakeAway = radioBtnTake.Text; } CheckoutForm checkoutPage = new CheckoutForm(user, cartItems, dineOrTakeAway); this.Hide(); checkoutPage.ShowDialog(); this.Close(); //close previous form } }
private void btnBack_Click(object sender, EventArgs e) { CheckoutForm checkoutPage = new CheckoutForm(user, cartItems, dineOrTakeAway); this.Hide(); checkoutPage.ShowDialog(); this.Close(); }