Ejemplo n.º 1
0
        /// <summary>
        /// 绑定数据
        /// </summary>
        protected void BindRankData( )
        {
            string tag = "MatchRank";
            object ob  = SessionState.Get(tag);

            if (SessionState.Get("MatchRank") == null)
            {
                TreasureFacade treasureFacade = new TreasureFacade(kindID);
                string         sqlQuery       = "Select Top 100 * from GameScoreInfo(nolock) order by Score desc";
                DataSet        ds             = treasureFacade.GetDataSetByWhere(sqlQuery);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    rptRank.DataSource = ds;
                    rptRank.DataBind( );
                }
                SessionState.Set(tag, ob, 10);
            }
            else
            {
                DataSet ds = ( DataSet )ob;
                if (ds.Tables[0].Rows.Count > 0)
                {
                    rptRank.DataSource = ds;
                    rptRank.DataBind( );
                }
            }
        }
Ejemplo n.º 2
0
        private void BindData( )
        {
            litNoSelect.Visible = false;
            int kindID = int.Parse(ddlGame.SelectedValue);

            if (kindID <= 0)
            {
                litNoSelect.Visible = true;
                return;
            }
            PagerSet pagerSet = new TreasureFacade(kindID).GetGameScoreInfoList(anpPage.CurrentPageIndex, anpPage.PageSize, SearchItems, Orderby);

            anpPage.RecordCount = pagerSet.RecordCount;
            if (pagerSet.PageSet.Tables[0].Rows.Count > 0)
            {
                rptDataList.DataSource = pagerSet.PageSet;
                rptDataList.DataBind( );
                rptDataList.Visible = true;
                litNoData.Visible   = false;
            }
            else
            {
                rptDataList.Visible = false;
                litNoData.Visible   = true;
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 获取实卡展示图片
        /// </summary>
        /// <param name="context"></param>
        private void GetCardImage(HttpContext context)
        {
            //获取类类型ID
            int cardTypeID = GameRequest.GetInt("param", 0);

            if (cardTypeID == 0)
            {
                return;
            }

            TreasureFacade aideTreasureFacade = new TreasureFacade( );
            GlobalLivcard  cardType           = aideTreasureFacade.GetGlobalLivcardInfo(cardTypeID);

            if (cardType == null)
            {
                return;
            }

            //if( cardType.Image != null )
            //{
            //    context.Response.Clear();
            //    context.Response.ContentType = "image/Bmp";
            //    context.Response.BinaryWrite( cardType.Image );
            //    context.Response.End();
            //}
        }
Ejemplo n.º 4
0
        //绑定数据
        private void UserInoutDataBind( )
        {
            int kindID = int.Parse(ddlGame.SelectedValue);

            if (kindID <= 0)
            {
                MessageBox("请选择游戏");
                return;
            }

            PagerSet pagerSet = new TreasureFacade(kindID).GetRecordUserInoutList(anpNews.CurrentPageIndex, anpNews.PageSize, SearchItems, Orderby);

            if (pagerSet.PageSet.Tables[0].Rows.Count > 0)
            {
                litNoData.Visible = false;
            }
            else
            {
                litNoData.Visible = true;
            }

            rptUserInout.DataSource = pagerSet.PageSet;
            rptUserInout.DataBind( );
            anpNews.RecordCount = pagerSet.RecordCount;
        }
        public string AddOffLinePaymentInfo(System.Web.HttpContext context)
        {
            this.username    = context.Request["username"];
            this.payAmount   = decimal.Parse(context.Request["coin"]);
            this.orderID     = context.Request["orderid"];
            this.applyDate   = DateTime.Parse(context.Request["P_Time"]);
            this.paymentType = int.Parse(context.Request["PaymentType"]);;
            this.bankName    = "BankName";



            //  ShareDetialInfo shareDetialInfo = new ShareDetialInfo();
            OffLinePayOrders OffLinePayOrdersInfo = new OffLinePayOrders();

            OffLinePayOrdersInfo.Accounts    = this.username;
            OffLinePayOrdersInfo.OrderID     = this.orderID;
            OffLinePayOrdersInfo.PayAmount   = this.payAmount;
            OffLinePayOrdersInfo.ApplyDate   = this.applyDate;
            OffLinePayOrdersInfo.PaymentType = this.paymentType;
            OffLinePayOrdersInfo.BankName    = this.bankName;

            context.Response.ContentType = "text/plain";
            //context.Response.Write("OffLinePayOrdersInfo.Accounts: " + OffLinePayOrdersInfo.Accounts + "\r\n");
            //context.Response.Write("OffLinePayOrdersInfo.PayAmount: " + OffLinePayOrdersInfo.PayAmount + "\r\n");
            //context.Response.Write("OffLinePayOrdersInfo.OrderID: " + OffLinePayOrdersInfo.OrderID + "\r\n");
            //context.Response.Write("OffLinePayOrdersInfo.ApplyDate: " + OffLinePayOrdersInfo.ApplyDate + "\r\n");
            //context.Response.Write("OffLinePayOrdersInfo.PaymentType: " + OffLinePayOrdersInfo.PaymentType + "\r\n");

            //  shareDetialInfo.ShareID = 100;
            TreasureFacade treasureFacade = new TreasureFacade();

            treasureFacade.WriteOffLinePayment(OffLinePayOrdersInfo);

            return("1");
        }
Ejemplo n.º 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //定义变量
            userName = GameRequest.GetFormString("txtPayAccounts");
            string reUserName = GameRequest.GetFormString("txtPayReAccounts");

            money     = GameRequest.GetFormInt("hdfSalePrice", 0);
            sendUrl   = System.Configuration.ConfigurationSettings.AppSettings["DaySendUrl"];    //导向地址
            notifyUrl = System.Configuration.ConfigurationSettings.AppSettings["DayNotifyUrl"];  //同步回调地址
            string key = System.Configuration.ConfigurationSettings.AppSettings["DayKey"];       //密钥

            merId = System.Configuration.ConfigurationSettings.AppSettings["DayMerId"];          //商户ID


            //验证参数
            if (userName != reUserName)
            {
                ShowAndRedirect("两次输入的用户名不一致", "/Pay/PayDay.aspx");
                return;
            }
            if (money == 0)
            {
                ShowAndRedirect("金额输入有误", "/Pay/PayDay.aspx");
                return;
            }

            //生成订单
            orderID = PayHelper.GetOrderIDByPrefix("Day");      //订单号
            OnLineOrder onlineOrder = new OnLineOrder( );

            onlineOrder.ShareID = 2;
            onlineOrder.OrderID = orderID;
            if (Fetch.GetUserCookie( ) == null)
            {
                onlineOrder.OperUserID = 0;
            }
            else
            {
                onlineOrder.OperUserID = Fetch.GetUserCookie( ).UserID;
            }
            onlineOrder.Accounts    = userName;
            onlineOrder.CardTotal   = 1;
            onlineOrder.CardTypeID  = money < 30 ? 1 : money < 60 ? 2 : money < 120 ? 3 : 4;
            onlineOrder.OrderAmount = money;
            onlineOrder.IPAddress   = GameRequest.GetUserIP( );
            TreasureFacade treasureFacade = new TreasureFacade( );
            Message        umsg           = treasureFacade.RequestOrder(onlineOrder);

            if (!umsg.Success)
            {
                RenderAlertInfo(true, umsg.Content, 2);
                return;
            }

            //生成sign签名
            string signStr = merId + "|" + orderID + "|" + money + "|" + sendUrl + "|" + userName + "|" + key;

            sign = EncryptMD5(signStr, false, 32);
        }
        private void BindData()
        {
            if (IntParam <= 0)
            {
                return;
            }
            //获取信息
            AccountsInfo model = FacadeManage.aideAccountsFacade.GetAccountInfoByUserID(IntParam);

            if (model == null)
            {
                MessageBox("用户信息不存在");
                return;
            }

            CtrlHelper.SetText(ltGameID, model.GameID.ToString());
            CtrlHelper.SetText(ltAccounts, model.Accounts.Trim());
            int kindID = int.Parse(ddlGame.SelectedValue);

            if (kindID <= 0)
            {
                return;
            }

            //积分信息
            //GameScoreFacade aideGameScoreFacade = new GameScoreFacade( aidePlatformFacade.GetConn( kindID ) );
            //Game.Entity.GameScore.GameScoreInfo scoreInfo = aideGameScoreFacade.GetGameScoreInfoByUserId( IntParam );
            GameScoreInfo scoreInfo = new TreasureFacade(kindID).GetGameScoreInfoByUserID(IntParam);

            if (scoreInfo == null)
            {
                return;
            }
            CtrlHelper.SetText(ltScore, scoreInfo.Score.ToString("N0"));

            CtrlHelper.SetText(ltWinCount, scoreInfo.WinCount.ToString());
            CtrlHelper.SetText(ltLostCount, scoreInfo.LostCount.ToString());
            CtrlHelper.SetText(ltDrawCount, scoreInfo.DrawCount.ToString());
            CtrlHelper.SetText(ltFleeCount, scoreInfo.FleeCount.ToString());


            //登录房间、注册信息
            CtrlHelper.SetText(ltGameLogonTimes, scoreInfo.AllLogonTimes.ToString() + "次");
            CtrlHelper.SetText(ltLastLogonDate, scoreInfo.LastLogonDate.ToString("yyyy-MM-dd HH:mm:ss"));
            CtrlHelper.SetText(ltLogonSpacingTime, Fetch.GetTimeSpan(Convert.ToDateTime(scoreInfo.LastLogonDate), DateTime.Now) + "前");

            CtrlHelper.SetText(ltLastLogonIP, scoreInfo.LastLogonIP.ToString());
            CtrlHelper.SetText(ltLogonIPInfo, IPQuery.GetAddressWithIP(scoreInfo.LastLogonIP.ToString()));
            CtrlHelper.SetText(ltLastLogonMachine, scoreInfo.LastLogonMachine.ToString());
            CtrlHelper.SetText(ltRegisterDate, scoreInfo.RegisterDate.ToString("yyyy-MM-dd HH:mm:ss"));
            CtrlHelper.SetText(ltRegisterIP, scoreInfo.RegisterIP.ToString());
            CtrlHelper.SetText(ltRegIPInfo, IPQuery.GetAddressWithIP(scoreInfo.RegisterIP.ToString()));
            CtrlHelper.SetText(ltRegisterMachine, scoreInfo.RegisterMachine.ToString());
            CtrlHelper.SetText(ltOnLineTimeCount, scoreInfo.OnLineTimeCount.ToString());
            CtrlHelper.SetText(ltPlayTimeCount, scoreInfo.PlayTimeCount.ToString());
        }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            //context.Response.Write("Hello World");
            TreasureFacade treasureFacade   = new TreasureFacade();
            DataTable      offPayQrCodeList = treasureFacade.GetOffPayQrCodeInfo();
            string         json             = DataTableToJson(offPayQrCodeList);

            context.Response.Write(json);
        }
