Esempio n. 1
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>");
        }
    }
Esempio n. 2
0
    //赋值
    private void set_get_value()
    {
        string ReceivablesDate = Convert.ToDateTime(FKBirthday.Text).ToString("yyyy-MM-dd") + " " + this.ddlHour.SelectedValue + ":" + this.ddlMinute.SelectedValue + ":00";
        string zw_hcr          = Convert.ToDateTime(HCBirthday.Text).ToString("yyyy-MM-dd") + " " + this.DropDownList1.SelectedValue + ":" + this.DropDownList2.SelectedValue + ":00";

        RemittancesModel info = new RemittancesModel();

        info.ReceivablesDate    = DateTime.Parse(ReceivablesDate).ToUniversalTime();
        info.RemittancesDate    = DateTime.Parse(zw_hcr).ToUniversalTime();
        info.ImportBank         = "";
        info.ImportNumber       = "";
        info.RemittancesAccount = "";
        info.RemittancesBank    = "";
        info.SenderID           = "";
        info.Sender             = "";

        info.RemitNumber         = this.Number.Text;
        info.RemitMoney          = decimal.Parse(this.Money.Text);
        info.StandardCurrency    = CommonDataBLL.GetStandard();
        info.ConfirmType         = int.Parse(Way.SelectedValue);
        info.Remark              = this.Remark.Text;
        info.RemittancesCurrency = CommonDataBLL.GetStandard();
        info.PayWay              = (int)PayWayType.RecAdvance;
        info.RemittancesMoney    = decimal.Parse(this.Money.Text);
        info.Managers            = Session["Company"].ToString();
        info.PhotoPath           = "";
        info.OperateIp           = Request.UserHostAddress;
        info.OperateNum          = Session["Company"].ToString();
        info.IsGSQR              = true;
        info.PayexpectNum        = BLL.CommonClass.CommonDataBLL.GetMaxqishu();
        //获取汇单号
        string huidan = "HK" + Model.Other.MYDateTime.ToYYMMDDHHmmssString();
        //判断汇单号是否存在:true存在,false不存在
        bool isExist = RemittancesBLL.isMemberExistsHuiDan(huidan);

        while (isExist)
        {
            huidan  = "HK" + Model.Other.MYDateTime.ToYYMMDDHHmmssString();
            isExist = RemittancesBLL.isMemberExistsHuiDan(huidan);
        }
        info.Remittancesid = huidan;
        if (this.RadPayFashion.SelectedIndex == 1)
        {
            string zw_hr_kfh = BankName.SelectedItem.Text.Substring(0, BankName.SelectedItem.Text.IndexOf("—", 0));
            string zw_hr_zh  = BankName.SelectedItem.Text.Substring(BankName.SelectedItem.Text.IndexOf("—", 0) + 1, BankName.SelectedItem.Text.Length - BankName.SelectedItem.Text.IndexOf("—", 0) - 1);
            string zw_skr    = ReceivablesDate;
            info.RemittancesDate    = DateTime.Parse(zw_hcr).ToUniversalTime();
            info.ImportBank         = zw_hr_kfh;
            info.ImportNumber       = zw_hr_zh;
            info.RemittancesAccount = this.RemitNum.Text;
            info.ReceivablesDate    = DateTime.Parse(zw_skr).ToUniversalTime();
            info.RemittancesBank    = this.RemitBank.Text;
            info.SenderID           = this.IdentityCard.Text;
            info.Sender             = this.Remitter.Text;
        }
        if (ViewState["Type"].ToString() == "Member")
        {
            info.RemitStatus = 1;
            info.Use         = int.Parse(member_type.SelectedValue);
        }
        else if (ViewState["Type"].ToString() == "Store")
        {
            info.RemitStatus = 0;
            info.Use         = int.Parse(store_type.SelectedValue);
        }
        int            ret  = 0;
        SqlTransaction tran = null;
        SqlConnection  conn = DAL.DBHelper.SqlCon();

        conn.Open();
        tran = conn.BeginTransaction();
        //添加汇款记录,并更新对应的金额
        int id = 0;

        RemittancesBLL.AddMemberRemittancesTran(info, CommonDataBLL.GetStandard().ToString(), CommonDataBLL.GetStandard().ToString(), out id, tran);
        if (id > 0)
        {
            if (info.Use == 0)//现金账户对账单
            {
                ret = D_AccountBLL.AddAccountTran(info.RemitNumber, Double.Parse(info.RemitMoney.ToString()) * RemittancesBLL.GetCurrency(info.RemittancesCurrency), D_AccountSftype.MemberType, D_Sftype.BounsAccount, D_AccountKmtype.RechargeByManager, DirectionEnum.AccountsIncreased, " " + "~007214", tran);
            }
            else if (info.Use == 1)//消费账户对账单
            {
                ret = D_AccountBLL.AddAccountTran(info.RemitNumber, Double.Parse(info.RemitMoney.ToString()) * RemittancesBLL.GetCurrency(info.RemittancesCurrency), D_AccountSftype.MemberCoshType, D_Sftype.EleAccount, D_AccountKmtype.RechargeByManager, DirectionEnum.AccountsIncreased, " " + "~007214", tran);
            }
            else if (info.Use == 2)//复消账户对账单
            {
                ret = D_AccountBLL.AddAccountTran(info.RemitNumber, Double.Parse(info.RemitMoney.ToString()) * RemittancesBLL.GetCurrency(info.RemittancesCurrency), D_AccountSftype.MemberTypeFx, D_Sftype.CancellationAccount, D_AccountKmtype.RechargeByManager, DirectionEnum.AccountsIncreased, " " + "~007214", tran);
            }


            //店铺订货款
            else if (info.Use == 10)
            {
                ret = D_AccountBLL.AddStoreAccount(info.RemitNumber, Double.Parse(info.RemitMoney.ToString()) * RemittancesBLL.GetCurrency(info.RemittancesCurrency), D_AccountSftype.StoreDingHuokuan, S_Sftype.dianhuo, D_AccountKmtype.RechargeByManager, DirectionEnum.AccountsIncreased, " " + "~003079", tran);
            }//店铺周转款
            else if (info.Use == 11)
            {
                ret = D_AccountBLL.AddStoreAccount(info.RemitNumber, Double.Parse(info.RemitMoney.ToString()) * RemittancesBLL.GetCurrency(info.RemittancesCurrency), D_AccountSftype.StoreZhouZhuankuan, S_Sftype.zhouzhuan, D_AccountKmtype.RechargeByManager, DirectionEnum.AccountsIncreased, " " + "~003079", tran);
            }
            if (ret > 0)
            {
                //发送短信

                //string receiverName = "", storeidnumber = "", mobile = "";
                //if (ViewState["Type"].ToString() == "Store")
                //{
                //    StoreInfoModel storeinfo = StoreInfoDAL.GetStoreInfoByStoreId(this.Number.Text);
                //    receiverName = Encryption.Encryption.GetDecipherName(storeinfo.Name);
                //    storeidnumber = storeinfo.Number;
                //    mobile = Encryption.Encryption.GetDecipherTele(storeinfo.MobileTele);
                //}
                //else if (ViewState["Type"].ToString() == "Member")
                //{
                //    MemberInfoModel storeinfo = MemberInfoDAL.getMemberInfo(Number.Text.Trim());
                //    receiverName = Encryption.Encryption.GetDecipherName(storeinfo.Name);
                //    storeidnumber = storeinfo.Number;
                //    mobile = Encryption.Encryption.GetDecipherTele(storeinfo.MobileTele);
                //}
                //Session["RemittancesModel"] = null;

                //string hkid = id.ToString();
                //try
                //{
                //    BLL.MobileSMS.SendMsgMode(tran, receiverName, "收到" + info.RemittancesMoney + RemittancesBLL.GetCurrencyByID(info.RemittancesCurrency), storeidnumber, mobile, hkid, Model.SMSCategory.sms_Receivables);
                //    tran.Commit();
                //}
                //catch
                //{
                //    tran.Rollback();
                //}
                if (ViewState["Type"].ToString() == "Member")
                {
                    tran.Commit();
                    conn.Close();
                    Page.ClientScript.RegisterStartupScript(GetType(), "", "<script language='javascript'>alert('" + GetTran("001126", "汇款成功!") + "');location.href='AuditingStoreAccount.aspx?type=Member';</script>");
                }
                else
                {
                    tran.Commit();
                    conn.Close();
                    Page.ClientScript.RegisterStartupScript(GetType(), "", "<script language='javascript'>alert('" + GetTran("001126", "汇款成功!") + "');location.href='AuditingStoreAccount.aspx';</script>");
                }
            }
            else
            {
                tran.Rollback(); conn.Close(); Page.ClientScript.RegisterStartupScript(GetType(), "", "<script language='javascript'>alert('" + GetTran("008020", "汇款失败") + "!');</script>");
            }
        }
        else
        {
            tran.Rollback(); conn.Close(); Page.ClientScript.RegisterStartupScript(GetType(), "", "<script language='javascript'>alert('" + GetTran("008020", "汇款失败") + "!');</script>");
        }
    }