コード例 #1
0
        private void BookConfb_Click(object sender, EventArgs e)
        {
            float Stand    = Convert.ToInt32(StandardUpDn.Value);
            float Child    = Convert.ToInt32(ChildUpDn.Value);
            float OAP      = Convert.ToInt32(OAPUpDn.Value);
            float Quantity = Stand + Child + OAP;

            Play plays = new Play();

            CheckValuel.Text = plays.checkValue.ToString();
            plays.AddtoBasket("User1", BookTitlel.Text, Stand, Child, OAP, dateTimePicker2.Value, BookTimel.Text, CurrTotal.Text, Quantity);
            if (plays.success == 1)
            {
                MessageBox.Show("Your tickets were booked successfully");
                CheckValuel.Text = plays.checkValue.ToString();
            }
            else if (plays.success == 2)
            {
                MessageBox.Show("You booked more seats than are available");
                CheckValuel.Text = plays.checkValue.ToString();
            }
            StandardUpDn.Value = 0;
            ChildUpDn.Value    = 0;
            OAPUpDn.Value      = 0;
        }