Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (member.IsInRoomOrGame(UiCommon.UserLoginInfo.UserName))
            {
                //lblMsg.Text = "抱歉,您的帐号已进入房间中或正在游戏中,不能进行存取款操作!";
                BCST.Common.CommonManager.Web.RegJs(this, "alert('抱歉,您的帐号已进入房间中或正在游戏中,不能进行存取款操作!');history.back();", true);
                return;
            }

            if (!IsPostBack)
            {
                BindUserMoney();
                //绑定游戏列表
                DataTable ds = DbSession.Default.FromSql("SELECT * FROM dbo.TGameNameInfo").ToDataTable();
                if (ds.Rows.Count > 0)
                {
                    ddlGame.DataSource = ds;

                    ddlGame.DataTextField  = "ComName";
                    ddlGame.DataValueField = "NameID";
                    ddlGame.DataBind();
                }
                BindGameMoney();
            }
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (member.IsInRoomOrGame(UiCommon.UserLoginInfo.UserName))
            {
                //lblMsg.Text = "抱歉,您的帐号已进入房间中或正在游戏中,不能进行存取款操作!";
                BCST.Common.CommonManager.Web.RegJs(this, "alert('抱歉,您的帐号已进入房间中或正在游戏中,不能进行存取款操作!');location.href='/Manage/';", false);
                return;
            }

            //1.读取表web_config中的转账参数信息
            DataRow dr = BLL.Config.GetInfoOfTrans();

            if (dr != null)
            {
                if (dr["TransferLessAllMoney"] != null)
                {
                    TransferLessAllMoney = Convert.ToInt64(dr["TransferLessAllMoney"]);
                }

                if (dr["TransferLessMoney"] != null)
                {
                    TransferLessMoney = Convert.ToInt32(dr["TransferLessMoney"]);
                }

                if (dr["TransferMultiple"] != null)
                {
                    TransferMultiple = Convert.ToInt32(dr["TransferMultiple"]);
                }

                if (dr["TransferTax"] != null)
                {
                    TransferTax = Convert.ToInt32(dr["TransferTax"]);
                }

                if (dr["MaxTransTax"] != null)
                {
                    MaxTransTax = Convert.ToInt32(dr["MaxTransTax"]);
                }

                if (dr["VipTransferTax"] != null)
                {
                    VipTransferTax = Convert.ToInt32(dr["VipTransferTax"]);
                }
            }
        }
Beispiel #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string errorUrl = "/Manage/Pay/JFTpay/Default.aspx"; //出错跳转地址
            string BackUrl  = UiCommon.StringConfig.WebSiteName + "/Manage/Pay/JFTpay/Receive.aspx";


            string PayType     = Request.Form["pay_type"];                           //支付类型(1是网银,2为点卡)
            string txtUserName = Utility.Common.GetStringOfForm("txtUserName");      //用户名
            string payMoney    = Utility.Common.GetIntOfForm("PayMoney").ToString(); //支付金额
            string txtCardNo   = Utility.Common.GetStringOfForm("txtCardNo");        //卡号
            string txtCardPass = Utility.Common.GetStringOfForm("txtCardPass");      //卡密
            string OrderNo;

            //string strCouponNum = Utility.Common.GetStringOfForm("CouponNum");

            //1,支付类型
            if (PayType == "1")
            {
                OrderNo = DateTime.Now.ToString("yyyyMMddHHmmssffffff");
            }
            else
            {
                OrderNo = "ka" + DateTime.Now.ToString("yyyyMMddHHmmssffff");
            }

            //2, 验证用户名
            BLL.Member mem = new BLL.Member();
            if (!mem.ExistName(txtUserName))
            {
                Response.Write("<script>alert('找不到您要充值的用户帐号,请检查输入是否有误');location.href='" + errorUrl + "';</script>");
                Response.End();
            }

            if (mem.IsInRoomOrGame(txtUserName))
            {
                Response.Write("<script>alert('要充值的帐号正在游戏中,请先退出游戏再进行充值。');location.href='" + errorUrl + "';</script>");
                Response.End();
            }



            //4, 插入支付的订单日志
            mem.Add3PayOrder(txtUserName.Trim(), Convert.ToInt32(payMoney), 9, "聚付通充值", OrderNo);

            payMoney = payMoney + ".00";



            //5, 跳转到支付平台
            jftpay(OrderNo, BackUrl, payMoney, txtUserName, "");
        }
Beispiel #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (member.IsInRoomOrGame(UiCommon.UserLoginInfo.UserName))
            {
                //lblMsg.Text = "抱歉,您的帐号已进入房间中或正在游戏中,不能进行存取款操作!";
                BCST.Common.CommonManager.Web.RegJs(this, "alert('抱歉,您的帐号已进入房间中或正在游戏中,不能进行存取款操作!');history.back();", true);
                return;
            }

            if (!IsPostBack)
            {
                BindUserMoney();
            }
        }
Beispiel #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string errorUrl = "/Manage/Pay/JFTpay/Default.aspx"; //出错跳转地址
            string BackUrl = UiCommon.StringConfig.WebSiteName + "/Manage/Pay/JFTpay/Receive.aspx";

            string PayType = Request.Form["pay_type"]; //支付类型(1是网银,2为点卡)
            string txtUserName = Utility.Common.GetStringOfForm("txtUserName"); //用户名
            string payMoney = Utility.Common.GetIntOfForm("PayMoney").ToString(); //支付金额
            string txtCardNo = Utility.Common.GetStringOfForm("txtCardNo"); //卡号
            string txtCardPass = Utility.Common.GetStringOfForm("txtCardPass"); //卡密
            string OrderNo;

            //string strCouponNum = Utility.Common.GetStringOfForm("CouponNum");

            //1,支付类型
            if (PayType == "1")
            {
                OrderNo = DateTime.Now.ToString("yyyyMMddHHmmssffffff");

            }
            else
            {
                OrderNo = "ka" + DateTime.Now.ToString("yyyyMMddHHmmssffff");

            }

            //2, 验证用户名
            BLL.Member mem = new BLL.Member();
            if (!mem.ExistName(txtUserName))
            {
                Response.Write("<script>alert('找不到您要充值的用户帐号,请检查输入是否有误');location.href='" + errorUrl + "';</script>");
                Response.End();
            }

            if (mem.IsInRoomOrGame(txtUserName))
            {
                Response.Write("<script>alert('要充值的帐号正在游戏中,请先退出游戏再进行充值。');location.href='" + errorUrl + "';</script>");
                Response.End();
            }

            //4, 插入支付的订单日志
            mem.Add3PayOrder(txtUserName.Trim(), Convert.ToInt32(payMoney), 9, "聚付通充值", OrderNo);

            payMoney = payMoney + ".00";

            //5, 跳转到支付平台
            jftpay(OrderNo, BackUrl, payMoney,txtUserName,"");
        }