Ejemplo n.º 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                StreamReader sr = new StreamReader(Request.InputStream);
                receiptData = sr.ReadToEnd();

                //苹果返回数据
                string         rValue  = AppInfo(receiptData);
                AppReceiptInfo receipt = AppReceiptInfo.DeserializeObject(rValue);

                //订单数据
                ShareDetialInfo detailInfo = new ShareDetialInfo();
                detailInfo.UserID    = userID;
                detailInfo.OrderID   = orderID;
                detailInfo.PayAmount = payAmount;
                detailInfo.ShareID   = 100;

                //处理数据
                TreasureFacade treasureFacade = new TreasureFacade();
                treasureFacade.WriteReturnAppDetail(detailInfo, receipt);

                if (receipt.Status == 0)
                {
                    DataSet ds = treasureFacade.GetAppInfoByProductID(receipt.Receipt.product_id);
                    if (ds.Tables[0].Rows.Count == 0)
                    {
                        Response.Write("失败");
                        return;
                    }

                    //写充值记录
                    try
                    {
                        Message msg = treasureFacade.FilliedApp(detailInfo);
                        if (msg.Success)
                        {
                            Response.Write("0");
                        }
                        else
                        {
                            Response.Write(msg.Content);
                        }
                    }
                    catch (Exception ex)
                    {
                        Response.Write(ex.Message);
                    }
                }
                else
                {
                    Response.Write("失败");
                }
            }
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 绑定数据
        /// </summary>
        protected void BindRankData( )
        {
            TreasureFacade treasureFacade = new TreasureFacade(kindID);
            string         sqlQuery       = "Select Top 100 * from GameScoreInfo(nolock) order by Score desc";
            DataSet        ds             = treasureFacade.GetDataSetByWhere(sqlQuery);

            if (ds.Tables[0].Rows.Count > 0)
            {
                rptRank.DataSource = ds;
                rptRank.DataBind( );
            }
        }
