Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //获取标准币种
        bzCurrency = CommonDataBLL.GetStandard();
        // huilv = (AjaxClass.GetCurrency(Convert.ToInt32(bzCurrency), Convert.ToInt32(Session["Default_Currency"].ToString())));
        Permissions.MemRedirect(Page, Permissions.redirUrl);
        AjaxPro.Utility.RegisterTypeForAjax(typeof(AjaxClass));
        //判断会员账户是否被冻结
        if (MemberInfoDAL.CheckState(Session["Member"].ToString()))
        {
            Page.ClientScript.RegisterStartupScript(GetType(), null, "<script language='javascript'>alert('您的账户被冻结,不能使用电子转账');window.location.href='First.aspx';</script>"); return;
        }

        if (!IsPostBack)
        {
            try
            {
                bind();
                double Cash         = 0; //石斛积分账户
                double Declarations = 0; //报单账户
                ECRemitDetailBLL.GetCashDeclarations(Session["Member"].ToString(), out Cash, out Declarations);
                shky.Text = "FTC可用:" + Convert.ToString(Cash);
                // bdky.Text = "注册积分可用:"+Convert.ToString(Declarations);
            }
            catch
            {
                Response.Redirect("../PassWordManage/CheckAdv.aspx?type=member&url=MoneyManage");
            }


            lbUsername.Text = Encryption.Encryption.GetDecipherName(DAL.DBHelper.ExecuteScalar("select isnull(Name,'') as Name from memberinfo where number='" + Session["Member"].ToString() + "'").ToString());
        }
        //translation();
    }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Permissions.MemRedirect(Page, Permissions.redirUrl);
        //获取标准币种
        AjaxPro.Utility.RegisterTypeForAjax(typeof(AjaxClass));
        bzCurrency = CommonDataBLL.GetStandard();
        huilv      = 0;
        //判断会员账户是否被冻结
        if (MemberInfoDAL.CheckState(Session["Member"].ToString()))
        {
            Page.ClientScript.RegisterStartupScript(GetType(), null, "<script language='javascript'>alert('您的账户被冻结,不能使用交易系统');setTimeout(function(){ window.location.href='First.aspx'},3000);</script>"); return;
        }
        if (!IsPostBack)
        {
            DateTime dtnow = DateTime.Now;

            Session["smscode"] = null;
            //if (Common.GetISCanCharge()==0) {
            //    ClientScript.RegisterStartupScript(this.GetType(), "", "<script>  window.location.href='first.aspx'; </script>"); return;
            //}
            string number = Session["member"].ToString();
            //object obj = DAL.DBHelper.ExecuteScalar("select papernumber  from memberinfo where number='" + number + "'");
            //if (obj == DBNull.Value || obj == null || obj.ToString() == "") {
            //    ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('您还未进行实名制认证 ,请先去实名认证!');window.location.href='PhoneSettings/CheckPassword.aspx?url=RealName&&type=name'; </script>"); return;
            //}
            SqlDataReader sdr = DAL.DBHelper.ExecuteReader("Select Top 1 * From jykz ORDER BY ID");
            while (sdr.Read())
            {
                mrmin = sdr["mrMinjf"].ToString().Trim();
                mrmax = sdr["mrMaxjf"].ToString();
                mcmin = sdr["mcMinjf"].ToString();
                mcmax = sdr["mcMaxjf"].ToString();
            }
            sdr.Close();
            sdr.Dispose();

            zuida = DBHelper.ExecuteScalar("select pointAin-pointAout from memberinfo where number='" + number + "'").ToString();

            if (Session["Default_Currency"] == null)
            {
                Session["Default_Currency"] = bzCurrency;
            }
            LoadDataAAA();
            setStoreInfo();
            search_rsj();
            Translations();
        }
    }