Beispiel #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string errorUrl,strMd5Key, txtUserName;
            int intPayType, intBankID, intCardID;

            errorUrl = "/Manage/Pay/Baofoo/Default.aspx"; //出错跳转地址
            strMerchant_url = UiCommon.StringConfig.WebSiteName + "/Manage/Pay/Baofoo/return_url.aspx"; //客户端跳转地址
            strReturn_url = UiCommon.StringConfig.WebSiteName + "/Manage/Pay/Baofoo/merchant_url.aspx";//服务器端返回地址
            strMerchantID = ConfigurationManager.AppSettings["baofoo_memberid"]; //商户号
            strMd5Key = ConfigurationManager.AppSettings["baofoo_key"]; //密钥 双方约定
            txtUserName = Utility.Common.GetStringOfForm("txtUserName"); //用户名
            payMoney = Utility.Common.GetIntOfForm("PayMoney").ToString(); //支付金额

            strCouponNum = Utility.Common.GetStringOfForm("CouponNum");

            strTradeDate = DateTime.Now.ToString("yyyyMMddHHmmss"); //交易日期

            //strPayID = Request.Params["SPayID"];//神州行卡充值是1

            intPayType = Utility.Common.GetIntOfForm("pay_type"); //支付方式
            intBankID = Utility.Common.GetIntOfForm("bankid");  //银行对应的ID
            intCardID = Utility.Common.GetIntOfForm("cardid");  //点卡对应的ID

            if (intPayType == 1) //银行支付
            {
                strPayID = intBankID.ToString();
                strTransID = DateTime.Now.ToString("yyyyMMddHHmmssffff"); //商户订单号(交易流水号)8-20位:必须唯一,推荐:前6位为商户号,后10位为用户流水号,string类型
            }
            else //点卡支付
            {
                strPayID = intCardID.ToString();
                strTransID = "ka" + DateTime.Now.ToString("yyMMddHHmmssffff");
            }

            BLL.Member mem = new BLL.Member();
            //判断用户帐号是否正常
            if (!mem.ExistName(txtUserName.Trim()))
            {
                Response.Write("<script>alert('找不到您要充值的用户帐号,请检查输入是否有误');location.href='" + errorUrl + "';</script>");
                Response.End();
            }

            if (mem.IsInRoomOrGame(txtUserName.Trim()))
            {
                Response.Write("<script>alert('要充值的帐号正在游戏中,请先退出游戏再进行充值。');location.href='" + errorUrl + "';</script>");
                Response.End();
            }

            strProductName = "";//商品名称
            strAmount = "1";//商品数量,为1
            strProductLogo = "";//商品图片地址
            strUsername = "";
            strEmail = "";
            strMobile = "";

            // [modify] jeffery
            strAdditionalInfo = "";
            //strAdditionalInfo = txtUserName + "!@#" + strCouponNum;
            // ---end

            strNoticeType = "1";//0 不跳转 1 会跳转

            //商户保存订单信息.....
            //SaveOrderInfo();
            //支付成功前, 插入支付的订单日志

            mem.Add3PayOrder(txtUserName.Trim(),
                Convert.ToInt32(payMoney),
                8, "宝付充值", strTransID);

            payMoney = (Convert.ToInt32(payMoney) * 100).ToString();

            strMd5Sign = GetMd5Sign(strMerchantID, strPayID, strTradeDate,
                strTransID, payMoney, strMerchant_url, strReturn_url, strNoticeType, strMd5Key);
        }
