Exemple #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         PubFunction.BindSysAreaMobile(this.sltProvince, 0);
         if (this.Session["MemID"] != null)
         {
             int MemID = int.Parse(this.Session["MemID"].ToString());
             this.BindMemInfo(MemID);
             this.txtMemID.Value = MemID.ToString();
         }
         else
         {
             base.Response.Redirect("login.aspx");
         }
     }
 }
Exemple #2
0
        private void BindMemInfo(int MemID)
        {
            Chain.Model.Mem modelMem = new Chain.BLL.Mem().GetModel(MemID);
            this.memname.Value = modelMem.MemName;
            this.mobile.Value  = modelMem.MemMobile;
            this.boy.Attributes.Remove("class");
            this.girl.Attributes.Remove("class");
            if (modelMem.MemSex)
            {
                this.boy.Attributes.Add("class", "line_btn active");
                this.girl.Attributes.Add("class", "line_btn");
            }
            else
            {
                this.girl.Attributes.Add("class", "line_btn active");
                this.boy.Attributes.Add("class", "line_btn");
            }
            if (modelMem.MemPhoto != null && modelMem.MemPhoto != "")
            {
                this.imgShow.Src = modelMem.MemPhoto.ToString();
            }
            else
            {
                this.imgShow.Src = "images/headimg.jpg";
            }
            string identity = modelMem.MemIdentityCard;

            this.identityCard.Value = modelMem.MemIdentityCard;
            this.email.Value        = modelMem.MemEmail;
            string birth = "";

            if (identity.Length == 18)
            {
                birth = string.Concat(new string[]
                {
                    identity.Substring(6, 4),
                    "-",
                    identity.Substring(10, 2),
                    "-",
                    identity.Substring(12, 2)
                });
            }
            this.birthday.InnerHtml = birth;
            PubFunction.BindSysAreaMobile(this.sltProvince, 0);
            if (modelMem.MemProvince != "")
            {
                this.sltProvince.Value = modelMem.MemProvince;
                if (this.sltProvince.Value != "" && this.sltProvince.Value != "请选择")
                {
                    PubFunction.BindSysAreaMobile(this.sltCity, int.Parse(this.sltProvince.Value));
                }
                if (modelMem.MemCity != "")
                {
                    this.sltCity.Value = modelMem.MemCity;
                }
                if (this.sltCity.Value != "" && this.sltCity.Value != "请选择")
                {
                    PubFunction.BindSysAreaMobile(this.sltCounty, int.Parse(this.sltCity.Value));
                }
                if (modelMem.MemCounty != "")
                {
                    this.sltCounty.Value = modelMem.MemCounty;
                }
                if (this.sltCounty.Value != "" && this.sltCounty.Value != "请选择")
                {
                    PubFunction.BindSysAreaMobile(this.sltVillage, int.Parse(this.sltCounty.Value));
                }
                if (modelMem.MemVillage != "")
                {
                    this.sltVillage.Value = modelMem.MemVillage;
                }
            }
            string memaddress = this.GetMemAddress(modelMem.MemProvince, modelMem.MemCity, modelMem.MemCounty, modelMem.MemVillage, modelMem.MemAddress);

            if (memaddress.Length > 14)
            {
                this.address.InnerHtml = memaddress.Substring(0, 14) + "...";
            }
            else
            {
                this.address.InnerHtml = memaddress;
            }
            this.boy.Attributes.Remove("class");
            this.boy.Attributes.Remove("girl");
            if (modelMem.MemSex)
            {
                this.boy.Attributes.Add("class", "line_btn active");
                this.girl.Attributes.Add("class", "line_btn");
            }
            else
            {
                this.girl.Attributes.Add("class", "line_btn active");
                this.boy.Attributes.Add("class", "line_btn");
            }
            this.detailAddress.Value = modelMem.MemAddress;
        }
Exemple #3
0
 private void BindMemInfo(int MemID)
 {
     Chain.BLL.Mem        bllMem     = new Chain.BLL.Mem();
     Chain.BLL.MemAddress bllAddress = new Chain.BLL.MemAddress();
     if (base.Request.QueryString["AddressID"] != null)
     {
         int       AddressID = int.Parse(base.Request.QueryString["AddressID"]);
         DataTable dt        = bllAddress.GetList(string.Concat(new object[]
         {
             " MemID=",
             MemID,
             " and ID=",
             AddressID
         })).Tables[0];
         if (dt.Rows.Count > 0)
         {
             this.txtAddressID.Value = AddressID.ToString();
             Chain.Model.MemAddress modelAddress = bllAddress.GetModel(AddressID);
             this.memname.Value       = modelAddress.MemName;
             this.mobile.Value        = modelAddress.MemMobile;
             this.detailAddress.Value = modelAddress.MemDetailAddress;
             string memaddress = this.GetMemAddress(modelAddress.MemProvince, modelAddress.MemCity, modelAddress.MemCounty, modelAddress.MemVillage, modelAddress.MemDetailAddress);
             if (memaddress.Length > 14)
             {
                 this.address.InnerHtml = memaddress.Substring(0, 14) + "...";
             }
             else
             {
                 this.address.InnerHtml = memaddress;
             }
             int IsDefault = int.Parse(dt.Rows[0]["IsDefault"].ToString());
             this.yes.Attributes.Remove("class");
             this.no.Attributes.Remove("class");
             if (IsDefault == 1)
             {
                 this.yes.Attributes.Add("class", "line_btn active");
                 this.no.Attributes.Add("class", "line_btn");
             }
             else
             {
                 this.no.Attributes.Add("class", "line_btn active");
                 this.yes.Attributes.Add("class", "line_btn");
             }
             PubFunction.BindSysAreaMobile(this.sltProvince, 0);
             if (modelAddress.MemProvince != "")
             {
                 this.sltProvince.Value = modelAddress.MemProvince;
                 if (this.sltProvince.Value != "" && this.sltProvince.Value != "请选择")
                 {
                     PubFunction.BindSysAreaMobile(this.sltCity, int.Parse(this.sltProvince.Value));
                 }
                 if (modelAddress.MemCity != "")
                 {
                     this.sltCity.Value = modelAddress.MemCity;
                 }
                 if (this.sltCity.Value != "" && this.sltCity.Value != "请选择")
                 {
                     PubFunction.BindSysAreaMobile(this.sltCounty, int.Parse(this.sltCity.Value));
                 }
                 if (modelAddress.MemCounty != "")
                 {
                     this.sltCounty.Value = modelAddress.MemCounty;
                 }
                 if (this.sltCounty.Value != "" && this.sltCounty.Value != "请选择")
                 {
                     PubFunction.BindSysAreaMobile(this.sltVillage, int.Parse(this.sltCounty.Value));
                 }
                 if (modelAddress.MemVillage != "")
                 {
                     this.sltVillage.Value = modelAddress.MemVillage;
                 }
             }
         }
     }
 }