Ejemplo n.º 3
0
    /// <summary>
    /// 转账
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnE_Click(object sender, EventArgs e)
    {
        //设置特定值防止重复提交
        hid_fangzhi.Value = "0";

        //判断会员账户是否被冻结
        if (MemberInfoDAL.CheckState(Session["Member"].ToString()))
        {
            Page.ClientScript.RegisterStartupScript(GetType(), null, "<script language='javascript'>alert('您的账户被冻结,不能使用电子转账');window.location.href='First.aspx';</script>"); return;
        }

        ECTransferDetailModel detailmodel = new ECTransferDetailModel();

        try {
            //验证金额是否合法
            double money = 0.0;
            if (!double.TryParse(this.txtEmoney.Text.Trim(), out money))
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('金额必须是数字,请重新输入!');</script>");
                return;
            }
            //验证是否输入金额
            if (this.txtEmoney.Text.Length <= 0 || money <= 0)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转出金额必须大于0!');</script>");
                return;
            }
            //验证输入金额是否是10的倍数
            decimal mony = Convert.ToDecimal(this.txtEmoney.Text);
            if (mony % 10 != 0)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转出金额必须是10的倍数');</script>");
                return;
            }
            double Cash         = 0; //可用FTC账户
            double Declarations = 0; //消费账户
            ECRemitDetailBLL.GetCashDeclarations(Session["Member"].ToString(), out Cash, out Declarations);
            int       level2 = 0;
            double    djq    = 0;
            string    ssql   = "select level2,fuxiaoin-fuxiaoout+fuxiaothin-fuxiaothout as djq from MemberInfoBalance" + CommonDataBLL.getMaxqishu() + " a ,MemberInfo b where  a.number=b.Number and a.number='" + Session["Member"].ToString() + "'";
            DataTable dts    = DAL.DBHelper.ExecuteDataTable(ssql);
            if (dts.Rows.Count > 0)
            {
                level2 = Convert.ToInt16(dts.Rows[0]["Level2"].ToString());
                djq    = Convert.ToDouble(dts.Rows[0]["djq"].ToString());
            }
            double jdjy = 0;

            if (level2 > 0)
            {
                if (Convert.ToDouble(Cash) + djq > 30000)
                {
                    jdjy = (Convert.ToDouble(Cash) + djq) - 30000;
                    if (jdjy > Convert.ToDouble(Cash))
                    {
                        jdjy = Convert.ToDouble(Cash);
                    }
                }
                else
                {
                    jdjy = 0;
                }
                Cash = jdjy;
            }
            //验证转账金额最大值
            if (RadioButtonList1.SelectedValue == "1" && money > Cash)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转出金额必须小于当前FTC可用账户最大可转金额!');</script>");
                return;
            }
            else if (RadioButtonList1.SelectedValue == "3" && money > Declarations)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000000", "转出金额必须小于当前消费账户最大可转金额!") + "');</script>");
                return;
            }
            else if (RadioButtonList1.SelectedValue == "2")
            {
                double    bd  = 0;
                string    sql = "select pointBIn-pointBOut as bd from MemberInfo where number='" + Session["Member"].ToString() + "'";
                DataTable shj = DBHelper.ExecuteDataTable(sql);
                if (shj.Rows.Count > 0)
                {
                    bd = Convert.ToDouble(shj.Rows[0][0].ToString());
                    if (money > bd)
                    {
                        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000000", "转出金额必须小于当前报单账户最大可转金额!") + "');</script>");
                        return;
                    }
                }
            }
            else if (RadioButtonList1.SelectedValue == "4")
            {
                double    bd  = 0;
                double    xj  = 0;
                string    sql = "select zzye-xuhao as bd,Jackpot-Out as xj from MemberInfo where number='" + Session["Member"].ToString() + "'";
                DataTable shj = DBHelper.ExecuteDataTable(sql);
                if (shj.Rows.Count > 0)
                {
                    bd = Convert.ToDouble(shj.Rows[0][0].ToString());
                    xj = Convert.ToDouble(shj.Rows[0][1].ToString());
                    if (money > bd)
                    {
                        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000000", "转出金额必须小于当前保险账户最大可转金额!") + "');</script>");
                        return;
                    }
                    if (xj > 10)
                    {
                        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000000", "可用FTC使用完才可以操作保险账户转账!") + "');</script>");
                        return;
                    }
                }
            }
            string number = "";
            if (RadioButtonList1.SelectedValue == "1" || RadioButtonList1.SelectedValue == "4")
            {
                string    sql = "select number from MemberInfo where MobileTele='" + txt_InNumber.Text + "'";
                DataTable shj = DBHelper.ExecuteDataTable(sql);
                if (shj.Rows.Count > 0)
                {
                    number = shj.Rows[0][0].ToString();
                }
                else
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('无此编号,请检查后再重新输入111!')</script>");
                    return;
                }


                string GetError1 = new AjaxClass().CheckNumberNetTui(number, lbEnum.Text.Trim());
                string GetError2 = new AjaxClass().CheckNumberNetTui(lbEnum.Text.Trim(), number);

                if (RadioButtonList1.SelectedValue == "1" && ((GetError1 != null && GetError1 != "") && (GetError2 != null && GetError2 != "")))
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('可用FTC只能转给同一网络下的用户!');</script>", false);
                    return;
                }
                if (RadioButtonList1.SelectedValue == "4" && ((GetError1 != null && GetError1 != "") && (GetError2 != null && GetError2 != "")))
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('可用FTC只能转给同一网络下的用户!');</script>", false);
                    return;
                }
                //验证转入编号
                if (number == "")
                {
                    ScriptHelper.SetAlert(Page, "编号不能为空!");
                    return;
                }
            }
            else
            {
                number = Session["Member"].ToString();
            }


            string lll  = Request.Form["rad_Inzh"];
            string llll = rad_Outzh.SelectedValue;
            //验证会员是否自己给自己转入现金账户
            if (txt_InNumber.Text.Trim() == lbEnum.Text.Trim() && RadioButtonList1.SelectedValue == "1")
            {
                ScriptHelper.SetAlert(Page, "自己不能转入自己的FTC账户");
                return;
            }
            //验证会员是否自己给自己转入消费账户
            //if (txt_InNumber.Text.Trim() == lbEnum.Text.Trim() && RadioButtonList1.SelectedValue == "3")
            //{
            //    ScriptHelper.SetAlert(Page, GetTran("000000", "自己不能转入自己的消费积分账户"));
            //    return;
            //}

            //验证会员转入账户是否服务机构订货款和转入编号是否服务机构编号
            //if (Request.Form["rad_Inzh"] == "2" && (int)DAL.DBHelper.ExecuteScalar("select count(0) as count from storeinfo where storeid= '" + txt_InNumber.Text.Trim() + "'") <= 0)
            //{
            //    ScriptHelper.SetAlert(Page, GetTran("007696", "转入服务机构订货款,转入编号必须是服务机构编号"));
            //    return;
            //}
            //else if (Request.Form["rad_Inzh"] != "2" && (int)DAL.DBHelper.ExecuteScalar("select count(0) as count from memberinfo where number= '" + txt_InNumber.Text.Trim() + "'") <= 0)
            //{
            //    ScriptHelper.SetAlert(Page, GetTran("007697", "转入编号不正确,请重新填写!"));
            //    return;
            //}

            //验证备注do
            if (this.txtEnote.Text.Length > 500)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('您输入的字符超出最大范围!');</script>");
                return;
            }
            //验证密码 非空
            //if (this.txtEpwd.Text.Trim() == "")
            //{
            //    ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("006662", "请输入二级密码!") + "');</script>");
            //    return;
            //}

            ////验证电子账户密码是否正确
            //string word = Encryption.Encryption.GetEncryptionPwd(this.txtEpwd.Text.Trim(), this.lbEnum.Text.Trim());
            //int blean = ECRemitDetailBLL.ValidatePwd(Session["Member"].ToString(), word);
            //if (blean == 1)
            //{
            //    System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('" + GetTran("001554", "电子账户密码不正确!") + "');", true);
            //    return;
            //}
            //else if (blean == 2)
            //{
            //    System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('" + GetTran("007162", "对不起,您连续5次输入密码错,请2小时候在登录!") + "');", true);
            //    return;
            //}
            //是否收到款项
            if (!cboyishd.Checked)
            {
                ScriptHelper.SetAlert(Page, "请先确认是否收到该会员支付的上数金额!");
                return;
            }


            detailmodel.OutNumber = Session["Member"].ToString();
            detailmodel.OutMoney  = double.Parse(this.txtEmoney.Text.Trim());
            detailmodel.ExpectNum = CommonDataBLL.getMaxqishu();

            detailmodel.OperateIP     = CommonDataBLL.OperateIP;      // 获取ip
            detailmodel.OperateNumber = Session["Member"].ToString(); // 获取当前会员编号
            detailmodel.Remark        = this.txtEnote.Text.Trim();
            if (RadioButtonList1.SelectedValue == "1")
            {
                detailmodel.InNumber       = number;
                detailmodel.outAccountType = OutAccountType.MemberCash;
                detailmodel.inAccountType  = InAccountType.MemberCash;
            }
            if (RadioButtonList1.SelectedValue == "2")
            {
                detailmodel.InNumber       = number;
                detailmodel.outAccountType = OutAccountType.MemberBD;
                detailmodel.inAccountType  = InAccountType.MemberCash;
            }
            if (RadioButtonList1.SelectedValue == "3")
            {
                detailmodel.InNumber       = number;
                detailmodel.outAccountType = OutAccountType.MemberCons;
                detailmodel.inAccountType  = InAccountType.MemberCash;
            }
            if (RadioButtonList1.SelectedValue == "4")
            {
                detailmodel.InNumber       = number;
                detailmodel.outAccountType = OutAccountType.MemberTypeFx;
                detailmodel.inAccountType  = InAccountType.MemberTypeFx;
            }
        }
        catch
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('请输入正确的参数!');</script>");
        }
        SqlTransaction tran = null;
        SqlConnection  conn = DAL.DBHelper.SqlCon();

        conn.Open();
        tran = conn.BeginTransaction();
        try
        {
            if (detailmodel.outAccountType == OutAccountType.MemberCash && detailmodel.inAccountType == InAccountType.MemberCash)
            {
                string    number = "";
                string    sql    = "select number from MemberInfo where MobileTele='" + txt_InNumber.Text + "'";
                DataTable shj    = DBHelper.ExecuteDataTable(sql);
                if (shj.Rows.Count > 0)
                {
                    number = shj.Rows[0][0].ToString();
                    detailmodel.InNumber = number;
                }
                else
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('无此编号,请检查后再重新输入222!')</script>");
                    return;
                }
                //对会员现金账户转入会员现金账户
                if (ECRemitDetailBLL.AddMoneyManageTran(detailmodel, 1, 2, tran) == 0)
                {
                    //string mot = "";
                    //string sqll = "select MobileTele from MemberInfo where number='" + lbEnum.Text + "'";
                    //DataTable xsj = DBHelper.ExecuteDataTable(sqll);
                    //if (xsj.Rows.Count > 0)
                    //{
                    //    mot = xsj.Rows[0][0].ToString();
                    //}
                    int    ret  = D_AccountBLL.AddAccountWithdrawTran(Session["Member"].ToString(), detailmodel.OutMoney, D_AccountSftype.MemberType, D_Sftype.BounsAccount, D_AccountKmtype.AccountTransfer, DirectionEnum.AccountReduced, "会员可用FTC账户转入" + txt_InNumber.Text.Trim() + "~会员保险账户", tran);
                    string st   = "INSERT INTO MemberAccount(Number,HappenTime,HappenMoney,BalanceMoney,Direction,SfType,KmType,Remark) SELECT number,GETutcDATE()," + detailmodel.OutMoney + ",zzye-xuhao,0,8,4,'会员可用钱包转出" + detailmodel.OutMoney + "到" + txt_InNumber.Text + "保险钱包。' from memberinfo where Number='" + detailmodel.InNumber + "'";
                    int    ret1 = DBHelper.ExecuteNonQuery(tran, st);
                    if (ret > 0 && ret1 > 0)
                    {
                        tran.Commit();
                        conn.Close();
                        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转帐成功!');$('#tourl').show();document.getElementById('tourl').href='AccountDetail.aspx?type=AccountXJ';</script>");
                    }
                    else
                    {
                        tran.Rollback();
                        conn.Close();
                        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转帐失败2222!');</script>");
                    }
                }

                else
                {
                    tran.Rollback();
                    conn.Close();
                    ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转帐失败1111!');</script>");
                }
            }
            if (detailmodel.outAccountType == OutAccountType.MemberBD && detailmodel.inAccountType == InAccountType.MemberCash)
            {
                //对会员现金账户转入会员消费账户
                if (ECRemitDetailBLL.AddMoneyManageTran(detailmodel, 3, 2, tran) == 0)
                {
                    //string mot = "";
                    //string sqll = "select MobileTele from MemberInfo where number='" + lbEnum.Text + "'";
                    //DataTable xsj = DBHelper.ExecuteDataTable(sqll);
                    //if (xsj.Rows.Count > 0)
                    //{
                    //    mot = xsj.Rows[0][0].ToString();
                    //}
                    int ret  = D_AccountBLL.AddAccountWithdrawTran(Session["Member"].ToString(), detailmodel.OutMoney, D_AccountSftype.MemberTypeBd, D_Sftype.baodanFTC, D_AccountKmtype.AccountTransfer, DirectionEnum.AccountReduced, "会员报单账户转入" + detailmodel.InNumber + "~会员保险账户", tran);
                    int ret1 = D_AccountBLL.AddAccountTran(detailmodel.InNumber, detailmodel.OutMoney, D_AccountSftype.zzye, D_Sftype.zzye, D_AccountKmtype.RechargeByTransfer, DirectionEnum.AccountsIncreased, lbEnum.Text + "会员报单账户为" + detailmodel.InNumber + "会员保险账户转入" + detailmodel.OutMoney, tran);
                    if (ret > 0 && ret1 > 0)
                    {
                        tran.Commit();
                        conn.Close();
                        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转帐成功!');$('#tourl').show();document.getElementById('tourl').href='AccountDetail.aspx?type=AccountXJ';</script>");
                    }
                    else
                    {
                        tran.Rollback();
                        conn.Close();
                        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转帐失败2222!');</script>");
                    }
                }
                else
                {
                    tran.Rollback();
                    conn.Close();
                    ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转帐失败1111!');</script>");
                }
            }

            if (detailmodel.outAccountType == OutAccountType.MemberCons && detailmodel.inAccountType == InAccountType.MemberCash)
            {
                //对会员消费账户转入会员消费账户
                if (ECRemitDetailBLL.AddMoneyManageTran(detailmodel, 0, 2, tran) == 0)
                {
                    //string mot = "";
                    //string sqll = "select MobileTele from MemberInfo where number='" + lbEnum.Text + "'";
                    //DataTable xsj = DBHelper.ExecuteDataTable(sqll);
                    //if (xsj.Rows.Count > 0)
                    //{
                    //    mot = xsj.Rows[0][0].ToString();
                    //}
                    int ret  = D_AccountBLL.AddAccountWithdrawTran(Session["Member"].ToString(), detailmodel.OutMoney, D_AccountSftype.MemberCoshType, D_Sftype.EleAccount, D_AccountKmtype.AccountTransfer, DirectionEnum.AccountReduced, "会员消费账户转入" + txt_InNumber.Text.Trim() + "~会员可用FTC账户", tran);
                    int ret1 = D_AccountBLL.AddAccountTran(Session["Member"].ToString(), detailmodel.OutMoney, D_AccountSftype.zzye, D_Sftype.zzye, D_AccountKmtype.RechargeByTransfer, DirectionEnum.AccountsIncreased, lbEnum.Text + "会员消费账户为" + txt_InNumber.Text.Trim() + "会员可用FTC账户转入" + detailmodel.OutMoney, tran);
                    if (ret > 0 && ret1 > 0)
                    {
                        tran.Commit();
                        conn.Close();
                        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转帐成功!');$('#tourl').show();document.getElementById('tourl').href='AccountDetail.aspx?type=AccountXJ';</script>");
                    }
                    else
                    {
                        tran.Rollback();
                        conn.Close();
                        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转帐失败2222!');</script>");
                    }
                }
                else
                {
                    tran.Rollback();
                    conn.Close();
                    ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转帐失败1111!');</script>");
                }
            }
            if (RadioButtonList1.SelectedValue == "4")
            {
                //对会员保险账户转入会员保险账户

                string    mot  = "";
                int       ret  = 0;
                int       ret1 = 0;
                int       ret2 = 0;
                int       ret3 = 0;
                string    sqll = "select number from MemberInfo where MobileTele='" + txt_InNumber.Text + "'";
                DataTable xsj  = DBHelper.ExecuteDataTable(sqll);
                if (xsj.Rows.Count > 0)
                {
                    mot = xsj.Rows[0][0].ToString();

                    ret  = DBHelper.ExecuteNonQuery(tran, "update memberinfo set xuhao+=" + detailmodel.OutMoney + " where number='" + Session["Member"].ToString() + "'");
                    ret1 = DBHelper.ExecuteNonQuery(tran, "update memberinfo set zzye+=" + detailmodel.OutMoney + "  where number='" + mot + "'");
                    ret2 = DBHelper.ExecuteNonQuery(tran, "INSERT INTO MemberAccount(Number,HappenTime,HappenMoney,BalanceMoney,Direction,SfType,KmType,Remark) SELECT number,GETutcDATE()," + detailmodel.OutMoney + ",zzye-xuhao,1,8,4,'会员保险钱包转出" + detailmodel.OutMoney + "到" + txt_InNumber.Text + "保险钱包。' from memberinfo where Number='" + Session["Member"].ToString() + "'");
                    ret3 = DBHelper.ExecuteNonQuery(tran, "INSERT INTO MemberAccount(Number,HappenTime,HappenMoney,BalanceMoney,Direction,SfType,KmType,Remark) SELECT number,GETutcDATE()," + detailmodel.OutMoney + ",zzye-xuhao,0,8,4,'会员保险钱包转出" + detailmodel.OutMoney + "到" + txt_InNumber.Text + "保险钱包。' from memberinfo where Number='" + mot + "'");
                }
                if (ret > 0 && ret1 > 0)
                {
                    tran.Commit();
                    conn.Close();
                    ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转帐成功!');$('#tourl').show();document.getElementById('tourl').href='AccountDetail.aspx?type=AccountXJ';</script>");
                }
                else
                {
                    tran.Rollback();
                    conn.Close();
                    ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转帐失败2222!');</script>");
                }
            }
            else
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转帐失败444!');</script>");
            }



            this.txtEmoney.Text    = string.Empty;
            this.txt_InNumber.Text = string.Empty;
            txtEnote.Text          = string.Empty;
        }
        catch {
            //tran.Rollback();
            conn.Close();
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转帐失败!123');</script>");
        }
    }