Beispiel #7
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (!CommonManager.Web.CheckPostSource())
                return;
            if (!IsValid)
                return;

            //0���������
            #region �������
            //��ȡ�����ļ�
            XmlOperator xo = new XmlOperator(_filePath);
            if (!xo.HasDocument)
            {
                CommonManager.Web.RegJs(this, "alert('��������δ��ͨ�����Ժ��ٳ��Խ����ҳ��');history.back();", false);
                return;
            }
            if (string.IsNullOrEmpty(txtPassword.Text.Trim()))
            {
                CommonManager.Web.RegJs(this, "alert('���������ĵ�ǰ���룡');", false);
                return;
            }
            TUsers user = DbSession.Default.Get<TUsers>(TUsers._.UserID == UserLoginInfo.UserID);
            if (user.Pass != CommonManager.String.EncryptMD5SystemDefaultMethod(txtPassword.Text.Trim(), false, true))
            {
                CommonManager.Web.RegJs(this, "alert('����������벻��ȷ�����������롣');", false);
                return;
            }
            if (string.IsNullOrEmpty(txtAgent.Text.Trim()) || string.IsNullOrEmpty(txtAgent2.Text.Trim()) || txtAgent.Text.Trim() != txtAgent2.Text.Trim())
            {
                CommonManager.Web.RegJs(this, "alert('����ȷ����������ʺ�');", false);
                return;
            }
            else if (!DbSession.Default.Exists<Web_Agent>(Web_Agent._.LoginName == txtAgent.Text.Trim()))
            {
                CommonManager.Web.RegJs(this, "alert('�������ʺŲ����ڣ������º˶ԣ�');", false);
                return;
            }
            if (string.IsNullOrEmpty(txtMoney.Text.Trim()) || !CommonManager.String.IsInteger(txtMoney.Text.Trim()))
            {
                CommonManager.Web.RegJs(this, "alert('����ȷ����Ҫת�ʵĽ�ң�');", false);
                return;
            }
            #endregion
            //1������û�����Ľ��
            #region ����û�����Ľ��
            int money = int.Parse(txtMoney.Text.Trim());
            BLL.Member m = new BLL.Member();
            Int64 bmoney = m.GetBankMoney(user.UserID.ToString());
            if (money > bmoney)
            {
                CommonManager.Web.RegJs(this, "alert('�������н�����ֻ��" + bmoney.ToString() == "0" ? "0" : bmoney.ToString() + UiCommon.StringConfig.AddZero() + "�����������롣');", false);
                return;
            }
            int minmoney = int.Parse(xo.GetNodeValue("MinMoney"));
            if (money <= minmoney)
            {
                CommonManager.Web.RegJs(this, "alert('ÿ�ζһ���������������" + minmoney.ToString() + "00��');", false);
                return;
            }
            #endregion
            //2��ȡ�ô�������Ϸ�ʻ�
            #region ȡ�ô�������Ϸ�ʻ�
            Web_VAgentUserInfo agent = DbSession.Default.Get<Web_VAgentUserInfo>(Web_VAgentUserInfo._.LoginName == txtAgent.Text.Trim());
            if (agent == null)
            {
                CommonManager.Web.RegJs(this, "alert('�������ʺŲ����ڣ������º˶ԣ�');", false);
                return;
            }
            #endregion
            //3��ת��
            //3.1���������ʺ��Ƿ�����Ϸ��
            #region �������ʺ��Ƿ�����Ϸ��
            if (m.IsInRoomOrGame(UserLoginInfo.UserName))
            {
                CommonManager.Web.RegJs(this, "alert('�����ʺ�������Ϸ�У������˳���Ϸ�ٽ��в�����');", false);
                return;
            }
            #endregion
            //3.2�����������ʺ��Ƿ�����Ϸ��
            #region ���������ʺ��Ƿ�����Ϸ��
            if (m.IsInRoomOrGame(agent.UserName))
            {
                CommonManager.Web.RegJs(this, "alert('�������ʺ�������Ϸ�У����ζһ����ܽ��У����Ժ��ԡ�');", false);
                return;
            }
            #endregion
            //3.3����ʼת��
            #region ��ʼת��
            //3.3.1������ʵ�ʵ��˽�ң���ȡ�����ļ��е������ѷ�ʽ
            string type = xo.GetNodeValue("Type");
            //3.3.2������������
            int profee = type == "0" ? int.Parse(xo.GetNodeValue("StaticValue")) : (int)((float)money * (float.Parse(xo.GetNodeValue("PercentValue")) / 100));
            //3.3.3������ʵ�ʵ��˽��
            int amoney = money - profee;

            //3.3.4��ת��
            //if( m.BankTransfer( UserLoginInfo.UserName, agent.UserName, amoney, CommonManager.Web.GetIP() ) )
            //{
            //    //3.4����¼ת����־
            //    Web_AgentMoneyLog log = new Web_AgentMoneyLog();
            //    log.ActuallyMoney = amoney;
            //    log.AgentID = agent.ID;
            //    log.InputDate = DateTime.Now;
            //    log.Money = money;
            //    log.ProcedureFee = profee;
            //    log.UserID = int.Parse( UserLoginInfo.UserID );
            //    DbSession.Default.Save<Web_AgentMoneyLog>( log );
            //    //4����ʾ��Ϣ��ת����־��¼ҳ��
            //    CommonManager.Web.RegJs( this, "alert('�һ��ɹ���');location.href='ExchangeMoneyLog.aspx';", false );
            //}
            //else
            //{
            //    //4����ʾ��Ϣ
            //    CommonManager.Web.RegJs( this, "alert('�һ�ʧ�ܣ�����������ԭ�����Ժ��ԡ�');", false );
            //}
            #endregion
        }
