Пример #1
0
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     //Pizza myPizza = new Pizza(Convert.ToDouble(costBox.Text));
     Pizza myPizza = new Pizza(Convert.ToDouble(costBox.Text));
     Admin Eater = new Admin();
     Eater.myPizza = myPizza;
     List<object> Parameters = new List<object> { Eater, myPizza };
     this.Frame.Navigate(typeof(EatingPage), Parameters);
 }
Пример #2
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            List<object> Parameters = e.Parameter as List<Object>;
            string type = Parameters[0].GetType().ToString();
            if (type == "WhoAteMyPizza.Classes.Admin")
            {
                myPizza = (Pizza)Parameters[1];
                EndButton.Visibility = Visibility.Visible;

            }
            else
                myPizza = new Pizza(10);
            Eater = (User)Parameters[0];
            textBox.Text = myPizza.cost.ToString();
        }
Пример #3
0
 public double estimateCost(Pizza pizza)
 {
     double ToPay = pizza.cost * this.eatenPieces / 8;
     return ToPay;
 }