Ejemplo n.º 4
0
    /// <summary>
    /// 支付按钮事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnsure_Click(object sender, EventArgs e)
    {
        double currency = AjaxClass.GetCurrency(Convert.ToInt32(bzCurrency), Convert.ToInt32(Session["Default_Currency"].ToString()));
        int    res      = -1;
        string usemoney = lbltotalmoney.Text.Trim();
        string billid   = ViewState["billid"].ToString();
        int    roletype = Convert.ToInt32(ViewState["roletype"]);
        int    dotype   = Convert.ToInt32(ViewState["dotype"]);

        loginnumber = ViewState["loginnumber"].ToString();

        string curip = Request.UserHostAddress.ToString();

        if (!rdorempay.Checked)  //非离线支付
        {
            if (ViewState["remid"] != null)
            {
                RemittancesDAL.DelRemittancesrelationremtemp(ViewState["remid"].ToString());
            }
        }
        else //使用离线支付方式
        {
            if (ViewState["remid"] != null)
            {
                RemittancesDAL.UPRemittancesre(ViewState["remid"].ToString());
            }
        }

        if (rdoonlinepay.Checked)  //在线支付
        {
            string hkid = billid;
            ClientScript.RegisterStartupScript(GetType(), "msg", "alert('该功能正在开发中,请耐心等候!!!');", true);
            return;

            if (dotype == 1)
            {
                hkid = RemittancesDAL.AddRemittancebytypeOnline(billid, roletype, curip, loginnumber, 1);
            }
            else if (dotype == 2)
            {
                RemittancesDAL.UpdateOnlinepayway(billid, 4);
            }

            string posturl = Getposturl(hkid);

            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>window.open ('" + posturl + "');</script>");
            this.btnsure.Enabled = false;
            return;
        }
        else if (rdorempay.Checked)  //离线支付
        {
            //usemoney = (double.Parse(lblrmb.Text.Trim()) * currency).ToString();
            usemoney = double.Parse(lblrmb.Text.Trim()).ToString("0.00");
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script> window.location.href='payerror.aspx?ef=" + EncryKey.Encrypt("100" + "," + billid + "," + usemoney) + "';</script>");
            return;
        }
        else if (rdostorepay.Checked)  //去店铺支付
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script> window.location.href='payerror.aspx?ef=" + EncryKey.Encrypt("101" + "," + billid + "," + usemoney) + "';</script>");
            return;
        }
        else if (rdoectpay.Checked)                                     //会员电子货币支付
        {
            if (MemberOrderDAL.Getvalidteiscanpay(billid, loginnumber)) //限制订单必须有订货所属店铺推荐人协助人支付)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script> alert('" + GetTran("007452", "该订单不属于您的协助或推荐报单,不能完成支付!") + "'); window.location.href='../Logout.aspx'; </script>");
                return;
            }
            if (ViewState["odnumber"].ToString() != loginnumber)//如果不是自己给自己支付
            {
                if (this.rdombsuregetmoney.SelectedValue == "0")
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "", "<script> alert('" + GetTran("007455", "请确认已收到该会员支付的报单金额") + "');   </script>");
                    return;
                }
            }
            if (this.txtadvpass.Text == "")
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("006656", "二级密码不能为空!") + "');</script>");
                return;
            }
            string oldPass = Encryption.Encryption.GetEncryptionPwd(this.txtadvpass.Text.ToString(), loginnumber);
            int    n       = PwdModifyBLL.check(loginnumber, oldPass, 1);
            if (n <= 0)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script> alert('" + GetTran("006058", "二级密码不正确!") + "'); </script>");
                return;
            }

            if (MemberInfoDAL.CheckState(Session["Member"].ToString()))
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script> alert('" + GetTran("007456", "会员账户已冻结,不能完成支付!") + "'); </script>");
                return;
            }


            DataTable dt_one    = DAL.DBHelper.ExecuteDataTable("select ordertype from MemberOrder where OrderID=" + billid);
            string    ordertype = dt_one.Rows[0]["ordertype"].ToString();//订单类型
            int       act;
            if (ordertype == "22" || ordertype == "12")
            {
                act = Convert.ToInt32(rdoaccounttype2.SelectedValue);
            }
            else if (ordertype == "25")
            {
                act = Convert.ToInt32(rdoaccounttype3.SelectedValue);
            }
            else
            {
                act = Convert.ToInt32(rdoaccounttype.SelectedValue);
            }

            res = AddOrderDataDAL.OrderPayment(loginnumber, billid, curip, roletype, dotype, act, loginnumber, "", 2, -1, 1, 1, "", double.Parse(usemoney), "");
            this.btnsure.Enabled = false;
        }
        else if (rdostpaymb.Checked)                                    //店铺支付 会员订单
        {
            if (MemberOrderDAL.Getvalidteiscanpay(billid, loginnumber)) //限制订单必须有订货所属店铺推荐人协助人支付)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script> alert('" + GetTran("007452", "该订单不属于您的协助或推荐报单,不能完成支付!") + "'); window.location.href='../Logout.aspx'; </script>");
                return;
            }
            if (this.rdoisagree.SelectedValue == "0") //验证是否确认收到款
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script> alert('" + GetTran("007455", "请确认已收到该会员支付的报单金额") + "!');   </script>");
                return;
            }
            if (this.txtpayadbpass.Text == "")
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("006656", "二级密码不能为空!") + "');</script>");
                return;
            }
            string oldPass = Encryption.Encryption.GetEncryptionPwd(this.txtpayadbpass.Text.ToString(), Session["Store"].ToString());
            int    n       = PwdModifyBLL.checkstore(loginnumber, oldPass, 1);
            if (n <= 0)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script> alert('" + GetTran("006058", "二级密码不正确!") + "'); </script>");
                return;
            }

            int act = Convert.ToInt32(rdostactypepaymb.SelectedValue);
            res = AddOrderDataDAL.OrderPayment(loginnumber, billid, curip, 2, 3, act, loginnumber, "", 5, -1, 1, 1, "", double.Parse(usemoney), "");
            this.btnsure.Enabled = false;
        }
        else if (rdostopayorder.Checked)  //店铺电子账户支付 订货单
        {
            if (this.txtstadvpass.Text == "")
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("006656", "二级密码不能为空!") + "');</script>");
                return;
            }
            string oldPass = Encryption.Encryption.GetEncryptionPwd(this.txtstadvpass.Text.ToString(), Session["Store"].ToString());
            int    n       = PwdModifyBLL.checkstore(loginnumber, oldPass, 1);
            if (n <= 0)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script> alert('" + GetTran("006058", "二级密码不正确!") + "'); </script>");

                return;
            }
            int act = Convert.ToInt32(rdostaccount.SelectedValue);

            res = AddOrderDataDAL.OrderPayment(loginnumber, billid, curip, roletype, dotype, act, loginnumber, "", 2, -1, 1, 1, "", double.Parse(usemoney), ""); this.btnsure.Enabled = false;
        }
        else
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script> alert('" + GetTran("000000", "请至少选择一种支付方式!") + "'); </script>");
            return;
        }

        PublicClass.SendMsg(1, billid, "");

        ClientScript.RegisterStartupScript(this.GetType(), "", "<script> window.location.href='payerror.aspx?ef=" + EncryKey.Encrypt(res.ToString() + "," + billid + "," + usemoney) + "';</script>");
        return;
    }
