Example #1
0
 /// <summary>
 /// 发货方式改变,地址也改变
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void DDLSendType_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (lblOdType.Text == GetTran("004008", "注册报单"))
     {
         int selV = int.Parse(this.DDLSendType.SelectedValue);
         if (selV == 0)//公司发货给店铺
         {
             string    sql      = "select cpccode,storeaddress from storeinfo where storeid='" + mim.StoreID + "'";
             DataTable dt_Store = DAL.DBHelper.ExecuteDataTable(sql);
             if (dt_Store.Rows.Count > 0)
             {
                 CountryCity2.SetCityCode(dt_Store.Rows[0][0].ToString());//将注册的地址设置为默认的
                 Txtdz.Text = dt_Store.Rows[0][1].ToString();
             }
         }
         else //公司发货给会员
         {
             if (mim != null)
             {
                 CountryCity2.SetCityCode(mim.CPCCode);//将注册的地址设置为默认的
                 Txtdz.Text = mim.Address;
             }
         }
     }
     else
     {
         int selV = int.Parse(this.DDLSendType.SelectedValue);
         if (selV == 0)//公司发货给店铺
         {
             if (Session["Member"] != null)
             {
                 string    sql      = "select scpccode,storeaddress from storeinfo si left join memberinfo mi on si.storeid=mi.storeid where mi.number='" + luo.MemBh + "'";
                 DataTable dt_Store = DAL.DBHelper.ExecuteDataTable(sql);
                 if (dt_Store.Rows.Count > 0)
                 {
                     CountryCity2.SetCityCode(dt_Store.Rows[0][0].ToString());//将注册的地址设置为默认的
                     Txtdz.Text = dt_Store.Rows[0][1].ToString();
                 }
             }
         }
         else //公司发货给会员
         {
             if (Session["Member"] != null)
             {
                 string    sql       = "select cpccode,address from memberinfo where number='" + luo.MemBh + "'";
                 DataTable dt_Member = DAL.DBHelper.ExecuteDataTable(sql);
                 if (dt_Member.Rows.Count > 0)
                 {
                     CountryCity2.SetCityCode(dt_Member.Rows[0][0].ToString());//将注册的地址设置为默认的
                     Txtdz.Text = dt_Member.Rows[0][1].ToString();
                 }
             }
         }
     }
 }
