コード例 #1
0
        private void updateTotalLabels()
        {
            //get the show's total
            NightlySum totalSum = showTotal();

            //create object to perform math. more for cleanliness than anything else
            TicketSums sums = new TicketSums(totalSum, Ticket.adultCost, Ticket.studentCost, Ticket.seniorCost, Ticket.parPassCost);

            //assign the values to the labels
            lblShowTixTot1.Text = totalSum.tickets.ToString();
            lblShowAdTixTot1.Text = totalSum.adults.ToString();
            lblShowStudTixTot1.Text = totalSum.students.ToString();
            lblShowSenTixTot1.Text = totalSum.seniors.ToString();
            lblShowCompTixTot1.Text = totalSum.comps.ToString();
            lblShowParPassTixTot1.Text =
                (totalSum.parPass / show.htNights2Nights.Count).ToString();   //this is done to reflect the actual amount of passes sold, not the seats occupied by pass holders

            lblShowTakenTot1.Text = "$ " + String.Format("{0:0.00}", stripPasses(sums));
            lblShowSenTaken1.Text = "$ " + String.Format("{0:0.00}", sums.totalSenior());
            lblShowAdTaken1.Text = "$ " + String.Format("{0:0.00}", sums.totalAdult());
            lblShowStudTaken1.Text = "$ " + String.Format("{0:0.00}", sums.totalStudent());
            lblShowParPassTaken1.Text = "$ " + String.Format("{0:0.00}",
                sums.totalParPass() / show.htNights2Nights.Count); //this is done to reflect the actual amount of passes sold, not the seats occupied by pass holders
        }
コード例 #2
0
        private void updateNightLabels(NightlySum sum)
        {
            //create object to perform math. more for cleanliness than anything else
            TicketSums sums = new TicketSums(sum, Ticket.adultCost, Ticket.studentCost, Ticket.seniorCost, Ticket.parPassCost);

            //assign the values to the labels
            lblNightTixTot1.Text = sum.tickets.ToString();
            lblNightAdTix1.Text = sum.adults.ToString();
            lblNightStudTix1.Text = sum.students.ToString();
            lblNightSenTix1.Text = sum.seniors.ToString();
            lblNightCompTix1.Text = sum.comps.ToString();
            lblNightParPassTix1.Text = sum.parPass.ToString();

            lblNightTaken1.Text = "$ " + String.Format("{0:0.00}", sums.total());
            lblNightSenTaken1.Text = "$ " + String.Format("{0:0.00}", sums.totalSenior());
            lblNightAdTaken1.Text = "$ " + String.Format("{0:0.00}", sums.totalAdult());
            lblNightStudTaken1.Text = "$ " + String.Format("{0:0.00}", sums.totalStudent());
        }