Exemplo n.º 1
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     this.adname = GameRequest.GetString("adname");
     if (!string.IsNullOrEmpty(this.adname))
     {
         string a;
         if ((a = this.adname) != null)
         {
             if (a == "蛋蛋")
             {
                 this.adid = GameRequest.GetString("pcid");
                 return;
             }
             if (a == "蹦蹦")
             {
                 this.adid = GameRequest.GetString("annalID");
                 return;
             }
             if (a == "聚聚玩")
             {
                 this.adid = GameRequest.GetString("jjwID");
                 return;
             }
         }
         this.adid = "";
     }
 }
Exemplo n.º 2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            AuthUserOperationPermission(Permission.Edit);
            //更新充值卡表
            string date     = CtrlHelper.GetText(txtEnjoinOverDate);
            string password = CtrlHelper.GetText(txtPassword);
            int    buildId  = Convert.ToInt32(GameRequest.GetString("buildId").Trim( ));

            if (date == "" && password == "")
            {
                MessageBox("请输入密码或者有效期");
                return;
            }
            StringBuilder sqlQuery = new StringBuilder();

            if (date != "" && password != "")
            {
                sqlQuery.AppendFormat("update {0} set ValidDate='{1}',PassWord='******' where CardID in ({3})", LivcardAssociator.Tablename, date, Utility.MD5(password), StrParamsList);
            }
            else
            {
                if (date != "")
                {
                    sqlQuery.AppendFormat("update {0} set ValidDate='{1}' where CardID in ({2})", LivcardAssociator.Tablename, date, StrParamsList);
                }
                else
                {
                    sqlQuery.AppendFormat("update {0} set PassWord='******' where CardID in ({2})", LivcardAssociator.Tablename, Utility.MD5(password), StrParamsList);
                }
            }
            int results = FacadeManage.aideTreasureFacade.ExecuteSql(sqlQuery.ToString());
            LivcardBuildStream LivcardBuild = FacadeManage.aideTreasureFacade.GetLivcardBuildStreamInfo(buildId);

            //更新批次表
            string        byteList     = UnicodeEncoding.Default.GetString(LivcardBuild.BuildCardPacket);
            StringBuilder sqlQueryCard = new StringBuilder( );

            sqlQueryCard.AppendFormat("SELECT SerialID FROM {0} WHERE CardID in ({1})", LivcardAssociator.Tablename, StrParamsList);
            DataSet ds = FacadeManage.aideTreasureFacade.GetDataSetBySql(sqlQueryCard.ToString());

            foreach (DataRow row in ds.Tables[0].Rows)
            {
                string serialID = row["SerialID"].ToString( );
                int    number1  = byteList.IndexOf(serialID);
                string prefix   = byteList.Substring(0, number1 + serialID.Length + 1);
                int    number2  = byteList.IndexOf("/", number1 + serialID.Length + 1);
                string profix   = byteList.Substring(number2);
                byteList = prefix + password + profix;
            }
            LivcardBuild.BuildCardPacket = UnicodeEncoding.Default.GetBytes(byteList);
            FacadeManage.aideTreasureFacade.UpdateLivcardBuildStream(LivcardBuild);
            if (results > 0)
            {
                MessageBoxClose("成功更新" + results + "条记录");
            }
            else
            {
                MessageBoxClose("没有符合的数据更新");
            }
        }
        public JsonResult DelConfigure()
        {
            if (user != null)
            {
                AdminPermission adminPermission = new AdminPermission(user, user.MoudleID);
                if (!adminPermission.GetPermission(8L))
                {
                    return(Json(new
                    {
                        IsOk = false,
                        Msg = "没有权限",
                        Url = "/NoPower/Index"
                    }));
                }
            }
            string @string = GameRequest.GetString("cid");

            string[]      array         = @string.Trim().Split(',');
            StringBuilder stringBuilder = new StringBuilder();

            string[] array2 = array;
            foreach (string text in array2)
            {
                int result = 0;
                if (int.TryParse(text, out result))
                {
                    stringBuilder.Append(text + ",");
                }
            }
            if (!string.IsNullOrEmpty(stringBuilder.ToString()))
            {
                try
                {
                    FacadeManage.aideAccountsFacade.DeleteConfigure(stringBuilder.ToString().TrimEnd(','));
                    return(Json(new
                    {
                        IsOk = true,
                        Msg = "删除成功"
                    }));
                }
                catch
                {
                    return(Json(new
                    {
                        IsOk = false,
                        Msg = "删除失败"
                    }));
                }
            }
            return(Json(new
            {
                IsOk = false,
                Msg = "参数不正确"
            }));
        }
