コード例 #1
0
        void Client_BuyMinerCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <int> e)
        {
            try
            {
                if (e.Cancelled)
                {
                    return;
                }

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

                int result = e.Result;
                if (result == OperResult.RESULTCODE_TRUE)
                {
                    MyMessageBox.ShowInfo("购买矿工成功");
                    App.UserVMObject.AsyncGetPlayerInfo();
                    _syn.Post(p =>
                    {
                        this.Close();
                    }, null);
                }
                else
                {
                    MyMessageBox.ShowInfo("购买失败。原因:" + OperResult.GetMsg(result));
                    return;
                }
            }
            catch (Exception exc)
            {
                MyMessageBox.ShowInfo("购买矿工,服务器回调处理异常。" + exc.Message);
            }
        }
コード例 #2
0
        private void btnSell_Click(object sender, RoutedEventArgs e)
        {
            int sellStoneCount = (int)this.numSellStones.Value;

            if (sellStoneCount < 1000)
            {
                MyMessageBox.ShowInfo("每次至少要出售1000块矿石");
                return;
            }

            decimal rmb     = GetAllRMB();
            decimal expense = GetExpense(rmb);
            decimal getRMB  = rmb - expense;

            if (getRMB <= 0)
            {
                MyMessageBox.ShowInfo("出售" + Strings.Stone + "最少手续费为:" + GlobalData.GameConfig.ExchangeExpenseMinNumber.ToString()
                                      + ", 您当前出售的矿石不够支付,无法出售。");
                return;
            }

            App.BusyToken.ShowBusyWindow("正在提交服务器...");
            GlobalData.Client.SellStone(sellStoneCount, null);
        }
コード例 #3
0
 private void btnOK_Click(object sender, RoutedEventArgs e)
 {
     Clipboard.SetText(this.txtInvitationCode.Text);
     MyMessageBox.ShowInfo("已复制到剪切版");
 }
コード例 #4
0
        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);
            }
        }
コード例 #5
0
        void Client_BuyMineCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <TradeOperResult> e)
        {
            try
            {
                if (e.Cancelled)
                {
                    return;
                }

                if (e.Error != null || e.Result == 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("成功收获" + e.Result.OperNumber + "的矿石储量");
                            }
                            else
                            {
                                MyMessageBox.ShowInfo("没有接收到支付宝付款信息。如确实付款,请稍后查看购买记录,或联系客服。");
                            }
                        }
                        else if (payResult == MessageBoxAlipayPayQuestionResult.Failed)
                        {
                            MyWebPage.ShowMyWebPage(result.AlipayLink);
                            MyMessageBox.ShowInfo("请在弹出的网页中,登录支付宝进行付款。");
                            return;
                        }
                    }
                    else
                    {
                        MyMessageBox.ShowInfo("成功收获" + e.Result.OperNumber + "的矿石储量");
                    }
                }
                else
                {
                    MyMessageBox.ShowInfo("成功收获" + e.Result.OperNumber + "的矿石储量");
                }

                App.UserVMObject.AsyncGetPlayerInfo();

                _syn.Post(p =>
                {
                    this.DialogResult = true;
                }, null);
            }
            catch (Exception exc)
            {
                MyMessageBox.ShowInfo("购买矿山,服务器回调处理异常。" + exc.Message);
            }
        }