Exemplo n.º 1
0
        /// <summary>
        /// 移动购买奖品
        /// </summary>
        /// <param name="context"></param>
        public void MobileBuyAward(HttpContext context)
        {
            Message       msg      = new Message();
            AjaxJsonValid ajaxJson = new AjaxJsonValid();

            int    userID    = GameRequest.GetFormInt("userID", 0);          //用户标识
            string signature = GameRequest.GetFormString("signature");       //签名
            string time      = GameRequest.GetFormString("time");            //过期时间

            //验证签名
            Message message = FacadeManage.aideAccountsFacade.CheckUserSignature(userID, time, signature);

            if (!message.Success)
            {
                ajaxJson.msg = message.Content;
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }

            //获取参数
            int    awardID       = GameRequest.GetFormInt("awardID", 0);                          //商品ID
            int    counts        = GameRequest.GetFormInt("counts", 0);                           //购买数量
            string compellation  = TextFilter.FilterScript(GameRequest.GetFormString("name"));    //真实姓名
            string mobilePhone   = TextFilter.FilterScript(GameRequest.GetFormString("phone"));   //移动电话
            int    province      = GameRequest.GetFormInt("province", -1);                        //省份
            int    city          = GameRequest.GetFormInt("city", -1);                            //城市
            int    area          = GameRequest.GetFormInt("area", -1);                            //地区
            string dwellingPlace = TextFilter.FilterScript(GameRequest.GetFormString("address")); //详细地址

            //验证奖品
            if (awardID == 0)
            {
                ajaxJson.msg = "非常抱歉,你所选购的商品不存在!";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }

            //验证数量
            if (counts <= 0)
            {
                ajaxJson.msg = "请输入正确的兑换数量!";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }
            if (counts > 99)
            {
                ajaxJson.msg = "每次兑换的数量最多为 99 件";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }

            AwardInfo awardInfo = FacadeManage.aideNativeWebFacade.GetAwardInfo(awardID);

            //验证真实姓名
            msg = CheckingRealNameFormat(compellation, false);
            if (!msg.Success)
            {
                ajaxJson.msg = "请输入正确的收件人";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }

            //验证手机号
            msg = CheckingMobilePhoneNumFormat(mobilePhone, false);
            if (!msg.Success)
            {
                ajaxJson.msg = "请输入正确的手机号码";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }

            //验证地址
            if (province == -1)
            {
                ajaxJson.msg = "请选择省份";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }
            if (city == -1)
            {
                ajaxJson.msg = "请选择城市";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }
            if (area == -1)
            {
                ajaxJson.msg = "请选择地区";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }
            if (string.IsNullOrEmpty(dwellingPlace))
            {
                ajaxJson.msg = "请输入详细地址";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }

            //  防止数据溢出,商品单价不能超过2000万
            if (awardInfo.Price > 20000000)
            {
                ajaxJson.msg = "很抱歉,该商品暂停兑换!";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }

            //验证用户
            UserInfo userInfo = FacadeManage.aideAccountsFacade.GetUserGlobalInfo(userID, 0, "").EntityList[0] as UserInfo;

            //验证余额
            int totalAmount = awardInfo.Price * counts;     //总金额

            if (totalAmount > userInfo.UserMedal)
            {
                ajaxJson.msg = "很抱歉!您的元宝数不足,不能兑换该奖品";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }

            //验证库存
            if (awardInfo.Inventory <= counts)
            {
                ajaxJson.msg = "很抱歉!奖品的库存数不足,请更新其他奖品或者等待补充库存";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }

            //扣除奖牌
            userInfo.UserMedal = userInfo.UserMedal - totalAmount;

            //更新奖牌
            AwardOrder awardOrder = new AwardOrder();

            awardOrder.UserID        = userInfo.UserID;
            awardOrder.AwardID       = awardID;
            awardOrder.AwardPrice    = awardInfo.Price;
            awardOrder.AwardCount    = counts;
            awardOrder.TotalAmount   = totalAmount;
            awardOrder.Compellation  = compellation;
            awardOrder.MobilePhone   = mobilePhone;
            awardOrder.QQ            = "";
            awardOrder.Province      = province;
            awardOrder.City          = city;
            awardOrder.Area          = area;
            awardOrder.DwellingPlace = dwellingPlace;
            awardOrder.PostalCode    = "";
            awardOrder.BuyIP         = Utility.UserIP;

            msg = FacadeManage.aideNativeWebFacade.BuyAward(awardOrder);
            if (msg.Success)
            {
                ajaxJson.SetValidDataValue(true);
                ajaxJson.msg = "恭喜您!兑换成功";
                awardOrder   = msg.EntityList[0] as AwardOrder;
                context.Response.Write(ajaxJson.SerializeToJson());
            }
            else
            {
                ajaxJson.msg = msg.Content;
                context.Response.Write(ajaxJson.SerializeToJson());
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 上传自定义头像
        /// </summary>
        /// <param name="context"></param>
        public void UploadFace(HttpContext context)
        {
            Message       msg = new Message();
            AjaxJsonValid ajv = new AjaxJsonValid();

            int    userID    = GameRequest.GetFormInt("userID", 0);         // 用户标识
            string signature = GameRequest.GetFormString("signature");      // 签名数据
            string time      = GameRequest.GetFormString("time");           // 过期时间
            string clientIP  = GameRequest.GetFormString("clientIP");       // 客户端IP
            string machineID = GameRequest.GetFormString("machineID");      // 机器码ID

            // 验证签名
            //Message message = FacadeManage.aideAccountsFacade.CheckUserSignature(userID, time, signature);
            //if (!message.Success)
            //{
            //    ajv.msg = message.Content;
            //    context.Response.Write(ajv.SerializeToJson());
            //    return;
            //}

            //// 验证数据
            //if (string.IsNullOrEmpty(clientIP))
            //{
            //    ajv.msg = "请传入IP地址!";
            //    context.Response.Write(ajv.SerializeToJson());
            //    return;
            //}
            //if (string.IsNullOrEmpty(machineID))
            //{
            //    ajv.msg = "请传入机器码ID!";
            //    context.Response.Write(ajv.SerializeToJson());
            //    return;
            //}

            // 最大上传 1M
            int maxSize = 1048576;

            // 验证文件格式
            if (context.Request.Files.Count == 0)
            {
                ajv.msg = "请选择一个头像!";
                context.Response.Write(ajv.SerializeToJson());
                return;
            }
            HttpPostedFile file = context.Request.Files[0];

            if (file.InputStream == null || file.InputStream.Length == 0)
            {
                ajv.msg = "请上传有效的头像!";
                context.Response.Write(ajv.SerializeToJson());
                return;
            }
            // 验证头像大小
            if (file.InputStream.Length > maxSize)
            {
                msg.Content = string.Format("头像不能超过 {0} M!", 1);
                context.Response.Write(ajv.SerializeToJson());
                return;
            }
            // 尝试转化为图片
            System.Drawing.Image image = null;
            try
            {
                image = System.Drawing.Image.FromStream(file.InputStream);
            }
            catch
            {
                image.Dispose();
                msg.Content = string.Format("非法文件,目前只支持图片格式文件,对您使用不便感到非常抱歉。");
                context.Response.Write(ajv.SerializeToJson());
                return;
            }

            //缩放图片
            Bitmap   bitmap = new Bitmap(48, 48);
            Graphics g      = Graphics.FromImage(bitmap);

            g.DrawImage(image, 0, 0, 48, 48);

            //获取像素
            int x, y, site = 0;

            byte[] b = new byte[48 * 48 * 4];
            for (y = 0; y < 48; y++)
            {
                for (x = 0; x < 48; x++)
                {
                    Color pixelColor = bitmap.GetPixel(x, y);
                    b[site]     = pixelColor.B;
                    b[site + 1] = pixelColor.G;
                    b[site + 2] = pixelColor.R;
                    b[site + 3] = 0;
                    site        = site + 4;
                }
            }

            //保存图片
            AccountsFace accountsFace = new AccountsFace();

            accountsFace.UserID     = userID;
            accountsFace.CustomFace = b;
            accountsFace.InsertAddr = GameRequest.GetUserIP();
            accountsFace.InsertTime = DateTime.Now;
            msg = FacadeManage.aideAccountsFacade.InsertCustomFace(accountsFace);
            if (msg.Success)
            {
                AccountsInfo model = msg.EntityList[0] as AccountsInfo;
                ajv.AddDataItem("CustomID", model.CustomID);
            }
            ajv.msg = "上传成功!";
            ajv.SetValidDataValue(true);
            context.Response.Write(ajv.SerializeToJson());

            //释放资源
            image.Dispose();
            bitmap.Dispose();
            g.Dispose();
        }
Exemplo n.º 3
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            if (TextUtility.EmptyTrimOrNull(CtrlHelper.GetTextAndFilter(txtNickName)))
            {
                Show("抱歉!您输入的昵称错误了。");
                return;
            }

            Message umsg = FacadeManage.aideAccountsFacade.ModifyUserNickname(Fetch.GetUserCookie().UserID, TextFilter.FilterScript(txtNickName.Text.Trim()), GameRequest.GetUserIP());

            if (umsg.Success)
            {
                ShowAndRedirect("昵称修改成功!", "/Member/ModifyNikeName.aspx");
            }
            else
            {
                Show(umsg.Content);
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// 玩家领取推广返利
 /// </summary>
 /// <param name="userid"></param>
 /// <param name="num"></param>
 /// <returns></returns>
 public Message UserSpreadReceive(int userid, int num)
 {
     return(recordData.UserSpreadReceive(userid, num, GameRequest.GetUserIP()));
 }
Exemplo n.º 5
0
        /// <summary>
        /// 通过申诉重置密码
        /// </summary>
        /// <param name="context"></param>
        public void ResetPwdByReport(HttpContext context)
        {
            Message       msg          = new Message();
            AjaxJsonValid ajaxJson     = new AjaxJsonValid();
            int           userId       = 0;
            string        validateCode = GameRequest.GetFormString("txtCode");

            //验证码验证
            if (!validateCode.Equals(Fetch.GetVerifyCode(), StringComparison.InvariantCultureIgnoreCase))
            {
                ajaxJson.msg = "验证码不正确";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }

            //链接验证
            string     number     = Utils.GameRequest.GetFormString("number");
            string     sign       = Utils.GameRequest.GetFormString("sign");
            LossReport lossReport = FacadeManage.aideNativeWebFacade.GetLossReport(number);

            if (lossReport == null)
            {
                ajaxJson.msg = "重置失败,非法操作";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }
            if (lossReport.ProcessStatus == 3)
            {
                ajaxJson.msg = "重置失败,该申诉号已被处理,不能重复操作";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }
            string key         = AppConfig.ReportForgetPasswordKey;
            string confirmSign = Utility.MD5(number + lossReport.UserID + lossReport.ReportDate.ToString() + lossReport.Random + key);

            if (sign != confirmSign)
            {
                ajaxJson.msg = "重置失败,签名错误";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }
            if (DateTime.Now > lossReport.OverDate)
            {
                ajaxJson.msg = "重置失败,该申诉链接已经过期,链接有效期为24个小时";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }
            userId = lossReport.UserID;

            string password        = GameRequest.GetFormString("txtPassword");
            string confirmPassword = GameRequest.GetFormString("txtConfirmPassword");

            //验证密码
            if (password != confirmPassword)
            {
                ajaxJson.msg = "两次输入的密码不一直";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }
            msg = InputDataValidate.CheckingPasswordFormat(password);
            if (!msg.Success)
            {
                ajaxJson.msg = msg.Content;
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }

            //验证帐号
            UserInfo userInfo = FacadeManage.aideAccountsFacade.GetUserBaseInfoByUserID(userId);

            if (!msg.Success)
            {
                ajaxJson.msg = msg.Content;
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }

            //重置密码
            string oldPass = userInfo.LogonPass;

            userInfo.LogonPass = Utility.MD5(password);
            msg          = FacadeManage.aideAccountsFacade.ResetLoginPasswdByLossReport(userInfo, number);
            ajaxJson.msg = msg.Content;
            ajaxJson.SetValidDataValue(msg.Success);
            context.Response.Write(ajaxJson.SerializeToJson());
        }
Exemplo n.º 6
0
        /// <summary>
        /// 更新等级配置
        /// </summary>
        private void UpdateLevelConfig(HttpContext context)
        {
            //验证权限
            int             moduleID = 408;
            AdminPermission adminPer = new AdminPermission(userExt, moduleID);

            if (!adminPer.GetPermission((long)Permission.Delete))
            {
                ajv.msg = "非法操作,无操作权限";
                context.Response.Write(ajv.SerializeToJson());
                return;
            }

            int    levelID    = GameRequest.GetFormInt("id", 0);
            string experience = GameRequest.GetFormString("experience");
            string gold       = GameRequest.GetFormString("gold");
            string medal      = GameRequest.GetFormString("medal");
            string remark     = GameRequest.GetFormString("remark");

            //验证ID
            if (levelID == 0)
            {
                ajv.msg = "非法操作,无效的等级标识";
                context.Response.Write(ajv.SerializeToJson());
                return;
            }

            //验证经验值
            if (!Utils.Validate.IsNumeric(experience))
            {
                ajv.msg = "请输入正确的经验值";
                context.Response.Write(ajv.SerializeToJson());
                return;
            }

            //验证金币
            if (!Utils.Validate.IsNumeric(gold))
            {
                ajv.msg = "请输入正确的金币";
                context.Response.Write(ajv.SerializeToJson());
                return;
            }

            //验证元宝
            if (!Utils.Validate.IsNumeric(medal))
            {
                ajv.msg = "请输入正确的元宝";
                context.Response.Write(ajv.SerializeToJson());
                return;
            }

            //验证备注
            if (remark.Length > 64)
            {
                ajv.msg = "备注的最大长度不能超过64";
                context.Response.Write(ajv.SerializeToJson());
                return;
            }

            GrowLevelConfig glc = new GrowLevelConfig();

            glc.LevelID     = levelID;
            glc.Experience  = Convert.ToInt32(experience);
            glc.RewardGold  = Convert.ToInt32(gold);
            glc.RewardMedal = Convert.ToInt32(medal);
            glc.LevelRemark = remark;

            int result = FacadeManage.aidePlatformFacade.UpdateGrowLevelConfig(glc);

            if (result > 0)
            {
                ajv.msg = "修改成功";
                ajv.SetValidDataValue(true);
            }
            else
            {
                ajv.msg = "修改失败";
            }
            context.Response.Write(ajv.SerializeToJson());
        }
Exemplo n.º 7
0
        public JsonResult Daifu(int tradeId, string orderId, string bankAccount, string bankAccountCode, decimal bankAmount, string selectBankCode)
        {
            if (string.IsNullOrEmpty(orderId) || string.IsNullOrEmpty(bankAccount) || string.IsNullOrEmpty(bankAccountCode) || bankAmount <= 0m || string.IsNullOrEmpty(selectBankCode))
            {
                return(Json(new
                {
                    IsOk = false,
                    Msg = "订单号或者银行信息有一项未填写"
                }));
            }
            string formString = GameRequest.GetFormString("bankAddress");

            if (formString == "")
            {
                return(Json(new
                {
                    IsOk = false,
                    Msg = "请输入开户行地址"
                }));
            }
            string flowid = "";
            string text   = GameRequest.GetString("Province");
            string text2  = GameRequest.GetString("City");

            if (text == "")
            {
                text = "江西";
            }
            if (text2 == "")
            {
                text2 = "南昌";
            }
            string text3 = DaiFu.Daifu_youmifu(orderId, bankAmount, bankAccount, bankAccountCode, selectBankCode, formString, text, text2, base.Request.Url.Host, out flowid);
            byte   b     = 3;
            string text4 = "";

            if (text3.ToUpper() == "SUCCESS")
            {
                b     = 2;
                text4 = "代付成功";
                Dictionary <string, object> dictionary = new Dictionary <string, object>();
                dictionary["id"]          = 0;
                dictionary["orderid"]     = orderId;
                dictionary["type"]        = b;
                dictionary["msg"]         = text4;
                dictionary["strOperator"] = user.Username;
                dictionary["strClientIP"] = GameRequest.GetUserIP();
                dictionary["strErr"]      = "";
                Message message = FacadeManage.aideAccountsFacade.ExcuteByProce("P_Acc_PlayerDrawRefused", dictionary);
                if (message.Success)
                {
                    return(Json(new
                    {
                        IsOk = true,
                        Msg = text4
                    }));
                }
                return(Json(new
                {
                    IsOk = false,
                    Msg = text4 + "  数据处理失败," + message.Content
                }));
            }
            return(Json(new
            {
                IsOk = false,
                Msg = text3
            }));
        }
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            int medals = Utility.StrToInt(txtMedals.Text.Trim( ), 0);

            if (medals <= 0)
            {
                Show("兑换的奖牌数必须为正整数!");
                return;
            }
            Message umsg = accountsFacade.UserConvertMedal(Fetch.GetUserCookie( ).UserID, medals, 10, GameRequest.GetUserIP( ));

            if (umsg.Success)
            {
                ShowAndRedirect("奖牌兑换成功!", "/Member/ConvertMedal.aspx");
            }
            else
            {
                Show(umsg.Content);
            }
        }
Exemplo n.º 9
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strReason = CtrlHelper.GetText(txtReason);
            int    score     = CtrlHelper.GetInt(txtScore, 0);
            int    kindID    = int.Parse(ddlGame.SelectedValue);

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

            AccountsInfo modelAccountInfo = new AccountsInfo( );

            string[] arrUserIDList = StrParamsList.Split(new char[] { ',' });
            foreach (string strid in arrUserIDList)
            {
                if (Utils.Validate.IsPositiveInt(strid))
                {
                    modelAccountInfo = aideAccountsFacade.GetAccountInfoByUserID(int.Parse(strid));
                    if (modelAccountInfo == null)
                    {
                        continue;
                    }

                    new TreasureFacade(kindID).GrantScore(int.Parse(strid), kindID, score, userExt.UserID, strReason, GameRequest.GetUserIP( ));
                }
            }
            MessageBox("确认成功");
        }
Exemplo n.º 10
0
        /// <summary>
        /// 购买商品
        /// </summary>
        /// <param name="context"></param>
        private void BuyAward(HttpContext context)
        {
            Message       msg      = new Message();
            AjaxJsonValid ajaxJson = new AjaxJsonValid();
            int           userid   = GameRequest.GetQueryInt("userid", 0);
            //判断登录
            //if (!Fetch.IsUserOnline())
            //{
            //    ajaxJson.code = 1;
            //    ajaxJson.msg = "请先登录";
            //    context.Response.Write(ajaxJson.SerializeToJson());
            //    return;
            //}

            //获取参数
            // int typeID = GameRequest.GetQueryInt("TypeID", 0);
            int          awardID  = GameRequest.GetQueryInt("awardID", 0); //商品ID
            int          counts   = GameRequest.GetQueryInt("counts", 0);  //购买数量
            AccountsInfo userinfo = FacadeManage.aideAccountsFacade.GetAccountsInfoByUserID(userid);

            //验证奖品
            if (awardID == 0)
            {
                ajaxJson.msg = "非常抱歉,你所选购的商品不存在!";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }

            //验证数量
            if (counts <= 0)
            {
                ajaxJson.msg = "请输入正确的兑换数量!";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }
            if (counts > 100)
            {
                ajaxJson.msg = "兑换数量不能超过100!";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }

            AwardInfo awardInfo = FacadeManage.aideNativeWebFacade.GetAwardInfo(awardID);

            AwardUser awardUser = FacadeManage.aideNativeWebFacade.GetAwardUser(userid);


            //验证用户
            UserCurrency Currency = FacadeManage.aideTreasureFacade.GetUserCurrency(userid);


            //验证余额
            int totalAmount = awardInfo.UnitPrice * counts;     //总金额

            if (totalAmount <= 0)
            {
                ajaxJson.msg = "很抱歉!兑换的奖品配置额度太大或为零";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }
            if (totalAmount > (Currency == null?0:Currency.AwardTicket))
            {
                ajaxJson.msg  = "很抱歉!您的奖券数不足,不能兑换该奖品";
                ajaxJson.code = -1;
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }

            //验证库存
            if (awardInfo.Inventory <= 0 && awardInfo.AwardType != 1)
            {
                ajaxJson.msg = "很抱歉!奖品的库存数不足,请更新其他奖品或者等待补充库存";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }

            //扣除奖牌
            Currency.AwardTicket = Currency.AwardTicket - totalAmount;

            //更新奖牌
            AwardOrder awardOrder = new AwardOrder();

            awardOrder.OrderID       = Fetch.GetOrderIDByPrefix("XT");
            awardOrder.UserID        = Currency.UserID;
            awardOrder.GameID        = userinfo.GameID;
            awardOrder.AwardID       = awardID;
            awardOrder.AwardType     = awardInfo.AwardType;
            awardOrder.AwardName     = awardInfo.AwardName;
            awardOrder.UnitPrice     = awardInfo.UnitPrice;
            awardOrder.BuyNum        = counts;
            awardOrder.PayTicket     = totalAmount;
            awardOrder.Gold          = awardInfo.Gold;
            awardOrder.Diamond       = awardInfo.Diamond;
            awardOrder.Compellation  = awardUser == null?"": awardUser.Compellation;
            awardOrder.MobilePhone   = awardUser == null ? "" : awardUser.MobilePhone;
            awardOrder.Province      = awardUser == null ? "" : awardUser.Province;
            awardOrder.City          = awardUser == null ? "" : awardUser.City;
            awardOrder.Area          = awardUser == null ? "" : awardUser.Area;
            awardOrder.DetailAddress = awardUser == null ? "" : awardUser.DetailAddress;
            awardOrder.ClinetIP      = Utility.UserIP;

            msg = FacadeManage.aideNativeWebFacade.BuyAward(awardOrder);
            if (msg.Success)
            {
                ajaxJson.SetValidDataValue(true);
                ajaxJson.msg = "兑换成功!实物商品请注意查收";
                if (awardInfo.AwardType == 1)
                {
                    ajaxJson.msg = "兑换成功!将在5分钟内发放至游戏中";
                }

                awardOrder = msg.EntityList[0] as AwardOrder;

                ajaxJson.SetDataItem("rs", 1);
                context.Response.Write(ajaxJson.SerializeToJson());
            }
            else
            {
                ajaxJson.msg = msg.Content;
                ajaxJson.SetDataItem("rs", -1);
                context.Response.Write(ajaxJson.SerializeToJson());
            }
        }
Exemplo n.º 11
0
        /// <summary>
        /// 页面保存
        /// </summary>
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strReason = CtrlHelper.GetText(txtReason);
            int    diamond   = CtrlHelper.GetInt(txtDiamond, 0);
            bool   flag      = cbPull.Checked;

            if (diamond <= 0)
            {
                MessageBox("赠送钻石数必须大于零!");
                return;
            }
            if (string.IsNullOrEmpty(strReason))
            {
                MessageBox("赠送备注不能为空");
                return;
            }
            string             ip  = GameRequest.GetUserIP();
            RecordGrantDiamond rgd = new RecordGrantDiamond();

            rgd.MasterID    = userExt.UserID;
            rgd.UserID      = IntParam;
            rgd.TypeID      = 0;
            rgd.AddDiamond  = diamond;
            rgd.ClientIP    = ip;
            rgd.CollectNote = strReason;

            Message msg = FacadeManage.aideTreasureFacade.GrantDiamond(rgd);

            if (msg.Success)
            {
                if (flag)
                {
                    AccountsUmeng umeng = FacadeManage.aideAccountsFacade.GetAccountsUmeng(IntParam);
                    if (umeng != null && !string.IsNullOrEmpty(umeng.DeviceToken))
                    {
                        string   content = "系统管理员" + userExt.UserName + "已赠送您" + diamond.ToString() + "钻石";
                        DateTime start   = DateTime.Now.AddMinutes(1);
                        DateTime end     = start.AddHours(5);
                        bool     result  = Umeng.SendMessage(umeng.DeviceType, content, "unicast", start.ToString("yyyy-MM-dd HH:mm:ss"), end.ToString("yyyy-MM-dd HH:mm:ss"), umeng.DeviceToken);
                        if (!result)
                        {
                            MessageBox("赠送成功,但推送消息失败,请前往友盟后台绑定系统后台ip");
                            return;
                        }
                        RecordAccountsUmeng record = new RecordAccountsUmeng();
                        record.MasterID    = rgd.MasterID;
                        record.UserID      = rgd.UserID;
                        record.PushType    = umeng.DeviceType;
                        record.PushTime    = DateTime.Now;
                        record.PushIP      = ip;
                        record.PushContent = content;
                        int rows = FacadeManage.aideRecordFacade.AddRecordAccountsUmeng(record);
                        MessageBox(rows > 0 ? "赠送成功" : "赠送成功,但推送记录写入失败");
                    }
                    else
                    {
                        MessageBox("赠送成功,但推送用户未绑定设备,无法推送");
                    }
                }
                else
                {
                    MessageBox("赠送成功");
                }
            }
            else
            {
                MessageBox("赠送失败");
            }
        }
