public EOStackPage GetEOStackPage(Type page) { EOStackPage basePage = null; if (PageIsOnStack(page)) { basePage = (EOStackPage)NavigationStack.Where(a => a.GetType() == page).First(); } return(basePage); }
public CustomerPage(EOStackPage page) : this() { basePage = page; }
public ArrangementFilter(EOStackPage page) : this() { basePage = page; }
public PersonFilter(EOStackPage page) : this() { basePage = page; }
public InventoryFilter(EOStackPage page) : this() { this.page = page; }
public CustomerContainerPage(EOStackPage page, PersonDTO customer) : this(customer) { basePage = page; }
private async void Pay_Click(object sender, RoutedEventArgs e) { //send record for payment //success? show message - go back to Work Order page //failure? show message stay on this page Pay.IsEnabled = false; bool proceedWithSave = true; string ccConfirm = String.Empty; if (PaymentTypeComboBox.SelectedIndex == 2) { CreditCard cc = new CreditCard() { Cvc = CVVTextBox.Text, HolderName = NameOnCardTextBox.Text, Numbers = CardNumberTextBox.Text, Month = ExpMonthTextBox.Text, Year = ExpYearTextBox.Text }; List <string> msgs = cc.VerifyCreditCardInfo(); if (msgs.Count == 0) { PaymentResponse paymentResponse = await PayWithCC(cc); ccConfirm = paymentResponse.ccConfirm; proceedWithSave = paymentResponse.success; if (paymentResponse.Messages.Count > 0) { MessageBox.Show(Application.Current.MainWindow, MessageFormatter(paymentResponse.Messages["Stripe"]), "Error", MessageBoxButton.OK); } } else { proceedWithSave = false; MessageBox.Show("Error", MessageFormatter(msgs), MessageBoxButton.OK); } } if (proceedWithSave) { bool paymentSaved = await SavePaymentRecord(ccConfirm); if (paymentSaved) { MessageBox.Show(Application.Current.MainWindow, "Payment Successful", "Success", MessageBoxButton.OK); MainWindow wnd = Application.Current.MainWindow as MainWindow; if (wnd.PageIsOnStack(typeof(WorkOrderPage))) { EOStackPage parentPage = wnd.GetEOStackPage(typeof(WorkOrderPage)); if (parentPage != null) { WorkOrderMessage msg = new WorkOrderMessage(); msg.WorkOrderPaid = true; parentPage.LoadWorkOrderData(msg); } } wnd.OnBackClick(this); } else { MessageBox.Show(Application.Current.MainWindow, "There was a problem saving the payment record", "Error", MessageBoxButton.OK); } } Pay.IsEnabled = true; }