Exemplo n.º 4
0
        /// <summary>
        /// 接口主路由
        /// </summary>
        /// <param name="context"></param>
        public void ProcessRequest(HttpContext context)
        {
            //允许跨站请求域名
            context.Response.AddHeader("Access-Control-Allow-Origin", AppConfig.MoblieInterfaceDomain);
            context.Response.ContentType = "application/json";

            string action = GameRequest.GetString("action");

            //签名验证 //接口版本号
            _ajv = new AjaxJsonValid();
            _ajv.SetDataItem("apiVersion", 20171120);
            if (_userId <= 0)
            {
                _ajv.code = (int)ApiCode.VertyParamErrorCode;
                _ajv.msg  = string.Format(EnumHelper.GetDesc(ApiCode.VertyParamErrorCode), " userid 为空");
                _ajv.SetValidDataValue(false);
                context.Response.Write(_ajv.SerializeToJson());
                return;
            }
            switch (action)
            {
            case "userspreadhome":
                UserSpreadHome();
                break;

            case "userspreadreceive":
                int num = GameRequest.GetInt("num", 0);
                if (num <= 0)
                {
                    _ajv.code = (int)ApiCode.VertyParamErrorCode;
                    _ajv.msg  = string.Format(EnumHelper.GetDesc(ApiCode.VertyParamErrorCode), " num(领取数量)");
                    _ajv.SetValidDataValue(false);
                    context.Response.Write(_ajv.SerializeToJson());
                    return;
                }
                UserSpreadReveice(num);
                break;

            default:
                _ajv.code = (int)ApiCode.VertyParamErrorCode;
                _ajv.msg  = string.Format(EnumHelper.GetDesc(ApiCode.VertyParamErrorCode), " action");
                _ajv.SetValidDataValue(false);
                break;
            }

            context.Response.Write(_ajv.SerializeToJson());
        }
        public void LeavingMessage(System.Web.HttpContext context)
        {
            int queryInt = GameRequest.GetQueryInt("userid", 0);

            GameRequest.GetQueryString("signature");
            GameRequest.GetQueryString("time");
            AjaxJsonValid ajaxJsonValid = new AjaxJsonValid();

            ajaxJsonValid.code = 1;
            string @string = GameRequest.GetString("contact");

            if (@string == "")
            {
                ajaxJsonValid.msg = "请输入联系方式";
                context.Response.Write(ajaxJsonValid.SerializeToJson());
            }
            else
            {
                int    queryInt2   = GameRequest.GetQueryInt("typeid", 0);
                string queryString = GameRequest.GetQueryString("content");
                if (queryString == "")
                {
                    ajaxJsonValid.msg = "留言内容不能为空";
                    context.Response.Write(ajaxJsonValid.SerializeToJson());
                }
                else
                {
                    System.Collections.Generic.Dictionary <string, object> dictionary = new System.Collections.Generic.Dictionary <string, object>();
                    dictionary["dwUserID"]    = queryInt;
                    dictionary["strTitle"]    = @string;
                    dictionary["dwTypeID"]    = queryInt2;
                    dictionary["strContent"]  = queryString;
                    dictionary["strImageUrl"] = "";
                    dictionary["strClientIp"] = GameRequest.GetUserIP();
                    dictionary["strErr"]      = "";
                    Message message = FacadeManage.aideNativeWebFacade.ExcuteByProce("NET_PW_AddGameFeedbackNew", dictionary);
                    if (message.Success)
                    {
                        ajaxJsonValid.code = 0;
                    }
                    ajaxJsonValid.msg = message.Content;
                    context.Response.Write(ajaxJsonValid.SerializeToJson());
                }
            }
        }
        public string GetMySpread()
        {
            int    @int    = GameRequest.GetInt("userid", 0);
            string @string = GameRequest.GetString("signature");
            string string2 = GameRequest.GetString("time");
            string result;

            if (@int <= 0)
            {
                result = JsonHelper.SerializeObject(new
                {
                    Code = 1,
                    Msg  = "参数错误"
                });
            }
            else
            {
                Message message = FacadeManage.aideAccountsFacade.CheckUserSignature(@int, string2, @string);
                if (!message.Success)
                {
                    result = JsonHelper.SerializeObject(new
                    {
                        Code = 1,
                        Msg  = message.Content
                    });
                }
                else
                {
                    UserTicketInfo userCookie = Fetch.GetUserCookie();
                    if (userCookie == null || userCookie.UserID != @int)
                    {
                        UserInfo userInfo = message.EntityList[0] as UserInfo;
                        Fetch.SetUserCookie(userInfo.ToUserTicketInfo());
                    }
                    System.Data.DataTable mySpread = FacadeManage.aideTreasureFacade.GetMySpread(@int);
                    result = JsonHelper.SerializeObject(new
                    {
                        Code = 0,
                        Data = mySpread
                    });
                }
            }
            return(result);
        }
Exemplo n.º 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            payType = GameRequest.GetString("paytype").ToLower();
            switch (payType)
            {
            case "alipay":
                payName           = "支付宝充值";
                sPaySidebar.PayID = 2;
                cardType          = 801;
                break;

            case "wechat":
                payName           = "微信支付";
                sPaySidebar.PayID = 3;
                cardType          = 802;
                break;

            case "bank":
            default:
                payName           = "网上银行";
                sPaySidebar.PayID = 0;
                cardType          = 800;
                break;
            }

            if (!IsPostBack)
            {
                SwitchStep(1);

                if (Fetch.GetUserCookie() != null)
                {
                    this.txtPayAccounts.Text   = Fetch.GetUserCookie().Accounts;
                    this.txtPayReAccounts.Text = Fetch.GetUserCookie().Accounts;
                }

                DataSet ds = FacadeManage.aideTreasureFacade.GetPayQuotaList(cardType);
                ddlCurrenry.DataSource     = ds;
                ddlCurrenry.DataTextField  = "PresentCurrency";
                ddlCurrenry.DataValueField = "Price";
                ddlCurrenry.DataBind();
                ddlCurrenry.Items.Insert(0, new ListItem(" -----请选择充值额度----- ", "0"));
            }
        }
        public string GetMyLowerMember()
        {
            int    @int    = GameRequest.GetInt("userid", 0);
            string @string = GameRequest.GetString("signature");
            string string2 = GameRequest.GetString("time");
            int    int2    = GameRequest.GetInt("pageIndex", 1);
            int    int3    = GameRequest.GetInt("pageSize", 20);
            string result;

            if (@int <= 0)
            {
                result = JsonHelper.SerializeObject(new
                {
                    Code = 1,
                    Msg  = "参数错误"
                });
            }
            else
            {
                Message message = FacadeManage.aideAccountsFacade.CheckUserSignature(@int, string2, @string);
                if (!message.Success)
                {
                    result = JsonHelper.SerializeObject(new
                    {
                        Code = 1,
                        Msg  = message.Content
                    });
                }
                else
                {
                    PagerSet list = FacadeManage.aideTreasureFacade.GetList("(SELECT * FROM RYAgentDB.dbo.Fn_GetSpreadDowns(" + @int + ",0)) as tab", int2, int3, "Order By NowYj", "");
                    System.Data.DataTable data = list.PageSet.Tables[0];
                    result = JsonHelper.SerializeObject(new
                    {
                        Code  = 0,
                        Data  = data,
                        Total = list.RecordCount
                    });
                }
            }
            return(result);
        }
