コード例 #1
0
        private void SumCalculate()
        {
            string select   = comboTypeBox.SelectedItem.ToString().ToLower().Split()[0];
            string fullname = nameInputBox.Text.ToString().ToLower();
            double discount = 1;
            double cost     = 0;

            foreach (Client client in cashbox.GetClients())
            {
                if (String.Equals(client.fullName.ToLower(), fullname))
                {
                    discount = client.discount;
                }
            }

            if (String.Equals(select, "партерр"))
            {
                cost = discount * Parterre.GetCost();
            }
            else if (String.Equals(select, "балкон"))
            {
                cost = discount * Balcony.GetCost();
            }
            else if (String.Equals(select, "ложа"))
            {
                cost = discount * Lodge.GetCost();
            }
            sumTicketBox.Text = "Стоимость билета: " + cost + " руб.";
        }
コード例 #2
0
 private void Page_Loaded(object sender, RoutedEventArgs e)
 {
     foreach (Client client in cashbox.GetClients())
     {
         clientListBox.Items.Add(client.fullName);
     }
 }
コード例 #3
0
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            foreach (Client client in cashbox.GetClients())
            {
                clientsComboBox.Items.Add(client.fullName);
            }

            foreach (string namePerformnce in cashbox.GetPerformancesName())
            {
                performancesComboBox.Items.Add(namePerformnce);
            }
        }
コード例 #4
0
        private void ClientList_Loaded(object sender, RoutedEventArgs e)
        {
            foreach (Client client in cashbox.GetClients())
            {
                TextBlock fullNameBlock = new TextBlock();
                TextBlock ticketBlock   = new TextBlock();
                TextBlock statusBlock   = new TextBlock();

                fullNameBlock.Text = client.fullName;
                ticketBlock.Text   = "Билетов куплено: " + client.GetNumberOfTickets();
                statusBlock.Text   = client.GetStatus();

                fullNameBlock.Width  = column1.Width;
                fullNameBlock.Height = 30;
                ticketBlock.Width    = column2.Width;
                ticketBlock.Height   = 30;
                statusBlock.Width    = column3.Width;
                statusBlock.Height   = 30;

                column1.Children.Add(fullNameBlock);
                column2.Children.Add(ticketBlock);
                column3.Children.Add(statusBlock);
            }
        }