예제 #1
0
        public EOStackPage GetEOStackPage(Type page)
        {
            EOStackPage basePage = null;

            if (PageIsOnStack(page))
            {
                basePage = (EOStackPage)NavigationStack.Where(a => a.GetType() == page).First();
            }

            return(basePage);
        }
예제 #2
0
 public CustomerPage(EOStackPage page) : this()
 {
     basePage = page;
 }
 public ArrangementFilter(EOStackPage page) : this()
 {
     basePage = page;
 }
예제 #4
0
 public PersonFilter(EOStackPage page) : this()
 {
     basePage = page;
 }
예제 #5
0
 public InventoryFilter(EOStackPage page) : this()
 {
     this.page = page;
 }
예제 #6
0
 public CustomerContainerPage(EOStackPage page, PersonDTO customer) : this(customer)
 {
     basePage = page;
 }
예제 #7
0
        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;
        }