Esempio n. 1
0
        private void cmdCalculate_Click(object sender, EventArgs e)
        {
            mQuantity = int.Parse(txtQuantity.Text);

            if (chkDiscount.Checked)
            {
                mDiscount             = true;
                this.txtDiscount.Text = "6";
            }

            if (radBalcony.Checked)
            {
                mSection = 1;
            }
            if (radGeneral.Checked)
            {
                mSection = 2;
            }
            if (radBox.Checked)
            {
                mSection = 3;
            }

            mTicketPrice = new TicketPrice(mSection, mQuantity, mDiscount);

            mTicketPrice.calculatePrice();
            lblAmount.Text = System.Convert.ToString(mTicketPrice.AmountDue);
        }
Esempio n. 2
0
        //private void chkDiscount_CheckStateChanged(object sender, EventArgs e)
        //{
        //    if (chkDiscount.Checked)
        //    { txtDiscount.Enabled = true; }
        //    else { txtDiscount.Enabled = false; }
        //}

        private void cmdCalculate_Click(object sender, EventArgs e)
        {
            mQuantity = int.Parse(txtQuantity.Text);

            if (chkDiscount.Checked)
            {
                mDiscount           = 1;
                txtDiscount.Enabled = true;
            }
            else if (ckbChild.Checked)
            {
                mDiscount           = 2;
                txtDiscount.Enabled = true;
            }
            else if (!ckbChild.Checked && !chkDiscount.Checked)
            {
                mDiscount = 0;
            }

            if (radBalcony.Checked)
            {
                mSection = 1;
            }
            if (radGeneral.Checked)
            {
                mSection = 2;
            }
            if (radBox.Checked)
            {
                mSection = 3;
            }

            if (radBack.Checked)
            {
                mSection = 4;
            }



            mTicketPrice = new TicketPrice(mSection, mQuantity, mDiscount);

            mTicketPrice.calculatePrice();
            lblAmount.Text = System.Convert.ToString(mTicketPrice.AmountDue);
        }
Esempio n. 3
0
        private async void cmdCalculate_Click(object sender, EventArgs e)
        {
            mQuantity = int.Parse(txtQuantity.Text);

            if (chkDiscount.Checked && chkChild.Checked)
            {
                lblError.Text = "You can only have one discount";
                return;
            }
            lblError.Text = "";
            if (chkDiscount.Checked)
            {
                mDiscount = true;
            }
            else if (chkChild.Checked)
            {
                mChildDiscount = true;
            }

            if (radBalcony.Checked)
            {
                mSection = 1;
            }
            if (radGeneral.Checked)
            {
                mSection = 2;
            }
            if (radBox.Checked)
            {
                mSection = 3;
            }

            mTicketPrice = new TicketPrice(mSection, mQuantity, mDiscount);

            mTicketPrice.calculatePrice();
            lblAmount.Text = System.Convert.ToString(mTicketPrice.AmountDue);
        }