Example #1
0
    public string GetDefrayName(string defrayType)
    {
        string defrayName = new GroupRegisterBLL().GetDefryType(defrayType);

        return(defrayName);
    }
Example #2
0
    public string GetPayStatus(string paytype)
    {
        string payStatus = new GroupRegisterBLL().GetDeftrayState(paytype);

        return(payStatus);
    }
Example #3
0
    private void GetOldMemberData(string bianhao)
    {
        //MemberInfoModifyBll mf = new MemberInfoModifyBll();
        MemberInfoModel member = MemberInfoModifyBll.getMemberInfo(bianhao);

        if (member != null)
        {
            this.LblBh.Text      = member.Number;
            this.LblBh.ForeColor = Color.Silver;
            //解密姓名
            this.labName.Text = Encryption.Encryption.GetDecipherName(CommonDataBLL.quanjiao(member.Name));
            Txtlm.Text        = member.PetName;
            Txtyb1.Text       = member.PostalCode;

            //解密地址
            this.txtdizhi.Text = Encryption.Encryption.GetDecipherAddress(member.Address);

            Txtjtdh.Text = Encryption.Encryption.GetDecipherTele(member.HomeTele);
            if (this.Txtjtdh.Text.Trim() == "")
            {
                this.Txtjtdh.Text = GetTran("000028", "电话号码");
                this.Txtjtdh.Style.Add("color", "gray");
            }

            Txtbgdh.Text = Encryption.Encryption.GetDecipherTele(member.OfficeTele);
            if (this.Txtbgdh.Text.Trim() == "")
            {
                this.Txtbgdh.Text = GetTran("000028", "电话号码");
                this.Txtbgdh.Style.Add("color", "gray");
            }
            Txtyddh.Text = Encryption.Encryption.GetDecipherTele(member.MobileTele);

            Txtczdh.Text = Encryption.Encryption.GetDecipherTele(member.FaxTele);
            if (this.Txtczdh.Text.Trim() == "")
            {
                this.Txtczdh.Text = GetTran("000028", "电话号码");
                this.Txtczdh.Style.Add("color", "gray");
            }

            IList <string> strBankInfo = new GroupRegisterBLL().GetBankValue(member.BankCode);
            if (strBankInfo.Count > 0)
            {
                foreach (ListItem li in ddlCountry.Items)
                {
                    if (li.Value == strBankInfo[1].Substring(0, 2))
                    {
                        li.Selected = true;
                        break;
                    }
                }
                ViewState["bankcode"] = strBankInfo[1];
            }
            txtbankbrachname.Text = member.Bankbranchname;
            if (member.BCPCCode != "")
            {
                List <string> BankArea = new RegistermemberBLL().ChoseArea(member.BCPCCode);
                //解密银行地址并且读出银行详细地址
                UserControl_CountryCity countrycity1 = Page.FindControl("CountryCity2") as UserControl_CountryCity;
                //取得该会员地址
                CityModel bankArea = DAL.CommonDataDAL.GetCPCCode(member.BCPCCode);
                countrycity1.SelectCountry(bankArea.Country, bankArea.Province, bankArea.City, bankArea.Xian);
            }
            List <string> GetCardType = new GroupRegisterBLL().GetCardType(member.PaperType.PaperTypeCode);
            lblzhengjian.Text = GetCardType[0];
            UserControl_CountryCity countrycity = Page.FindControl("CountryCity1") as UserControl_CountryCity;
            //取得该会员地址
            CityModel MemberArea = DAL.CommonDataDAL.GetCPCCode(member.CPCCode);
            countrycity.SelectCountry(MemberArea.Country, MemberArea.Province, MemberArea.City, MemberArea.Xian);
            //生日需要修改
            lblBirthday.Text = (Convert.ToDateTime(member.Birthday).Year + "-" + (Convert.ToDateTime(member.Birthday)).Month + "-" + (Convert.ToDateTime(member.Birthday)).Day);

            //解密开户名
            this.labkaihuming.Text = Encryption.Encryption.GetDecipherName(member.BankBook) == "" ? Encryption.Encryption.GetDecipherName(member.Name) : Encryption.Encryption.GetDecipherName(member.BankBook);
            //卡号解密
            this.labkahao.Text = Encryption.Encryption.GetDecipherCard(member.BankCard);
            if (Convert.ToInt32(member.Sex) == 0)
            {
                this.labSex.Text = GetTran("000095", "女");
            }
            else
            {
                this.labSex.Text = GetTran("000094", "男");
            }

            //解密证件号
            this.labzhengjianhaoma.Text = Encryption.Encryption.GetDecipherNumber(member.PaperNumber);
            Txtbz.Text = member.Remark;
        }
    }
