Example #1
0
        protected void button5_ServerClick(object sender, EventArgs e)
        {
            if (!BCST.Common.CommonManager.Web.CheckPostSource())
                return;

            BLL.Member member = new BLL.Member();
            //string password = hidPwd2.Value.Trim();//txtPassword.Text.Trim();
            string password = txtPassword.Text.Trim();
            if (!member.CompareLoginPassword(UserLoginInfo.UserID, password))
            {
                lblMsg.Text = "�Բ���������ĵ�¼��������";
                return;
            }

            if (dd_11.Visible)
            {
                if (string.IsNullOrEmpty(txtOldTwoPass.Text.Trim()))
                {
                    lblMsg.Text = "������ԭ�������룡";
                    return;
                }
                if (!member.CompareTwoPassword(UserLoginInfo.UserID, txtOldTwoPass.Text.Trim()))
                {
                    lblMsg.Text = "�Բ����������ԭ������������";
                    return;
                }
            }

            string cardType = Common.FilterString(ddlCardType.SelectedValue);
            string cardNo = Common.FilterString(txtCardNo.Text.Trim());
            string question = Common.FilterString(ddlQuestion.SelectedValue);
            string answer = Common.FilterString(txtAnwer.Text.Trim());
            string twoPass = Common.FilterString(txtTwoPass.Text.Trim());

            int iRows = 0;
            if (dd_5.Visible)
            {
                iRows = member.UpdateTwoPassInfo(UserLoginInfo.UserID, cardType, cardNo, question, answer, twoPass);
            }
            else if (!string.IsNullOrEmpty(twoPass))
            {
                // iRows = member.UpdateTwoPass(UserLoginInfo.UserID, twoPass);
                iRows = member.UpdateTwoPass(UserLoginInfo.UserID, cardNo, answer, twoPass);
            }
            else
            {
                lblMsg.Text = "�������벻��Ϊ�գ�" + DateTime.Now;
                return;
            }

            if (iRows > 0)
            {
                if (dd_5.Visible)
                {
                    lblMsg.Text = "�������뱣���������óɹ���" + DateTime.Now;
                }
                else
                {
                    lblMsg.Text = "���������޸ijɹ���" + DateTime.Now;
                }
                Hidden();
                //lblMsg.Text = "�������뱣�������޸ijɹ���" + DateTime.Now;
                //Hidden();
            }
            else if (iRows == -9)
            {
                lblMsg.Text = "��Ǹ������д��֤�����������𰸲�����δ���޸��������룬���������룡";
                Hidden();
            }
            else
            {
                lblMsg.Text = "��Ǹ�������޸�ʧ�ܣ������Ƿ�������æ�����Ժ����ԣ�";
            }
        }
