Beispiel #1
0
        private void showBill(object sender, EventArgs e)
        {
            CheckBillForm billForm = new CheckBillForm();

            string[] universities = new string[] { "University of Oxford", "University of Cambridge", "University of Leeds" };
            if (nameBox.Text == "")
            {
                MessageBox.Show("Please Enter a Name!", "Data Entry Error");
            }

            billTotal = 50;
            if (radioDinner.Checked && radioLunch.Checked)
            {
                billTotal = billTotal + 25;
            }
            else if (radioDinner.Checked)
            {
                billTotal = billTotal + 15;
            }
            else if (radioLunch.Checked)
            {
                billTotal = billTotal + 10;
            }

            billForm.firstnameBox.Text  = nameBox.Text;
            billForm.universityBox.Text = universities[universityCombo.SelectedIndex];
            billForm.BillTotal.Text     = billTotal.ToString();

            if (radioDinner.Checked == true)
            {
                billForm.selectOption.Text    = "Dinner Selected";
                billForm.selectOption.Visible = true;
            }
            else if (radioLunch.Checked == true)
            {
                billForm.selectOption.Text    = "Lunch Selected";
                billForm.selectOption.Visible = true;
            }

            billForm.Show();
        }
Beispiel #2
0
        private void quitForm_Click(object sender, EventArgs e)
        {
            CheckBillForm billForm = new CheckBillForm();

            Application.Exit();
        }