Exemplo n.º 1
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string strAccounts = context.Request.Form["txtAccounts"] ?? string.Empty;
            string serialID    = context.Request.Form["txtSerialID"] ?? string.Empty;
            string password    = context.Request.Form["txtPassword"] ?? string.Empty;

            if (string.IsNullOrEmpty(strAccounts) || string.IsNullOrEmpty(serialID) || string.IsNullOrEmpty(password))
            {
                context.Response.Write("-1");
            }
            ShareDetialInfo detailInfo = new ShareDetialInfo();

            detailInfo.SerialID   = serialID;
            detailInfo.OperUserID = 0;
            detailInfo.Accounts   = strAccounts;
            detailInfo.ShareID    = 1;          //实卡充值服务标识
            detailInfo.IPAddress  = Utility.UserIP;
            #region 充值
            Message umsg = treasureFacade.FilledLivcard(detailInfo, TextEncrypt.EncryptPassword(password));
            if (umsg.Success)
            {
                context.Response.Write("0");
            }
            else
            {
                context.Response.Write(umsg.Content);
            }
        }
        /// <summary>
        /// 充值按钮事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnPay_Click(object sender, EventArgs e)
        {
            string strAccounts   = CtrlHelper.GetText(txtAccounts);
            string strReAccounts = CtrlHelper.GetText(txtAccounts2);
            string serialID      = CtrlHelper.GetText(txtSerialID);
            string password      = CtrlHelper.GetText(txtPassword);

            if (strAccounts == "")
            {
                RenderAlertInfo(true, "抱歉,请输入游戏账号。", 2);
                return;
            }
            if (strReAccounts != strAccounts)
            {
                RenderAlertInfo(true, "抱歉,两次输入的帐号不一致。", 2);
                return;
            }
            if (serialID == "")
            {
                RenderAlertInfo(true, "抱歉,请输入充值卡号。", 2);
                return;
            }
            if (password == "")
            {
                RenderAlertInfo(true, "抱歉,请输入卡号密码。", 2);
                return;
            }

            //充值信息
            ShareDetialInfo detailInfo = new ShareDetialInfo();

            detailInfo.SerialID = CtrlHelper.GetText(txtSerialID);
            if (userTicket == null)
            {
                detailInfo.OperUserID = 0;
            }
            else
            {
                detailInfo.OperUserID = userTicket.UserID;
            }
            detailInfo.Accounts  = strAccounts;
            detailInfo.ShareID   = 1;           //实卡充值服务标识
            detailInfo.IPAddress = Utility.UserIP;

            #region 充值

            Message umsg = treasureFacade.FilledLivcard(detailInfo, TextEncrypt.EncryptPassword(txtPassword.Text.Trim()));
            if (umsg.Success)
            {
                RenderAlertInfo(false, "实卡充值成功。", 2);
            }
            else
            {
                RenderAlertInfo(true, umsg.Content, 2);
            }

            #endregion
        }
Exemplo n.º 3
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string strAccounts   = context.Request.Params["txtAccounts"];
            string strReAccounts = context.Request.Params["txtAccounts2"];
            string serialID      = context.Request.Params["txtSerialID"];
            string password      = TextEncrypt.EncryptPassword(context.Request.Params["txtPassword"]);

            if (strAccounts == "")
            {
                context.Response.Write("1");
                // RenderAlertInfo(true, "抱歉,请输入游戏账号。", 2);
                return;
            }
            if (strReAccounts != strAccounts)
            {
                context.Response.Write("2");
                //RenderAlertInfo(true, "抱歉,两次输入的帐号不一致。", 2);
                return;
            }
            if (serialID == "")
            {
                context.Response.Write("3");
                // RenderAlertInfo(true, "抱歉,请输入充值卡号。", 2);
                return;
            }
            if (password == "")
            {
                context.Response.Write("4");
                // RenderAlertInfo(true, "抱歉,请输入卡号密码。", 2);
                return;
            }

            //充值信息
            ShareDetialInfo detailInfo = new ShareDetialInfo();

            detailInfo.SerialID   = serialID;
            detailInfo.OperUserID = 0;
            detailInfo.Accounts   = strAccounts;
            detailInfo.ShareID    = 1;          //实卡充值服务标识
            detailInfo.IPAddress  = Utility.UserIP;

            #region 充值

            Message umsg = treasureFacade.FilledLivcard(detailInfo, password);
            if (umsg.Success)
            {
                context.Response.Write("0");
                //RenderAlertInfo(false, "实卡充值成功。", 2);
            }
            else
            {
                context.Response.Write(umsg.Content);
                // RenderAlertInfo(true, umsg.Content, 2);
            }
        }