Exemplo n.º 9
0
        /// <summary>
        /// 任务启动 更改数据库状态
        /// </summary>
        private void StartUpTask()
        {
            string msg        = "";
            int    recid      = GameRequest.GetInt("taskid", 0);
            string platform   = GameRequest.GetQueryString("platform");
            string serveraddr = GameRequest.GetString("serveraddr");

            //string fileaddr = GameRequest.GetString("fileaddr");
            //string filename = GameRequest.GetString("filename");
            if (recid == 0)
            {
                msg = "{\"status\":\"error\",\"msg\":\"error04\"}";
            }
            else if (string.IsNullOrEmpty(serveraddr))
            {
                msg = "{\"status\":\"error\",\"msg\":\"'error05\"}";
            }
            //else if (string.IsNullOrEmpty(fileaddr)) { msg = "{status:'error',msg:'error06'}"; }
            //else if (string.IsNullOrEmpty(filename)) { msg = "{status:'error',msg:'error07'}"; }
            else
            {
                if (platform != "Android" && platform != "iOS")
                {
                    msg = "{\"status\":\"error\",\"msg\":\"error03\"}";
                }
                else
                {
                    string sql = string.Format(@"  update {2} set PackageTaskStatus=2, StartDatetime=GETDATE(),serverAddr='{0}'
                                               where RecID='{1}' and ((PackageTaskStatus=0 and DATEDIFF(N,StartDatetime,GETDATE())<5) or PackageTaskStatus=1)", serveraddr, recid, platform == "Android" ? "[sdk_NewPackageCreateTask]" : "[sdk_NewPackageCreateTask_IOS]");
                    int    row = aideNativeWebFacade.ExecuteSql(sql);
                    if (row > 0)
                    {
                        msg = "{\"status\":\"success\",\"msg\":\"startTask_OK\"}";
                    }
                    else
                    {
                        msg = "{\"status\":\"error\",\"msg\":\"error08\"}";
                    }
                }
            }
            Response.Write(msg);
        }
Exemplo n.º 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //查询汇率
            SystemStatusInfo ssi = FacadeManage.aideAccountsFacade.GetSystemStatusInfo(AppConfig.SystemConfigKey.RateCurrency.ToString());

            if (ssi != null)
            {
                rateGameBean = ssi.StatusValue;
            }

            payType = GameRequest.GetString("paytype").ToLower();
            switch (payType)
            {
            case "alipay":
                payName           = "支付宝充值";
                sPaySidebar.PayID = 2;
                break;

            case "wechat":
                payName           = "微信支付";
                sPaySidebar.PayID = 3;
                break;

            case "bank":
            default:
                payName           = "网上银行";
                sPaySidebar.PayID = 0;
                break;
            }

            if (!IsPostBack)
            {
                SwitchStep(1);

                if (Fetch.GetUserCookie() != null)
                {
                    this.txtPayAccounts.Text   = Fetch.GetUserCookie().Accounts;
                    this.txtPayReAccounts.Text = Fetch.GetUserCookie().Accounts;
                    this.txtPayAccounts.Focus();
                }
            }
        }
        public string GetWithdrawals()
        {
            int    @int    = GameRequest.GetInt("userid", 0);
            string @string = GameRequest.GetString("signature");
            string string2 = GameRequest.GetString("time");
            int    int2    = GameRequest.GetInt("pageIndex", 1);
            int    int3    = GameRequest.GetInt("pageSize", 20);
            string result;

            if (@int <= 0)
            {
                result = JsonHelper.SerializeObject(new
                {
                    Code = 1,
                    Msg  = "参数错误"
                });
            }
            else
            {
                Message message = FacadeManage.aideAccountsFacade.CheckUserSignature(@int, string2, @string);
                if (!message.Success)
                {
                    result = JsonHelper.SerializeObject(new
                    {
                        Code = 1,
                        Msg  = message.Content
                    });
                }
                else
                {
                    PagerSet list = FacadeManage.aideTreasureFacade.GetList("(select * from RYAgentDB.dbo.T_SpreadBalance where  userid = " + @int + ") as tab", int2, int3, "Order By ID DESC", "");
                    System.Data.DataTable data = list.PageSet.Tables[0];
                    result = JsonHelper.SerializeObject(new
                    {
                        Code  = 0,
                        Data  = data,
                        Total = list.RecordCount
                    });
                }
            }
            return(result);
        }
