예제 #1
0
        void vm_CheckoutNotice(object sender, SimpleMvvmToolkit.NotificationEventArgs <Core.Model.Order, bool> e)
        {
            bool tmp    = false;
            var  payWin = new InvoicePaymentDialog();

            payWin.Owner = Application.Current.MainWindow;

            if (Settings.Default.AutoPrint)
            {
                payWin.paymentView.chkPrint.IsChecked = true;
            }
            else
            {
                payWin.paymentView.chkPrint.IsChecked = false;
            }

            payWin.DataContext = e.Data;
            payWin.paymentView.btnPay.Click += (s, ee) =>
            {
                tmp = true;
                bool print = payWin.paymentView.chkPrint.IsChecked.HasValue && payWin.paymentView.chkPrint.IsChecked.Value;
                payWin.Close();
                e.Completed(true);

                if (print)
                {
                    this.btnPrint.Command.Execute(null);
                }
            };
            payWin.paymentView.txtPaidAmount.Focus();
            payWin.ShowDialog();

            if (!tmp)
            {
                e.Completed(false);
            }
        }
예제 #2
0
        void vm_CheckoutNotice(object sender, SimpleMvvmToolkit.NotificationEventArgs<Core.Model.Order, bool> e)
        {
            bool tmp = false;
            var payWin = new InvoicePaymentDialog();
            payWin.Owner = Application.Current.MainWindow;

            if (Settings.Default.AutoPrint)
            {
                payWin.paymentView.chkPrint.IsChecked = true;
            }
            else
            {
                payWin.paymentView.chkPrint.IsChecked = false;
            }

            payWin.DataContext = e.Data;
            payWin.paymentView.btnPay.Click += (s, ee) =>
            {
                tmp = true;
                bool print = payWin.paymentView.chkPrint.IsChecked.HasValue && payWin.paymentView.chkPrint.IsChecked.Value;
                payWin.Close();
                e.Completed(true);

                if (print)
                {
                    this.btnPrint.Command.Execute(null);
                }
            };
            payWin.paymentView.txtPaidAmount.Focus();
            payWin.ShowDialog();

            if (!tmp)
            {
                e.Completed(false);
            }
        }