Exemplo n.º 12
0
        private void SetAwardUser(HttpContext context)
        {
            AjaxJsonValid ajaxJson      = new AjaxJsonValid();
            Message       msg           = new Message();
            int           userid        = GameRequest.GetQueryInt("userid", 0);
            string        settype       = TextFilter.FilterScript(GameRequest.GetQueryString("settype")); //设置类型update修改insert添加
            string        compellation  = TextFilter.FilterScript(GameRequest.GetQueryString("name"));    //真实姓名
            string        mobilePhone   = TextFilter.FilterScript(GameRequest.GetQueryString("phone"));   //移动电话
            string        province      = GameRequest.GetQueryString("province");                         //省份
            string        city          = GameRequest.GetQueryString("city");                             //城市
            string        area          = GameRequest.GetQueryString("area");                             //地区
            string        dwellingPlace = TextFilter.FilterScript(GameRequest.GetQueryString("address")); //详细地址

            //验证真实姓名

            msg = CheckingRealNameFormat(compellation, false);
            if (!msg.Success)
            {
                ajaxJson.msg = "请输入正确的收件人";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }


            //验证手机号

            msg = CheckingMobilePhoneNumFormat(mobilePhone, false);
            if (!msg.Success)
            {
                ajaxJson.msg = "请输入正确的手机号码";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }
            //验证地址邮编

            if (province.Length < 1)
            {
                ajaxJson.msg = "请选择省份";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }
            if (city.Length < 1)
            {
                ajaxJson.msg = "请选择城市";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }
            if (area.Length < 1)
            {
                ajaxJson.msg = "请选择地区";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }
            if (string.IsNullOrEmpty(dwellingPlace))
            {
                ajaxJson.msg = "请输入详细地址";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }
            AwardUser awardUser = new AwardUser();

            awardUser.UserID        = userid;
            awardUser.Compellation  = compellation;
            awardUser.MobilePhone   = mobilePhone;
            awardUser.Province      = province;
            awardUser.City          = city;
            awardUser.Area          = area;
            awardUser.DetailAddress = dwellingPlace;
            if (settype == "update")
            {
                int rs = FacadeManage.aideNativeWebFacade.updateAwardUser(awardUser);
                if (rs > 0)
                {
                    ajaxJson.msg = "修改成功";
                    ajaxJson.SetValidDataValue(true);
                    ajaxJson.SetDataItem("rs", 1);
                    context.Response.Write(ajaxJson.SerializeToJson());
                    return;
                }
                else
                {
                    ajaxJson.msg = "修改失败";
                    ajaxJson.SetDataItem("rs", -1);
                    context.Response.Write(ajaxJson.SerializeToJson());
                    return;
                }
            }
            if (settype == "insert")
            {
                int rs = FacadeManage.aideNativeWebFacade.insertAwardUser(awardUser);
                if (rs > 0)
                {
                    ajaxJson.msg = "提交成功";
                    ajaxJson.SetValidDataValue(true);
                    ajaxJson.SetDataItem("rs", 1);
                    context.Response.Write(ajaxJson.SerializeToJson());
                    return;
                }
                else
                {
                    ajaxJson.msg = "提交失败";
                    ajaxJson.SetDataItem("rs", -1);
                    context.Response.Write(ajaxJson.SerializeToJson());
                    return;
                }
            }
        }