Exemplo n.º 12
0
        /// <summary>
        /// 获取信息
        /// </summary>
        private void InitStart()
        {
            //查询订单编号
            string orderID = GameRequest.GetString("OrderID");

            OnLineOrder onlineOrder = treasureFacade.GetOnlineOrder(orderID);

            if (onlineOrder != null)
            {
                lblOrderID.Text      = onlineOrder.OrderID.ToString();
                lblAccounts.Text     = onlineOrder.Accounts.ToString();
                lblGameID.Text       = onlineOrder.GameID.ToString();
                lblCardName.Text     = Convert.ToInt32(onlineOrder.OrderAmount) < 30 ? "蓝钻会员卡" : Convert.ToInt32(onlineOrder.OrderAmount) < 60 ? "黄钻会员卡" : Convert.ToInt32(onlineOrder.OrderAmount) < 120 ? "白钻会员卡" : "红钻会员卡";
                lblMemberMonth.Text  = onlineOrder.OrderAmount / 10 + " 个月";
                lblPresentScore.Text = (onlineOrder.CardGold * onlineOrder.OrderAmount / (onlineOrder.CardPrice)).ToString("N");
                lblOrderAmount.Text  = onlineOrder.OrderAmount.ToString("N");
            }

            string msg = "0";

            if (!String.IsNullOrEmpty(GameRequest.GetString("msg")))
            {
                msg = Request["msg"].ToString( ).Trim( );
            }
            else
            {
                if (Request.QueryString["payResult"] == null)
                {
                    msg = "1";
                }
                else
                {
                    if (Request.QueryString["payResult"].ToString() != "10")
                    {
                        msg = "3";
                    }
                }
            }

            this.lblResults.Text = GetBillMessage(msg);
        }
Exemplo n.º 13
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            SystemStatusInfo systemStatusInfo = FacadeManage.aideAccountsFacade.GetSystemStatusInfo(AppConfig.SystemConfigKey.RateCurrency.ToString());

            if (systemStatusInfo != null)
            {
                this.rateGameBean = systemStatusInfo.StatusValue;
            }
            this.payType = GameRequest.GetString("paytype").ToLower();
            string a;

            if ((a = this.payType) != null)
            {
                if (a == "alipay")
                {
                    this.payName = "支付宝充值";
                    goto IL_AF;
                }
                if (a == "wechat")
                {
                    this.payName = "微信支付";
                    goto IL_AF;
                }
                if (!(a == "bank"))
                {
                }
            }
            this.payName = "网上银行";
IL_AF:
            if (!base.IsPostBack)
            {
                this.SwitchStep(1);
                if (Fetch.GetUserCookie() != null)
                {
                    this.txtPayAccounts.Text   = Fetch.GetUserCookie().Accounts;
                    this.txtPayReAccounts.Text = Fetch.GetUserCookie().Accounts;
                    this.txtPayAccounts.Focus();
                }
            }
        }