Ejemplo n.º 11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            TreasureFacade treasureFacade = new TreasureFacade();
            string         yb_data        = Request["data"].ToString();
            string         yb_encryptkey  = Request["encryptkey"].ToString();
            Boolean        ok             = EncryptUtil.checkDecryptAndSign(yb_data, yb_encryptkey, Config.yibaoPublickey, Config.merchantPrivatekey);

            if (ok)
            {
                string AESKey   = RSA.Class.RSAFromPkcs8.decryptData(yb_encryptkey, Config.merchantPrivatekey, "UTF-8");
                string realData = payapi_mobile_demo.AES.Decrypt(yb_data, AESKey);


                SortedDictionary <string, object> sd = Newtonsoft.Json.JsonConvert.DeserializeObject <SortedDictionary <string, object> >(realData);


                /** 3.取得data明文sign。 */
                string sign = (string)sd["sign"];

                /** 4.对map中的值进行验证 */
                StringBuilder signData = new StringBuilder();
                foreach (var item in sd)
                {
                    /** 把sign参数隔过去 */
                    if (item.Key == "sign")
                    {
                        continue;
                    }
                    signData.Append(item.Value);
                }

                string          orderid    = (string)sd["orderid"];
                string          money      = (Convert.ToInt32(sd["amount"])).ToString();
                ShareDetialInfo detailInfo = new ShareDetialInfo();//请不要修改或删除
                detailInfo.PayAmount = decimal.Parse(money) / 100;
                detailInfo.OrderID   = orderid;
                detailInfo.IPAddress = GameRequest.GetUserIP();
                Message message = treasureFacade.FilliedOnline(detailInfo, 0);
                if (message.Success)
                {
                    Response.Write("success");
                }
                else
                {
                    Response.Write("sorry");
                }
            }
            else
            {
                Response.Write("sorry");
            }
        }