Exemplo n.º 13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (AppConfig.Mode != AppConfig.CodeMode.Dev)
                {
                    if (Fetch.isWeChat(Request))
                    {
                        //演示和通用平台
                        if (string.IsNullOrEmpty(wxparam))
                        {
//                        string domain = "http://" + (string.IsNullOrEmpty(AppConfig.FrontSiteDomain)
//                                            ? GameRequest.GetCurrentFullHost()
//                                            : AppConfig.FrontSiteDomain);
                            Response.Redirect(AppConfig.AuthorizeURL + "?url=http://" +
                                              GameRequest.GetCurrentFullHost() + "/Card/Index.aspx?code=1001");
                        }
                        else
                        {
                            WxUser wu = Fetch.GetWxUser(wxparam);
                            if (wu == null)
                            {
                                Response.Write(
                                    "<div style=\"font-size:1.2rem; color:red; text-align:center; margin-top:3rem;\">参数异常,请稍后尝试。</div>");
                                return;
                            }
                            Message msg =
                                FacadeManage.aideAgentFacade.AgentWXLogin(wu.unionid, GameRequest.GetUserIP());
                            if (msg.Success)
                            {
                                Entity.Agent.AgentInfo ui = msg.EntityList[0] as Entity.Agent.AgentInfo;
                                if (ui != null)
                                {
                                    //for Version 2.0 跳转
                                    string token = Fetch.SHA256Encrypt(
                                        $"<{ui.UserID}>,<{ui.AgentID}>,<{ui.AgentDomain}>,<{Fetch.ConvertDateTimeToUnix(DateTime.Now)}>");
                                    FacadeManage.aideNativeWebFacade.SaveAgentToken(ui, token);
                                    Response.Redirect($"v2/#/?token={token}");
                                }
                                else
                                {
                                    Response.Write(
                                        "<div style=\"font-size:1.2rem; color:red; text-align:center; margin-top:3rem;\">登录失败,请稍后尝试</div>");
                                }
                            }
                            else
                            {
                                Response.Write(
                                    "<div style=\"font-size:1.2rem; color:red; text-align:center; margin-top:3rem;\">" +
                                    wu.nickname + "," +
                                    msg.Content + "</div>");
                            }
                        }
                    }
                    else
                    {
                        if (version == 1)
                        {
                            // for Version 1.0 非微信提示
                            Response.Write(
                                "<div style=\"font-size:1.2rem; color:red; text-align:center; margin-top:3rem;\">请在微信内打开</div>");
                        }
                        else if (version == 2)
                        {
                            // for Version 2.0 跳转到手机+安全密码登录页面
                            Response.Redirect("v2/#/Login");
                        }
                    }
                }
            }
        }
Exemplo n.º 14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int    userId    = GameRequest.GetQueryInt("userid", 0);          //用户标识
            string signature = GameRequest.GetQueryString("signature");       //签名
            string time      = GameRequest.GetQueryString("time");            //过期时间
            string url       = GameRequest.GetQueryString("url");             //跳转地址

            //验证UserID
            if (userId == 0)
            {
                Response.Redirect(url);
                return;
            }

            //判断是否已登录
            UserTicketInfo userTiketInfo = Fetch.GetUserCookie();

            if (userTiketInfo != null && userTiketInfo.UserID == userId)
            {
                Response.Redirect(url);
                return;
            }

            //查询用户
            Message msg = FacadeManage.aideAccountsFacade.GetUserGlobalInfo(userId, 0, "");

            if (!msg.Success)
            {
                Response.Redirect(url);
                return;
            }
            UserInfo userInfo = msg.EntityList[0] as UserInfo;

            if (userInfo == null)
            {
                Response.Redirect(url);
                return;
            }

            //验证是否有动态密码
            if (string.IsNullOrEmpty(userInfo.DynamicPass.Trim()))
            {
                Response.Redirect(url);
                return;
            }

            //验证签名
            //签名加密方法 MD5(UserID+动态密码+Time+Key);
            string md5Str       = userId.ToString() + userInfo.DynamicPass + time.ToString() + AppConfig.SyncLoginKey;
            string webSignature = Utility.MD5(md5Str);

            if (signature != webSignature)
            {
                FileManager.WriteFile(Server.MapPath("/Log/1.txt"), string.Format("md5Str={0}&webSignature={1}&signature={2}&UserID={3}\n", md5Str, webSignature, signature, userId), true);
                Response.Redirect(url);
                return;
            }

            //验证链接有效期
            DateTime dtOut = userInfo.DynamicPassTime.AddMilliseconds(Convert.ToDouble(time) + Convert.ToDouble(AppConfig.SyncUrlTimeOut));

            if (dtOut < DateTime.Now)
            {
                Response.Redirect(url);
                return;
            }

            //同步登录
            Fetch.SetUserCookie(userInfo.ToUserTicketInfo());
            Response.Redirect(url);
        }
Exemplo n.º 15
0
        public void IT_When_AcceptGame_Then_Success()
        {
            var player1Name = GetPlayerName();
            var player1GameHandler = this.ConnectPlayer(player1Name);
            var player2Name = GetPlayerName();
            var player2GameHandler = this.ConnectPlayer(player2Name);

            var notification = default(GameNotification);
            var notificationObject = default(object);

            player1GameHandler.Notification += (sender, e) =>
            {
                notification = this.serializer.Deserialize<GameNotification>(e.SerializedNotification);
                notificationObject = this.serializer.Deserialize<object>(notification.SerializedNotificationObject);
            };
            player2GameHandler.Notification += (sender, e) =>
            {
                var gameInviteNotification = this.serializer.Deserialize<GameNotification>(e.SerializedNotification);

                if (gameInviteNotification.Type != (int)GameNotificationType.GameInvite)
                {
                    return;
                }

                var gameInviteNotificationObject = this.serializer.Deserialize<GameInviteReceivedServerMessage>(gameInviteNotification.SerializedNotificationObject);

                var acceptGameRequestObject = new AcceptGameClientMessage
                {
                    UserName = player2Name,
                    SessionName = gameInviteNotificationObject.SessionName
                };
                var acceptGameRequest = new GameRequest(GameRequestType.GameAccepted)
                {
                    Sender = player2Name,
                    SerializedRequestObject = this.serializer.Serialize(acceptGameRequestObject)
                };

                player2GameHandler.OnMessage(this.serializer.Serialize(acceptGameRequest));
            };

            var createGameRequestObject = new CreateGameClientMessage
            {
                UserName = player1Name,
                InvitedUserName = player2Name
            };
            var createGameRequest = new GameRequest(GameRequestType.CreateGame)
            {
                Sender = player1Name,
                SerializedRequestObject = this.serializer.Serialize(createGameRequestObject)
            };

            player1GameHandler.OnMessage(this.serializer.Serialize(createGameRequest));

            Assert.AreEqual((int)GameNotificationType.GameCreated, notification.Type);
            Assert.IsNotNull(notificationObject);
            Assert.IsTrue(notificationObject is GameCreatedServerMessage);

            var gameCreatedNotificationObject = notificationObject as GameCreatedServerMessage;

            Assert.AreEqual(player1Name, gameCreatedNotificationObject.Player1Name);
            Assert.AreEqual(player2Name, gameCreatedNotificationObject.Player2Name);
            Assert.AreEqual(string.Format("{0}-vs-{1}", player1Name, player2Name), gameCreatedNotificationObject.SessionName);
            Assert.IsTrue(string.IsNullOrEmpty(gameCreatedNotificationObject.AdditionalInformation));
        }
Exemplo n.º 16
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strReason = CtrlHelper.GetText(txtReason);
            int    intDays   = CtrlHelper.GetInt(txtMemberDays, 0);

            if (intDays <= 0)
            {
                MessageBox("赠送天数必须为大于零的正整数!");
                return;
            }
            if (string.IsNullOrEmpty(strReason))
            {
                MessageBox("赠送原因不能为空!");
                return;
            }

            AccountsInfo modelAccountInfo = new AccountsInfo( );

            /*RecordGrantMember grantMember = new RecordGrantMember( );
             * grantMember.ClientIP = GameRequest.GetUserIP( );
             * grantMember.MasterID = userExt.UserID;
             * grantMember.GrantCardType = int.Parse( ddlMemberType.SelectedValue );
             * grantMember.MemberDays = intDays;
             * grantMember.Reason = strReason;
             */
            string[] arrUserIDList = StrParamsList.Split(new char[] { ',' });
            foreach (string strid in arrUserIDList)
            {
                if (Utils.Validate.IsPositiveInt(strid))
                {
                    modelAccountInfo = aideAccountsFacade.GetAccountInfoByUserID(int.Parse(strid));
                    if (modelAccountInfo == null)
                    {
                        continue;
                    }

                    aideRecordFacade.GrantMember(int.Parse(strid), CtrlHelper.GetSelectValue(ddlMemberType, 0), intDays, userExt.UserID, strReason, GameRequest.GetUserIP( ));

                    /*grantMember.UserID = int.Parse( strid );
                     * modelAccountInfo.MemberOrder = CtrlHelper.GetSelectValue( ddlMemberType,0 );
                     *
                     * aideAccountsFacade.UpdateAccount( modelAccountInfo );           //更新会员信息
                     * aideRecordFacade.InsertRecordGrantMember( grantMember );        //插入赠送会员日志*/
                }
            }
            MessageBox("确认成功");
        }
