예제 #1
0
        private void PageInit()
        {
            ddl_counties.DataSource     = bll.GetList(0);
            ddl_counties.DataValueField = "Id";
            ddl_counties.DataTextField  = "AreaName";
            ddl_counties.DataBind();
            ddl_counties.Items.Insert(0, new ListItem("-请选择-", ""));

            if (action.Equals("edit"))
            {
                btnAdd.Visible    = false;
                btnMoidfy.Visible = true;

                Area item = bll.GetItem(pid);
                ddl_counties.SelectedValue = item.Pid.ToString();
                StreetInit(item.Pid.ToString(), item.Id.ToString());

                Area item2 = bll.GetItem(Id);
                txtDistrict.Value = item2.AreaName;
                txtKey.Value      = item2.AreaKey;
            }
            else
            {
                ddl_counties.SelectedValue = pid.ToString();
                StreetInit(pid.ToString(), Id.ToString());
            }
        }
예제 #2
0
        protected int GetPidById(object sid)
        {
            Area item = abll.GetItem(Convert.ToInt32(sid));

            return(item.Pid);
        }