Example #4
0
    protected void go_Click(object sender, System.EventArgs e)
    {
        //删除会员图片
        string dirName = "";
        string oldFileName = "";
        string newFileName = "";
        string newFilePath = "";
        int    photoW = 0, photoH = 0;

        #region
        //if (this.myFile.PostedFile.FileName.Trim() != string.Empty)
        //{
        //    //删除旧图
        //    if (Session["Member"].ToString() != "")
        //    {
        //        delMemberPic(Session["Member"].ToString());
        //    }
        //    else
        //    {
        //        //Response.Write("<script>alert('参数错误,请重新登陆!');location.href('index.aspx')</script>");
        //        msg = "<script language='javascript'>alert('参数错误!重新登陆!');location.href('../index.aspx')</script>";
        //        return;
        //    }
        //    #region 上传新图

        //    //string oldFilePath = this.myFile.PostedFile.FileName.Trim();

        //    //try
        //    //{
        //    //    if (oldFilePath != string.Empty)
        //    //    {
        //    //        //检查目录是否存在
        //    //        dirName = DateTime.Now.Year.ToString() + "-" + DateTime.Now.Month.ToString();
        //    //        if (!System.IO.Directory.Exists(Server.MapPath("../upload/" + dirName)))
        //    //        {
        //    //            System.IO.Directory.CreateDirectory(Server.MapPath("../upload/" + dirName));
        //    //        }

        //    //        oldFileName = System.IO.Path.GetFileName(oldFilePath);

        //    //        string fileExtName = System.IO.Path.GetExtension(oldFilePath);
        //    //        if (fileExtName.ToLower() != ".gif" && fileExtName.ToLower() != ".jpg" && fileExtName.ToLower() != ".jpeg")
        //    //        {
        //    //           // Response.Write("<script>alert('上传文件格式不正确!')</script>");
        //    //            msg = "<script language='javascript'>alert('上传文件格式不正确!');</script>";
        //    //            return;
        //    //        }
        //    //        if (myFile.PostedFile.ContentLength > 102400)
        //    //        {
        //    //            //Response.Write("<script>alert('上传文件不能大于100K!')</script>");
        //    //            msg = "<script language='javascript'>alert('上传文件不能大于100K!');</script>";
        //    //            return;
        //    //        }

        //    //        System.Random rd = new Random(0);
        //    //        newFileName = DateTime.Now.Year.ToString() + rd.Next(10).ToString()
        //    //            + DateTime.Now.Month.ToString() + rd.Next(10).ToString()
        //    //            + DateTime.Now.Day.ToString() + rd.Next(10).ToString()
        //    //            + DateTime.Now.Second.ToString()
        //    //            + fileExtName;

        //    //        newFilePath = Server.MapPath("..\\upload\\" + dirName) + "\\" + newFileName;
        //    //        this.myFile.PostedFile.SaveAs(newFilePath);

        //    //        try
        //    //        {
        //    //            System.Drawing.Image myIma = System.Drawing.Image.FromFile(newFilePath);
        //    //            photoH = myIma.Height;
        //    //            photoW = myIma.Width;

        //    //        }
        //    //        catch
        //    //        { }

        //    //        ViewState["photopath"] = dirName + "\\" + newFileName;
        //    //        ViewState["photoH"] = photoH.ToString();
        //    //        ViewState["photoW"] = photoW.ToString();

        //    //    }
        //    //}
        //    //catch (Exception ext)
        //    //{
        //    //    Response.Write("<script>alert('" + ext.ToString() + "')</script>");
        //    //    return;
        //    //}
        //    #endregion
        //    #region 上传图片
        //    string oldFilePath = this.myFile.PostedFile.FileName.Trim();
        //    //string oldFilePath = "";

        //    try
        //    {
        //        if (oldFilePath != string.Empty)
        //        {
        //            if (!Directory.Exists(Server.MapPath("../Store/H_image"))) //如果文件夹不存在则创建
        //            {
        //                Directory.CreateDirectory(Server.MapPath("../Store/H_image"));
        //            }

        //            //检查目录是否存在
        //            dirName = DateTime.Now.Year.ToString() + "-" + DateTime.Now.Month.ToString();

        //            oldFileName = System.IO.Path.GetFileName(oldFilePath);

        //            string fileExtName = System.IO.Path.GetExtension(oldFilePath);
        //            if (fileExtName.ToLower() != ".gif" && fileExtName.ToLower() != ".jpg" && fileExtName.ToLower() != ".jpeg" && fileExtName.ToLower() != ".bmp" && fileExtName.ToLower() != ".png")
        //            {
        //                System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('" + GetTran("000823", "上传文件格式不正确!") + "');", true);
        //                return;
        //            }
        //            if (this.myFile.PostedFile.ContentLength > 51200)
        //            {
        //                System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('" + GetTran("000824", "上传文件不能大于50K!") + "');", true);
        //                return;
        //            }
        //            //System.Drawing.Image img = System.Drawing.Image.FromStream(PhotoPath1.PostedFile.InputStream);
        //            //int width = img.Width;
        //            //int hight = img.Height;
        //            //if (width > 50 || hight > 50)
        //            //{
        //            //    Response.Write("<script>alert('" + GetTran("006034", "图片宽度和高度太大!") + "');</script>");
        //            //    this.Button1.Enabled = true;
        //            //    return "";
        //            //}
        //            System.Random rd = new Random(0);
        //            newFileName = DateTime.Now.Year.ToString() + rd.Next(10).ToString()
        //                + DateTime.Now.Month.ToString() + rd.Next(10).ToString()
        //                + DateTime.Now.Day.ToString() + rd.Next(10).ToString()
        //                + DateTime.Now.Second.ToString()
        //                + fileExtName;
        //            newFilePath = Server.MapPath("..\\Store\\H_image\\") + newFileName;

        //            string LevelIcon = "../Store/" + new MemberInfoModifyBll().GetMemberPhoto(Session["Member"].ToString());
        //            if (System.IO.File.Exists(Server.MapPath(LevelIcon)))
        //            {
        //                System.IO.File.Delete(Server.MapPath(LevelIcon));
        //            }

        //            this.myFile.PostedFile.SaveAs(newFilePath);
        //            try
        //            {
        //                System.Drawing.Image myIma = System.Drawing.Image.FromFile(newFilePath);
        //                photoH = myIma.Height;
        //                photoW = myIma.Width;

        //            }
        //            catch
        //            { }
        //            filepath = @"\Store\H_image\" + newFileName;
        //            try
        //            {
        //                System.Drawing.Image myIma = System.Drawing.Image.FromFile(newFilePath);
        //                photoH = myIma.Height;
        //                photoW = myIma.Width;

        //            }
        //            catch (Exception ex1)
        //            {
        //                System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('" + GetTran("006895", "图片格式转换错误!") + "');", true);
        //                if (System.IO.File.Exists(Server.MapPath(filepath)))
        //                {
        //                    System.IO.File.Delete(Server.MapPath(filepath));
        //                }
        //                return;
        //            }
        //        }
        //    }
        //    catch
        //    {
        //        return;
        //    }
        //    #endregion
        //}
        //else
        //{
        //}
        #endregion
        //生日
        DateTime birthday;
        try
        {
            //更改至标准时间
            birthday = Convert.ToDateTime(lblBirthday.Text);
        }
        catch
        {
            Page.ClientScript.RegisterStartupScript(GetType(), null, "<script language='javascript'>alert('" + GetTran("000148", "对不起,请选择正确的出生日期!") + "');</script>", false);
            return;
        }
        int sex = 0;
        if (labSex.Text.Trim() == GetTran("000094", "男"))
        {
            sex = 1;
        }
        else
        {
            sex = 0;
        }

        if (Txtbz.Text.Length > 500)
        {
            Page.ClientScript.RegisterStartupScript(GetType(), null, "<script language='javascript'>alert('" + GetTran("007704", "备注内容不能超过500字") + "!');</script>", false);
            return;
        }
        //姓名加密
        string name    = Encryption.Encryption.GetEncryptionName(labName.Text.Trim());
        string Petname = Txtlm.Text.Trim();
        //string Birthday = birthday;
        //string sex = sex;
        //加密电话

        string HomeTele = Encryption.Encryption.GetEncryptionTele(Txtjtdh.Text.Trim());

        string OfficeTele = Encryption.Encryption.GetEncryptionTele(Txtbgdh.Text.Trim());

        string MobileTele = Encryption.Encryption.GetEncryptionTele(Txtyddh.Text.Trim());

        string FaxTele = Encryption.Encryption.GetEncryptionTele(Txtczdh.Text.Trim());

        UserControl_CountryCity countrycity = Page.FindControl("CountryCity1") as UserControl_CountryCity;
        string Country  = countrycity.Country;
        string Province = countrycity.Province;
        string City     = countrycity.City;
        string Xian     = countrycity.Xian;
        if (Country == "请选择" || Province == "请选择" || City == "请选择" || Xian == "请选择" || Country == "" || Province == "" || City == "" || Xian == "")
        {
            ScriptHelper.SetAlert(Page, "请选择地址!");
            return;
        }
        string CPCCode = DAL.CommonDataDAL.GetCPCCode(Country, Province, City, Xian);
        //加密地址
        string Address = Encryption.Encryption.GetEncryptionAddress(txtdizhi.Text.Trim());
        if (Address.Trim().Length == 0)
        {
            ScriptHelper.SetAlert(Page, "请填写详细地址!");
            return;
        }

        string PostalCode = Txtyb1.Text.Trim();

        string PaperType = new GroupRegisterBLL().GetPaperTypeCode(lblzhengjian.Text.Trim());
        //证件加密
        string PaperNumber = Encryption.Encryption.GetEncryptionNumber(labzhengjianhaoma.Text.Trim());
        if (this.Txtbz.Text.Length > 500)
        {
            System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('" + GetTran("006708", "对不起,备注输入的字符太多,最多500个字符!") + "');", true);
            return;
        }
        ;
        string Remark = Txtbz.Text.Trim();
        //int Healthy = Convert.ToInt32(MemberHealth.SelectedValue);
        string photopath = "";
        //需要修改标准时间
        DateTime Birthday = Convert.ToDateTime(birthday);

        #region 银行信息

        UserControl_CountryCity countrycity1 = Page.FindControl("CountryCity2") as UserControl_CountryCity;
        string Country1  = countrycity1.Country;
        string Province1 = countrycity1.Province;
        string City1     = countrycity1.City;
        string Xian1     = countrycity1.Xian;
        if (Country1 == "请选择" || Province1 == "请选择" || City1 == "请选择" || Xian1 == "请选择" || Country1 == "" || Province1 == "" || City1 == "" || Xian1 == "")
        {
            ScriptHelper.SetAlert(Page, "请选择开户行地址!");
            return;
        }
        string bcpccode      = DAL.CommonDataDAL.GetCPCCode(Country1, Province1, City1, Xian1);
        string bankcode      = DdlBank.SelectedValue;
        string bankbrachname = txtbankbrachname.Text.Trim();
        string bankcard      = Encryption.Encryption.GetEncryptionCard(labkahao.Text.Trim());
        string bankaddress   = "";

        #endregion

        BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("Memberinfo", "ltrim(rtrim(number))");
        cl_h_info.AddRecord(Session["Member"].ToString());
        MemberInfoModifyBll mf = new MemberInfoModifyBll();
        if (mf.updateMember(Session["Member"].ToString(), name, Petname, Birthday, sex, HomeTele, OfficeTele, MobileTele, FaxTele, Country, Province, City, Address, PostalCode, PaperType, PaperNumber, Remark, photopath, photoW, photoH, CPCCode, bcpccode, bankaddress, bankcard, bankcode, bankbrachname))
        {
            cl_h_info.AddRecord(Session["Member"].ToString());
            cl_h_info.ModifiedIntoLogs(BLL.CommonClass.ChangeCategory.member3, Session["Member"].ToString(), BLL.CommonClass.ENUM_USERTYPE.objecttype5);
            //ScriptHelper.SetAlert(Page,"修改成功!!!");
            Page.ClientScript.RegisterStartupScript(GetType(), null, "<script language='javascript'>alert('" + GetTran("000222", "修改成功!") + "');</script>", false);
        }
        else
        {
            //ScriptHelper.SetAlert(Page, "修改失败!!!");
            Page.ClientScript.RegisterStartupScript(GetType(), null, "<script language='javascript'>alert('" + GetTran("000225", "修改失败!") + "');</script>", false);
        }
        GetOldMemberData(Session["Member"].ToString());
    }