Exemplo n.º 17
0
        /// <summary>
        /// 清楚表数据
        /// </summary>
        /// <param name="context"></param>
        private void ClearTableData(HttpContext context)
        {
            //验证权限
            int             moduleID = 812;
            AdminPermission adminPer = new AdminPermission(userExt, moduleID);

            if (!adminPer.GetPermission((long)Permission.Delete))
            {
                ajv.msg = "非法操作,无操作权限";
                context.Response.Write(ajv.SerializeToJson());
                return;
            }

            string time = GameRequest.GetString("time");
            int    id   = GameRequest.GetInt("id", 0);

            //验证ID
            if (id == 0)
            {
                ajv.msg = "非法操作,清除数据失败";
                context.Response.Write(ajv.SerializeToJson());
                return;
            }

            //验证截止日期
            if (string.IsNullOrEmpty(time))
            {
                ajv.msg = "请选择要清除数据的截止时间";
                context.Response.Write(ajv.SerializeToJson());
                return;
            }
            DateTime date;

            try
            {
                date = Convert.ToDateTime(time).AddDays(1);
            }
            catch
            {
                ajv.msg = "请输入正确的时间";
                context.Response.Write(ajv.SerializeToJson());
                return;
            }

            //删除数据
            int result = 0;

            switch (id)
            {
            case 1:     //删除玩家进出记录表
                result = FacadeManage.aideTreasureFacade.DeleteRecordUserInoutByTime(date);
                break;

            case 2:     //删除游戏记录总局表
                result = FacadeManage.aideTreasureFacade.DeleteRecordDrawInfoByTime(date);
                break;

            case 3:     //删除游戏记录详情表
                result = FacadeManage.aideTreasureFacade.DeleteRecordDrawScoreByTime(date);
                break;

            case 4:     //删除银行操作记录表
                result = FacadeManage.aideTreasureFacade.DeleteRecordInsureByTime(date);
                break;

            default:
                break;
            }

            ajv.SetValidDataValue(true);
            ajv.msg = string.Format("操作成功,共删除了{0}条记录", result);
            context.Response.Write(ajv.SerializeToJson());
            return;
        }
Exemplo n.º 18
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string formString = GameRequest.GetFormString("account");

            if (formString == "")
            {
                base.Response.Write("充值账号错误");
                base.Response.End();
            }
            int formInt = GameRequest.GetFormInt("amount", 0);

            if (formInt < 20)
            {
                base.Response.Write("充值金额不能低于20");
                base.Response.End();
            }
            GameRequest.GetFormString("type");
            string str             = "http://pay.cffsye.top";
            string text            = "UTF-8";
            string text2           = "V3.0";
            string text3           = ApplicationSettings.Get("parter_zhifu");
            string text4           = str + "/pay/zhifubank/notify_url.aspx";
            string text5           = formInt.ToString();
            string orderIDByPrefix = PayHelper.GetOrderIDByPrefix("zf");
            string text6           = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            string text7           = "RSA-S";
            string text8           = "";
            string text9           = "";
            string text10          = "test";
            string text11          = "";
            string text12          = str + "/pay/zhifubank/notify_url.aspx";
            string text13          = "direct_pay";
            string text14          = "";
            string text15          = "";
            string text16          = "";
            string text17          = "";
            string text18          = "";
            string text19          = "";
            string text20          = "";
            string text21          = "";
            string text22          = "";

            if (text17 != "")
            {
                text22 = text22 + "bank_code=" + text17 + "&";
            }
            if (text18 != "")
            {
                text22 = text22 + "client_ip=" + text18 + "&";
            }
            if (text19 != "")
            {
                text22 = text22 + "client_ip_check=" + text19 + "&";
            }
            if (text15 != "")
            {
                text22 = text22 + "extend_param=" + text15 + "&";
            }
            if (text16 != "")
            {
                text22 = text22 + "extra_return_param=" + text16 + "&";
            }
            if (text != "")
            {
                text22 = text22 + "input_charset=" + text + "&";
            }
            if (text2 != "")
            {
                text22 = text22 + "interface_version=" + text2 + "&";
            }
            if (text3 != "")
            {
                text22 = text22 + "merchant_code=" + text3 + "&";
            }
            if (text4 != "")
            {
                text22 = text22 + "notify_url=" + text4 + "&";
            }
            if (text5 != "")
            {
                text22 = text22 + "order_amount=" + text5 + "&";
            }
            if (orderIDByPrefix != "")
            {
                text22 = text22 + "order_no=" + orderIDByPrefix + "&";
            }
            if (text6 != "")
            {
                text22 = text22 + "order_time=" + text6 + "&";
            }
            if (text21 != "")
            {
                text22 = text22 + "pay_type=" + text21 + "&";
            }
            if (text8 != "")
            {
                text22 = text22 + "product_code=" + text8 + "&";
            }
            if (text9 != "")
            {
                text22 = text22 + "product_desc=" + text9 + "&";
            }
            if (text10 != "")
            {
                text22 = text22 + "product_name=" + text10 + "&";
            }
            if (text11 != "")
            {
                text22 = text22 + "product_num=" + text11 + "&";
            }
            if (text20 != "")
            {
                text22 = text22 + "redo_flag=" + text20 + "&";
            }
            if (text12 != "")
            {
                text22 = text22 + "return_url=" + text12 + "&";
            }
            if (text13 != "")
            {
                text22 = text22 + "service_type=" + text13;
            }
            if (text14 != "")
            {
                text22 = text22 + "&show_url=" + text14;
            }
            if (text7 == "RSA-S")
            {
                string privateKey = ApplicationSettings.Get("merPriKey_zhifu");
                privateKey = HttpHelp.RSAPrivateKeyJava2DotNet(privateKey);
                string value = HttpHelp.RSASign(text22, privateKey);
                this.sign.Value = value;
            }
            this.merchant_code.Value      = text3;
            this.bank_code.Value          = text17;
            this.order_no.Value           = orderIDByPrefix;
            this.order_amount.Value       = text5;
            this.service_type.Value       = text13;
            this.input_charset.Value      = text;
            this.notify_url.Value         = text4;
            this.interface_version.Value  = text2;
            this.sign_type.Value          = text7;
            this.order_time.Value         = text6;
            this.product_name.Value       = text10;
            this.client_ip.Value          = text18;
            this.client_ip_check.Value    = text19;
            this.extend_param.Value       = text15;
            this.extra_return_param.Value = text16;
            this.product_code.Value       = text8;
            this.product_desc.Value       = text9;
            this.product_num.Value        = text11;
            this.return_url.Value         = text12;
            this.show_url.Value           = text14;
            this.redo_flag.Value          = text20;
            this.pay_type.Value           = text21;
            OnLineOrder onLineOrder = new OnLineOrder();

            onLineOrder.OrderID = orderIDByPrefix;
            if (Fetch.GetUserCookie() == null)
            {
                onLineOrder.OperUserID = 0;
            }
            else
            {
                onLineOrder.OperUserID = Fetch.GetUserCookie().UserID;
            }
            onLineOrder.Accounts    = formString;
            onLineOrder.OrderAmount = formInt;
            onLineOrder.IPAddress   = GameRequest.GetUserIP();
            onLineOrder.ShareID     = 1;
            Message message = FacadeManage.aideTreasureFacade.RequestOrder(onLineOrder);

            if (!message.Success)
            {
                base.Response.Write(message.Content);
                base.Response.End();
            }
        }
Exemplo n.º 19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // 设置 Response编码格式为GB2312
            Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            if (!string.IsNullOrEmpty(Request.Form["Cuserspay"]) && !string.IsNullOrEmpty(Request.Form["inputMoney"]))
            {
                string pay_username = Request.Form["Cuserspay"];
                string PayMoney     = Request.Form["inputMoney"];
                string payBank      = Request.Form["CpayBank"];
                string rtypeBank    = Request.Form["yx_bank"];

                string payTel = string.IsNullOrEmpty(Request.Form["txt_telphone"]) == true? "" : Request.Form["txt_telphone"];

                if (rtypeBank != "BANKSEL")
                {
                    payBank = rtypeBank;
                }

                p3_Amt          = Convert.ToString(decimal.Parse(PayMoney));
                p4_verifyAmt    = "false";
                p5_Pid          = "金币";
                p6_Pcat         = "1";
                p7_Pdesc        = "1";
                p8_Url          = ConfigurationManager.AppSettings["CallBackC"].ToString();
                pa_MP           = pay_username;
                pa7_cardAmt     = Request.Form["inputMoney"];
                pa8_cardNo      = Request.Form["pa8_cardNo"];
                pa9_cardPwd     = Request["pa9_cardPwd"];
                pd_FrpId        = payBank;
                pr_NeedResponse = "1";
                pz_userId       = Convert.ToString(DateTime.Now.ToString("yyyyMMddhhmmss"));
                pz1_userRegTime = DateTime.Now.ToString();

                p2_Order = "CYC" + DateTime.Now.ToString("yyyyMMddhhmmss");
                //非银行卡专业版正式使用
                try
                {
                    int payType = 0;
                    switch (payBank)
                    {
                    case "JUNNET":
                        payType = 2;
                        break;

                    case "SNDACARD":
                        payType = 3;
                        break;

                    case "SZX":
                        payType = 4;
                        break;

                    case "ZHENGTU":
                        payType = 5;
                        break;

                    case "QQCARD":
                        payType = 6;
                        break;

                    case "UNICOM":
                        payType = 7;
                        break;

                    case "JIUYOU":
                        payType = 8;
                        break;

                    case "NETEASE":
                        payType = 9;
                        break;

                    case "WANMEI":
                        payType = 10;
                        break;

                    case "SOHU":
                        payType = 11;
                        break;

                    case "TELECOM":
                        payType = 12;
                        break;

                    case "TIANXIA":
                        payType = 13;
                        break;

                    case "TIANHONG":
                        payType = 14;
                        break;

                    case "YPCARD":
                        payType = 16;
                        break;

                    case "ZONGYOU":
                        payType = 17;
                        break;
                    }

                    DataSet     ds          = new DataSet();
                    int         uid         = accountsFacade.GetAccountsId(pay_username);
                    OnLineOrder onlineOrder = new OnLineOrder();
                    onlineOrder.Accounts    = pay_username;
                    onlineOrder.UserID      = uid;
                    onlineOrder.OrderAmount = decimal.Parse(PayMoney);
                    onlineOrder.OrderID     = p2_Order;
                    onlineOrder.OrderStatus = 0;
                    onlineOrder.ShareID     = payType;
                    onlineOrder.CardTotal   = 1;
                    onlineOrder.CardTypeID  = payType;//卡类充值
                    onlineOrder.TelPhone    = payTel;
                    onlineOrder.IPAddress   = GameRequest.GetUserIP();
                    Message msg = treasureFacade.RequestOrder(onlineOrder);


                    if (!msg.Success)
                    {
                        Response.Redirect("/Tips.aspx?msg=" + msg.Content);
                    }
                    else
                    {
                        //非银行卡专业版正式使用
                        SZXResult result = SZX.AnnulCard(onlineOrder.OrderID, p3_Amt, p4_verifyAmt, p5_Pid, p6_Pcat, p7_Pdesc, p8_Url,
                                                         pa_MP, pa7_cardAmt, pa8_cardNo, pa9_cardPwd, pd_FrpId, pr_NeedResponse, pz_userId, pz1_userRegTime);
                        if (result.R1_Code == "1")
                        {
                            Response.Redirect("/WiteNetCard.html?OID=" + onlineOrder.OrderID);
                        }
                        else
                        {
                            Response.Redirect("/WiteNetCard.html?OID=" + onlineOrder.OrderID);
                        }
                    }
                }
                catch (Exception ex)
                {
                    Response.Write(ex.ToString());
                }
            }
        }
Exemplo n.º 20
0
 /// <summary>
 /// Gets a list of the top 20 previous Games matching the gameLayout
 /// </summary>
 /// <param name="gameRequest"></param>
 /// <returns>List of Hiscores</returns>
 public Task <IEnumerable <GameScore> > GetHighScores(GameRequest gameRequest)
 {
     Log.Information("ScoreService.GetHighScores");
     return(_gameScoreRepository.GetHighScores(gameRequest));
 }