Exemplo n.º 14
0
        /// <summary>
        /// 完成任务
        /// </summary>
        private void FinishTask()
        {
            string msg      = "";
            int    recid    = GameRequest.GetInt("taskid", 0);
            string platform = GameRequest.GetQueryString("platform");
            //string packageaddr = GameRequest.GetString("packageaddr");
            string packagename = GameRequest.GetString("packagename");

            if (recid == 0)
            {
                msg = "{\"status\":\"error\",\"msg\":\"error04\"}";
            }
            //else if (string.IsNullOrEmpty(packageaddr)) { msg = "{\"status\":\"error\",\"msg\":\"error09\"}"; }
            else if (string.IsNullOrEmpty(packagename))
            {
                msg = "{\"status\":\"error\",\"msg\":\"error10\"}";
            }
            else
            {
                if (platform != "Android" && platform != "iOS")
                {
                    msg = "{\"status\":\"error\",\"msg\":\"error03\"}";
                }
                else
                {
                    string sql = string.Format(@"  update {2} set PackageTaskStatus=3, FinishDatetime=GETDATE(),
                                                [packagename]='{1}' where RecID='{0}' and PackageTaskStatus=2", recid, packagename, platform == "Android" ? "[sdk_NewPackageCreateTask]" : "[sdk_NewPackageCreateTask_IOS]");
                    int    row = aideNativeWebFacade.ExecuteSql(sql);
                    if (row > 0)
                    {
                        msg = "{\"status\":\"success\",\"msg\":\"finishTask_OK\"}";
                    }
                    else
                    {
                        msg = "{\"status\":\"error\",\"msg\":\"error11\"}";
                    }
                }
            }
            Response.Write(msg);
        }
        public void GetQuestionList(System.Web.HttpContext context)
        {
            int    @int    = GameRequest.GetInt("hot", 0);
            string @string = GameRequest.GetString("title");
            int    int2    = GameRequest.GetInt("typeId", 0);

            System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder("WHERE Nullity=0");
            if (@int > 0)
            {
                stringBuilder.Append(" AND Hot=1");
            }
            if (@string != "")
            {
                stringBuilder.Append(" AND IssueTitle like '%'+@title+'%'");
            }
            if (int2 > 0)
            {
                stringBuilder.AppendFormat(" AND TypeID={0}", int2);
            }
            System.Data.DataTable questionList = FacadeManage.aideNativeWebFacade.GetQuestionList(stringBuilder.ToString(), @string);
            context.Response.Write(JsonHelper.SerializeObject(questionList));
        }
Exemplo n.º 16
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.º 17
0
        /// <summary>
        /// 统一处理入口(主要验证)
        /// </summary>
        /// <param name="context"></param>
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                //允许跨站请求域名
                context.Response.AddHeader("Access-Control-Allow-Origin", AppConfig.MoblieInterfaceDomain);
                //接口返回数据格式
                context.Response.ContentType = "application/json";
                //接口请求类型
                string action = GameRequest.GetQueryString("action").ToLower();

                //获取参数
                _userid = GameRequest.GetQueryInt("userid", 0);
                _device = GameRequest.GetString("device");
                _ajv    = new AjaxJsonValid();
#if !DEBUG //DEBUG情况下不验证
                string time = GameRequest.GetQueryString("time");
                string sign = GameRequest.GetQueryString("sign");

                //签名验证
                _ajv =
                    Fetch.VerifySignData((context.Request.QueryString["userid"] == null ? "" : _userid.ToString()) + AppConfig.MoblieInterfaceKey + time,
                                         sign);
//            Log4Net.WriteInfoLog("signStr:"+(context.Request.QueryString["userid"] == null ? "" : _userid.ToString()) + AppConfig.MoblieInterfaceKey + time + " sign:"+sign);
                if (_ajv.code == (int)ApiCode.VertySignErrorCode)
                {
                    context.Response.Write(_ajv.SerializeToJson());
                    return;
                }
#endif
                //参数验证
                if (context.Request.QueryString["userid"] != null && _userid <= 0)
                {
                    _ajv.code = (int)ApiCode.VertyParamErrorCode;
                    _ajv.msg  = string.Format(EnumHelper.GetDesc(ApiCode.VertyParamErrorCode), " userid 错误");
                    context.Response.Write(_ajv.SerializeToJson());
                    return;
                }
                //获取其他参数
                int configid = GameRequest.GetQueryInt("configid", 0);
                int typeid   = GameRequest.GetQueryInt("typeid", 0);

                switch (action)
                {
                case "webversion":
                    _ajv.SetDataItem("apiVersion", 20171220);
                    _ajv.SetDataItem("webVersion", "V1.1.8");
                    _ajv.SetDataItem("updateAt", "2018/02/03");
                    _ajv.SetValidDataValue(true);
                    break;

                //获取手机端登录数据
                case "getmobilelogindata":
                    _ajv.SetDataItem("apiVersion", 20171017);
                    GetMobileLoginData();
                    break;

                //获取手机端登录后数据
                case "getmobileloginlater":
                    _ajv.SetDataItem("apiVersion", 20171213);
                    GetMobileLoginLater();
                    break;

                //获取充值产品列表
                case "getpayproduct":
                    _ajv.SetDataItem("apiVersion", 20171028);
                    //获取参数
                    int typeId = GameRequest.GetQueryInt("typeid", 0);
                    GetPayProduct(typeId);
                    break;

                //领取推广有效好友奖励
                case "receivespreadaward":
                    //参数验证
                    if (configid <= 0)
                    {
                        _ajv.code = (int)ApiCode.VertyParamErrorCode;
                        _ajv.msg  = string.Format(EnumHelper.GetDesc(ApiCode.VertyParamErrorCode), " configid 错误");
                        context.Response.Write(_ajv.SerializeToJson());
                        return;
                    }
                    ReceiveSpreadAward(configid);
                    break;

                case "getgameintrolist":
                    _ajv.SetDataItem("apiVersion", 20171107);
                    GetGameIntroList();
                    break;

                //钻石充值下单
                case "createpayorder":
                    _ajv.SetDataItem("apiVersion", 20171123);
                    //获取参数
                    string paytype = GameRequest.GetQueryString("paytype");
                    string openid  = GameRequest.GetQueryString("openid");
                    string subtype = GameRequest.GetQueryString("subtype");

                    //参数验证
                    if (configid <= 0 || paytype.Equals(""))
                    {
                        _ajv.code = (int)ApiCode.VertyParamErrorCode;
                        _ajv.msg  = string.Format(EnumHelper.GetDesc(ApiCode.VertyParamErrorCode), "");
                        context.Response.Write(_ajv.SerializeToJson());
                        return;
                    }
                    context.Response.Write(CreatePayOrder(configid, paytype, openid, subtype).SerializeToJson());
                    return;

                //获取排行榜数据
                case "getrankingdata":
                    _ajv.SetDataItem("apiVersion", 20171129);
                    //参数验证
                    if (typeid <= 0 || typeid > 7)
                    {
                        _ajv.code = (int)ApiCode.VertyParamErrorCode;
                        _ajv.msg  = string.Format(EnumHelper.GetDesc(ApiCode.VertyParamErrorCode), " typeid 错误");
                        context.Response.Write(_ajv.SerializeToJson());
                        return;
                    }

                    GetRankingData(typeid);
                    break;

                //获取财富信息
                case "getuserwealth":
                    GetUserWealth();
                    break;

                //获取玩家信息
                case "getuserinfo":
                    _ajv.SetDataItem("apiVersion", 20171208);
                    GetUserInfo();
                    break;

                //领取排行奖励
                case "receiverankingaward":
                    _ajv.SetDataItem("apiVersion", 20171213);
                    //获取参数
                    int dateid = GameRequest.GetQueryInt("dateid", 0);

                    //参数验证
                    if (dateid <= 0 || typeid <= 0)
                    {
                        _ajv.code = (int)ApiCode.VertyParamErrorCode;
                        _ajv.msg  = string.Format(EnumHelper.GetDesc(ApiCode.VertyParamErrorCode), "");
                        context.Response.Write(_ajv.SerializeToJson());
                        return;
                    }
                    ReceiveRankingAward(dateid, typeid);
                    break;

                //获取游戏列表
                case "getgamelist":
                    GetGameList();
                    break;

                //领取注册赠送奖励
                case "receiveregistergrant":
                    _ajv.SetDataItem("apiVersion", 20171213);
                    ReceiveRegisterGrant();
                    break;

                //金币流水记录
                case "recordtreasuretrade":
                    RecordTreasureTrade();
                    break;

                //钻石流水记录
                case "recorddiamondstrade":
                    RecordDiamondsTrade();
                    break;

                //钻石兑换金币
                case "diamondexchgold":
                    _ajv.SetDataItem("apiVersion", 20171213);     //for 响应规范
                    if (configid <= 0 || typeid < 0)
                    {
                        _ajv.code = (int)ApiCode.VertyParamErrorCode;
                        _ajv.msg  = string.Format(EnumHelper.GetDesc(ApiCode.VertyParamErrorCode),
                                                  " configid或typeid 错误");
                        context.Response.Write(_ajv.SerializeToJson());
                        return;
                    }
                    DiamondExchGold(configid, typeid);
                    break;

                case "getpayorderstatus":
                    _ajv.SetDataItem("apiVersion", 20171127);
                    string orderid = GameRequest.GetString("orderid");
                    if (string.IsNullOrEmpty(orderid))
                    {
                        _ajv.code = (int)ApiCode.VertyParamErrorCode;
                        _ajv.msg  = string.Format(EnumHelper.GetDesc(ApiCode.VertyParamErrorCode), " orderid 错误");
                        context.Response.Write(_ajv.SerializeToJson());
                        return;
                    }
                    GetPayOrderStatus(orderid);
                    break;

                case "getquestionandanswerlist":
                    _ajv.SetDataItem("apiVersion", 20180125);
                    GetQuestionAndAnswerList();
                    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("下面一条为手机接口故障信息", "MobileInterface");
                Log4Net.WriteErrorLog(ex);
                _ajv = new AjaxJsonValid
                {
                    code = 500,
                    msg  = "手机接口短暂故障,请联系管理员!"
                };
                context.Response.Write(_ajv.SerializeToJson());
            }
            context.Response.End();
        }
