private void btnPayOrder_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                StoneDelegateBuyOrderInfoUIModel buyOrder = ((Button)sender).DataContext as StoneDelegateBuyOrderInfoUIModel;

                MyWebPage.ShowMyWebPage(buyOrder.AlipayLink);
                MyMessageBox.ShowInfo("请在弹出的网页中,登录支付宝进行付款。");

                if (!AlipayPaySucceed)
                {
                    var payResult = MyMessageBox.ShowAlipayPayQuestion();
                    if (payResult == MessageBoxAlipayPayQuestionResult.Succeed)
                    {
                        App.UserVMObject.AsyncGetPlayerInfo();
                    }
                    else if (payResult == MessageBoxAlipayPayQuestionResult.Failed)
                    {
                        MyWebPage.ShowMyWebPage(buyOrder.AlipayLink);
                        MyMessageBox.ShowInfo("请在弹出的网页中,登录支付宝进行付款。");
                        return;
                    }
                }
            }
            catch (Exception exc)
            {
                LogHelper.Instance.AddErrorLog("Alipay Pay DelegateBuyStone Order Exception", exc);
            }
        }
Exemple #2
0
        void Client_GoldCoinRechargeCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <MetaData.Trade.TradeOperResult> e)
        {
            try
            {
                if (e.Cancelled)
                {
                    return;
                }

                if (e.Error != null)
                {
                    MyMessageBox.ShowInfo("访问服务器失败。");
                    return;
                }

                TradeOperResult result = e.Result;
                if (result.ResultCode != OperResult.RESULTCODE_TRUE)
                {
                    MyMessageBox.ShowInfo("金币充值失败。原因:" + OperResult.GetMsg(result.ResultCode));
                    return;
                }
                if (result.PayType == (int)PayType.Alipay)
                {
                    MyWebPage.ShowMyWebPage(result.AlipayLink);
                    MyMessageBox.ShowInfo("请在弹出的网页中,登录支付宝进行付款。");

                    if (!AlipayPaySucceed)
                    {
                        var payResult = MyMessageBox.ShowAlipayPayQuestion();
                        if (payResult == MessageBoxAlipayPayQuestionResult.Succeed)
                        {
                            if (!AlipayPaySucceed)
                            {
                                MyMessageBox.ShowInfo("没有接收到支付宝付款信息。如确实付款,请稍后查看购买记录,或联系客服。");
                            }
                        }
                        else if (payResult == MessageBoxAlipayPayQuestionResult.Failed)
                        {
                            MyWebPage.ShowMyWebPage(result.AlipayLink);
                            MyMessageBox.ShowInfo("请在弹出的网页中,登录支付宝进行付款。");
                            return;
                        }
                    }
                }

                App.UserVMObject.AsyncGetPlayerInfo();
                _syn.Post(p =>
                {
                    //this.DialogResult = true;
                    this.Close();
                }, null);
            }
            catch (Exception exc)
            {
                MyMessageBox.ShowInfo("充值金币,服务器回调处理异常。" + exc.Message);
            }
        }
        //void Client_ReleaseLockOrderCompleted(object sender, Wcf.Clients.WebInvokeEventArgs<bool> e)
        //{
        //    try
        //    {
        //        if (e.Cancelled)
        //        {
        //            return;
        //        }

        //        App.BusyToken.CloseBusyWindow();

        //        if (e.Error != null)
        //        {
        //            _syn.Post(o =>
        //            {
        //                MyMessageBox.ShowInfo("连接服务器失败。");
        //            }, null);
        //            return;
        //        }

        //        App.StoneOrderVMObject.AsyncGetAllNotFinishedSellOrders();

        //        this.Close();
        //    }
        //    catch (Exception exc)
        //    {
        //        MyMessageBox.ShowInfo("购买矿石,取消购买矿石订单,回调处理异常。" + exc.Message);
        //    }
        //}

        private void btnOK_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (chkPayType.IsChecked == true)//支付宝支付
                {
                    MyWebPage.ShowMyWebPage(this.LockedOrder.PayUrl);
                    MyMessageBox.ShowInfo("请在弹出的网页中,登录支付宝进行付款。");

                    if (!AlipayPaySucceed)
                    {
                        var payResult = MyMessageBox.ShowAlipayPayQuestion();
                        if (payResult == MessageBoxAlipayPayQuestionResult.Succeed)
                        {
                            App.UserVMObject.AsyncGetPlayerInfo();

                            if (!AlipayPaySucceed)
                            {
                                System.Windows.Forms.DialogResult result = MyMessageBox.ShowQuestionOKCancel("没有接收到支付宝付款信息。如确实付款,请点击【确定】,将对订单进行申诉,同时联系管理员进行处理,否则请点击【取消】。注意:三次恶意订单申诉,请被永久封号。");
                                if (result == System.Windows.Forms.DialogResult.OK)
                                {
                                    App.StoneOrderVMObject.AsyncSetStoneOrderPayException(LockedOrder.OrderNumber);
                                }
                            }
                        }
                        else if (payResult == MessageBoxAlipayPayQuestionResult.Failed)
                        {
                            MyWebPage.ShowMyWebPage(this.LockedOrder.PayUrl);
                            MyMessageBox.ShowInfo("请在弹出的网页中,登录支付宝进行付款。");
                            return;
                        }
                    }
                }
                else
                {
                    App.StoneOrderVMObject.AsyncPayOrderByRMB(LockedOrder.OrderNumber, LockedOrder.ValueRMB);
                }
            }
            catch (Exception exc)
            {
                MyMessageBox.ShowInfo("购买矿石,处理异常。" + exc.Message);
            }
        }