Ejemplo n.º 12
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strReason = CtrlHelper.GetText(txtReason);
            int    kindID    = int.Parse(ddlGame.SelectedValue);


            if (kindID <= 0)
            {
                MessageBox("请选择游戏");
                return;
            }
            if (string.IsNullOrEmpty(strReason))
            {
                MessageBox("清零原因不能为空");
                return;
            }

            AccountsInfo modelAccountInfo = new AccountsInfo( );

            string[] arrUserIDList = StrParamsList.Split(new char[] { ',' });
            int      count         = 0;

            foreach (string strid in arrUserIDList)
            {
                if (Utils.Validate.IsPositiveInt(strid))
                {
                    modelAccountInfo = aideAccountsFacade.GetAccountInfoByUserID(int.Parse(strid));
                    if (modelAccountInfo == null)
                    {
                        continue;
                    }
                    //new TreasureFacade( kindID ).GrantClearScore( int.Parse( strid ), kindID, userExt.UserID, strReason, GameRequest.GetUserIP( ) );
                    TreasureFacade tf  = new TreasureFacade(kindID);
                    Message        msg = tf.GrantClearScore(int.Parse(strid), kindID, userExt.UserID, strReason, GameRequest.GetUserIP( ));
                    if (msg.Success)
                    {
                        count++;
                    }
                }
            }
            if (count > 0)
            {
                MessageBox("所选用户共有" + count + "个用户积分为负,全部清除成功!");
            }
            else
            {
                MessageBox("所选用户没有积分为负的用户");
            }
        }
Ejemplo n.º 13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //财富排行
            TreasureFacade treasureFacade = new TreasureFacade();
            DataSet        ds             = treasureFacade.GetScoreRanking(10);

            rptScoreRanking.DataSource = ds;
            rptScoreRanking.DataBind();

            //魅力排行
            AccountsFacade accountsFacade = new AccountsFacade();

            ds = accountsFacade.GetLovesRanking(10);
            rptLovesRanking.DataSource = ds;
            rptLovesRanking.DataBind();
        }