Exemplo n.º 18
0
        /// <summary>
        /// 钻石充值下单
        /// </summary>
        /// <param name="configid"></param>
        /// <param name="paytype"></param>
        /// <param name="openid"></param>
        /// <param name="subtype"></param>
        /// <returns>AjaxJsonValid</returns>
        private static AjaxJsonValid CreatePayOrder(int configid, string paytype, string openid, string subtype)
        {
            //下单信息
            OnLinePayOrder order = new OnLinePayOrder
            {
                UserID       = _userid,
                ConfigID     = configid,
                OrderAddress = GameRequest.GetUserIP()
            };

            switch (paytype)
            {
            case "wx":
                order.ShareID = 101;
                order.OrderID = Fetch.GetOrderIDByPrefix("WXAPP");
                break;

            case "zfb":
                order.ShareID = 201;
                order.OrderID = Fetch.GetOrderIDByPrefix("ZFBAPP");
                break;

            case "hwx":
                order.ShareID = 102;
                order.OrderID = Fetch.GetOrderIDByPrefix("HWX");
                break;

            case "lq":
                order.ShareID = 301;
                order.OrderID = Fetch.GetOrderIDByPrefix("360LQ");
                break;

            case "jft":
                switch (subtype)
                {
                case "wx":
                    order.ShareID = 302;
                    order.OrderID = Fetch.GetOrderIDByPrefix("JFTH5WX");
                    break;

                case "zfb":
                    order.ShareID = 303;
                    order.OrderID = Fetch.GetOrderIDByPrefix("JFTH5ZFB");
                    break;

                default:
                    order.ShareID = 300;
                    order.OrderID = Fetch.GetOrderIDByPrefix("JFT");
                    break;
                }
                break;

            default:
                _ajv.code = (int)ApiCode.VertyParamErrorCode;
                _ajv.msg  = string.Format(EnumHelper.GetDesc(ApiCode.VertyParamErrorCode), " paytype(充值类型) 错误");
                return(_ajv);
            }

            //下单操作
            Message umsg = FacadeManage.aideTreasureFacade.CreatePayOrderInfo(order, _device);

            if (umsg.Success)
            {
                OnLinePayOrder orderReturn = umsg.EntityList[0] as OnLinePayOrder;
                if (paytype == "wx" || paytype == "hwx")
                {
                    _ajv.SetDataItem("PayPackage",
                                     GetWxPayPackage(orderReturn, paytype, openid, GameRequest.GetCurrentFullHost()));
                }
                else if (paytype == "lq")
                {
                    LQPay.LQPayRequest request =
                        new LQPay.LQPayRequest(orderReturn, subtype == "zfb" ? "alipay" : "weixin");
                    _ajv.SetDataItem("PayUrl", HttpUtility.UrlDecode(LQPay.GetPayPackage(request.ToUrl("PayUrl"))));
                }
                else if (paytype == "jft")
                {
                    JFTPay.JFTH5Request request =
                        new JFTPay.JFTH5Request(orderReturn?.OrderID, orderReturn?.Amount.ToString("F2"),
                                                subtype == "zfb" ? "ZFB" : "WX", orderReturn?.GameID.ToString(),
                                                Utility.UserIP.Replace(".", "_"))
                    {
                        p25_terminal = string.IsNullOrEmpty(GameRequest.GetString("terminaltype"))  ? "3"  : GameRequest.GetString("terminaltype")
                    };
                    //需要手机传 IOS:2  Android:3
                    if (AppConfig.Mode == AppConfig.CodeMode.Dev) //测试开发用,正式时请注释掉此段代码
                    {
                        JFTPay.JFTH5Notify notify = new JFTPay.JFTH5Notify(orderReturn);
                        _ajv.SetDataItem("ReturnUrlForTest", notify.TestNotifyUrl());
                    }
                    _ajv.SetDataItem("PayUrl", JFTPay.Config.JFTH5Url);
                    _ajv.SetDataItem("Params", request.UrlParams());
                }
                _ajv.SetDataItem("OrderID", orderReturn?.OrderID ?? "");
            }
            _ajv.SetValidDataValue(umsg.Success);
            _ajv.code = umsg.MessageID;
            _ajv.msg  = umsg.Content;
            return(_ajv);
        }