Exemple #4
0
 private void hlinkHomePage_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e)
 {
     MyWebPage.ShowMyWebPage("");
     e.Handled = true;
 }
Exemple #5
0
 private void hlinkRegister_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e)
 {
     MyWebPage.ShowMyWebPage("Register.aspx");
     e.Handled = true;
 }
        void Client_DelegateBuyStoneCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <MetaData.OperResultObject> e)
        {
            try
            {
                App.BusyToken.CloseBusyWindow();

                if (e.Error != null)
                {
                    LogHelper.Instance.AddErrorLog("Client_DelegateBuyStone Server Exception", e.Error);
                    return;
                }
                if (e.UserState == null)
                {
                    return;
                }
                PayType paytype = (PayType)e.UserState;

                App.StackStoneVMObject.AsyncGetAllNotFinishedBuyOrders();
                App.UserVMObject.AsyncGetPlayerInfo();

                if (e.Result.OperResultCode == OperResult.RESULTCODE_TRUE)
                {
                    if (paytype == PayType.Alipay)
                    {
                        MyWebPage.ShowMyWebPage(e.Result.Message);
                        MyMessageBox.ShowInfo("请在弹出的网页中,登录支付宝进行付款。");

                        if (!AlipayPaySucceed)
                        {
                            var payResult = MyMessageBox.ShowAlipayPayQuestion();
                            if (payResult == MessageBoxAlipayPayQuestionResult.Succeed)
                            {
                                App.UserVMObject.AsyncGetPlayerInfo();

                                //if (!AlipayPaySucceed)
                                //{
                                //    System.Windows.Forms.DialogResult result = MyMessageBox.ShowQuestionOKCancel("没有接收到支付宝付款信息。如确实付款,请点击【确定】,将对订单进行申诉,同时联系管理员进行处理,否则请点击【取消】。注意:三次恶意订单申诉,请被永久封号。");
                                //    if (result == System.Windows.Forms.DialogResult.OK)
                                //    {
                                //        App.StoneOrderVMObject.AsyncSetStoneOrderPayException(LockedOrder.OrderNumber);
                                //    }
                                //}
                            }
                            else if (payResult == MessageBoxAlipayPayQuestionResult.Failed)
                            {
                                MyWebPage.ShowMyWebPage(e.Result.Message);
                                MyMessageBox.ShowInfo("请在弹出的网页中,登录支付宝进行付款。");
                                return;
                            }
                        }
                    }
                    else
                    {
                        MyMessageBox.ShowInfo("挂单成功");
                    }
                }
                else
                {
                    MyMessageBox.ShowInfo("挂单失败,原因为:" + OperResult.GetMsg(e.Result.OperResultCode));
                }
            }
            catch (Exception exc)
            {
                LogHelper.Instance.AddErrorLog("Client_DelegateBuyStone Exception", exc);
            }
        }