コード例 #1
0
        private void DataBindS()
        {
            /*省级单位*/
            ddlProvince.Items.Clear();
            DataTable td = getTable.GetAllDataFromtblProvinceRegionList();

            for (int i = 0; i < td.Rows.Count; i++)
            {
                ListItem item = new ListItem();
                item.Value = td.Rows[i]["ProvinceID"].ToString();
                item.Text  = td.Rows[i]["ProvinceName_c"].ToString();
                ddlProvince.Items.Add(item);
            }
            ddlProvince.SelectedIndex = 0;
            string    ProvinceID = ddlProvince.SelectedValue;
            DataTable tdt        = getTable.GetAllDataFromtblDowntownRegionList("ProvinceId =" + ProvinceID);

            for (int i = 0; i < tdt.Rows.Count; i++)
            {
                ListItem item = new ListItem();
                item.Value = tdt.Rows[i]["RegionID"].ToString();
                item.Text  = tdt.Rows[i]["RegionName_c"].ToString();
                ddlDataRegiom.Items.Add(item);
            }
        }
コード例 #2
0
        private TreeNode CreateSubMenu(TreeNode tnTop, string pid)
        {
            DataTable tsubmnu = getTable.GetAllDataFromtblDowntownRegionList("ProvinceId =" + pid);

            for (int j = 0; j < tsubmnu.Rows.Count; j++)
            {
                TreeNode tnSubMenu = new TreeNode();
                tnSubMenu.Text  = tsubmnu.Rows[j]["RegionName_c"].ToString().Trim() + " |英文:" + tsubmnu.Rows[j]["RegionName_e"].ToString().Trim();;
                tnSubMenu.Value = "R" + tsubmnu.Rows[j]["RegionID"].ToString().Trim();
                tnTop.ChildNodes.Add(tnSubMenu);
            }
            return(tnTop);
        }