private void Confirm_Order2(object sender, RoutedEventArgs e) { float addReviewOrderSubtotal = 0.00f; //Clear Checkout UC Children Switcher.GetReviewOrder().ReviewItemList.Children.Clear(); foreach (CheckoutItem child in Switcher.GetCheckout().CheckoutItemList.Children) { ReviewOrderItem reviewOrderItem = new ReviewOrderItem(); reviewOrderItem.ReviewOrderItemName.Text = child.CheckoutItemName.Text; reviewOrderItem.ReviewOrderItemPrice.Text = child.CheckoutItemPrice.Text; reviewOrderItem.ReviewOrderItemQuantity.Text = child.CheckoutItemQuantity.Text; reviewOrderItem.ReviewOrderSR.Text = child.CheckoutItemSR.Text; Switcher.GetReviewOrder().ReviewItemList.Children.Add(reviewOrderItem); //Adding Prices for Review Page string temp = reviewOrderItem.ReviewOrderItemPrice.Text.Substring(1); float itemPrice = float.Parse(temp); float totalItemPrice = itemPrice * (float.Parse(reviewOrderItem.ReviewOrderItemQuantity.Text)); addReviewOrderSubtotal += totalItemPrice; } //Last Calculation for Prices float addReviewOrderGST = addReviewOrderSubtotal * MainWindow.GST; float addReviewOrderTotal = addReviewOrderSubtotal + addReviewOrderGST; //Set Calculation Prices on ReviewOrder Switcher.GetReviewOrder().ReviewOrderSubtotal.Text = "$" + addReviewOrderSubtotal.ToString("0.00"); Switcher.GetReviewOrder().ReviewOrderGST.Text = "$" + addReviewOrderGST.ToString("0.00"); Switcher.GetReviewOrder().ReviewOrderTotal.Text = "$" + addReviewOrderTotal.ToString("0.00"); if (MainWindow.hasAlcohol == true) { this.Confirm_Alcohol.Text = "Alcohol"; } //Clear Checkout and Cart Switcher.GetCheckout().CheckoutItemList.Children.Clear(); Switcher.GetCart().CartItemList.Children.Clear(); //Clear Pricing MainWindow.GlobalSubtotal = 0; //Prices Switcher.GetCart().CartMenuTotal.Text = "$0.00"; Switcher.GetCheckout().Subtotal.Text = ("$0.00"); Switcher.GetNewMenu().MenuTotal.Text = ("$0.00"); Switcher.GetCheckout().GST.Text = "$0.00"; Switcher.GetCheckout().Total.Text = "$0.00"; }
private void ReviewOrder(object sender, RoutedEventArgs e) { Window window = new Window { Title = "Review Order", Content = Switcher.GetReviewOrder(), Height = 400, Width = 300 }; window.ShowDialog(); }