// constructor
        public KassenUI(Transaction transaction, CustomerUI customerUI)
        {
            this.tankstelle = Tankstelle.Current();
            this.customerUI = customerUI;
            insertedMoney   = new List <int>();

            InitializeComponent();
            this.transaction = transaction;
            Betrag.Content   = transaction.GetCostInMoney().ToString("C2");
            IReadOnlyList <int> coinValues = this.tankstelle.GetAvailableCoins();

            foreach (int coinValue in coinValues)
            {
                Button button = new Button()
                {
                    Content    = ((decimal)coinValue / 100).ToString("C2"),
                    FontSize   = 20,
                    Background = Brushes.LightGreen,
                    Foreground = Brushes.Black,
                    Margin     = new Thickness(3)
                };

                button.Click += (s, e) => { OnMoneyButton_Click(s, e, coinValue); };
                MoneyPanel.Children.Add(button);
            }
        }
Beispiel #2
0
        // on selection of gas nozzle
        public void SelectZapfhahn(Zapfhahn zapfhahn)
        {
            selectedZapfsaeule.Selectzapfhahn(zapfhahn);
            CustomerUI customerUI = new CustomerUI();

            CustomerUIFrame.Content = customerUI;
            customerUI.SetZapfhahnValues(selectedZapfsaeule, zapfhahn, this);
        }