Ejemplo n.º 14
0
        protected void rptScoreList_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            if (e.CommandName == "Clear")
            {
                int kindID = Convert.ToInt32(e.CommandArgument.ToString());

                TreasureFacade treasureFacade = new TreasureFacade(kindID);
                Message        umsg           = treasureFacade.ClearGameScore(Fetch.GetUserCookie().UserID, GameRequest.GetUserIP());
                if (umsg.Success)
                {
                    ShowAndRedirect("负分清零成功!", "/Member/ClearScore.aspx");
                }
                else
                {
                    Show(umsg.Content);
                }
            }
        }
Ejemplo n.º 15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string key      = System.Configuration.ConfigurationSettings.AppSettings["DayKey"];            //密钥
            string merId    = System.Configuration.ConfigurationSettings.AppSettings["DayMerId"];          //商户ID
            string status   = GameRequest.GetFormString("status");                                         //交易状态
            string sign     = GameRequest.GetFormString("sign");                                           //签名
            string orderId  = GameRequest.GetFormString("orderId");                                        //订单号
            float  payMoney = GameRequest.GetFormFloat("payMoney", 0);                                     //金额
            string operDate = GameRequest.GetFormString("operDate");                                       //订单日期
            string userName = GameRequest.GetFormString("userName");                                       //用户名
            string showUrl  = "http://" + HttpContext.Current.Request.Url.Authority + "/Pay/PayShow.aspx"; //交易完成后提示地址
            string signStr  = merId + "|" + orderId + "|" + status + "|" + payMoney + "|" + operDate + "|" + userName + "|" + key;
            string testSign = EncryptMD5(signStr, false, 32);                                              //计算签名

            ReturnDayDetailInfo result = new ReturnDayDetailInfo( );

            result.OrderID  = orderId;
            result.PayMoney = Convert.ToDecimal(payMoney);
            result.Sign     = sign;
            result.UserName = userName;
            result.Status   = status;

            //天天付支付结果入库
            TreasureFacade treasureFacade = new TreasureFacade( );

            treasureFacade.WriteReturnDayDetail(result);

            if (signStr == testSign)
            {
                //交易状态为005时表示交易完成
                if (status == "055")
                {
                    ShareDetialInfo detailInfo = new ShareDetialInfo( );
                    detailInfo.OrderID   = orderId;
                    detailInfo.IPAddress = Utility.UserIP;
                    Message umsg = treasureFacade.FilliedOnline(detailInfo, 0);
                    if (umsg.Success)
                    {
                        Response.Write("OK");
                    }
                }
            }
        }
Ejemplo n.º 16
0
        protected void Logic(SZXCallbackResult result)
        {
            if (result.R1_Code == "1")
            {
                ShareDetialInfo detailInfo     = new ShareDetialInfo();
                TreasureFacade  treasureFacade = new TreasureFacade();

                detailInfo.OrderID   = result.P2_Order;
                detailInfo.IPAddress = Utility.UserIP;
                detailInfo.PayAmount = decimal.Parse(result.P7_realAmount);
                Message msg = treasureFacade.FilliedOnline(detailInfo, 0);
                Response.Write(detailInfo.PayAmount);
                Response.Write(msg.Content);
                Response.Write("支付成功");
            }
            else
            {
                Response.Write("支付失败");
            }
        }
Ejemplo n.º 17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            TreasureFacade treasureFacade = new TreasureFacade();
            string         yb_data        = Request["data"].ToString();
            string         yb_encryptkey  = Request["encryptkey"].ToString();

            Boolean ok = EncryptUtil.checkDecryptAndSign(yb_data, yb_encryptkey, Config.yibaoPublickey, Config.merchantPrivatekey);

            if (ok)
            {
                string AESKey   = RSA.Class.RSAFromPkcs8.decryptData(yb_encryptkey, Config.merchantPrivatekey, "UTF-8");
                string realData = payapi_mobile_demo.AES.Decrypt(yb_data, AESKey);
                SortedDictionary <string, object> sd = Newtonsoft.Json.JsonConvert.DeserializeObject <SortedDictionary <string, object> >(realData);
                /** 3.取得data明文sign。 */
                string sign = (string)sd["sign"];
                /** 4.对map中的值进行验证 */
                StringBuilder signData = new StringBuilder();
                foreach (var item in sd)
                {
                    /** 把sign参数隔过去 */
                    if (item.Key == "sign")
                    {
                        continue;
                    }
                    signData.Append(item.Value);
                }
                string orderid = (string)sd["orderid"];

                Request.Cookies.Remove("ErrorMsg");
                Response.Redirect("/showPayInfo.html");
            }
            else
            {
                HttpCookie UserCookie2 = new HttpCookie("ErrorMsg");
                UserCookie2["error"] = HttpUtility.UrlEncode("订单失败");
                UserCookie2.Expires  = DateTime.Now.AddMinutes(7);
                Response.Cookies.Add(UserCookie2);
                Response.Redirect("/showPayInfo.html");
            }
        }