Example #5
0
    protected void btnOk_Click(object sender, EventArgs e)
    {
        string number       = this.labBh.Text;
        string placement    = SearchPlacement_DoubleLines1.Placement;
        string direct       = DisposeString.DisString(this.txtDirect.Text, "'", "").Trim();
        string oldplacement = ViewState["placement"].ToString();
        string olddirect    = ViewState["direct"].ToString();
        string storeid      = ViewState["storeid"].ToString();

        if (placement == "" || direct == "")
        {
            lblmessage.Text = GetTran("000716", "推荐编号或安置编号都不能为空!");
            return;
        }
        if (ChangeTeamBLL.CheckNum(direct))
        {
            lblmessage.Text = GetTran("000717", "推荐编号不存在!");
            return;
        }
        if (ChangeTeamBLL.CheckNum(placement))
        {
            lblmessage.Text = GetTran("000718", "安置编号不存在!");
            return;
        }
        string topMemberId = BLL.CommonClass.CommonDataBLL.getManageID(3);
        int    district    = Convert.ToInt32(ViewState["district"]);;

        if (placement != topMemberId)
        {
            int flag_xiou = ChangeTeamBLL.GetPlacementCount(placement, number);
            if (flag_xiou >= 2)
            {
                ScriptHelper.SetAlert(Page, GetTran("000000", "此安置编号下已经安置了两个人!"));
                return;
            }
            if (DBHelper.ExecuteScalar("select count(0) from memberinfo where placement='" + placement + "' and District=" + direct + "").ToString() != "0")
            {
                district = AddOrderDataDAL.GetDistrict(placement, 1);
                if (district == 1)
                {
                    if (DBHelper.ExecuteScalar("select count(0) from memberinfo where placement='" + placement + "' and District=2").ToString() != "0")
                    {
                        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("000000", "安置人所选区位已有人安置!") + "');</script>", false);
                        return;
                    }
                }
                else if (district == 2)
                {
                    if (DBHelper.ExecuteScalar("select count(0) from memberinfo where placement='" + placement + "' and District=1").ToString() != "0")
                    {
                        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("000000", "安置人所选区位已有人安置!") + "');</script>", false);
                        return;
                    }
                }
                else
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("000000", "安置人所选区位已有人安置!") + "');</script>", false);
                    return;
                }
            }


            RegistermemberBLL registermemberBLL = new RegistermemberBLL();
            string            CheckMember       = registermemberBLL.CheckMemberInProc(number, placement, direct, storeid);
            CheckMember = new GroupRegisterBLL().GerCheckErrorInfo(CheckMember);

            if (CheckMember != null)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + CheckMember + "');</script>", false);
                return;
            }

            string p_info = registermemberBLL.GetHavePlacedOrDriect(number, "", placement, direct);
            if (p_info != null)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + p_info + "');</script>", false);
                return;
            }

            //判断该编号是否有安置,推荐
            string GetError = registermemberBLL.GetError(direct, placement);
            if (GetError != null)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetError + "');</script>", false);

                return;
            }
            string GetError1 = new AjaxClass().CheckNumberNetAn(direct, placement);
            if (GetError1 != null && GetError1 != "")
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("005986", "安置编号必须在推荐编号的安置网络下面!") + "');</script>", false);
                return;
            }

            #region 安置推荐人必须要激活

            if (Convert.ToInt32(DAL.DBHelper.ExecuteScalar("select COUNT(0) from MemberInfo where MemberState=1 and Number='" + direct + "'")) == 0)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("000000", "招商编号未激活!") + "');</script>", false);
                return;
            }
            if (Convert.ToInt32(DAL.DBHelper.ExecuteScalar("select COUNT(0) from MemberInfo where MemberState=1 and Number='" + placement + "'")) == 0)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("000000", "互助编号未激活!") + "');</script>", false);
                return;
            }

            #endregion
        }

        bool ispass = false;
        if (ViewState["placement"].ToString() != placement || ViewState["direct"].ToString() != direct)
        {
            Application.Lock();
            string msg = ChangeTeamBLL.UpdateNet(number, placement, direct, oldplacement, olddirect, district, ChangeTeamBLL.GetFlag(number), out ispass);
            Application.UnLock();

            ScriptHelper.SetAlert(Page, msg);
        }
        else
        {
            ScriptHelper.SetAlert(Page, this.GetTran("000000", "推荐、安置人编号未变化!"));
        }
    }