Example #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //获取标准币种
        bzCurrency = CommonDataBLL.GetStandard();
        i          = (AjaxClass.GetCurrency(Convert.ToInt32(bzCurrency), Convert.ToInt32(Session["Default_Currency"].ToString())));
        Permissions.ThreeRedirect(Page, "../member/" + Permissions.redirUrl);
        luo.SetVlaue();
        AjaxPro.Utility.RegisterTypeForAjax(typeof(AjaxMemShopCart));
        AjaxPro.Utility.RegisterTypeForAjax(typeof(AjaxClass));

        Translations();

        if (!IsPostBack)
        {
            BindRadioType();

            if (Session["mbreginfo"] != null)
            {
                mim = (MemberInfoModel)Session["mbreginfo"];
            }
            if (Session["UserType"] != null && Session["UserType"].ToString() != "3" && Session["EditOrderID"] == null)
            {
                top.Visible          = false;
                bottom.Visible       = false;
                STop1.Visible        = false;
                SLeft1.Visible       = false;
                txtMemBh.Visible     = true;
                lblMemBh.Style.Value = "display:none;";
            }
            else
            {
                if (Session["UserType"].ToString() == "2")
                {
                    top.Visible    = false;
                    bottom.Visible = false;
                    STop1.Visible  = true;
                    SLeft1.Visible = true;
                }
                else
                {
                    top.Visible    = false;
                    bottom.Visible = false;
                    STop1.Visible  = false;
                    SLeft1.Visible = false;
                }

                txtMemBh.Style.Value = "display:none;";
                lblMemBh.Style.Value = "display:block;";

                txtMemBh.Text = luo.MemBh;
                lblMemBh.Text = luo.MemBh;
            }

            BindData();

            //不是注册过来的新会员
            if (Session["mbreginfo"] == null)
            {
                if ((Session["UserType"] != null && Session["UserType"].ToString() == "3") || Session["EditOrderID"] != null)
                {
                    top.Visible    = true;
                    bottom.Visible = true;
                    STop1.Visible  = false;
                    SLeft1.Visible = false;


                    Txtyddh.Visible = false;
                    txtName.Visible = false;

                    //不是注册过来的,就进行名称和邮编的查询
                    DataTable dt = DAL.DBHelper.ExecuteDataTable("select name,postalcode,mobiletele,cpccode,address,storeid from memberinfo where number='" + luo.MemBh + "'");
                    if (dt != null && dt.Rows.Count > 0)
                    {
                        this.txtName.Text = Encryption.Encryption.GetDecipherName(dt.Rows[0]["Name"].ToString());
                        this.labName.Text = Encryption.Encryption.GetDecipherName(dt.Rows[0]["Name"].ToString());
                        if (dt.Rows[0]["postalcode"].ToString() != "")
                        {
                            this.txtPostCode.Text = dt.Rows[0]["postalcode"].ToString();
                            this.labPostCode.Text = dt.Rows[0]["postalcode"].ToString();
                        }
                        else
                        {
                            this.txtPostCode.Text = "111111";
                            this.labPostCode.Text = "111111";
                        }
                        this.Txtyddh.Text = dt.Rows[0]["mobiletele"].ToString();
                        this.labyddh.Text = dt.Rows[0]["mobiletele"].ToString();
                    }
                    GetBindAddress();
                }
                else
                {
                    if (Session["UserType"].ToString() == "2")
                    {
                        top.Visible    = false;
                        bottom.Visible = false;
                        STop1.Visible  = true;
                        SLeft1.Visible = true;
                    }
                    else
                    {
                        top.Visible    = true;
                        bottom.Visible = true;
                        STop1.Visible  = false;
                        SLeft1.Visible = false;
                    }


                    this.rbtAddress.Items.Add(GetTran("000200", "新地址"));

                    this.rbtAddress.SelectedIndex = 0;
                    txtName.Enabled = false;
                    Txtyddh.Enabled = false;
                }
            }
            else
            {
                if (Session["UserType"] != null && Session["UserType"].ToString() != "3" && Session["EditOrderID"] == null)
                {
                    top.Visible          = false;
                    bottom.Visible       = false;
                    STop1.Visible        = false;
                    SLeft1.Visible       = false;
                    txtMemBh.Visible     = true;
                    lblMemBh.Style.Value = "display:none;";
                }
                else
                {
                    if (Session["UserType"].ToString() == "2")
                    {
                        top.Visible    = false;
                        bottom.Visible = false;
                        STop1.Visible  = true;
                        SLeft1.Visible = true;
                    }
                    else
                    {
                        top.Visible    = false;
                        bottom.Visible = false;
                        STop1.Visible  = false;
                        SLeft1.Visible = false;
                    }
                }
                //邮编和姓名默认赋值进去
                MemberInfoModel mi = (MemberInfoModel)Session["mbreginfo"];
                mim = mi;

                txtMemBh.Style.Value = "display:none;";
                lblMemBh.Style.Value = "display:block;";
                txtMemBh.Text        = mi.Number;
                lblMemBh.Text        = mi.Number;

                this.txtName.Text     = Encryption.Encryption.GetDecipherName(mi.Name);
                this.labName.Text     = Encryption.Encryption.GetDecipherName(mi.Name);
                this.txtPostCode.Text = mi.PostalCode;
                this.labPostCode.Text = mi.PostalCode;
                if (mi.PostalCode.Length == 0)
                {
                    this.labPostCode.Text = "111111";
                    this.txtPostCode.Text = "111111";
                }
                this.Txtyddh.Text = mi.MobileTele;
                this.labyddh.Text = mi.MobileTele;

                txtConName.Text    = Encryption.Encryption.GetDecipherName(mi.Name);
                txtOtherPhone.Text = mi.MobileTele;
                this.txtName.Attributes.Add("style", "display:none;");
                this.txtPostCode.Attributes.Add("style", "display:none;");
                this.Txtyddh.Attributes.Add("style", "display:none;");
                if (mi.CPCCode.Trim().Length > 0)
                {
                    CountryCity2.SetCityCode(mi.CPCCode);//将注册的地址设置为默认的
                }
                Txtdz.Text = mi.Address;
                GetBindAddress();
            }
            p_content2.Style.Add("display", "none");
        }
    }