Example #2
0
        protected void button5_ServerClick(object sender, EventArgs e)
        {
            if (!BCST.Common.CommonManager.Web.CheckPostSource())
            {
                return;
            }

            string userId      = UiCommon.UserLoginInfo.UserID;
            string outUserName = UiCommon.UserLoginInfo.UserName;
            string password    = txtPassword.Text.Trim();//hidPwd.Value.Trim(); //

            if (!member.CompareTwoPassword(userId, password))
            {
                lblMsg.Text = "对不起,您输入的银行密码有误!";
                return;
            }

            Int64 outUserBankMoney = member.GetBankMoney(userId);

            string inputUserName = Utility.Common.FilterString(txtInputUserName.Text.Trim());



            //2.判断转出方账号是否在游戏房间或正在游戏中,是则不能进行转账操作!
            if (member.IsInRoomOrGame(outUserName))
            {
                lblMsg.Text = "抱歉,您的帐号已进入房间中或正在游戏中,不能进行转账操作!";
                return;
            }

            //2.1转出方账户余额必须大于这个数TransferLessAllMoney才能转账
            long LeftMoney = member.GetAllMoney(userId);       //获取账户余额

            if (LeftMoney <= Convert.ToInt64(TransferLessAllMoney))
            {
                lblMsg.Text = "抱歉,您的账户余额必须大于规定的" + UiCommon.StringConfig.AddZeros(TransferLessAllMoney) + UiCommon.StringConfig.MoneyName + "才能转账!";
                return;
            }

            //3.如果转入方的账号不存在,不能进行转账操作
            if (!member.ExistName(inputUserName))
            {
                lblMsg.Text = "抱歉,您填写的转入帐号不存在!";
                return;
            }

            //4.如果转入方的账号正在游戏中,不能进行转账操作(此项限制可选)
            if (member.IsInRoomOrGame(inputUserName))
            {
                lblMsg.Text = "抱歉,转入方的帐号已进入房间中或正在游戏中,不能进行转账操作!";
                return;
            }

            long transMoney = Convert.ToInt64(txtMoney.Text.Trim());

            //5.1转账金额必须是这个数的倍数TransferMultiple
            if (transMoney % TransferMultiple != 0)
            {
                lblMsg.Text = "抱歉,您输入的转账金额必须是" + TransferMultiple + "的倍数!";
                return;
            }

            transMoney = Convert.ToInt64(UiCommon.StringConfig.RemoveZeros(transMoney));
            //5.2转账金额不能小于单笔转账规定值TransferLessMoney
            if (transMoney < TransferLessMoney)
            {
                lblMsg.Text = "抱歉,您输入的转账金额小于单笔转账规定值" + UiCommon.StringConfig.AddZeros(TransferLessMoney) + UiCommon.StringConfig.MoneyName + "!";
                return;
            }

            //6.转出方银行帐户余额不足,请存款后在进行转帐!
            if (outUserBankMoney < transMoney)
            {
                lblMsg.Text = "抱歉,您的银行余额不足,请存款或充值后再进行转账!";
                return;
            }

            //transMoney少于零,则说明输入的金额比配置的倍数小。输入的金额至少要达到倍数的额数。2010-01-26
            if (transMoney <= 0)
            {
                lblMsg.Text = "抱歉,转账金额必须大于或等于" + UiCommon.StringConfig.GetMultiple();
                return;
            }

            //7.更新转出方银行存款、更新转入方银行存款、写入转账 Web_TransLog 记录表
            Dictionary <string, object> dic = new Dictionary <string, object>();

            DbSession.Default.FromProc("Web_pBankTrans")
            .AddInputParameter("@outUserName", DbType.String, outUserName)
            .AddInputParameter("@inUserName", DbType.String, inputUserName)
            .AddInputParameter("@transMoney", DbType.Int64, transMoney)
            .AddInputParameter("@transTime", DbType.DateTime, DateTime.Now)
            .AddInputParameter("@transIP", DbType.String, CommonManager.Web.GetIP())
            .AddOutputParameter("@Result", DbType.Int32, 4)
            .Execute(out dic);

            //if( member.BankTransfer( outUserName, inputUserName, transMoney, Utility.Common.RequestIP ) )
            if (dic.Count > 0 && (int)dic["Result"] == 0)
            {
                DateTime tmp_viptime = DbSession.Default.FromSql("select DATEADD([second],viptime,'1970-01-01 08:00:00') from Web_vUserList where UserName=@UserName").AddInputParameter("@UserName", DbType.String, outUserName).ToScalar <DateTime>();

                int taxMoney = 0;// = transMoney;
                if (tmp_viptime > DateTime.Now)
                {
                    //VIP手续费   根据项目实施部要求转账手续费改成千分比  周圣华 2010-05-14
                    taxMoney = (int)((float)transMoney * (((float)VipTransferTax / 10000))); //*= (VipTransferTax / 100);
                }
                else
                {
                    //普通会员手续费
                    taxMoney = (int)((float)transMoney * (((float)TransferTax / 10000))); //*= (TransferTax / 100);
                }

                if (taxMoney > MaxTransTax)
                {
                    taxMoney = MaxTransTax;
                }
                int sjTransMoney = (int)transMoney - taxMoney; //实际转账金额

                CommonManager.Web.RegJs(this, "alert('转账成功,您转给" + inputUserName + "的" + UiCommon.StringConfig.AddZeros(transMoney) + UiCommon.StringConfig.MoneyName + ",扣除手续费" + UiCommon.StringConfig.AddZeros(taxMoney) + UiCommon.StringConfig.MoneyName + "后," + UiCommon.StringConfig.AddZeros(sjTransMoney) + UiCommon.StringConfig.MoneyName + "已转入他/她的银行账户!');location.href=location.href;", false);
            }
            else if (dic.Count > 0 && (int)dic["Result"] == 1)
            {
                CommonManager.Web.RegJs(this, "alert('您的银行" + UiCommon.StringConfig.MoneyName + "不足,请先去充值后再转帐。');location.href=location.href;", true);
            }
            else if (dic.Count > 0 && (int)dic["Result"] == 3)
            {
                CommonManager.Web.RegJs(this, "alert('抱歉,转账不能自己转给自己,请重新输入转入帐号!');location.href=location.href;", true);
            }
            else
            {
                //lblMsg.Text = "抱歉,转账操作失败,可能是服务器繁忙,请稍候再试!";
                CommonManager.Web.RegJs(this, "alert('抱歉,转账操作失败,可能是服务器繁忙,请稍候再试!');location.href=location.href;", true);
            }
        }