Beispiel #8
0
        protected void button5_ServerClick(object sender, EventArgs e)
        {
            if (!BCST.Common.CommonManager.Web.CheckPostSource())
                return;
            //1.У����֤��
            if (UiCommon.ValidCode.CurrentCode == null)
            {
                lblMsg.Text = "��֤���ѹ��ڣ��������µ���֤�룡";
                txtValidCode.Text = string.Empty;
                return;
            }
            else if (txtValidCode.Text.Trim() != UiCommon.ValidCode.CurrentCode)
            {
                lblMsg.Text = "��֤����������������µ���֤�룡";
                txtValidCode.Text = string.Empty;
                return;
            }

            //2.�ж��û����Ƿ����
            BLL.Member member = new BLL.Member();
            string userName = Utility.Common.SqlEncode(txtUserName.Text.Trim());
            if (!member.ExistName(userName))
            {
                lblMsg.Text = "���������Ϸ�ʺ�(�û���)�����ڣ�";
                txtValidCode.Text = string.Empty;
                return;
            }
            //�ж���ҳ�ֵʱ����������Ϸ��
            if (member.IsInRoomOrGame(userName))
            {
                lblMsg.Text = "Ҫ��ֵ���ʺ�������Ϸ�У������˳���Ϸ�ٽ��г�ֵ��";
                txtValidCode.Text = string.Empty;
                return;

            }
            //3.�жϳ�ֵ���Ƿ��ѳ�ֵ���򿨺ż��������
            string cardNo = Utility.Common.SqlEncode(txtCardNo.Text.Trim());
            string cardPwd = Utility.Common.SqlEncode(txtCardPwd.Text.Trim());
            int cardState = new BLL.Card().PointCardState(cardNo, cardPwd);
            if (cardState == -1)
            {
                lblMsg.Text = "�Բ���������Ŀ��Ż���������";
                txtValidCode.Text = string.Empty;
                return;
            }
            else if (cardState == 1)
            {
                lblMsg.Text = "�Բ���������Ŀ����Ѿ�����ֵ��";
                txtValidCode.Text = string.Empty;
                return;
            }

            #region ��ѿ�

            // ��ѿ�������
            int freeCardForUser = 0;
            DataRow dr = member.GetFreeCardCount();
            if (dr != null)
            {
            freeCardForUser = Convert.ToInt32(dr["FreeCardCount"]);
            }

            //������ѿ������ж��û��Ƿ��Ѿ���ֵ��XX�š��磺��ѿ�ÿ���û�ֻ�ܳ�ֵ2�š�
            if (member.IsFreeCard(cardNo))
            {
            int cardCount = member.FreeCardCount(userName);
            if (cardCount >= freeCardForUser)
            {
                lblMsg.Text = "���Ѿ�ʹ��" + freeCardForUser + "����ѿ��ˣ�";
                txtValidCode.Text = string.Empty;
                return;
            }
            }
            #endregion

            //4.����ֵ���ת���ɽ�Ҵ�������
            //����ֵ�û�������Ƽ��ˣ���Web_Config�и��ݲ���ֵ�����Ƽ���
            //���µ㿨״̬
            //by YMH 2012-9-4  ��ֵ����
             //���ֳ�ֵ����
            if (ConfigurationManager.AppSettings["IsPayToPoint"] == "1" && rblPayType.SelectedValue=="point" && ddlGameList.SelectedValue!="")
            {
            //��ֵ����
            int result = member.PointCardFull2(userName, cardNo, cardPwd, Utility.Common.RequestIP,ddlGameList.SelectedValue);
            if (result == 0)
            {
                lblMsg.Text = "��ֵ��[" + cardNo + "]��ֵ�ɹ�����ֵ����Ϸ�ʺ�(�û���)��" + userName + "��" + DateTime.Now;
                txtUserName.Text = string.Empty;
                txtUserName2.Text = string.Empty;
                txtCardNo.Text = string.Empty;
                txtValidCode.Text = string.Empty;
            }
            else if (result == -1)
            {
                lblMsg.Text = "��Ǹ���㿨�����ڻ�㿨�š����벻��ȷ��";
                txtValidCode.Text = string.Empty;
            }
            else
            {
                lblMsg.Text = "��Ǹ���㿨��ֵʧ�ܣ������Ƿ�������æ�����Ժ����ԣ�";
                txtValidCode.Text = string.Empty;
            }
            }
            else//��ֵ���
            {
            if (member.PointCardFull(userName, cardNo, cardPwd, Utility.Common.RequestIP))
            {
                lblMsg.Text = "��ֵ��[" + cardNo + "]��ֵ�ɹ�����ֵ����Ϸ�ʺ�(�û���)��" + userName + "��" + DateTime.Now;
                txtUserName.Text = string.Empty;
                txtUserName2.Text = string.Empty;
                txtCardNo.Text = string.Empty;
                txtValidCode.Text = string.Empty;
            }
            else
            {
                lblMsg.Text = "��Ǹ���㿨��ֵʧ�ܣ������Ƿ�������æ�����Ժ����ԣ�";
                txtValidCode.Text = string.Empty;
            }
            }
        }
Beispiel #9
0
        protected void button5_ServerClick(object sender, EventArgs e)
        {
            if (!BCST.Common.CommonManager.Web.CheckPostSource())
            {
                return;
            }
            //1.校验验证码
            if (UiCommon.ValidCode.CurrentCode == null)
            {
                lblMsg.Text       = "验证码已过期,请输入新的验证码!";
                txtValidCode.Text = string.Empty;
                return;
            }
            else if (txtValidCode.Text.Trim() != UiCommon.ValidCode.CurrentCode)
            {
                lblMsg.Text       = "验证码输入错误,请输入新的验证码!";
                txtValidCode.Text = string.Empty;
                return;
            }

            //2.判断用户名是否存在
            BLL.Member member   = new BLL.Member();
            string     userName = Utility.Common.SqlEncode(txtUserName.Text.Trim());

            if (!member.ExistName(userName))
            {
                lblMsg.Text       = "您输入的游戏帐号(用户名)不存在!";
                txtValidCode.Text = string.Empty;
                return;
            }
            //判断玩家充值时,不能在游戏中
            if (member.IsInRoomOrGame(userName))
            {
                lblMsg.Text       = "要充值的帐号正在游戏中,请先退出游戏再进行充值!";
                txtValidCode.Text = string.Empty;
                return;
            }
            //3.判断充值卡是否已充值,或卡号及密码错误
            string cardNo    = Utility.Common.SqlEncode(txtCardNo.Text.Trim());
            string cardPwd   = Utility.Common.SqlEncode(txtCardPwd.Text.Trim());
            int    cardState = new BLL.Card().PointCardState(cardNo, cardPwd);

            if (cardState == -1)
            {
                lblMsg.Text       = "对不起,您输入的卡号或密码有误!";
                txtValidCode.Text = string.Empty;
                return;
            }
            else if (cardState == 1)
            {
                lblMsg.Text       = "对不起,您输入的卡号已经被充值!";
                txtValidCode.Text = string.Empty;
                return;
            }

            #region 免费卡

            // 免费卡的张数
            int     freeCardForUser = 0;
            DataRow dr = member.GetFreeCardCount();
            if (dr != null)
            {
                freeCardForUser = Convert.ToInt32(dr["FreeCardCount"]);
            }


            //若是免费卡,先判断用户是否已经充值了XX张。如:免费卡每个用户只能充值2张。
            if (member.IsFreeCard(cardNo))
            {
                int cardCount = member.FreeCardCount(userName);
                if (cardCount >= freeCardForUser)
                {
                    lblMsg.Text       = "您已经使用" + freeCardForUser + "张免费卡了!";
                    txtValidCode.Text = string.Empty;
                    return;
                }
            }
            #endregion

            //4.将充值金额转换成金币存入银行
            //被充值用户如果有推荐人,在Web_Config中根据参数值奖励推荐人
            //更新点卡状态
            //by YMH 2012-9-4  充值积分
            //积分充值存在
            if (ConfigurationManager.AppSettings["IsPayToPoint"] == "1" && rblPayType.SelectedValue == "point" && ddlGameList.SelectedValue != "")
            {
                //充值积分
                int result = member.PointCardFull2(userName, cardNo, cardPwd, Utility.Common.RequestIP, ddlGameList.SelectedValue);
                if (result == 0)
                {
                    lblMsg.Text       = "充值卡[" + cardNo + "]充值成功,充值的游戏帐号(用户名)是" + userName + "!" + DateTime.Now;
                    txtUserName.Text  = string.Empty;
                    txtUserName2.Text = string.Empty;
                    txtCardNo.Text    = string.Empty;
                    txtValidCode.Text = string.Empty;
                }
                else if (result == -1)
                {
                    lblMsg.Text       = "抱歉,点卡不存在或点卡号、密码不正确!";
                    txtValidCode.Text = string.Empty;
                }
                else
                {
                    lblMsg.Text       = "抱歉,点卡充值失败,可能是服务器繁忙,请稍候再试!";
                    txtValidCode.Text = string.Empty;
                }
            }
            else//充值金币
            {
                if (member.PointCardFull(userName, cardNo, cardPwd, Utility.Common.RequestIP))
                {
                    lblMsg.Text       = "充值卡[" + cardNo + "]充值成功,充值的游戏帐号(用户名)是" + userName + "!" + DateTime.Now;
                    txtUserName.Text  = string.Empty;
                    txtUserName2.Text = string.Empty;
                    txtCardNo.Text    = string.Empty;
                    txtValidCode.Text = string.Empty;
                }
                else
                {
                    lblMsg.Text       = "抱歉,点卡充值失败,可能是服务器繁忙,请稍候再试!";
                    txtValidCode.Text = string.Empty;
                }
            }
        }