Ejemplo n.º 18
0
        protected void PayApp(HttpContext context)
        {
            #region 验证

            if (userID == 0 || orderID == "" || payAmount == 0)
            {
                context.Response.Write("非法操作");
            }
            #endregion

            #region 处理

            ShareDetialInfo detailInfo     = new ShareDetialInfo();
            TreasureFacade  treasureFacade = new TreasureFacade();

            //request
            detailInfo.UserID    = userID;
            detailInfo.OrderID   = orderID;
            detailInfo.PayAmount = Convert.ToDecimal(payAmount);
            detailInfo.ShareID   = 100;

            try
            {
                Message msg = treasureFacade.FilliedApp(detailInfo);
                if (msg.Success)
                {
                    context.Response.Write("0");
                }
                else
                {
                    context.Response.Write(msg.Content);
                }
            }
            catch (Exception ex)
            {
                context.Response.Write(ex.Message);
            }
            #endregion
        }
Ejemplo n.º 19
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     if (!base.IsPostBack)
     {
         System.IO.StreamReader streamReader = new System.IO.StreamReader(base.Request.InputStream);
         this.receiptData = streamReader.ReadToEnd();
         string          jsonText        = this.AppInfo(this.receiptData);
         AppReceiptInfo  appReceiptInfo  = AppReceiptInfo.DeserializeObject(jsonText);
         ShareDetialInfo shareDetialInfo = new ShareDetialInfo();
         shareDetialInfo.UserID    = this.userID;
         shareDetialInfo.OrderID   = this.orderID;
         shareDetialInfo.PayAmount = this.payAmount;
         shareDetialInfo.ShareID   = 100;
         TreasureFacade treasureFacade = new TreasureFacade();
         treasureFacade.WriteReturnAppDetail(shareDetialInfo, appReceiptInfo);
         if (appReceiptInfo.Status == 0)
         {
             try
             {
                 Message message = treasureFacade.FilliedApp(shareDetialInfo, appReceiptInfo.Receipt.product_id);
                 if (message.Success)
                 {
                     base.Response.Write("0");
                 }
                 else
                 {
                     base.Response.Write(message.Content);
                 }
                 return;
             }
             catch (System.Exception ex)
             {
                 base.Response.Write(ex.Message);
                 return;
             }
         }
         base.Response.Write("失败");
     }
 }
Ejemplo n.º 20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            TreasureFacade treasureFacade = new TreasureFacade();
            string         yb_data        = Request["data"].ToString();
            string         yb_encryptkey  = Request["encryptkey"].ToString();

            // Response.Write(yb_data+"<br/>"+yb_encryptkey);
            Boolean ok = EncryptUtil.checkDecryptAndSign(yb_data, yb_encryptkey, Config.yibaoPublickey, Config.merchantPrivatekey);

            if (ok)
            {
                string AESKey   = RSA.Class.RSAFromPkcs8.decryptData(yb_encryptkey, Config.merchantPrivatekey, "UTF-8");
                string realData = payapi_mobile_demo.AES.Decrypt(yb_data, AESKey);


                SortedDictionary <string, object> sd = Newtonsoft.Json.JsonConvert.DeserializeObject <SortedDictionary <string, object> >(realData);
                /** 3.取得data明文sign。 */
                string sign = (string)sd["sign"];

                /** 4.对map中的值进行验证 */
                StringBuilder signData = new StringBuilder();
                foreach (var item in sd)
                {
                    /** 把sign参数隔过去 */
                    if (item.Key == "sign")
                    {
                        continue;
                    }
                    signData.Append(item.Value);
                }

                string orderid = (string)sd["orderid"];
                Response.Redirect("/WiteCard.html?OID=" + orderid);
            }
            else
            {
                Response.Write("sorry");
            }
        }