Exemplo n.º 21
0
        public JsonResult DaifuTixian(PlatformDraw model)
        {
            int @int = GameRequest.GetInt("platId", 0);

            if (@int <= 0)
            {
                return(Json(new
                {
                    IsOk = false,
                    Msg = "请选择代付平台"
                }));
            }
            if (model.RealName == "" || model.BankCode == "" || model.BankNo == "" || model.DrawAmt <= 0m || model.BankAddr == "" || model.Code == "")
            {
                return(Json(new
                {
                    IsOk = false,
                    Msg = "请输入完整信息"
                }));
            }
            string @string = GameRequest.GetString("Province");
            string string2 = GameRequest.GetString("City");
            string flowid  = "";
            string text    = "";

            switch (@int)
            {
            case 1:
                model.OrderID = PayHelper.GetOrderIDByPrefix("txf");
                text          = DaiFu.GateWayPement(model.OrderID, model.DrawAmt, model.RealName, model.BankNo, model.BankCode, model.BankAddr, out flowid);
                break;

            case 2:
                if (@string == "" || string2 == "")
                {
                    return(Json(new
                    {
                        IsOk = false,
                        Msg = "请输入银行所在省市"
                    }));
                }
                model.OrderID = PayHelper.GetOrderIDByPrefix("45");
                text          = DaiFu.Daifu_45(model.OrderID, model.DrawAmt, model.RealName, model.BankNo, model.BankName, model.BankAddr, string2, out flowid);
                break;

            case 3:
                if (@string == "" || string2 == "")
                {
                    return(Json(new
                    {
                        IsOk = false,
                        Msg = "请输入银行所在省市"
                    }));
                }
                model.OrderID = PayHelper.GetOrderIDByPrefix("ymf");
                text          = DaiFu.Daifu_youmifu(model.OrderID, model.DrawAmt, model.RealName, model.BankNo, model.BankCode, model.BankAddr, @string, string2, base.Request.Url.Host, out flowid);
                break;

            case 4:
                if (@string == "" || string2 == "")
                {
                    return(Json(new
                    {
                        IsOk = false,
                        Msg = "请输入银行所在省市"
                    }));
                }
                model.OrderID = PayHelper.GetOrderIDByPrefix("ry");
                text          = DaiFu.Daifu_ruyi(model.OrderID, model.DrawAmt, model.RealName, model.BankNo, model.BankCode, model.BankAddr, @string, string2, base.Request.Url.Host, out flowid);
                break;
            }
            string text2 = "";

            if (text.ToUpper() == "SUCCESS")
            {
                base.Session["code"]  = null;
                base.Session["error"] = null;
                text2           = "提现请求提交成功,等待处理";
                model.OperateIP = GameRequest.GetUserIP();
                model.Operator  = user.Username;
                model.FlowID    = flowid;
                int num = FacadeManage.aideNativeWebFacade.AddPlatformDraw(model);
                if (num > 0)
                {
                    return(Json(new
                    {
                        IsOk = true,
                        Msg = text2
                    }));
                }
                return(Json(new
                {
                    IsOk = false,
                    Msg = text2 + "—记录数据错误"
                }));
            }
            return(Json(new
            {
                IsOk = false,
                Msg = text
            }));
        }
Exemplo n.º 22
0
        /// <summary>
        /// 代理账号+安全密码认证 换取 Token
        /// </summary>
        /// <param name="mobile"></param>
        /// <param name="pass"></param>
        private static void AgentAuth(string mobile, string pass)
        {
            if (string.IsNullOrEmpty(mobile) || string.IsNullOrEmpty(pass))
            {
                _ajv.code = (int)ApiCode.VertyParamErrorCode;
                _ajv.msg  = string.Format(EnumHelper.GetDesc(ApiCode.VertyParamErrorCode),
                                          " mobile、pass 缺失");
                return;
            }
            Message msg = FacadeManage.aideAgentFacade.AgentMobileLogin(mobile, pass, GameRequest.GetUserIP());

            if (msg.Success)
            {
                Entity.Agent.AgentInfo info = msg.EntityList[0] as Entity.Agent.AgentInfo;
                if (info != null)
                {
                    string token =
                        Fetch.SHA256Encrypt(
                            $"<{info.UserID}>,<{info.AgentID}>,<{info.AgentDomain}>,<{Fetch.ConvertDateTimeToUnix(DateTime.Now)}>");

                    FacadeManage.aideAgentFacade.SaveAgentToken(info, token);

                    _ajv.SetValidDataValue(true);
                    _ajv.SetDataItem("token", token);
                    _ajv.SetDataItem("expirtAt", DateTime.Now.AddDays(1));
                    return;
                }
            }

            _ajv.code = (int)ApiCode.Unauthorized;
            _ajv.msg  = EnumHelper.GetDesc(ApiCode.Unauthorized);
        }
Exemplo n.º 23
0
        /// <summary>
        /// 查询申诉状态
        /// </summary>
        /// <param name="context"></param>
        public void ReportState(HttpContext context)
        {
            Message       msg      = new Message();
            AjaxJsonValid ajaxJson = new AjaxJsonValid();

            string account    = GameRequest.GetFormString("account");                 //申诉帐号
            string reportNo   = GameRequest.GetFormString("reportNo");                //申诉编号
            string verifyCode = GameRequest.GetFormString("code");                    //验证码

            //验证验证码
            if (!verifyCode.Equals(Fetch.GetVerifyCode(), StringComparison.InvariantCultureIgnoreCase))
            {
                ajaxJson.msg = "验证码输入有误";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }

            //验证申诉帐号
            msg = InputDataValidate.CheckingUserNameFormat(account);
            if (!msg.Success)
            {
                ajaxJson.msg = "申诉帐号输入有误";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }

            //验证申诉流失号
            msg = InputDataValidate.CheckingReportNo(reportNo, false);
            if (!msg.Success)
            {
                ajaxJson.msg = msg.Content;
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }

            //查询申诉号
            LossReport lossReport = FacadeManage.aideNativeWebFacade.GetLossReport(reportNo, account);

            if (lossReport == null)
            {
                ajaxJson.msg = "帐号的申诉号不存在";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }

            //返回数据
            string state = string.Empty;

            switch (lossReport.ProcessStatus)
            {
            case 0:
                state = "客服处理中";
                break;

            case 1:
                state = "审核成功,注意查看邮件并重置密码";
                break;

            case 2:
                state = "审核失败,您的资料填写不正确或者不够详细,请重新申诉";
                break;

            case 3:
                state = "更新密码成功";
                break;
            }
            ajaxJson.AddDataItem("acount", account);
            ajaxJson.AddDataItem("reportNo", reportNo);
            ajaxJson.AddDataItem("state", state);
            ajaxJson.SetValidDataValue(true);
            context.Response.Write(ajaxJson.SerializeToJson());
        }
Exemplo n.º 24
0
        /// <summary>
        /// 获取记录列表 by type
        /// </summary>
        /// <param name="type"></param>
        private static void GetRecord(string type)
        {
            int      number    = GameRequest.GetInt("pagesize", 10);
            int      page      = GameRequest.GetInt("pageindex", 1);
            string   query     = GameRequest.GetString("query");
            string   startDate = GameRequest.GetString("startdate");
            string   endDate   = GameRequest.GetString("enddate");
            PagerSet ps;

            string where;
            string sqlUserId = "";

            if (!string.IsNullOrEmpty(query))
            {
                sqlUserId = " SourceUserID IN (SELECT UserID FROM WHQJAccountsDB.DBO.AccountsInfo(NOLOCK) " +
                            (Validate.IsPositiveInt(query)
                                ? $"WHERE GameID={query} OR NickName='{query}') "
                                : $"WHERE NickName = '{query}') ");
            }
            else
            {
                sqlUserId = " 1=1 ";
            }
            string sqlDate = "";

            if (!string.IsNullOrEmpty(startDate))
            {
                sqlDate = $" AND CollectDate >= '{startDate} 00:00:00'";
            }
            if (!string.IsNullOrEmpty(endDate))
            {
                sqlDate += $"AND CollectDate <= '{endDate} 23:59:59' ";
            }

            switch (type)
            {
            case "pay":     //获取充值返利记录
                where = $" WHERE TargetUserID = {UserId} AND AwardType  = 1 {sqlDate} AND {sqlUserId}";
                ps    = FacadeManage.aideAgentFacade.GetList(ReturnAwardRecord.Tablename, page, number, where,
                                                             $"ORDER BY {ReturnAwardRecord._CollectDate} DESC");
                IList <ReturnAwardRecord> payList = new List <ReturnAwardRecord>();
                if (ps?.RecordCount > 0)
                {
                    foreach (DataRow dr in ps.PageSet.Tables[0].Rows)
                    {
                        int          userId = Convert.ToInt32(dr["SourceUserID"].ToString());
                        AccountsInfo ai     = FacadeManage.aideAccountsFacade.GetAccountsInfoByUserID(userId);
                        payList.Add(new ReturnAwardRecord
                        {
                            CollectDate  = Convert.ToDateTime(dr["CollectDate"]),
                            ReturnBase   = Convert.ToInt64(dr["ReturnBase"]),
                            SourceUserID = Convert.ToInt32(dr["SourceUserID"].ToString()),
                            NickName     = ai?.NickName ?? "",
                            GameID       = ai?.GameID ?? 0,
                            IsAgent      = ai?.AgentID > 0,
                            Award        = Convert.ToInt32(dr["Award"].ToString())
                        });
                    }
                }
                _ajv.SetDataItem("record", payList);
                break;

            case "revenue":     //获取税收返利记录
                where = $" WHERE TargetUserID = {UserId} AND AwardType  = 2 {sqlDate} AND {sqlUserId}";
                ps    = FacadeManage.aideAgentFacade.GetList(ReturnAwardRecord.Tablename, page, number, where,
                                                             $"ORDER BY {ReturnAwardRecord._CollectDate} DESC");
                IList <ReturnAwardRecord> revenueList = new List <ReturnAwardRecord>();
                if (ps?.RecordCount > 0)
                {
                    foreach (DataRow dr in ps.PageSet.Tables[0].Rows)
                    {
                        int          userId = Convert.ToInt32(dr["SourceUserID"].ToString());
                        AccountsInfo ai     = FacadeManage.aideAccountsFacade.GetAccountsInfoByUserID(userId);
                        revenueList.Add(new ReturnAwardRecord
                        {
                            CollectDate  = Convert.ToDateTime(dr["CollectDate"]),
                            ReturnBase   = Convert.ToInt64(dr["ReturnBase"]),
                            SourceUserID = Convert.ToInt32(dr["SourceUserID"].ToString()),
                            NickName     = ai?.NickName ?? "",
                            GameID       = ai?.GameID ?? 0,
                            IsAgent      = ai?.AgentID > 0,
                            Award        = Convert.ToInt32(dr["Award"].ToString())
                        });
                    }
                }
                _ajv.SetDataItem("record", revenueList);
                break;

            case "diamond":     // 赠送钻石记录
                where = $" WHERE TradeType = 1 AND (SourceUserID = {UserId} OR TargetUserID = {UserId}) {sqlDate} AND {sqlUserId}";
                if (!string.IsNullOrEmpty(query))
                {
                    where = $" WHERE TradeType = 1 AND (SourceUserID = {UserId} OR TargetUserID = {UserId}) {sqlDate} AND ({sqlUserId}" +
                            $" OR TargetUserID IN ( SELECT UserID FROM WHQJAccountsDB.DBO.AccountsInfo(NOLOCK) " +
                            (Validate.IsPositiveInt(query)
                                ? $"WHERE GameID={query} OR NickName='{query}')) "
                                : $"WHERE NickName = '{query}')) ");
                }

                ps = FacadeManage.aideAgentFacade.GetList(ReturnAwardGrant.Tablename, page, number, where,
                                                          $"ORDER BY {ReturnAwardGrant._CollectDate} DESC");
                IList <ReturnAwardGrant> dList = new List <ReturnAwardGrant>();
                if (ps?.RecordCount > 0)
                {
                    foreach (DataRow dr in ps.PageSet.Tables[0].Rows)
                    {
                        int          userId        = Convert.ToInt32(dr["SourceUserID"].ToString());
                        int          receiveUserId = Convert.ToInt32(dr["TargetUserID"].ToString());
                        AccountsInfo ai            = FacadeManage.aideAccountsFacade.GetAccountsInfoByUserID(userId);
                        AccountsInfo rai           = FacadeManage.aideAccountsFacade.GetAccountsInfoByUserID(receiveUserId);
                        dList.Add(new ReturnAwardGrant
                        {
                            CollectDate  = Convert.ToDateTime(dr["CollectDate"]),
                            TargetUserID = Convert.ToInt32(dr["TargetUserID"]),
                            SourceUserID = Convert.ToInt32(dr["SourceUserID"].ToString()),
                            //SourceBefore = Convert.ToInt64(dr["SourceBefore"]),
                            //TargetBefore = Convert.ToInt64(dr["TargetBefore"]),
                            Amount          = Convert.ToInt64(dr["Amount"]),
                            NickName        = ai?.NickName ?? "",
                            ReceiveNickName = rai?.NickName ?? "",
                            GameID          = ai?.GameID ?? 0,
                            ReceiveGameID   = rai?.GameID ?? 0
                        });
                    }
                }
                _ajv.SetDataItem("record", dList);
                break;

            case "gold":     // 赠送金币记录
                where = $" WHERE TradeType = 2 AND (SourceUserID = {UserId} OR TargetUserID = {UserId}) {sqlDate} AND {sqlUserId}";
                if (!string.IsNullOrEmpty(query))
                {
                    where = $" WHERE TradeType = 2 AND (SourceUserID = {UserId} OR TargetUserID = {UserId}) {sqlDate} AND ({sqlUserId}" +
                            $" OR TargetUserID IN ( SELECT UserID FROM WHQJAccountsDB.DBO.AccountsInfo(NOLOCK) " +
                            (Validate.IsPositiveInt(query)
                                ? $"WHERE GameID={query} OR NickName='{query}')) "
                                : $"WHERE NickName = '{query}')) ");
                }

                ps = FacadeManage.aideAgentFacade.GetList(ReturnAwardGrant.Tablename, page, number, where,
                                                          $"ORDER BY {ReturnAwardGrant._CollectDate} DESC");
                IList <ReturnAwardGrant> gList = new List <ReturnAwardGrant>();
                if (ps?.RecordCount > 0)
                {
                    foreach (DataRow dr in ps.PageSet.Tables[0].Rows)
                    {
                        int          userId        = Convert.ToInt32(dr["SourceUserID"].ToString());
                        int          receiveUserId = Convert.ToInt32(dr["TargetUserID"].ToString());
                        AccountsInfo ai            = FacadeManage.aideAccountsFacade.GetAccountsInfoByUserID(userId);
                        AccountsInfo rai           = FacadeManage.aideAccountsFacade.GetAccountsInfoByUserID(receiveUserId);
                        gList.Add(new ReturnAwardGrant
                        {
                            CollectDate  = Convert.ToDateTime(dr["CollectDate"]),
                            TargetUserID = Convert.ToInt32(dr["TargetUserID"]),
                            SourceUserID = Convert.ToInt32(dr["SourceUserID"].ToString()),
                            //SourceBefore = Convert.ToInt64(dr["SourceBefore"]),
                            //TargetBefore = Convert.ToInt64(dr["TargetBefore"]),
                            Amount          = Convert.ToInt64(dr["Amount"]),
                            NickName        = ai?.NickName ?? "",
                            ReceiveNickName = rai?.NickName ?? "",
                            GameID          = ai?.GameID ?? 0,
                            ReceiveGameID   = rai?.GameID ?? 0
                        });
                    }
                }
                _ajv.SetDataItem("record", gList);
                break;

            default:
                _ajv.code = (int)ApiCode.VertyParamErrorCode;
                _ajv.msg  = string.Format(EnumHelper.GetDesc(ApiCode.VertyParamErrorCode), " type 无对应记录");
                return;
            }

            _ajv.SetDataItem("pageCount", ps?.PageCount);
            _ajv.SetDataItem("recordCount", ps?.RecordCount);
            _ajv.SetValidDataValue(true);
        }