Example #6
0
    /// <summary>
    /// 控件翻译方法
    /// </summary>
    //public void Translate()
    //{
    //    this.TranControls(this.dplCardType, new string[][] {
    //     new string[] { "005898", "无" },
    //     new string[] { "005776", "身份证" },
    //     new string[] { "005775", "护照" },
    //     new string[] { "005774", "港澳台证" },

    //    });
    //}

    /// <summary>
    /// 注册报单流程(包括判断)
    /// 调用逻辑层中的所有方法
    /// </summary>
    public void AddOrderAndInfoProcess()
    {
        string number = CommonDataBLL.quanjiao(HFNumber.Value.Trim());
        string direct = txtDirect.Text.Trim();

        //会员名是否小于6位
        if (!registermemberBLL.NumberLength(number))
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("000306", "抱歉!您输入的会员编号小于6位!") + "');</script>", false);
            return;
        }
        if (!registermemberBLL.NumberCheckAgain(number))
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("000309", "编号请输入字母,数字,横线!") + "');</script>", false);
            return;
        }

        string name = CommonDataBLL.quanjiao(txtName.Text.Trim());

        if (name == "")
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("008360", "真实姓名不能为空") + "!" + "');</script>", false);
            return;
        }
        string tel = CommonDataBLL.quanjiao(txtTele.Text.Trim());

        if (tel == "" || tel.Length != 11)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('手机号格式不正确!');</script>", false);
            return;
        }

        //string storeid = CommonDataBLL.quanjiao(txtStore.Text.Trim());
        //if (storeid == "")
        //{
        //    ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("008361", "所属店铺不能为空") + "!" + "');</script>", false);
        //    return;
        //}
        //else
        //{
        //    if (!StoreInfoDAL.CheckStoreId(storeid))
        //    {
        //        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("008362", "所属店铺编号不存在!") + "');</script>", false);
        //        return;
        //    }
        //}

        //判断用胡地址是否输入
        if (this.CountryCity2.Country == "请选择" || this.CountryCity2.Province == "请选择" || this.CountryCity2.City == "请选择" || this.CountryCity2.Xian == "请选择" || this.CountryCity2.Country == "" || this.CountryCity2.Province == "" || this.CountryCity2.City == "" || this.CountryCity2.Xian == "")
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("001548", "对不起,请选择国家省份城市!") + "');</script>", false);
            return;
        }
        if (DAL.CommonDataDAL.GetCPCCode(this.CountryCity2.Country, this.CountryCity2.Province, this.CountryCity2.City, this.CountryCity2.Xian) == "")
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("001548", "对不起,请选择国家省份城市!") + "');</script>", false);
            return;
        }

        //string direct = CommonDataBLL.quanjiao(txtDirect.Text.Trim());

        string placement = hidplacemnet.Value;// CommonDataBLL.quanjiao(SearchPlacement_DoubleLines1.Placement);

        //if (direct == "" || placement == "")
        //{
        //    ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("000716", "推荐编号和安置编号不能为空!") + "');</script>", false);
        //    return;
        //}

        //if (direct == number)
        //{
        //    ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("006700", "推荐编号不能与会员编号相同") + "');</script>", false);
        //    return;
        //}

        if (placement == number)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("001650", "安置编号不能与会员编号相同") + "');</script>", false);
            return;
        }

        //验证年龄是否大于18岁
        //string birthDate = CommonDataBLL.quanjiao(txtBirthDate.Text.Trim());
        //if (this.dplCardType.SelectedValue != "2")
        //{
        //    string alert = registermemberBLL.AgeIs18(birthDate);
        //    if (alert != null)
        //    {
        //        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + alert + "');</script>", false);
        //        return;
        //    }
        //}

        ////检查会员生日
        //if (this.dplCardType.SelectedValue != "2")
        //{
        //    if (registermemberBLL.CheckBirthDay(birthDate) == "error")
        //    {
        //        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("000148", "对不起,请选择正确的出生日期!") + "');</script>", false);
        //        return;
        //    }
        //}


        ////检测身份证需要新方法
        //string CardResult = "";
        //if (this.dplCardType.SelectedValue == "2")
        //{
        //    string papernumber = CommonDataBLL.quanjiao(this.txtPapernumber.Text.Trim());
        //    string result = BLL.Registration_declarations.CheckMemberInfo.CHK_IdentityCard(papernumber);
        //    if (result.IndexOf(",") <= 0)
        //    {

        //        return;
        //    }
        //    else
        //    {
        //        CardResult = result;
        //    }
        //    DateTime birthday = Convert.ToDateTime(CardResult.Substring(0, CardResult.IndexOf(",")));
        //    string alerta = registermemberBLL.AgeIs18(birthday.ToString());
        //    if (alerta != null)
        //    {
        //        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + alerta + "');</script>", false);
        //        return;
        //    }
        //}

        //ViewState["CardResult"] = CardResult;
        //验证会员编号是否重复
        if (registermemberBLL.CheckNumberTwice(number) != null)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("000406", "抱歉!该会员编号重复!") + "');</script>", false);
            if (Request.QueryString["Much"] == null)
            {
                string bb = BLL.CommonClass.CommonDataBLL.GetMemberNumber();
                this.txtNumber.Text     = bb;
                this.HFNumber.Value     = bb;
                this.txtNumber.ReadOnly = true;
            }
            return;
        }
        //验证手机号码是否重复
        if (registermemberBLL.CheckTeleTwice(txtTele.Text.Trim()) != null)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('抱歉!该手机号码已被注册!');</script>", false);
            return;
        }


        MemberInfoModel mi = AddUserInfo();

        if (mi.Placement != "8888888888")
        {
            if (DBHelper.ExecuteScalar("select count(0) from memberinfo where placement='" + mi.Placement + "' and District=" + mi.District + "  and  memberstate=1 ").ToString() != "0")
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("007433", "安置人所选区位已有人安置!") + "');</script>", false);
                return;
            }
        }



        //注册会员检错1.无上级  2.无此店  3..死循环
        string CheckMember = registermemberBLL.CheckMemberInProc(mi.Number, mi.Placement, mi.Direct, mi.StoreID);

        CheckMember        = new GroupRegisterBLL().GerCheckErrorInfo(CheckMember);
        ViewState["Error"] = CheckMember;
        if (Request.QueryString["Much"] == null)
        {
            if (CheckMember != null)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + CheckMember + "');</script>", false);
                return;
            }

            string placement_check = registermemberBLL.GetHavePlacedOrDriect(mi.Number, "", mi.Placement, mi.Direct);
            if (placement_check != null)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + placement_check + "');</script>", false);
                return;
            }



            //判断该编号是否有安置,推荐
            string GetError = registermemberBLL.GetError(mi.Direct, mi.Placement);
            if (GetError != null)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetError + "');</script>", false);

                return;
            }
            string GetError1 = new AjaxClass().CheckNumberNetAn(direct, placement);
            if (GetError1 != null && GetError1 != "")
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("005986", "安置编号必须在推荐编号的安置网络下面!") + "');</script>", false);
                return;
            }
            string GetError2 = new AjaxClass().CheckNumberNetAn(Session["Member"].ToString(), direct);
            if (GetError2 != null && GetError2 != "")
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("000000", "推荐编号必须在自己的安置网络下面!") + "');</script>", false);
                return;
            }


            #region 安置推荐人必须要激活


            if (Convert.ToInt32(DAL.DBHelper.ExecuteScalar("select COUNT(0) from MemberInfo where   MemberState=0 and Number='" + CommonDataBLL.quanjiao(Session["Member"].ToString()) + "'")) != 0)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("000000", "推荐编号未激活!") + "');</script>", false);
                return;
            }

            if (Convert.ToInt32(DAL.DBHelper.ExecuteScalar("select COUNT(0) from MemberInfo where   MemberState=2 and Number='" + CommonDataBLL.quanjiao(Session["Member"].ToString()) + "'")) != 0)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("009090", "推荐编号已注销!") + "');</script>", false);
                return;
            }
            if (Convert.ToInt32(DAL.DBHelper.ExecuteScalar("select COUNT(0) from MemberInfo where MemberState=0 and Number='" + CommonDataBLL.quanjiao(hidplacemnet.Value) + "'")) != 0)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("000000", "安置编号未激活!") + "');</script>", false);
                return;
            }
            if (Convert.ToInt32(DAL.DBHelper.ExecuteScalar("select COUNT(0) from MemberInfo where MemberState=2 and Number='" + CommonDataBLL.quanjiao(hidplacemnet.Value) + "'")) != 0)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("009107", "安置编号已注销!") + "');</script>", false);
                return;
            }

            #endregion

            //int placementXuHao = registermemberBLL.GetXuHao(mi.Direct);
            //if (placementXuHao >= 0)
            //{

            //    string GetError1 = new AjaxClass().CheckNumberNetAn(txtDirect.Text.Trim(), SearchPlacement_DoubleLines1.Placement);
            //    if (GetError1 != null && GetError1 != "")
            //    {
            //        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("005986", "安置编号必须在推荐编号的安置网络下面!") + "');</script>", false);
            //        return;
            //    }
            //}

            //如果是零购注册,判断推荐人和安置人的注册期数是否合格
            //if (Session["Company"] != null)
            //{
            //    int tjExpectNum = registermemberBLL.GetError2(this.Txttj.Text.Trim());
            //    if (tjExpectNum > Convert.ToInt32(this.ddlQishu.SelectedValue))
            //    {
            //        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("006013", "推荐人的注册期数必须大于") + this.ddlQishu.SelectedValue + "!');</script>", false);
            //        return;
            //    }

            //    int anExpectNum = registermemberBLL.GetError2(SearchPlacement_DoubleLines1.Placement.Trim());
            //    if (anExpectNum > Convert.ToInt32(this.ddlQishu.SelectedValue))
            //    {
            //        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("006014", "安置人的注册期数必须大于") + this.ddlQishu.SelectedValue + "!');</script>", false);
            //        return;
            //    }
            //}
        }

        mi.PhotoPath = "";


        if (Session["UserType"] != null && Session["UserType"].ToString() == "1") //公司注册
        {
            mi.OrderType       = 31;
            Session["LUOrder"] = mi.Number + ",31,1";
        }
        else if (Session["UserType"] != null && Session["UserType"].ToString() == "2") //店铺注册
        {
            mi.OrderType       = 11;
            Session["LUOrder"] = mi.Number + ",11,2";
        }
        else if (Session["UserType"] != null && Session["UserType"].ToString() == "3") //会员注册
        {
            mi.OrderType       = 21;
            Session["LUOrder"] = mi.Number + ",21,3";
            mi.Assister        = Session["Member"].ToString();
        }
        else //默认店铺注册
        {
            mi.OrderType       = 11;
            Session["LUOrder"] = mi.Number + ",11,2";
        }

        Session["mbreginfo"] = mi;

        if (Session["mbreginfo"] != null)
        {
            decimal   totalmoeny = 0.00M;
            decimal   bili       = 0.00M;
            DataTable dts        = DAL.DBHelper.ExecuteDataTable("select top 1 * from config order by createdate desc");
            if (dts.Rows != null && dts.Rows.Count > 0)
            {
                decimal htm = Convert.ToDecimal(hidtzmoney.Value);
                if (htm == Convert.ToDecimal(dts.Rows[0]["para1"]))
                {
                    bili = Convert.ToDecimal(dts.Rows[0]["para4"]);
                }
                if (htm == Convert.ToDecimal(dts.Rows[0]["para2"]))
                {
                    bili = Convert.ToDecimal(dts.Rows[0]["para5"]);
                }
                if (htm == Convert.ToDecimal(dts.Rows[0]["para3"]))
                {
                    bili = Convert.ToDecimal(dts.Rows[0]["para6"]);
                }
            }
            OrderFinalModel ofm      = new OrderFinalModel();
            var             dayPrice = CommonDataBLL.GetMaxDayPrice();

            totalmoeny = Convert.ToDecimal(hidtzmoney.Value);;                       //投资金额
            var value = Convert.ToDecimal(totalmoeny) / Convert.ToDecimal(dayPrice); //投资金额换化石斛积分

            var expect = CommonDataBLL.getMaxqishu();



            ofm.InvestJB  = Convert.ToDecimal(value * bili); //投资石斛积分数量
            ofm.PriceJB   = Convert.ToDecimal(dayPrice);     //石斛积分当前市价
            ofm.SendWay   = 1;
            ofm.Number    = mi.Number;
            ofm.Placement = mi.Placement;
            ofm.Direct    = mi.Direct;
            ofm.ExpectNum = expect;
            ofm.OrderID   = registermemberBLL.GetOrderInfo("add", null);
            ofm.StoreID   = mi.StoreID;
            ofm.Name      = mi.Name;
            ofm.PetName   = mi.PetName;
            ofm.LoginPass = mi.LoginPass;
            ofm.AdvPass   = mi.AdvPass;
            ofm.LevelInt  = mi.LevelInt;

            ofm.RegisterDate            = mi.RegisterDate;
            ofm.Birthday                = mi.Birthday;
            ofm.Sex                     = mi.Sex;
            ofm.HomeTele                = mi.HomeTele;
            ofm.OfficeTele              = mi.OfficeTele;
            ofm.MobileTele              = mi.MobileTele;
            ofm.FaxTele                 = mi.FaxTele;
            ofm.CPCCode                 = mi.CPCCode;
            ofm.Address                 = mi.Address;
            ofm.PostalCode              = mi.PostalCode;
            ofm.PaperType.PaperTypeCode = mi.PaperType.PaperTypeCode;
            ofm.PaperNumber             = mi.PaperNumber;
            ofm.BankCode                = mi.BankCode;
            ofm.BankAddress             = mi.BankAddress;
            ofm.BankCard                = mi.BankCard;
            ofm.BCPCCode                = mi.BCPCCode;
            ofm.BankBook                = mi.BankBook;
            ofm.Remark                  = mi.Remark;
            ofm.ChangeInfo              = mi.ChangeInfo;
            ofm.PhotoPath               = mi.PhotoPath;
            ofm.Email                   = mi.Email;
            ofm.IsBatch                 = mi.IsBatch;
            ofm.Language                = mi.Language;
            ofm.OperateIp               = mi.OperateIp;
            ofm.OperaterNum             = mi.OperaterNum;
            ofm.Answer                  = mi.Answer;
            ofm.Question                = mi.Question;
            ofm.Error                   = mi.Error;
            ofm.Bankbranchname          = mi.Bankbranchname;
            ofm.Flag                    = mi.Flag;
            ofm.Assister                = mi.Assister;
            ofm.District                = mi.District;

            ofm.Type = Convert.ToInt32(rbltotaltype.SelectedValue);

            ofm.TotalMoney            = Convert.ToDecimal(totalmoeny);
            ofm.TotalPv               = Convert.ToDecimal(value);//投资金额兑换成石斛
            ofm.OrderType             = mi.OrderType;
            ofm.OrderExpect           = expect;
            ofm.StandardcurrencyMoney = ofm.TotalMoney;
            ofm.PaymentMoney          = ofm.TotalMoney;
            ofm.OrderDate             = DateTime.UtcNow;
            ofm.RemittancesId         = "";
            ofm.ElectronicaccountId   = "";



            ofm.ConCity.Country  = "";
            ofm.ConCity.Province = "";
            ofm.ConCity.City     = "";
            ofm.ConCity.Xian     = "";
            ofm.ConAddress       = mi.Address;
            ofm.CCPCCode         = mi.CPCCode;



            ofm.ConTelPhone   = mi.MobileTele;
            ofm.ConMobilPhone = mi.MobileTele;
            ofm.CarryMoney    = 0;
            ofm.ConPost       = mi.Email;
            ofm.Consignee     = mi.PetName;
            ofm.ConZipCode    = mi.PostalCode;

            ofm.ProductIDList        = "";
            ofm.QuantityList         = "";
            ofm.NotEnoughProductList = "";
            ofm.PhotoPath            = "";
            Boolean flag = new AddOrderDataDAL().AddFinalOrder(ofm);
            if (flag)
            {
                // ClientScript.RegisterStartupScript(this.GetType(), "", "<script>$('#tiaoz').show();document.getElementById('tiaoz').href = '../payserver/chosepaysjpay.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID.ToString(), 1, 1) + "'; alertt('注册订单已生成,请及时支付!');</script>", false);
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>location.href = '../payserver/chosepaysjpay.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID.ToString(), 1, 1) + "'; </script>", false);
            }
        }
        else
        {
            Response.Redirect("registermember.aspx");
        }
    }