Exemplo n.º 19
0
        /// <summary>
        /// 统一处理入口(主要验证)
        /// </summary>
        /// <param name="context"></param>
        public void ProcessRequest(HttpContext context)
        {
            //允许跨站请求域名
            context.Response.AddHeader("Access-Control-Allow-Origin", AppConfig.MoblieInterfaceDomain);
            //接口返回数据格式
            context.Response.ContentType = "application/json";
            //接口请求类型
            string action = GameRequest.GetQueryString("action").ToLower();

            //获取参数
            _userid = GameRequest.GetQueryInt("userid", 0);
            _ajv    = new AjaxJsonValid();
#if !DEBUG //DEBUG情况下不验证
            string time = GameRequest.GetQueryString("time");
            string sign = GameRequest.GetQueryString("sign");

            //签名验证
            _ajv =
                Fetch.VerifySignData((context.Request.QueryString["userid"] == null ? "" : _userid.ToString()) + AppConfig.MoblieInterfaceKey + time,
                                     sign);
//            Log4Net.WriteInfoLog("signStr:"+(context.Request.QueryString["userid"] == null ? "" : _userid.ToString()) + AppConfig.MoblieInterfaceKey + time + " sign:"+sign);
            if (_ajv.code == (int)ApiCode.VertySignErrorCode)
            {
                context.Response.Write(_ajv.SerializeToJson());
                return;
            }
#endif
            //参数验证
            if (context.Request.QueryString["userid"] != null && _userid <= 0)
            {
                _ajv.code = (int)ApiCode.VertyParamErrorCode;
                _ajv.msg  = string.Format(EnumHelper.GetDesc(ApiCode.VertyParamErrorCode), " userid 错误");
                context.Response.Write(_ajv.SerializeToJson());
                return;
            }
            //获取其他参数
            int configid = GameRequest.GetQueryInt("configid", 0);
            int typeid   = GameRequest.GetQueryInt("typeid", 0);

            switch (action)
            {
            //获取手机端登录数据
            case "getmobilelogindata":
                _ajv.SetDataItem("apiVersion", 20171017);
                GetMobileLoginData();
                break;

            //获取手机端登录后数据
            case "getmobileloginlater":
                GetMobileLoginLater();
                break;

            //获取充值产品列表
            case "getpayproduct":
                _ajv.SetDataItem("apiVersion", 20171028);
                //获取参数
                int typeId = GameRequest.GetQueryInt("typeid", 0);
                GetPayProduct(typeId);
                break;

            //领取推广有效好友奖励
            case "receivespreadaward":
                //参数验证
                if (configid <= 0)
                {
                    _ajv.code = (int)ApiCode.VertyParamErrorCode;
                    _ajv.msg  = string.Format(EnumHelper.GetDesc(ApiCode.VertyParamErrorCode), " configid 错误");
                    context.Response.Write(_ajv.SerializeToJson());
                    return;
                }
                ReceiveSpreadAward(configid);
                break;

            case "getgameintrolist":
                _ajv.SetDataItem("apiVersion", 20171107);
                GetGameIntroList();
                break;

            //钻石充值下单
            case "createpayorder":
                _ajv.SetDataItem("apiVersion", 20171123);
                //获取参数
                string paytype = GameRequest.GetQueryString("paytype");
                string openid  = GameRequest.GetQueryString("openid");
                string subtype = GameRequest.GetQueryString("subtype");

                //参数验证
                if (configid <= 0 || paytype.Equals(""))
                {
                    _ajv.code = (int)ApiCode.VertyParamErrorCode;
                    _ajv.msg  = string.Format(EnumHelper.GetDesc(ApiCode.VertyParamErrorCode), "");
                    context.Response.Write(_ajv.SerializeToJson());
                    return;
                }
                context.Response.Write(CreatePayOrder(configid, paytype, openid, subtype).SerializeToJson());
                return;

            //获取排行榜数据
            case "getrankingdata":
                //参数验证
                if (typeid <= 0 || typeid > 7)
                {
                    _ajv.code = (int)ApiCode.VertyParamErrorCode;
                    _ajv.msg  = string.Format(EnumHelper.GetDesc(ApiCode.VertyParamErrorCode), " typeid 错误");
                    context.Response.Write(_ajv.SerializeToJson());
                    return;
                }

                GetRankingData(typeid);
                break;

            //获取财富信息
            case "getuserwealth":
                GetUserWealth();
                break;

            //领取排行奖励
            case "receiverankingaward":
                //获取参数
                int dateid = GameRequest.GetQueryInt("dateid", 0);

                //参数验证
                if (dateid <= 0 || typeid <= 0)
                {
                    _ajv.code = (int)ApiCode.VertyParamErrorCode;
                    _ajv.msg  = string.Format(EnumHelper.GetDesc(ApiCode.VertyParamErrorCode), "");
                    context.Response.Write(_ajv.SerializeToJson());
                    return;
                }
                ReceiveRankingAward(dateid, typeid);
                break;

            //获取游戏列表
            case "getgamelist":
                GetGameList();
                break;

            //领取注册赠送奖励
            case "receiveregistergrant":
                ReceiveRegisterGrant();
                break;

            //金币流水记录
            case "recordtreasuretrade":
                RecordTreasureTrade();
                break;

            //钻石流水记录
            case "recorddiamondstrade":
                RecordDiamondsTrade();
                break;

            //钻石兑换金币
            case "diamondexchgold":
                if (configid <= 0 || typeid < 0)
                {
                    _ajv.code = (int)ApiCode.VertyParamErrorCode;
                    _ajv.msg  = string.Format(EnumHelper.GetDesc(ApiCode.VertyParamErrorCode),
                                              " configid或typeid 错误");
                    context.Response.Write(_ajv.SerializeToJson());
                    return;
                }
                DiamondExchGold(configid, typeid);
                break;

            //                case "getlqnopwdloginurl":
            //                    _ajv.SetDataItem("apiVersion", 20171116);
            //                    string name = GameRequest.GetString("name");
            //                    if (string.IsNullOrEmpty(name))
            //                    {
            //                        _ajv.code = (int) ApiCode.VertyParamErrorCode;
            //                        _ajv.msg = string.Format(EnumHelper.GetDesc(ApiCode.VertyParamErrorCode),
            //                            " name 错误");
            //                        context.Response.Write(_ajv.SerializeToJson());
            //                        return;
            //                    }
            //                    GetLqNoPwdLoginUrl(name);
            //                    break;
            case "getpayorderstatus":
                _ajv.SetDataItem("apiVersion", 20171127);
                string orderid = GameRequest.GetString("orderid");
                if (string.IsNullOrEmpty(orderid))
                {
                    _ajv.code = (int)ApiCode.VertyParamErrorCode;
                    _ajv.msg  = string.Format(EnumHelper.GetDesc(ApiCode.VertyParamErrorCode), " orderid 错误");
                    context.Response.Write(_ajv.SerializeToJson());
                    return;
                }
                GetPayOrderStatus(orderid);
                break;

            default:
                _ajv.code = (int)ApiCode.VertyParamErrorCode;
                _ajv.msg  = string.Format(EnumHelper.GetDesc(ApiCode.VertyParamErrorCode), " action 错误");
                break;
            }

            context.Response.Write(_ajv.SerializeToJson());
        }
