protected override void OnNavigatedTo(NavigationEventArgs e) { if (e.Parameter != null) { checkoutTable = e.Parameter as TableContainer; tableTextblock.Text = "Table: " + checkoutTable.tableNumber; updateReceiptBox(); updateTotal(); } notificationTextbox.Text += "Subtotal:\nTax:\nGrand Total:\n"; double total = checkoutTable.totalCost; costsTextbox.Text += String.Format("{0:0.00}", total) + "\n"; double taxes = Math.Round(total * .08, 2); costsTextbox.Text += String.Format("{0:0.00}", taxes) + "\n"; double grandTotal = Math.Round(total + taxes, 2); costsTextbox.Text += String.Format("{0:0.00}", grandTotal) + "\n"; setTime(); dispatcherTimer.Tick += DispatcherTimer_Tick; dispatcherTimer.Interval = new TimeSpan(0, 0, 1); dispatcherTimer.Start(); }
private void Table_IsClicked(object sender, RoutedEventArgs e) { var testButton = sender as Button; string testString = (string)testButton.Content; int testInt = Convert.ToInt32(testString); TableContainer toSend = rootPage.containers.ElementAt <TableContainer>(testInt - 1); this.Frame.Navigate(typeof(CarryOutMenu), toSend); }
protected override void OnNavigatedTo(NavigationEventArgs e) { if (e.Parameter != null) { testTable = e.Parameter as TableContainer; tableNumber.Text = "Table: " + testTable.tableNumber; updateReceiptBox(); updateGuestBlock(); } else { testTable = new TableContainer() { tableNumber = 100 }; } setTime(); dispatcherTimer.Tick += DispatcherTimer_Tick; dispatcherTimer.Interval = new TimeSpan(0, 0, 1); dispatcherTimer.Start(); }