private void btnFinish_Click(object sender, EventArgs e) { if (checkDate()) { if (!RT1.Checked & !RT2.Checked & !RT3.Checked) { drink = "No Drink"; dish = "No Dish"; RT = "No"; LastForm frm = new LastForm(Id); frm.setAll(type, dateTimePicker1.Text, dateTimePicker2.Text, RT, totalPrice); frm.setRest(dish, drink, totalPrice); this.Hide(); frm.ShowDialog(); } } }
public void button1_Click(object sender, EventArgs e) { if (FoodBox.SelectedItem != null) { string[] foodnPrice = FoodBox.SelectedItem.ToString().Split(' '); int i = foodnPrice.Length; dish = foodnPrice[0] + " " + foodnPrice[1] + " " + foodnPrice[2]; if (i > 3) { dish += foodnPrice[3]; } price = double.Parse(foodnPrice[i - 2]); } else { dish = "No dish"; } if (DrinkBox.SelectedItem != null) { string[] drinknPrice = DrinkBox.SelectedItem.ToString().Split(' '); int i = drinknPrice.Length; drink = drinknPrice[0] + " " + drinknPrice[1] + " " + drinknPrice[2]; if (i > 3) { drink += drinknPrice[3]; } price += double.Parse(drinknPrice[i - 2]); } else { drink = "No drink"; } LastForm frm = new LastForm(Id); price *= days; frm.setRTPrice(price); frm.setAll(Type, CheckIn, CheckOut, rt, ttlPrice); price += ttlPrice; frm.setRest(dish, drink, price); this.Hide(); frm.ShowDialog(); }