Ejemplo n.º 1
0
        private City city = null; // 用于分块的城市

        // 构造函数
        public FormMain()
        {
            InitializeComponent();

            // 获取省份列表
            List <Region> regionList = RegionDao.SelectByParentId(0);

            foreach (Region region in regionList)
            {
                comboBoxProvince.Items.Add(region);
            }
            comboBoxProvince.SelectedIndex = 0;

            // 获取一级行业分类
            List <KeyWord> keyWordList = KeyWordDao.SelectByParentId(0);

            foreach (KeyWord keyWord in keyWordList)
            {
                comboBoxKey1.Items.Add(keyWord);
            }
            comboBoxKey1.SelectedIndex = 0;

            // 初始化分块
            initComboBoxBlock();

            // 初始化GDAL
            Ogr.RegisterAll();
        }
Ejemplo n.º 2
0
        // 改变一级分类
        private void comboBoxKey1_SelectedIndexChanged(object sender, EventArgs e)
        {
            comboBoxKey2.Items.Clear();
            KeyWord keyWord1 = comboBoxKey1.SelectedItem as KeyWord;
            int     parentId = Convert.ToInt32(keyWord1.Id);

            List <KeyWord> keyWordList = KeyWordDao.SelectByParentId(parentId);

            if (keyWordList.Count == 0)
            {
                comboBoxKey2.Items.Add(keyWord1);
            }
            else
            {
                foreach (KeyWord keyWord2 in keyWordList)
                {
                    comboBoxKey2.Items.Add(keyWord2);
                }
            }

            comboBoxKey2.SelectedIndex = 0;
        }
Ejemplo n.º 3
0
 public KeyWordService()
 {
     dao = new KeyWordDao();
 }