Exemplo n.º 25
0
        /// <summary>
        /// 帐号申诉
        /// </summary>
        /// <param name="context"></param>
        public void AccountReport(HttpContext context)
        {
            Message       msg       = new Message();
            AjaxJsonValid ajaxJson  = new AjaxJsonValid();
            int           inputItem = 0;                                              //输入项数

            string reportEmail   = GameRequest.GetFormString("reportEmail");          //申诉邮箱
            string account       = GameRequest.GetFormString("txtUser");              //申诉帐号
            string regDate       = GameRequest.GetFormString("regDate");              //注册日期
            string realName      = GameRequest.GetFormString("realName");             //真实姓名
            string idCard        = GameRequest.GetFormString("idCard");               //身份证号
            string mobile        = GameRequest.GetFormString("mobile");               //手机号码
            string nicknameOne   = GameRequest.GetFormString("nicknameOne");          //历史昵称1
            string nicknameTwo   = GameRequest.GetFormString("nicknameTwo");          //历史昵称2
            string nicknameThree = GameRequest.GetFormString("nicknameThree");        //历史昵称3
            string passwordOne   = GameRequest.GetFormString("passwordOne");          //历史密码1
            string passwordTwo   = GameRequest.GetFormString("passwordTwo");          //历史密码2
            string passwordThree = GameRequest.GetFormString("passwordThree");        //历史密码3
            string questionOne   = GameRequest.GetFormString("questionOne");          //密保问题1
            string answerOne     = GameRequest.GetFormString("answerOne");            //密保答案1
            string questionTwo   = GameRequest.GetFormString("questionTwo");          //密保问题2
            string answerTwo     = GameRequest.GetFormString("answerTwo");            //密保答案2
            string questionThree = GameRequest.GetFormString("questionThree");        //密保问题3
            string answerThree   = GameRequest.GetFormString("answerThree");          //密保答案3
            string suppInfo      = GameRequest.GetFormString("suppInfo");             //补充资料

            #region 参数验证

            //验证申诉邮箱
            msg = InputDataValidate.CheckingEmail(reportEmail);
            if (!msg.Success)
            {
                ajaxJson.msg = "申诉结果接受邮箱输入有误";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }

            //验证申诉帐号
            msg = InputDataValidate.CheckingUserNameFormat(account);
            if (!msg.Success)
            {
                ajaxJson.msg = "申诉帐号输入有误";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }

            // 验证注册日期
            if (!string.IsNullOrEmpty(regDate))
            {
                if (!Utils.Validate.IsShortDate(regDate))
                {
                    ajaxJson.msg = "注册日期输入有误";
                    context.Response.Write(ajaxJson.SerializeToJson());
                    return;
                }
                inputItem++;
            }

            //验证真实姓名
            if (!string.IsNullOrEmpty(realName))
            {
                msg = InputDataValidate.CheckingRealNameFormat(realName, true);
                if (!msg.Success)
                {
                    ajaxJson.msg = "真实姓名输入有误";
                    context.Response.Write(ajaxJson.SerializeToJson());
                    return;
                }
                inputItem++;
            }

            //验证身份证号
            if (!string.IsNullOrEmpty(idCard))
            {
                msg = InputDataValidate.CheckingIDCardFormat(idCard, true);
                if (!msg.Success)
                {
                    ajaxJson.msg = "身份证号输入有误";
                    context.Response.Write(ajaxJson.SerializeToJson());
                    return;
                }
                inputItem++;
            }

            //验证移动电话
            if (!string.IsNullOrEmpty(mobile))
            {
                msg = InputDataValidate.CheckingMobilePhoneNumFormat(mobile, true);
                if (!msg.Success)
                {
                    ajaxJson.msg = "移动电话输入有误";
                    context.Response.Write(ajaxJson.SerializeToJson());
                    return;
                }
                inputItem++;
            }

            //验证历史昵称
            if (!string.IsNullOrEmpty(nicknameOne))
            {
                msg = InputDataValidate.CheckingNickNameFormat(nicknameOne);
                if (!msg.Success)
                {
                    ajaxJson.msg = "历史昵称1输入有误";
                    context.Response.Write(ajaxJson.SerializeToJson());
                    return;
                }
                inputItem++;
            }
            if (!string.IsNullOrEmpty(nicknameTwo))
            {
                msg = InputDataValidate.CheckingNickNameFormat(nicknameTwo);
                if (!msg.Success)
                {
                    ajaxJson.msg = "历史昵称2输入有误";
                    context.Response.Write(ajaxJson.SerializeToJson());
                    return;
                }
                if (nicknameTwo == nicknameOne)
                {
                    ajaxJson.msg = "历史昵称不能相同";
                    context.Response.Write(ajaxJson.SerializeToJson());
                    return;
                }
                inputItem++;
            }
            if (!string.IsNullOrEmpty(nicknameThree))
            {
                msg = InputDataValidate.CheckingNickNameFormat(nicknameThree);
                if (!msg.Success)
                {
                    ajaxJson.msg = "历史昵称3输入有误";
                    context.Response.Write(ajaxJson.SerializeToJson());
                    return;
                }
                if (nicknameThree == nicknameOne || nicknameThree == nicknameTwo)
                {
                    ajaxJson.msg = "历史昵称不能相同";
                    context.Response.Write(ajaxJson.SerializeToJson());
                    return;
                }
                inputItem++;
            }

            //验证密码
            if (!string.IsNullOrEmpty(passwordOne))
            {
                inputItem++;
            }
            if (!string.IsNullOrEmpty(passwordTwo))
            {
                if (passwordTwo == passwordOne)
                {
                    ajaxJson.msg = "历史密码不能相同";
                    context.Response.Write(ajaxJson.SerializeToJson());
                    return;
                }
                inputItem++;
            }
            if (!string.IsNullOrEmpty(passwordThree))
            {
                if (passwordThree == passwordTwo || passwordThree == passwordOne)
                {
                    ajaxJson.msg = "历史密码不能相同";
                    context.Response.Write(ajaxJson.SerializeToJson());
                    return;
                }
                inputItem++;
            }

            //验证密保
            if (questionOne != "0")
            {
                msg = InputDataValidate.CheckingProtectAnswer(answerOne, 1, false);
                if (!msg.Success)
                {
                    ajaxJson.msg = msg.Content;
                    context.Response.Write(ajaxJson.SerializeToJson());
                    return;
                }
                inputItem++;
            }
            else
            {
                if (!string.IsNullOrEmpty(answerOne))
                {
                    ajaxJson.msg = "你输入了密保答案1,必须选择密保问题1";
                    context.Response.Write(ajaxJson.SerializeToJson());
                    return;
                }
                questionOne = "";
            }
            if (questionTwo != "0")
            {
                if (questionOne == questionTwo)
                {
                    ajaxJson.msg = "密保问题不能相同";
                    context.Response.Write(ajaxJson.SerializeToJson());
                    return;
                }
                msg = InputDataValidate.CheckingProtectAnswer(answerTwo, 2, false);
                if (!msg.Success)
                {
                    ajaxJson.msg = msg.Content;
                    context.Response.Write(ajaxJson.SerializeToJson());
                    return;
                }
                inputItem++;
            }
            else
            {
                if (!string.IsNullOrEmpty(answerTwo))
                {
                    ajaxJson.msg = "你输入了密保答案2,必须选择密保问题2";
                    context.Response.Write(ajaxJson.SerializeToJson());
                    return;
                }
                questionTwo = "";
            }
            if (questionThree != "0")
            {
                if (questionThree == questionOne || questionThree == questionTwo)
                {
                    ajaxJson.msg = "密保问题不能相同";
                    context.Response.Write(ajaxJson.SerializeToJson());
                    return;
                }
                msg = InputDataValidate.CheckingProtectAnswer(answerThree, 3, false);
                if (!msg.Success)
                {
                    ajaxJson.msg = msg.Content;
                    context.Response.Write(ajaxJson.SerializeToJson());
                    return;
                }
                inputItem++;
            }
            else
            {
                if (!string.IsNullOrEmpty(answerThree))
                {
                    ajaxJson.msg = "你输入了密保答案3,必须选择密保问题3";
                    context.Response.Write(ajaxJson.SerializeToJson());
                    return;
                }
                questionThree = "";
            }

            //验证补充资料
            msg = InputDataValidate.CheckingProtectAnswer(suppInfo, true);
            if (!msg.Success)
            {
                ajaxJson.msg = "补全资料太长,最长不能超过200个字符";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }

            //申诉项数验证
            if (inputItem < 4)
            {
                ajaxJson.msg = "为了保证您的申诉请求审核通过,请输入至少4项资料,不包括补充资料";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }

            #endregion 参数验证

            //检测帐号
            Message userMsg = FacadeManage.aideAccountsFacade.GetUserGlobalInfo(0, 0, account);
            if (!userMsg.Success)
            {
                ajaxJson.msg = "您所申诉的帐号不存在";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }
            UserInfo userInfo = userMsg.EntityList[0] as UserInfo;
            if (userInfo == null)
            {
                ajaxJson.msg = "您所申诉的帐号不存在";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }

            //申诉实体信息
            LossReport lossReport = new LossReport();
            lossReport.ReportNo     = Fetch.GetForgetPwdNumber();
            lossReport.ReportEmail  = reportEmail;
            lossReport.Accounts     = account;
            lossReport.RegisterDate = regDate;
            lossReport.Compellation = realName;
            lossReport.PassportID   = idCard;
            lossReport.MobilePhone  = mobile;
            lossReport.OldNickName1 = nicknameOne;
            lossReport.OldNickName2 = nicknameTwo;
            lossReport.OldNickName3 = nicknameThree;
            if (!string.IsNullOrEmpty(passwordOne))
            {
                lossReport.OldLogonPass1 = Utility.MD5(passwordOne);
            }
            if (!string.IsNullOrEmpty(passwordTwo))
            {
                lossReport.OldLogonPass2 = Utility.MD5(passwordTwo);
            }
            if (!string.IsNullOrEmpty(passwordThree))
            {
                lossReport.OldLogonPass3 = Utility.MD5(passwordThree);
            }
            lossReport.ReportIP     = GameRequest.GetUserIP();
            lossReport.Random       = Utils.TextUtility.CreateRandom(4, 1, 0, 0, 0, "");
            lossReport.GameID       = userInfo.GameID;
            lossReport.UserID       = userInfo.UserID;
            lossReport.OldQuestion1 = questionOne;
            lossReport.OldResponse1 = answerOne;
            lossReport.OldQuestion2 = questionTwo;
            lossReport.OldResponse2 = answerTwo;
            lossReport.OldQuestion3 = questionThree;
            lossReport.OldResponse3 = answerThree;
            lossReport.SuppInfo     = suppInfo;

            //保存数据
            try
            {
                FacadeManage.aideNativeWebFacade.SaveLossReport(lossReport);
                ajaxJson.SetValidDataValue(true);
                string url = string.Format("Complaint-Setp-2.aspx?number={0}&account={1}", lossReport.ReportNo, account);
                ajaxJson.AddDataItem("uri", url);
                ajaxJson.msg = "申诉成功,系统将在2个工作日内处理,申诉结果将会以邮件的形式通知您!请注意查收邮件";
            }
            catch (Exception ex)
            {
                ajaxJson.msg = ex.ToString();
            }
            context.Response.Write(ajaxJson.SerializeToJson());
            return;
        }