Ejemplo n.º 21
0
        protected void Page_Load(object sender, EventArgs e)
        {
            TreasureFacade treasureFacade = new TreasureFacade();
            string         outOrder_no    = Request["outOrder_no"].ToString();
            string         sign           = Request["sign"].ToString();
            string         realsign       = weixindes.Decrypt(sign, pwd);

            if (("?outOrder_no=" + outOrder_no).Equals(realsign))
            {
                ShareDetialInfo detailInfo = new ShareDetialInfo();
                detailInfo.OrderID   = outOrder_no;
                detailInfo.IPAddress = Utility.UserIP;
                OnLineOrder onlineorder = treasureFacade.GetOnlineOrder(outOrder_no);
                if (onlineorder != null)
                {
                    detailInfo.PayAmount = onlineorder.CardPrice;
                    Message msg = treasureFacade.FilliedOnline(detailInfo, 0);
                    if (!msg.Success)
                    {
                        Response.Write("Fail");
                    }
                    else
                    {
                        Response.Write("Success");
                    }
                }
                else
                {
                    Response.Write("Fail");
                }
            }
            else
            {
                Response.Write("Fail");
            }
        }
Ejemplo n.º 22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //判断是否登录
            if (!Fetch.IsUserOnline( ))
            {
                return;
            }

            if (!IsPostBack)
            {
                Message umsg = accountsFacade.GetUserGlobalInfo(Fetch.GetUserCookie( ).UserID, 0, "");
                if (umsg.Success)
                {
                    UserInfo user = umsg.EntityList[0] as UserInfo;
                    if (user != null && user.MemberOrder <= 0)
                    {
                        this.form1.Visible      = false;
                        this.divRight.Visible   = true;
                        this.divRight.InnerHtml = "<div class=\"Uerror\">抱歉!您不是会员,不能进行负分清零操作。<br /><a href=\"/Pay/PayIndex.aspx\" class=\"lan\" target=\"_blank\">点击购买会员</a></div>";
                        return;
                    }
                }

                DataTable  dtScore     = new DataTable( );
                DataColumn colKindName = new DataColumn("KindName");
                DataColumn colScore    = new DataColumn("Score");
                DataColumn colKindID   = new DataColumn("KindID");

                dtScore.Columns.Add(colKindName);
                dtScore.Columns.Add(colScore);
                dtScore.Columns.Add(colKindID);

                IList <GameKindItem> kinds = platformFacade.GetIntegralKinds();

                foreach (GameKindItem kind in kinds)
                {
                    TreasureFacade treasureFacade = new TreasureFacade(kind.KindID);

                    GameScoreInfo scoreInfo = treasureFacade.GetTreasureInfo2(Fetch.GetUserCookie( ).UserID);
                    if (scoreInfo == null)
                    {
                        continue;
                    }
                    if (scoreInfo.Score < 0)
                    {
                        DataRow r = dtScore.NewRow( );
                        r["KindName"] = kind.KindName;
                        r["KindID"]   = kind.KindID;
                        r["Score"]    = scoreInfo.Score;

                        dtScore.Rows.Add(r);
                    }
                }

                if (dtScore.Rows.Count > 0)
                {
                    rptScoreList.DataSource = dtScore;
                    rptScoreList.DataBind( );

                    this.lblAccounts.Text = Fetch.GetUserCookie( ).Accounts;
                    this.lblNumber.Text   = dtScore.Rows.Count.ToString( );

                    this.form1.Visible    = true;
                    this.divRight.Visible = false;
                }
                else
                {
                    this.form1.Visible    = false;
                    this.divRight.Visible = true;

                    this.divRight.InnerHtml = "<div class=\"Uright\">恭喜!您的游戏成绩保持的非常好,没有负分需要清零。</div>";
                }
            }

            /*Themes.Standard.Common_Header sHeader = ( Themes.Standard.Common_Header )this.FindControl( "sHeader" );
             * sHeader.title = "会员中心";*/
        }
