protected void Page_Load(object sender, EventArgs e)
 {
     if (SiteConfig.SiteOption.RegManager != 1)
     {
         function.WriteErrMsg("未开启管理员申请功能");
     }
     if (!IsPostBack)
     {
         IPCity cityMod = IPScaner.FindCity(IPScaner.GetUserIP());
         if (cityMod.IsValid)
         {
             function.Script(this, "pcc.SetDef('" + cityMod.Province + "','" + cityMod.City + "','" + cityMod.County + "');");
         }
         function.Script(this, "pcc.ProvinceInit();");
     }
 }
Exemple #2
0
        public VM_Register()
        {
            //根据IP,分析出地址,并填充
            cityMod = IPScaner.FindCity(IPScaner.GetUserIP());//"59.52.159.79"
            //
            //html_must = fieldBll.InputallHtml(0, 0, new ModelConfig()
            //{
            //    Source = ModelConfig.SType.UserRegister,
            //    Fields = SiteConfig.UserConfig.RegFieldsMustFill
            //});
            //html_select = fieldBll.InputallHtml(0, 0, new ModelConfig()
            //{
            //    Source = ModelConfig.SType.UserRegister,
            //    Fields = SiteConfig.UserConfig.RegFieldsSelectFill
            //});
            //1,添加字段2,用户参数--将其加入必填或选填字段3,输出给前端使用
            string selectFields = SiteConfig.UserConfig.RegFieldsSelectFill, mustFields = SiteConfig.UserConfig.RegFieldsMustFill;

            if (!string.IsNullOrEmpty(selectFields) || !string.IsNullOrEmpty(mustFields))
            {
                fieldDT = SqlHelper.ExecuteTable("SELECT *,ModelID=0,IsShow='True',IsSearchForm='False',IsView=1,IsDownField=0 FROM ZL_UserBaseField");
                if (!string.IsNullOrEmpty(selectFields))
                {
                    fieldDT.DefaultView.RowFilter = "FieldName IN (" + WrapFields(selectFields) + ")";
                    selectDT = fieldDT.DefaultView.ToTable();
                }
                if (!string.IsNullOrEmpty(mustFields))
                {
                    fieldDT.DefaultView.RowFilter = "FieldName IN (" + WrapFields(mustFields) + ")";
                    mustDT = fieldDT.DefaultView.ToTable();
                }
            }
            //----------------------------------------------
            groupDT = gpBll.GetSelGroup();
            int    puid   = DataConvert.CLng(Request.QueryString["ParentUserID"]);
            string puname = DataConvert.CStr(Request.QueryString["ParentUser"]);

            if (puid > 0)
            {
                pmu = buser.SelReturnModel(puid);
            }
            else if (!string.IsNullOrEmpty(puname))
            {
                pmu = buser.GetUserIDByUserName(puname);
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         //BindDP();
         M_UserInfo mu = buser.GetLogin();
         if (Mid > 0)
         {
             M_UserRecei model = receBll.GetSelect(Mid, mu.UserID);
             if (model == null)
             {
                 function.WriteErrMsg("修改的地址不存在");
             }
             ZipCode_T.Text = model.Zipcode;
             //省市县
             Street_T.Text    = model.Street;
             ReceName_T.Text  = model.ReceivName;
             MobileNum_T.Text = model.MobileNum;
             pro_hid.Value    = model.Provinces;
             Def_chk.Checked  = model.isDefault == 1 ? true : false;
             if (model.phone.Split('-').Length > 1)
             {
                 Area_T.Text  = model.phone.Split('-')[0];
                 Phone_T.Text = model.phone.Split('-')[1];
             }
             rUrl = Request.QueryString["ReturnUrl"];
         }
         else
         {
             IPCity cityMod = IPScaner.FindCity(IPScaner.GetUserIP());//"59.52.159.79"
             if (cityMod.IsValid)
             {
                 function.Script(this, "pcc.SetDef('" + cityMod.Province + "','" + cityMod.City + "','" + cityMod.County + "');");
             }
         }
         //用户没有其它地址时自动开启默认
         DataTable addressDT = receBll.SelByUID(mu.UserID);
         if (addressDT == null || addressDT.Rows.Count < 1)
         {
             Def_chk.Checked = true;
         }
     }
 }