Exemplo n.º 26
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "application/json";
            string action  = GameRequest.GetString("action").ToLower();
            int    version = GameRequest.GetInt("version", 2);

            #region Version 2.0 Router

            if (version == 2)
            {
                try
                {
                    //不需要认证的action
                    string[] unNeedAuthActions = { "agentauth", "gettoken" };

                    string token      = GameRequest.GetString("token");
                    string gameid     = GameRequest.GetString("gameid");
                    string authheader = context.Request.Headers["Authorization"];
                    _ajv = new AjaxJsonValid();
                    _ajv.SetDataItem("apiVersion", 20180316);
                    if (!string.IsNullOrEmpty(gameid))
                    {
                        unNeedAuthActions[1] = "setpassword";
                    }

                    //排除不需要认证后判断认证是否正确
                    if (!unNeedAuthActions.Contains(action))
                    {
                        if (string.IsNullOrEmpty(token) &&
                            (string.IsNullOrEmpty(authheader) || !authheader.Contains("Bearer")))
                        {
                            _ajv.code = (int)ApiCode.VertyParamErrorCode;
                            _ajv.msg  = string.Format(EnumHelper.GetDesc(ApiCode.VertyParamErrorCode), " token 缺失");
                            context.Response.Write(_ajv.SerializeToJson());
                            return;
                        }
                        string         authToken = !string.IsNullOrEmpty(token) ? token : authheader.Replace("Bearer ", "");
                        AgentTokenInfo authInfo  = FacadeManage.aideAgentFacade.VerifyAgentToken(authToken);
                        if (authInfo == null)
                        {
                            _ajv.code = (int)ApiCode.Unauthorized;
                            _ajv.msg  = EnumHelper.GetDesc(ApiCode.Unauthorized);
                            context.Response.Write(_ajv.SerializeToJson());
                            return;
                        }
                        //认证完成后 设置到全局
                        _agentInfo = FacadeManage.aideAgentFacade.GetAgentInfo(authInfo.AgentID, authInfo.UserID);
                    }

                    switch (action)
                    {
                    case "agentauth":     //1.0
                        AgentAuth(GameRequest.GetString("gameid"), GameRequest.GetString("pass"));
                        break;

                    case "getinfo":     //1.1
                        GetAgentInfo();
                        break;

                    case "gettoken":     //1.0
                        Gettoken();
                        break;

                    case "getnicknamebygameid":     //1.2
                        GetNickNameByGameID(GameRequest.GetInt("gameid", 0));
                        break;

                    case "getrecord":     //1.3
                        GetRecord(GameRequest.GetString("type"));
                        break;

                    case "getbelowlist":     //1.4
                        GetBelowList(GameRequest.GetString("type"), GameRequest.GetString("query"));
                        break;

                    case "getawardinfo":     //1.5
                        GetAwardInfo();
                        break;

                    case "presentscore":     //1.6
                        TakeScoreORDiamond(GameRequest.GetInt("gameid", 0), GameRequest.GetString("password"),
                                           GameRequest.GetInt("count", 0), Convert.ToByte(GameRequest.GetInt("type", 0)));
                        break;

                    case "presentdiamondorscore":
                        PresentDiamondOrScore(GameRequest.GetInt("gameid", 0), GameRequest.GetString("password"),
                                              GameRequest.GetInt("count", 0), Convert.ToByte(GameRequest.GetInt("type", 0)));
                        break;

                    case "setpassword":     //1.7
                        SetSafePass(GameRequest.GetString("password"));
                        break;

                    case "updatepassword":     //1.8
                        UpdateSafePass(GameRequest.GetString("oldPassword"), GameRequest.GetString("newPassword"));
                        break;

                    case "updateinfo":     //1.9
                        UpdateAgentInfo(GameRequest.GetString("address"), GameRequest.GetString("phone"),
                                        GameRequest.GetString("qq"));
                        break;

                    case "addagent":     //1.10
                        AddBelowAgent(GameRequest.GetInt("gameid", 0), GameRequest.GetString("agentDomain"),
                                      GameRequest.GetString("compellation"),
                                      "", GameRequest.GetString("phone"),
                                      ""
                                      );
                        break;

                    default:
                        _ajv.code = (int)ApiCode.VertyParamErrorCode;
                        _ajv.msg  = string.Format(EnumHelper.GetDesc(ApiCode.VertyParamErrorCode),
                                                  " action 对应接口不存在");
                        break;
                    }

                    context.Response.Write(_ajv.SerializeToJson());
                }
                catch (Exception ex)
                {
                    Log4Net.WriteInfoLog("下面一条为接口故障信息", "Agent_DataHandler");
                    Log4Net.WriteErrorLog(ex, "Agent_DataHandler");
                    _ajv = new AjaxJsonValid
                    {
                        code = (int)ApiCode.LogicErrorCode,
                        msg  = EnumHelper.GetDesc(ApiCode.LogicErrorCode)
                    };
                    context.Response.Write(_ajv.SerializeToJson());
                }
            }

            #endregion
        }
Exemplo n.º 27
0
        protected void btnPay_Click(object sender, EventArgs e)
        {
            string strAccounts   = CtrlHelper.GetText(txtPayAccounts);
            string strReAccounts = CtrlHelper.GetText(txtPayReAccounts);
            int    salePrice     = GameRequest.GetFormInt("rbSaleType", 0);
            string gamePayType   = GameRequest.GetFormString("rbPayGType");

            if (strAccounts == "")
            {
                RenderAlertInfo(true, "抱歉,请输入充值帐号。", 2);
                return;
            }
            if (strReAccounts != strAccounts)
            {
                RenderAlertInfo(true, "抱歉,两次输入的帐号不一致。", 2);
                return;
            }
            if (salePrice < 30)
            {
                RenderAlertInfo(true, "抱歉,充值金额必须大于30元", 2);
                return;
            }

            OnLineOrder onlineOrder = new OnLineOrder();

            onlineOrder.ShareID = gamePayType == "C" ? 7 : gamePayType == "D" ? 8 : gamePayType == "M" ? 9 : gamePayType == "N" ? 10 : 11;
            onlineOrder.OrderID = gamePayType == "C" ? PayHelper.GetOrderIDByPrefix("SD") : gamePayType == "D" ? PayHelper.GetOrderIDByPrefix("ZT") : gamePayType == "M" ? PayHelper.GetOrderIDByPrefix("WY") : gamePayType == "N" ? PayHelper.GetOrderIDByPrefix("SH") : PayHelper.GetOrderIDByPrefix("WM");

            #region 订单处理

            if (Fetch.GetUserCookie() == null)
            {
                onlineOrder.OperUserID = 0;
            }
            else
            {
                onlineOrder.OperUserID = Fetch.GetUserCookie().UserID;
            }
            onlineOrder.Accounts    = strAccounts;
            onlineOrder.CardTotal   = 1;
            onlineOrder.CardTypeID  = salePrice < 30 ? 1 : salePrice < 60 ? 2 : salePrice < 120 ? 3 : 4;
            onlineOrder.OrderAmount = salePrice;
            onlineOrder.IPAddress   = GameRequest.GetUserIP();

            //生成订单
            Message umsg = treasureFacade.RequestOrder(onlineOrder);
            if (!umsg.Success)
            {
                RenderAlertInfo(true, umsg.Content, 2);
                return;
            }

            #endregion

            #region 提交给快钱支付网关

            //商户号
            string merchantAcctId = ApplicationSettings.Get("merchantIdGame");

            //人民币网关密钥
            ///区分大小写.请与快钱联系索取
            string key = ApplicationSettings.Get("keyValueGame");

            //商户订单号
            string orderId = onlineOrder.OrderID.Trim();

            //支付金额
            string orderAmount = onlineOrder.OrderAmount.ToString();
            //string orderAmount = "1.00";

            //充值卡类型c 盛大一卡通d 征途游戏卡m网易一卡通n 搜狐一卡通u 完美一卡通
            string payType = gamePayType;

            //前台接收并显示页面,公网地址
            string pageUrl = "http://" + HttpContext.Current.Request.Url.Authority + "/Pay/PayShow.aspx";

            //支付结果底层发送的接收页面 后台接收页面
            string bgUrl = "http://" + HttpContext.Current.Request.Url.Authority + "/Pay/PayGameReceive.aspx";

            //扩展字段1
            string ext1 = "0";
            //扩展字段2
            string ext2 = "";

            //MD5签名 MD5签名:把请求支付的部分参数与KEY(商户后台可自行修改)拼凑成字符串经过国际标准32位MD5加密转换成大写

            String signMsgVal = "";
            signMsgVal = AppendParam(signMsgVal, "merchantAcctId", merchantAcctId);
            signMsgVal = AppendParam(signMsgVal, "orderId", orderId);
            signMsgVal = AppendParam(signMsgVal, "orderAmount", orderAmount);
            signMsgVal = AppendParam(signMsgVal, "payType", payType);
            signMsgVal = AppendParam(signMsgVal, "pageUrl", pageUrl);
            signMsgVal = AppendParam(signMsgVal, "bgUrl", bgUrl);
            signMsgVal = AppendParam(signMsgVal, "ext1", HttpUtility.UrlEncode(ext1, Encoding.GetEncoding("gb2312")).Trim());
            signMsgVal = AppendParam(signMsgVal, "ext2", HttpUtility.UrlEncode(ext2, Encoding.GetEncoding("gb2312")).Trim());
            signMsgVal = AppendParam(signMsgVal, "key", key);
            string signMsg = TextEncrypt.EncryptPassword(signMsgVal).ToUpper();
            #endregion

            RenderAlertInfo(false, "页面正跳转到支付平台,请稍候。。。", 2);

            #region 整理参数

            string getData = "";
            getData = AppendAllParam(getData, "merchantAcctId", merchantAcctId);
            getData = AppendAllParam(getData, "orderId", orderId);
            getData = AppendAllParam(getData, "orderAmount", orderAmount);
            getData = AppendAllParam(getData, "payType", payType);
            getData = AppendAllParam(getData, "pageUrl", HttpUtility.UrlEncode(pageUrl, Encoding.GetEncoding("gb2312")).Trim());
            getData = AppendAllParam(getData, "bgUrl", HttpUtility.UrlEncode(bgUrl, Encoding.GetEncoding("gb2312")).Trim());
            getData = AppendAllParam(getData, "ext1", HttpUtility.UrlEncode(ext1, Encoding.GetEncoding("gb2312")).Trim());
            getData = AppendAllParam(getData, "ext2", HttpUtility.UrlEncode(ext2, Encoding.GetEncoding("gb2312")).Trim());
            getData = AppendAllParam(getData, "signMsg", signMsg);

            string posturl = this.Page.Form.Action + "?" + getData;

            #endregion

            Response.Redirect(posturl);
        }