Ejemplo n.º 5
0
    protected void sub_Click(object sender, EventArgs e)
    {
        if (String.IsNullOrEmpty(txtPhoneNumber.Text))
        {
            Page.ClientScript.RegisterStartupScript(GetType(), "", "<script language='javascript'>alert('" + GetTran("008029", "请输入手机号码!") + "')</script>");
            hid_fangzhi.Value = "0";
            return;
        }
        else if (!PhoneRechargeBLL.CheckPhoneNumber(txtPhoneNumber.Text))
        {
            Page.ClientScript.RegisterStartupScript(GetType(), "", "<script language='javascript'>alert('" + GetTran("006545", "手机号码格式错误") + "!')</script>");
            hid_fangzhi.Value = "0";
            return;
        }

        if (MemberInfoDAL.CheckState(Session["Member"].ToString()))
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script> alert('" + GetTran("007456", "会员账户已冻结,不能完成支付!") + "'); </script>");
            hid_fangzhi.Value = "0";
            return;
        }

        PhoneRecharge pr = new PhoneRecharge();

        pr.RechargeID  = new PhoneRechargeBLL().GetRechargeID();
        pr.Number      = Session["Member"].ToString();
        pr.AddMoney    = Convert.ToDecimal(ddlMoney.SelectedValue);
        pr.AddState    = 1;
        pr.PhoneNumber = txtPhoneNumber.Text;
        pr.AddTime     = DateTime.Now.ToUniversalTime();
        pr.OperateIP   = Request.UserHostAddress;
        pr.OperaterNum = Session["Member"].ToString();
        string result = PhoneRechargeBLL.AddRecharge(pr);

        if (String.Equals(result, "1"))
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script> alert('" + GetTran("007514", "支付失败,账户可用余额不足") + "!'); </script>");
            hid_fangzhi.Value = "0";
            return;
        }
        else if (String.Equals(result, "fail"))
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script> alert('" + GetTran("008031", "手机充值失败,请重新操作!") + "'); </script>");
            hid_fangzhi.Value = "0";
            return;
        }
        else if (String.Equals(result, "ok"))
        {
            string         url     = Request.Url.ToString().ToLower().Replace("/member/phonerecharge.aspx", "/phonerecharge/chongzhi.aspx");
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);

            request.Accept    = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/ag-plugin, application/xaml+xml, application/vnd.ms-xpsdocument, application/x-ms-xbap, application/x-ms-application, */*";
            request.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)";

            request.Method    = "post";
            request.KeepAlive = true;
            request.Headers.Add("Accept-Language", "zh-cn,zh;q=0.5");
            request.Headers.Add("Accept-Charset", "GB2312,utf-8;q=0.7,*;q=0.7");
            request.ContentType = "application/x-www-form-urlencoded";

            Encoding ec = Encoding.GetEncoding("gb2312");
            Byte[]   bt = ec.GetBytes("txtPhoneNumber=" + pr.PhoneNumber + "&ddlMoney=" + pr.AddMoney.ToString() + "&RechargeID=" + pr.RechargeID);
            request.ContentLength = bt.Length;

            Stream streamrequest = request.GetRequestStream();
            streamrequest.Write(bt, 0, bt.Length);

            ClientScript.RegisterStartupScript(this.GetType(), "", "<script> alert('" + GetTran("008032", "手机充值操作完成,请等候5~10分钟话费将会充值到您的手机!") + "'); </script>");
            Response.Redirect(Request.Url.ToString().ToLower().Replace("/phonerecharge.aspx", "/findrecharge.aspx"));
        }
    }