Beispiel #10
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            //非法操作时重定向的URL地址
            //     string toUrl = "/Manage/Pay/Yeepay2/Default.aspx";
            //银行支付通道编码
            //与易宝的交易订单号
            string out_trade_no = string.Empty;

            string bankCode = CommonManager.Web.Request("params", "").Trim();

            if (bankCode.ToUpper() == "BANK")   //网银充值
            {
                bankCode     = CommonManager.Web.RequestForm("rtypeBank", "").ToUpper();
                payType      = "银行卡充值";
                out_trade_no = DateTime.Now.ToString("yyyyMMddHHmmssfffffff");
            }
            else  //点卡充值
            {
                bankCode     = CommonManager.Web.RequestForm("rtype", "").ToUpper();
                out_trade_no = "ka" + DateTime.Now.ToString("yyMMddHHmmssfffffff");
                switch (bankCode.ToLower())
                {
                case "szx-net":
                    payType = "神州行充值卡充值";
                    break;

                case "unicom-net":
                    payType = "联通卡充值";
                    break;

                case "ypcard-net":
                    payType = "易宝一卡通充值";
                    break;

                case "zhengtu-net":
                    payType = "征途游戏卡充值";
                    break;

                case "sndacard-net":
                    payType = "盛大游戏卡充值";
                    break;

                case "qqcard-net":
                    payType = "Q币支付";
                    break;

                case "junnet-net":
                    payType = "全国骏网一卡通充值";
                    break;
                }
            }


            BLL.Member mem      = new BLL.Member();
            string     userName = txtUserName.Text.Trim();

            //判断输入的用户是否存在
            if (!mem.ExistName(userName))
            {
                Response.Write("<script>alert('找不到您要充值的用户帐号,请检查输入是否有误');history.go(-1);</script>");
                Response.End();
            }
            //判断玩家充值时,不能在游戏中
            if (mem.IsInRoomOrGame(userName))
            {
                Response.Write("<script>alert('要充值的帐号正在游戏中,请先退出游戏再进行充值');history.go(-1);</script>");
                Response.End();
            }
            string money = PayMoney.Text.Trim();

            //判断面值是否正确
            if (string.IsNullOrEmpty(money) || !CommonManager.String.IsInteger(money) || int.Parse(money) <= 0)
            {
                CommonManager.Web.RegJs(this, "alert('金额只能输入大于0的整数。');history.back();", false);
                return;
            }

            int otherPayMoney = mem.UserTodayOtherPayMoney(userName);

            //是否超出今天充值限制额
            if (Convert.ToInt32(money) > otherPayMoney)
            {
                Response.Write("<script>alert('您今天能充值金额数不能大于" + otherPayMoney + "。');history.go(-1);</script>");
                Response.End();
            }


            //接收第三方支付平台返回支付结果的页面地址,为绝对地址
            string receivePageUrl = UiCommon.StringConfig.WebSiteName + "/Manage/pay/Yeepay2/Return.aspx";
            //商品名称(商户)
            string companyName = UiCommon.StringConfig.CompanyNameOfPay;
            //支付类型 Web_RMBCost.PayType
            int payTypeLog = 3;


            //类型信息 Web_RMBCost.Typeinfo
            string typeInfoLog = "易宝支付_" + payType;


            //插入支付订单日志
            //by YMH 2012-9-5  充值积分
            //积分充值存在
            if (ConfigurationManager.AppSettings["IsPayToPoint"] == "1" && rblPayType.SelectedValue == "point" && ddlGameList.SelectedValue != "")
            {
                pa_MP = "2"; //充积分
                new BLL.Member().Add3PayOrder(userName, Convert.ToInt32(money), typeInfoLog, out_trade_no, ddlGameList.SelectedValue);
            }
            else
            {
                pa_MP = "0"; //充金币
                new BLL.Member().Add3PayOrder(userName, Convert.ToInt32(money), payTypeLog, typeInfoLog, out_trade_no);
            }
            //开始调用支付网关



            //设置编码
            Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");


            //#if !debug
            #region 正式代码
            p1_MerId = StringConfig.YeepayMerID; // 商家ID
            keyValue = StringConfig.YeepayKey;   // 商家密钥
            Buy.NodeAuthorizationURL = StringConfig.YeepayNodeAuthorizationURL;
            #endregion
            //#endif


            p2_Order = out_trade_no;

            p3_Amt = money;

            //交易币种,固定值"CNY".
            p4_Cur = "CNY";

            //商品名称
            //用于支付时显示在易宝支付网关左侧的订单产品信息.
            p5_Pid = "";

            //商品种类
            p6_Pcat = "";

            //商品描述
            p7_Pdesc = "";
            //商户接收支付成功数据的地址,支付成功后易宝支付会向该地址发送两次成功通知.
            p8_Url = UiCommon.StringConfig.WebSiteName + "/Manage/Pay/Yeepay2/Return.aspx";
            //送货地址
            //为“1”: 需要用户将送货地址留在易宝支付系统;为“0”: 不需要,默认为 ”0”.
            p9_SAF = "0";

            //商户扩展信息
            //商户可以任意填写1K 的字符串,支付成功时将原样返回.	用这个字段判断是否是点卡 点卡手续费20%
            //   pa_MP = "";

            //银行编码
            //默认为"",到易宝支付网关.若不需显示易宝支付的页面,直接跳转到各银行、神州行支付、骏网一卡通等支付页面,该字段可依照附录:银行列表设置参数值.
            pd_FrpId = bankCode;


            //应答机制
            //为"1": 需要应答机制;为"0": 不需要应答机制.
            pr_NeedResponse = "1";

            // Response.Write(p1_MerId.ToString() + " <br> " + keyValue.ToString() + " <br> " + p2_Order.ToString() + " <br> " + p3_Amt.ToString() + " <br> " + p4_Cur.ToString() + " <br> " + p5_Pid.ToString() + " <br> " + p6_Pcat.ToString() + " <br> " + p7_Pdesc.ToString() + " <br> " + p8_Url.ToString() + " <br> " + p9_SAF.ToString() + " <br> " + pa_MP.ToString() + " <br> " + pd_FrpId.ToString() + " <br> " + pr_NeedResponse);
            // Response.End();

            Response.Redirect(Buy.CreateBuyUrl(p1_MerId, keyValue, p2_Order, p3_Amt, p4_Cur, p5_Pid, p6_Pcat, p7_Pdesc, p8_Url, p9_SAF, pa_MP, pd_FrpId, pr_NeedResponse));
        }