Exemplo n.º 28
0
        /// <summary>
        /// 更新奖品配置
        /// </summary>
        /// <param name="context"></param>
        private void UpdateLotteryItem(HttpContext context)
        {
            //验证权限
            int             moduleID = 312;
            AdminPermission adminPer = new AdminPermission(userExt, moduleID);

            if (!adminPer.GetPermission((long)Permission.Edit))
            {
                ajv.msg = "非法操作,无操作权限";
                context.Response.Write(ajv.SerializeToJson());
                return;
            }

            int    itemIndex = GameRequest.GetFormInt("id", 0);
            string itemType  = GameRequest.GetFormString("ItemType");
            string itemQuota = GameRequest.GetFormString("ItemQuota");
            string itemRate  = GameRequest.GetFormString("ItemRate");

            //验证ID
            if (itemIndex == 0)
            {
                ajv.msg = "非法操作,无效的奖品索引";
                context.Response.Write(ajv.SerializeToJson());
                return;
            }

            //验证类型
            if (!Utils.Validate.IsPositiveInt(itemType))
            {
                ajv.msg = "请输入正确的奖品类型";
                context.Response.Write(ajv.SerializeToJson());
                return;
            }
            //验证数量
            if (!Utils.Validate.IsPositiveInt(itemQuota))
            {
                ajv.msg = "请输入正确的奖品数量";
                context.Response.Write(ajv.SerializeToJson());
                return;
            }
            //验证中奖几率
            if (!Utils.Validate.IsPositiveInt(itemRate))
            {
                ajv.msg = "请输入正确的中奖几率";
                context.Response.Write(ajv.SerializeToJson());
                return;
            }

            LotteryItem model = new LotteryItem();

            model.ItemIndex = itemIndex;
            model.ItemType  = Convert.ToInt32(itemType);
            model.ItemQuota = Convert.ToInt32(itemQuota);
            model.ItemRate  = Convert.ToInt32(itemRate);
            int result = FacadeManage.aideTreasureFacade.UpdateLotteryItem(model);

            if (result > 0)
            {
                ajv.msg = "修改成功";
                ajv.SetValidDataValue(true);
            }
            else
            {
                ajv.msg = "修改失败";
            }
            context.Response.Write(ajv.SerializeToJson());
        }
Exemplo n.º 29
0
        protected void rptFleeList_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            if (e.CommandName == "Clear")
            {
                int kindID = Convert.ToInt32(e.CommandArgument.ToString());

                TreasureFacade treasureFacade = new TreasureFacade(kindID);
                Message        umsg           = treasureFacade.ClearGameFlee(Fetch.GetUserCookie().UserID, GameRequest.GetUserIP());
                if (umsg.Success)
                {
                    ShowAndRedirect("逃跑清零成功!", "/Member/ClearFlee.aspx");
                }
                else
                {
                    Show(umsg.Content);
                }
            }
        }
Exemplo n.º 30
0
        /// <summary>
        /// 获取游戏记录
        /// </summary>
        /// <param name="context"></param>
        private void GetUserGameRecord(HttpContext context)
        {
            //验证权限
            int             moduleID = 809;
            AdminPermission adminPer = new AdminPermission(userExt, moduleID);

            if (!adminPer.GetPermission((long)Permission.Read))
            {
                ajv.msg = "非法操作,无操作权限";
                context.Response.Write(ajv.SerializeToJson());
                return;
            }

            int drawID = GameRequest.GetQueryInt("drawID", 0);

            //验证ID
            if (drawID == 0)
            {
                ajv.msg = "非法操作,无效的局数标识";
                context.Response.Write(ajv.SerializeToJson());
                return;
            }

            //获取数据
            DataSet ds = FacadeManage.aideTreasureFacade.GetRecordDrawScoreByDrawID(drawID);

            if (ds.Tables[0].Rows.Count > 0)
            {
                //复制表结构
                DataTable dt = ds.Tables[0].Clone();

                //修改表列数据类型
                dt.Columns["IsAndroid"].DataType = typeof(string);
                dt.Columns["Score"].DataType     = typeof(string);
                dt.Columns["Revenue"].DataType   = typeof(string);

                for (int i = 0; i <= ds.Tables[0].Rows.Count - 1; i++)
                {
                    DataRow dw = dt.NewRow();
                    dw = ds.Tables[0].Rows[i];
                    dt.Rows.Add(dw.ItemArray);

                    //修改是否机器人数据项
                    if (Convert.ToInt32(dt.Rows[i]["IsAndroid"]) == 0)
                    {
                        dt.Rows[i]["IsAndroid"] = "否";
                    }
                    else
                    {
                        dt.Rows[i]["IsAndroid"] = "是";
                    }

                    //格式化输赢积分
                    dt.Rows[i]["Score"] = Convert.ToInt64(dt.Rows[i]["Score"]).ToString("N0");

                    //格式化税收
                    dt.Rows[i]["Revenue"] = Convert.ToInt32(dt.Rows[i]["Revenue"]).ToString("N0");
                }

                Game.Utils.Template            tm       = new Game.Utils.Template("/Template/UserGameRecord.html");
                Dictionary <string, DataTable> dicTable = new Dictionary <string, DataTable>();
                dicTable.Add("UserGameRecord", dt);
                tm.ForDataScoureList = dicTable;

                string html = tm.OutputHTML();
                ajv.AddDataItem("html", html);
            }

            //返回数据
            ajv.SetValidDataValue(true);
            context.Response.Write(ajv.SerializeToJson());
        }
Exemplo n.º 31
0
        /// <summary>
        /// 购买商品
        /// </summary>
        /// <param name="context"></param>
        public void BuyAward(HttpContext context)
        {
            Message       msg      = new Message();
            AjaxJsonValid ajaxJson = new AjaxJsonValid();

            //判断登录
            if (!Fetch.IsUserOnline())
            {
                ajaxJson.code = 1;
                ajaxJson.msg  = "请先登录";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }

            //获取参数
            int    typeID        = GameRequest.GetQueryInt("TypeID", 0);
            int    awardID       = GameRequest.GetFormInt("awardID", 0);                          //商品ID
            int    counts        = GameRequest.GetFormInt("counts", 0);                           //购买数量
            string compellation  = TextFilter.FilterScript(GameRequest.GetFormString("name"));    //真实姓名
            string mobilePhone   = TextFilter.FilterScript(GameRequest.GetFormString("phone"));   //移动电话
            int    province      = GameRequest.GetFormInt("province", -1);                        //省份
            int    city          = GameRequest.GetFormInt("city", -1);                            //城市
            int    area          = GameRequest.GetFormInt("area", -1);                            //地区
            string dwellingPlace = TextFilter.FilterScript(GameRequest.GetFormString("address")); //详细地址

            //验证奖品
            if (awardID == 0)
            {
                ajaxJson.msg = "非常抱歉,你所选购的商品不存在!";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }

            //验证数量
            if (counts <= 0)
            {
                ajaxJson.msg = "请输入正确的兑换数量!";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }
            if (counts > 100)
            {
                ajaxJson.msg = "兑换数量不能超过100!";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }

            AwardInfo awardInfo    = FacadeManage.aideNativeWebFacade.GetAwardInfo(awardID);
            int       needInfo     = awardInfo.NeedInfo;
            int       qqValue      = (int)AppConfig.AwardNeedInfoType.QQ号码;
            int       nameValue    = (int)AppConfig.AwardNeedInfoType.真实姓名;
            int       phoneValue   = (int)AppConfig.AwardNeedInfoType.手机号码;
            int       addressValue = (int)AppConfig.AwardNeedInfoType.收货地址及邮编;

            //验证真实姓名
            if ((needInfo & nameValue) == nameValue)
            {
                msg = CheckingRealNameFormat(compellation, false);
                if (!msg.Success)
                {
                    ajaxJson.msg = "请输入正确的收件人";
                    context.Response.Write(ajaxJson.SerializeToJson());
                    return;
                }
            }

            //验证手机号
            if ((needInfo & phoneValue) == phoneValue)
            {
                msg = CheckingMobilePhoneNumFormat(mobilePhone, false);
                if (!msg.Success)
                {
                    ajaxJson.msg = "请输入正确的手机号码";
                    context.Response.Write(ajaxJson.SerializeToJson());
                    return;
                }
            }

            //验证地址邮编
            if ((needInfo & addressValue) == addressValue)
            {
                if (province == -1)
                {
                    ajaxJson.msg = "请选择省份";
                    context.Response.Write(ajaxJson.SerializeToJson());
                    return;
                }
                if (city == -1)
                {
                    ajaxJson.msg = "请选择城市";
                    context.Response.Write(ajaxJson.SerializeToJson());
                    return;
                }
                if (area == -1)
                {
                    ajaxJson.msg = "请选择地区";
                    context.Response.Write(ajaxJson.SerializeToJson());
                    return;
                }
                if (string.IsNullOrEmpty(dwellingPlace))
                {
                    ajaxJson.msg = "请输入详细地址";
                    context.Response.Write(ajaxJson.SerializeToJson());
                    return;
                }
            }

            //验证用户
            UserInfo userInfo = FacadeManage.aideAccountsFacade.GetUserGlobalInfo(Fetch.GetUserCookie().UserID, 0, "").EntityList[0] as UserInfo;

            //验证余额
            int totalAmount = awardInfo.Price * counts;     //总金额

            if (totalAmount > userInfo.UserMedal)
            {
                ajaxJson.msg = "很抱歉!您的元宝数不足,不能兑换该奖品";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }

            //验证库存
            if (awardInfo.Inventory <= 0)
            {
                ajaxJson.msg = "很抱歉!奖品的库存数不足,请更新其他奖品或者等待补充库存";
                context.Response.Write(ajaxJson.SerializeToJson());
                return;
            }

            //扣除奖牌
            userInfo.UserMedal = userInfo.UserMedal - totalAmount;

            //更新奖牌
            AwardOrder awardOrder = new AwardOrder();

            awardOrder.UserID        = userInfo.UserID;
            awardOrder.AwardID       = awardID;
            awardOrder.AwardPrice    = awardInfo.Price;
            awardOrder.AwardCount    = counts;
            awardOrder.TotalAmount   = totalAmount;
            awardOrder.Compellation  = compellation;
            awardOrder.MobilePhone   = mobilePhone;
            awardOrder.QQ            = "";
            awardOrder.Province      = province;
            awardOrder.City          = city;
            awardOrder.Area          = area;
            awardOrder.DwellingPlace = dwellingPlace;
            awardOrder.PostalCode    = "";
            awardOrder.BuyIP         = Utility.UserIP;

            msg = FacadeManage.aideNativeWebFacade.BuyAward(awardOrder);
            if (msg.Success)
            {
                ajaxJson.SetValidDataValue(true);
                ajaxJson.msg = "恭喜您!兑换成功";
                awardOrder   = msg.EntityList[0] as AwardOrder;
                if (typeID == 0)
                {
                    ajaxJson.AddDataItem("uri", "/Shop/Order.aspx?param=" + awardOrder.AwardID);
                }
                else
                {
                    ajaxJson.AddDataItem("uri", "/Mobile/Shop/Order.aspx?param=" + awardOrder.AwardID);
                }
                context.Response.Write(ajaxJson.SerializeToJson());
            }
            else
            {
                ajaxJson.msg = msg.Content;
                context.Response.Write(ajaxJson.SerializeToJson());
            }
        }
Exemplo n.º 32
0
        private TestGameHandler ConnectPlayer(string playerName)
        {
            var playerConnectRequestObject = new PlayerConnectRequestObject
            {
                PlayerName = playerName
            };
            var playerConnectRequest = new GameRequest(GameRequestType.PlayerConnect)
            {
                Sender = playerName,
                SerializedRequestObject = this.serializer.Serialize(playerConnectRequestObject)
            };
            var playerGameHandler = new TestGameHandler(this.gameInitializer, this.serializer);

            playerGameHandler.OnOpen();
            playerGameHandler.OnMessage(this.serializer.Serialize(playerConnectRequest));

            return playerGameHandler;
        }