Example #1
0
 protected void ddl_province_SelectedIndexChanged(object sender, EventArgs e)
 {
     BLL.city bll_city = new BLL.city();
     ddl_city.Items.Clear();
     DataTable dt = bll_city.GetList("ProvinceID=" + ddl_province.SelectedValue).Tables[0];
     ddl_city.Items.Add(new ListItem("请选择市...", "0"));
     foreach (DataRow dr in dt.Rows)
     {
         ddl_city.Items.Add(new ListItem(dr["CityName"].ToString(), dr["CityID"].ToString()));
     }
 }
Example #2
0
 /// <summary>
 /// 获取市名称
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public string get_city_title(int id)
 {
     BLL.city bll = new BLL.city();
     Model.city model = bll.GetModel(id);
     if (model != null)
     {
         return model.CityName;
     }
     else
     {
         return "";
     }
 }
Example #3
0
 /// <summary>
 /// 获取市列表
 /// </summary>
 /// <returns></returns>
 public DataTable get_city(string strwhere)
 {
     BLL.city bll = new BLL.city();
     return bll.GetList(strwhere).Tables[0];
 }
Example #4
0
        private void ShowInfo(int _id)
        {
            BLL.users bll = new BLL.users();
            Model.users model = bll.GetModel(_id);

            ddlGroupId.SelectedValue = model.group_id.ToString();
            rblStatus.SelectedValue = model.status.ToString();
            txtUserName.Text = model.user_name;
            txtUserName.ReadOnly = true;
            txtUserName.Attributes.Remove("ajaxurl");
            if (!string.IsNullOrEmpty(model.password))
            {
                txtPassword.Attributes["value"] = txtPassword1.Attributes["value"] = defaultpassword;
            }
            txtEmail.Text = model.email;
            txtNickName.Text = model.nick_name;
            txtAvatar.Text = model.avatar;
            rblSex.SelectedValue = model.sex;
            if (model.birthday != null)
            {
                txtBirthday.Text = model.birthday.GetValueOrDefault().ToString("yyyy-M-d");
            }

            rb_user_type.SelectedValue = model.user_type.ToString();

            txtTelphone.Text = model.telphone;
            txtMobile.Text = model.mobile;
            txtQQ.Text = model.qq;
            txtAddress.Text = model.address;
            txtAmount.Text = model.amount.ToString();
            txtPoint.Text = model.point.ToString();
            txtExp.Text = model.exp.ToString();
            lblRegTime.Text = model.reg_time.ToString();
            lblRegIP.Text = model.reg_ip.ToString();
            //查找最近登录信息
            Model.user_login_log logModel = new BLL.user_login_log().GetLastModel(model.user_name);
            if (logModel != null)
            {
                lblLastTime.Text = logModel.login_time.ToString();
                lblLastIP.Text = logModel.login_ip;
            }

            ddl_province.SelectedValue = model.province.ToString();
            ddl_city.Items.Add(new ListItem("请选择市...", "0"));
            if (Convert.ToInt32(ddl_province.SelectedValue) > 0)
            {
                BLL.city bll_city = new BLL.city();
                DataTable dt = bll_city.GetList("ProvinceID=" + ddl_province.SelectedValue).Tables[0];

                foreach (DataRow dr in dt.Rows)
                {
                    ddl_city.Items.Add(new ListItem(dr["CityName"].ToString(), dr["CityID"].ToString()));
                }
                ddl_city.SelectedValue = model.city.ToString();
            }
            ddl_district.Items.Add(new ListItem("请选择区/县...", "0"));
            if (Convert.ToInt32(ddl_city.SelectedValue) > 0)
            {
                BLL.district bll_district = new BLL.district();
                ddl_district.Items.Clear();
                DataTable dt = bll_district.GetList("CityID=" + ddl_province.SelectedValue).Tables[0];
                foreach (DataRow dr in dt.Rows)
                {
                    ddl_district.Items.Add(new ListItem(dr["DistrictName"].ToString(), dr["DistrictID"].ToString()));
                }
                ddl_district.SelectedValue = model.district.ToString();
            }
        }
Example #5
0
        private void get_city_list(HttpContext context)
        {
            int province_id = DTRequest.GetQueryInt("province_id");

            BLL.city bll = new BLL.city();
            DataTable dt = bll.GetList("ProvinceID=" + province_id).Tables[0];
            if (dt != null && dt.Rows.Count > 0)
            {
                context.Response.Write(myJson.getJson(dt));
                return;
            }
            else
            {
                context.Response.Write("Null");
                return;
            }
        }