Beispiel #11
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (!CommonManager.Web.CheckPostSource())
            {
                return;
            }
            if (!IsValid)
            {
                return;
            }

            //0、服务端校验
            #region  务端校验
            //读取配置文件
            XmlOperator xo = new XmlOperator(_filePath);
            if (!xo.HasDocument)
            {
                CommonManager.Web.RegJs(this, "alert('本功能尚未开通,请稍候再尝试进入此页。');history.back();", false);
                return;
            }
            if (string.IsNullOrEmpty(txtPassword.Text.Trim()))
            {
                CommonManager.Web.RegJs(this, "alert('请输入您的当前密码!');", false);
                return;
            }
            TUsers user = DbSession.Default.Get <TUsers>(TUsers._.UserID == UserLoginInfo.UserID);
            if (user.Pass != CommonManager.String.EncryptMD5SystemDefaultMethod(txtPassword.Text.Trim(), false, true))
            {
                CommonManager.Web.RegJs(this, "alert('您输入的密码不正确,请重新输入。');", false);
                return;
            }
            if (string.IsNullOrEmpty(txtAgent.Text.Trim()) || string.IsNullOrEmpty(txtAgent2.Text.Trim()) || txtAgent.Text.Trim() != txtAgent2.Text.Trim())
            {
                CommonManager.Web.RegJs(this, "alert('请正确输入代理商帐号');", false);
                return;
            }
            else if (!DbSession.Default.Exists <Web_Agent>(Web_Agent._.LoginName == txtAgent.Text.Trim()))
            {
                CommonManager.Web.RegJs(this, "alert('代理商帐号不存在,请重新核对!');", false);
                return;
            }
            if (string.IsNullOrEmpty(txtMoney.Text.Trim()) || !CommonManager.String.IsInteger(txtMoney.Text.Trim()))
            {
                CommonManager.Web.RegJs(this, "alert('请正确输入要转帐的金币!');", false);
                return;
            }
            #endregion
            //1、检查用户输入的金额
            #region 检查用户输入的金额
            int        money  = int.Parse(txtMoney.Text.Trim());
            BLL.Member m      = new BLL.Member();
            Int64      bmoney = m.GetBankMoney(user.UserID.ToString());
            if (money > bmoney)
            {
                CommonManager.Web.RegJs(this, "alert('您的银行金币余额只有" + bmoney.ToString() == "0" ? "0" : bmoney.ToString() + UiCommon.StringConfig.AddZero() + ",请重新输入。');", false);
                return;
            }
            int minmoney = int.Parse(xo.GetNodeValue("MinMoney"));
            if (money <= minmoney)
            {
                CommonManager.Web.RegJs(this, "alert('每次兑换金币数量必须大于" + minmoney.ToString() + "00!');", false);
                return;
            }
            #endregion
            //2、取得代理商游戏帐户
            #region 取得代理商游戏帐户
            Web_VAgentUserInfo agent = DbSession.Default.Get <Web_VAgentUserInfo>(Web_VAgentUserInfo._.LoginName == txtAgent.Text.Trim());
            if (agent == null)
            {
                CommonManager.Web.RegJs(this, "alert('代理商帐号不存在,请重新核对!');", false);
                return;
            }
            #endregion
            //3、转帐
            //3.1、检测玩家帐号是否在游戏中
            #region 检测玩家帐号是否在游戏中
            if (m.IsInRoomOrGame(UserLoginInfo.UserName))
            {
                CommonManager.Web.RegJs(this, "alert('您的帐号正在游戏中,请先退出游戏再进行操作。');", false);
                return;
            }
            #endregion
            //3.2、检测代理商帐号是否在游戏中
            #region 检测代理商帐号是否在游戏中
            if (m.IsInRoomOrGame(agent.UserName))
            {
                CommonManager.Web.RegJs(this, "alert('代理商帐号正在游戏中,本次兑换不能进行,请稍后尝试。');", false);
                return;
            }
            #endregion
            //3.3、开始转账
            #region 开始转账
            //3.3.1、计算实际到账金币,读取配置文件中的手续费方式
            string type = xo.GetNodeValue("Type");
            //3.3.2、计算手续费
            int profee = type == "0" ? int.Parse(xo.GetNodeValue("StaticValue")) : (int)((float)money * (float.Parse(xo.GetNodeValue("PercentValue")) / 100));
            //3.3.3、计算实际到账金币
            int amoney = money - profee;


            //3.3.4、转帐
            //if( m.BankTransfer( UserLoginInfo.UserName, agent.UserName, amoney, CommonManager.Web.GetIP() ) )
            //{
            //    //3.4、记录转帐日志
            //    Web_AgentMoneyLog log = new Web_AgentMoneyLog();
            //    log.ActuallyMoney = amoney;
            //    log.AgentID = agent.ID;
            //    log.InputDate = DateTime.Now;
            //    log.Money = money;
            //    log.ProcedureFee = profee;
            //    log.UserID = int.Parse( UserLoginInfo.UserID );
            //    DbSession.Default.Save<Web_AgentMoneyLog>( log );
            //    //4、提示信息,转向日志记录页面
            //    CommonManager.Web.RegJs( this, "alert('兑换成功!');location.href='ExchangeMoneyLog.aspx';", false );
            //}
            //else
            //{
            //    //4、提示信息
            //    CommonManager.Web.RegJs( this, "alert('兑换失败,可能是网络原因,请稍后尝试。');", false );
            //}
            #endregion
        }