Exemplo n.º 20
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.º 21
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.º 22
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.º 23
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string @string = GameRequest.GetString("account");
            var    @int    = GameRequest.GetFloat("amount", 0);
            int    num     = GameRequest.GetInt("qudaoId", 0);

            if (@int <= 0 || num <= 0 || @string == "")
            {
                base.Response.Write("参数错误");
                base.Response.End();
            }
            string text = ApplicationSettings.Get("pay_url");

            if (text == "")
            {
                text = "http://" + base.Request.Url.Host;
            }
            System.Data.DataTable payInfo = FacadeManage.aideTreasureFacade.GetPayInfo(num);
            System.Collections.Generic.Dictionary <string, string> dictionary = new System.Collections.Generic.Dictionary <string, string>();
            dictionary["account"] = @string;
            dictionary["amount"]  = @int.ToString();
            if (payInfo.Rows.Count > 0)
            {
                dictionary["type"]    = payInfo.Rows[0]["QudaoCode"].ToString();
                dictionary["qudaoId"] = payInfo.Rows[0]["qudaoId"].ToString();
                base.Response.Write(PayHelper.BuildForm(dictionary, string.Concat(new object[]
                {
                    text,
                    "/pay/",
                    payInfo.Rows[0]["PlatformCode"],
                    "/send.aspx"
                })));
                base.Response.End();
            }
            else
            {
                if (num == 9)
                {
                    num     = 13;
                    payInfo = FacadeManage.aideTreasureFacade.GetPayInfo(num);
                    if (payInfo.Rows.Count > 0)
                    {
                        dictionary["type"] = payInfo.Rows[0]["QudaoCode"].ToString();
                        base.Response.Write(PayHelper.BuildForm(dictionary, string.Concat(new object[]
                        {
                            text,
                            "/pay/",
                            payInfo.Rows[0]["PlatformCode"],
                            "/send.aspx"
                        })));
                        base.Response.End();
                    }
                    else
                    {
                        base.Response.Write("该通道维护中1");
                        base.Response.End();
                    }
                }
                base.Response.Write("该通道维护中2");
                base.Response.End();
            }
        }
Exemplo n.º 24
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
            }));
        }