Ejemplo n.º 23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            TreasureFacade treasureFacade           = new TreasureFacade();
            SortedDictionary <string, string> sPara = GetRequestGet();

            try
            {
                if (sPara.Count > 0)//判断是否有带返回参数
                {
                    Notify aliNotify    = new Notify();
                    bool   verifyResult = aliNotify.Verify(sPara, Request.QueryString["notify_id"], Request.QueryString["sign"]);

                    if (verifyResult)//验证成功
                    {
                        /////////////////////////////////////////////////////////////////////////////////////////////////////////////
                        //请在这里加上商户的业务逻辑程序代码


                        //——请根据您的业务逻辑来编写程序(以下代码仅作参考)——
                        //获取支付宝的通知返回参数,可参考技术文档中页面跳转同步通知参数列表

                        //商户订单号

                        string out_trade_no = Request.QueryString["out_trade_no"];

                        //支付宝交易号

                        string trade_no = Request.QueryString["trade_no"];

                        //交易状态
                        string trade_status = Request.QueryString["trade_status"];


                        if (Request.QueryString["trade_status"] == "TRADE_FINISHED" || Request.QueryString["trade_status"] == "TRADE_SUCCESS")
                        {
                            //判断该笔订单是否在商户网站中已经做过处理
                            //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
                            //如果有做过处理,不执行商户的业务程序
                            Response.Redirect("/WiteCard.html?OID=" + out_trade_no);
                        }
                        else
                        {
                            Response.Redirect("/WiteCard.html?OID=" + out_trade_no);
                        }

                        //打印页面

                        //——请根据您的业务逻辑来编写程序(以上代码仅作参考)——

                        /////////////////////////////////////////////////////////////////////////////////////////////////////////////
                    }
                    else//验证失败
                    {
                        Response.Write("验证失败,请重试");
                    }
                }
                else
                {
                    Response.Write("交易失败,请重试");
                }
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
Ejemplo n.º 24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            TreasureFacade treasureFacade = new TreasureFacade();

            SortedDictionary <string, string> sPara = GetRequestPost();

            if (sPara.Count > 0)//判断是否有带返回参数
            {
                Notify aliNotify    = new Notify();
                bool   verifyResult = aliNotify.Verify(sPara, Request["notify_id"], Request["sign"]);

                if (verifyResult)//验证成功
                {
                    //获取支付宝的通知返回参数,可参考技术文档中服务器异步通知参数列表

                    //商户订单号

                    string out_trade_no = Request["out_trade_no"];

                    //支付宝交易号

                    string trade_no = Request["trade_no"];

                    //交易状态
                    string trade_status = Request["trade_status"];
                    string total_fee    = Request["total_fee"];

                    if (Request["trade_status"] == "TRADE_FINISHED")
                    {
                        ShareDetialInfo detailInfo = new ShareDetialInfo();
                        detailInfo.OrderID   = out_trade_no;
                        detailInfo.IPAddress = Utility.UserIP;
                        detailInfo.PayAmount = decimal.Parse(total_fee);
                        Message msg = treasureFacade.FilliedOnline(detailInfo, 0);
                        if (!msg.Success)
                        {
                            Response.Write(msg.Content);
                        }
                        else
                        {
                            Response.Write("支付成功");
                        }
                    }
                    else if (Request["trade_status"] == "TRADE_SUCCESS")
                    {
                        ShareDetialInfo detailInfo = new ShareDetialInfo();
                        detailInfo.OrderID   = out_trade_no;
                        detailInfo.IPAddress = Utility.UserIP;
                        detailInfo.PayAmount = decimal.Parse(total_fee);
                        Message msg = treasureFacade.FilliedOnline(detailInfo, 0);
                        if (!msg.Success)
                        {
                            Response.Write(msg.Content);
                        }
                        else
                        {
                            Response.Write("支付成功");
                        }
                    }
                    else
                    {
                    }

                    //——请根据您的业务逻辑来编写程序(以上代码仅作参考)——

                    Response.Write("success");//请不要修改或删除

                    /////////////////////////////////////////////////////////////////////////////////////////////////////////////
                }
                else//验证失败
                {
                    Response.Write("fail");
                }
            }
            else
            {
                Response.Write("无通知参数");
            }
        }