Beispiel #12
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            //非法操作时重定向的URL地址
            //     string toUrl = "/Manage/Pay/Yeepay2/Default.aspx";
            //银行支付通道编码
            //与易宝的交易订单号
            string out_trade_no = string.Empty;

            string bankCode = CommonManager.Web.Request("params", "").Trim();

            if (bankCode.ToUpper() == "BANK")   //网银充值
            {
                bankCode = CommonManager.Web.RequestForm("rtypeBank", "").ToUpper();
                payType = "银行卡充值";
                out_trade_no = DateTime.Now.ToString("yyyyMMddHHmmssfffffff");
            }
            else  //点卡充值
            {
                bankCode = CommonManager.Web.RequestForm("rtype", "").ToUpper();
                out_trade_no ="ka" + DateTime.Now.ToString("yyMMddHHmmssfffffff");
                switch (bankCode.ToLower())
                {
                    case "szx-net":
                        payType = "神州行充值卡充值";
                        break;
                    case "unicom-net":
                        payType = "联通卡充值";
                        break;
                    case "ypcard-net":
                        payType = "易宝一卡通充值";
                        break;
                    case "zhengtu-net":
                        payType = "征途游戏卡充值";
                        break;
                    case "sndacard-net":
                        payType = "盛大游戏卡充值";
                        break;
                    case "qqcard-net":
                        payType = "Q币支付";
                        break;
                    case "junnet-net":
                        payType = "全国骏网一卡通充值";
                        break;

                }
            }

            BLL.Member mem = new BLL.Member();
            string userName = txtUserName.Text.Trim();
            //判断输入的用户是否存在
            if (!mem.ExistName(userName))
            {
                Response.Write("<script>alert('找不到您要充值的用户帐号,请检查输入是否有误');history.go(-1);</script>");
                Response.End();
            }
            //判断玩家充值时,不能在游戏中
            if (mem.IsInRoomOrGame(userName))
            {
                Response.Write("<script>alert('要充值的帐号正在游戏中,请先退出游戏再进行充值');history.go(-1);</script>");
                Response.End();

            }
            string money = PayMoney.Text.Trim();
            //判断面值是否正确
            if (string.IsNullOrEmpty(money) || !CommonManager.String.IsInteger(money) || int.Parse(money) <= 0)
            {
                CommonManager.Web.RegJs(this, "alert('金额只能输入大于0的整数。');history.back();", false);
                return;
            }

            int otherPayMoney = mem.UserTodayOtherPayMoney(userName);
            //是否超出今天充值限制额
            if (Convert.ToInt32(money) > otherPayMoney)
            {
                Response.Write("<script>alert('您今天能充值金额数不能大于" + otherPayMoney + "。');history.go(-1);</script>");
                Response.End();
            }

            //接收第三方支付平台返回支付结果的页面地址,为绝对地址
            string receivePageUrl = UiCommon.StringConfig.WebSiteName + "/Manage/pay/Yeepay2/Return.aspx";
            //商品名称(商户)
            string companyName = UiCommon.StringConfig.CompanyNameOfPay;
            //支付类型 Web_RMBCost.PayType
            int payTypeLog = 3;

            //类型信息 Web_RMBCost.Typeinfo
            string typeInfoLog = "易宝支付_" + payType;

            //插入支付订单日志
               //by YMH 2012-9-5  充值积分
               //积分充值存在
            if (ConfigurationManager.AppSettings["IsPayToPoint"] == "1" && rblPayType.SelectedValue == "point" && ddlGameList.SelectedValue != "")
            {
                pa_MP = "2"; //充积分
                new BLL.Member().Add3PayOrder(userName, Convert.ToInt32(money), typeInfoLog, out_trade_no,ddlGameList.SelectedValue);

            }
            else
            {
                pa_MP = "0"; //充金币
                new BLL.Member().Add3PayOrder(userName, Convert.ToInt32(money), payTypeLog, typeInfoLog, out_trade_no);
            }
            //开始调用支付网关

            //设置编码
            Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");

            //#if !debug
            #region 正式代码
            p1_MerId = StringConfig.YeepayMerID;                                     // 商家ID
            keyValue = StringConfig.YeepayKey;  // 商家密钥
            Buy.NodeAuthorizationURL = StringConfig.YeepayNodeAuthorizationURL;
            #endregion
            //#endif

            p2_Order = out_trade_no;

            p3_Amt = money;

            //交易币种,固定值"CNY".
            p4_Cur = "CNY";

            //商品名称
            //用于支付时显示在易宝支付网关左侧的订单产品信息.
            p5_Pid = "";

            //商品种类
            p6_Pcat = "";

            //商品描述
            p7_Pdesc = "";
            //商户接收支付成功数据的地址,支付成功后易宝支付会向该地址发送两次成功通知.
            p8_Url = UiCommon.StringConfig.WebSiteName + "/Manage/Pay/Yeepay2/Return.aspx";
            //送货地址
            //为“1”: 需要用户将送货地址留在易宝支付系统;为“0”: 不需要,默认为 ”0”.
            p9_SAF = "0";

            //商户扩展信息
            //商户可以任意填写1K 的字符串,支付成功时将原样返回.	用这个字段判断是否是点卡 点卡手续费20%
            //   pa_MP = "";

            //银行编码
            //默认为"",到易宝支付网关.若不需显示易宝支付的页面,直接跳转到各银行、神州行支付、骏网一卡通等支付页面,该字段可依照附录:银行列表设置参数值.
            pd_FrpId = bankCode;

            //应答机制
            //为"1": 需要应答机制;为"0": 不需要应答机制.
            pr_NeedResponse = "1";

               // Response.Write(p1_MerId.ToString() + " <br> " + keyValue.ToString() + " <br> " + p2_Order.ToString() + " <br> " + p3_Amt.ToString() + " <br> " + p4_Cur.ToString() + " <br> " + p5_Pid.ToString() + " <br> " + p6_Pcat.ToString() + " <br> " + p7_Pdesc.ToString() + " <br> " + p8_Url.ToString() + " <br> " + p9_SAF.ToString() + " <br> " + pa_MP.ToString() + " <br> " + pd_FrpId.ToString() + " <br> " + pr_NeedResponse);
               // Response.End();

            Response.Redirect(Buy.CreateBuyUrl(p1_MerId, keyValue, p2_Order, p3_Amt, p4_Cur, p5_Pid, p6_Pcat, p7_Pdesc, p8_Url, p9_SAF, pa_MP, pd_FrpId, pr_NeedResponse));
        }