Example #3
0
        protected void button5_ServerClick(object sender, EventArgs e)
        {
            if (!BCST.Common.CommonManager.Web.CheckPostSource())
            {
                return;
            }

            BLL.Member member = new BLL.Member();
            //string password = hidPwd2.Value.Trim();//txtPassword.Text.Trim();
            string password = txtPassword.Text.Trim();

            if (!member.CompareLoginPassword(UserLoginInfo.UserID, password))
            {
                lblMsg.Text = "对不起,您输入的登录密码有误!";
                return;
            }

            if (dd_11.Visible)
            {
                if (string.IsNullOrEmpty(txtOldTwoPass.Text.Trim()))
                {
                    lblMsg.Text = "请输入原二级密码!";
                    return;
                }
                if (!member.CompareTwoPassword(UserLoginInfo.UserID, txtOldTwoPass.Text.Trim()))
                {
                    lblMsg.Text = "对不起,您输入的原二级密码有误!";
                    return;
                }
            }

            string cardType = Common.FilterString(ddlCardType.SelectedValue);
            string cardNo   = Common.FilterString(txtCardNo.Text.Trim());
            string question = Common.FilterString(ddlQuestion.SelectedValue);
            string answer   = Common.FilterString(txtAnwer.Text.Trim());
            string twoPass  = Common.FilterString(txtTwoPass.Text.Trim());

            int iRows = 0;

            if (dd_5.Visible)
            {
                iRows = member.UpdateTwoPassInfo(UserLoginInfo.UserID, cardType, cardNo, question, answer, twoPass);
            }
            else if (!string.IsNullOrEmpty(twoPass))
            {
                // iRows = member.UpdateTwoPass(UserLoginInfo.UserID, twoPass);
                iRows = member.UpdateTwoPass(UserLoginInfo.UserID, cardNo, answer, twoPass);
            }
            else
            {
                lblMsg.Text = "银行密码不能为空!" + DateTime.Now;
                return;
            }

            if (iRows > 0)
            {
                if (dd_5.Visible)
                {
                    lblMsg.Text = "银行密码保护资料设置成功!" + DateTime.Now;
                }
                else
                {
                    lblMsg.Text = "银行密码修改成功!" + DateTime.Now;
                }
                Hidden();
                //lblMsg.Text = "银行密码保护资料修改成功!" + DateTime.Now;
                //Hidden();
            }
            else if (iRows == -9)
            {
                lblMsg.Text = "抱歉,您填写的证件号码或问题答案不符,未能修改银行密码,请重新输入!";
                Hidden();
            }
            else
            {
                lblMsg.Text = "抱歉,资料修改失败,可能是服务器繁忙,请稍候再试!";
            }
        }
Example #4
0
        protected void button5_ServerClick(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtTwoPassword.Text.Trim()))
            {
                lblMsg.Text = "请输入银行密码!";
                return;
            }
            if (!member.CompareTwoPassword(UiCommon.UserLoginInfo.UserID, txtTwoPassword.Text.Trim()))
            {
                lblMsg.Text = "对不起,您输入的银行密码不正确!";
                return;
            }
            int opType = Convert.ToInt32(rdoType.SelectedValue);


            long ioMoney    = 0;
            int  GameNameID = 0;

            if (UiCommon.StringConfig.BankVersion == "1")
            {
                if (Convert.ToInt64(txtMoney.Text.Trim()) <= 0)
                {
                    lblMsg.Text = "存取金额必须是大于零的整数!";
                    return;
                }
                ioMoney = Convert.ToInt64(UiCommon.StringConfig.RemoveZeros(txtMoney.Text.Trim()));
            }
            else
            {
                if (Convert.ToInt64(txtMoney2.Text.Trim()) <= 0)
                {
                    lblMsg.Text = "存取金额必须是大于零的整数!";
                    return;
                }
                opType     = 0;
                GameNameID = Convert.ToInt32(ddlGame.SelectedValue);
                ioMoney    = Convert.ToInt64(UiCommon.StringConfig.RemoveZeros(txtMoney2.Text.Trim()));
            }
            //ioMoney少于零,则说明输入的金额比配置的倍数小。输入的金额至少要达到倍数的额数。
            if (ioMoney <= 0)
            {
                lblMsg.Text = "抱歉,金额必须大于或等于" + UiCommon.StringConfig.GetMultiple();
                return;
            }

            Dictionary <string, object> dic = new Dictionary <string, object>();

            DbSession.Default.FromProc("Web_pBankMoneyOpera")
            .AddInputParameter("@UserID", DbType.Int32, UiCommon.UserLoginInfo.UserID)
            .AddInputParameter("@MoneyQuantity", DbType.Int64, ioMoney)
            .AddInputParameter("@IsSave", DbType.Int32, opType)
            .AddInputParameter("@NameID", DbType.Int32, GameNameID)
            .AddReturnValueParameter("@ReturnValue", DbType.Int32)
            .Execute(out dic);
            string location = string.Empty;

            if (dic.Count > 0)
            {
                string msg = string.Empty;
                switch ((int)dic["ReturnValue"])
                {
                case 1:
                    msg      = "操作成功!";
                    location = "location.href=location.href;";
                    break;

                case -1:
                default:
                    msg = "抱歉,服务器出现未知错误,请稍后重试!";
                    break;

                case -2:
                    msg = "存款:您输入的存取金额不能大于钱包中的余款!";
                    break;

                case -3:
                    msg = "取款:您输入的存取金额不能大于银行中的存款!";
                    break;
                }
                CommonManager.Web.RegJs(this, "alert('" + msg + "');" + location, true);
            }
            else
            {
                CommonManager.Web.RegJs(this, "alert('抱歉,服务器出现未知错误,请稍后重试!');history.back();", false);
            }
        }