Beispiel #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string errorUrl, strMd5Key, txtUserName;
            int    intPayType, intBankID, intCardID;


            errorUrl        = "/Manage/Pay/Baofoo/Default.aspx";                                          //出错跳转地址
            strMerchant_url = UiCommon.StringConfig.WebSiteName + "/Manage/Pay/Baofoo/return_url.aspx";   //客户端跳转地址
            strReturn_url   = UiCommon.StringConfig.WebSiteName + "/Manage/Pay/Baofoo/merchant_url.aspx"; //服务器端返回地址
            strMerchantID   = ConfigurationManager.AppSettings["baofoo_memberid"];                        //商户号
            strMd5Key       = ConfigurationManager.AppSettings["baofoo_key"];                             //密钥 双方约定
            txtUserName     = Utility.Common.GetStringOfForm("txtUserName");                              //用户名
            payMoney        = Utility.Common.GetIntOfForm("PayMoney").ToString();                         //支付金额

            strCouponNum = Utility.Common.GetStringOfForm("CouponNum");

            strTradeDate = DateTime.Now.ToString("yyyyMMddHHmmss"); //交易日期

            //strPayID = Request.Params["SPayID"];//神州行卡充值是1

            intPayType = Utility.Common.GetIntOfForm("pay_type"); //支付方式
            intBankID  = Utility.Common.GetIntOfForm("bankid");   //银行对应的ID
            intCardID  = Utility.Common.GetIntOfForm("cardid");   //点卡对应的ID

            if (intPayType == 1)                                  //银行支付
            {
                strPayID   = intBankID.ToString();
                strTransID = DateTime.Now.ToString("yyyyMMddHHmmssffff"); //商户订单号(交易流水号)8-20位:必须唯一,推荐:前6位为商户号,后10位为用户流水号,string类型
            }
            else //点卡支付
            {
                strPayID   = intCardID.ToString();
                strTransID = "ka" + DateTime.Now.ToString("yyMMddHHmmssffff");
            }


            BLL.Member mem = new BLL.Member();
            //判断用户帐号是否正常
            if (!mem.ExistName(txtUserName.Trim()))
            {
                Response.Write("<script>alert('找不到您要充值的用户帐号,请检查输入是否有误');location.href='" + errorUrl + "';</script>");
                Response.End();
            }

            if (mem.IsInRoomOrGame(txtUserName.Trim()))
            {
                Response.Write("<script>alert('要充值的帐号正在游戏中,请先退出游戏再进行充值。');location.href='" + errorUrl + "';</script>");
                Response.End();
            }



            strProductName = "";  //商品名称
            strAmount      = "1"; //商品数量,为1
            strProductLogo = "";  //商品图片地址
            strUsername    = "";
            strEmail       = "";
            strMobile      = "";

            // [modify] jeffery
            strAdditionalInfo = "";
            //strAdditionalInfo = txtUserName + "!@#" + strCouponNum;
            // ---end

            strNoticeType = "1";//0 不跳转 1 会跳转

            //商户保存订单信息.....
            //SaveOrderInfo();
            //支付成功前, 插入支付的订单日志

            mem.Add3PayOrder(txtUserName.Trim(),
                             Convert.ToInt32(payMoney),
                             8, "宝付充值", strTransID);

            payMoney = (Convert.ToInt32(payMoney) * 100).ToString();

            strMd5Sign = GetMd5Sign(strMerchantID, strPayID, strTradeDate,
                                    strTransID, payMoney, strMerchant_url, strReturn_url, strNoticeType, strMd5Key);
        }