示例#1
0
        private void Search_Click(object sender, EventArgs e)
        {
            SearchConditions sc = new SearchConditions();

            string areacode = string.Empty;

            if (Region_Country.SelectedItem.GetType().Name.Equals("Area"))
            {
                areacode += ((Area)Region_Country.SelectedItem).areacode;
                if (Region_Province.SelectedItem.GetType().Name.Equals("Area"))
                {
                    areacode += ((Area)Region_Province.SelectedItem).areacode.PadRight(6, '_');
                }
                else
                {
                    areacode += "______";
                }
                sc.area.Add(areacode);
            }

            if (DataSource.SelectedItem.ToString() != "全部")
            {
                sc.datasource.Add(DataSource.SelectedItem.ToString());
            }

            if (!String.IsNullOrEmpty(Scale_From.Text) && !String.IsNullOrEmpty(Scale_To.Text))
            {
                sc.scale.Add(Convert.ToInt64(Scale_From.Text));
                sc.scale.Add(Convert.ToInt64(Scale_To.Text));
            }

            if (!String.IsNullOrEmpty(Resolution_From.Text) && !String.IsNullOrEmpty(Resolution_To.Text))
            {
                sc.resolution.Add(Convert.ToSingle(Resolution_From.Text));
                sc.resolution.Add(Convert.ToSingle(Resolution_To.Text));
            }

            sc.keywords = Keywords.Text;

            if (DB_Raster.Checked)
            {
                searchResult = RasterLayer.GetRasterLayerBySearchConditions("影像库", sc);
            }
            else if (DB_DEM.Checked)
            {
                searchResult = RasterLayer.GetRasterLayerBySearchConditions("DEM库", sc);
            }
            else if (DB_Vector.Checked)
            {
                searchResult = VectorLayer.GetVectorLayerBySearchConditions("矢量库", sc);
            }
            else if (DB_3D.Checked)
            {
                searchResult = FileLayer.GetFileLayerBySearchConditions("三维库", sc);
            }
            else if (DB_Test.Checked)
            {
                searchResult = FileLayer.GetFileLayerBySearchConditions("试验库", sc);
            }
            else if (DB_Others.Checked)
            {
                searchResult = FileLayer.GetFileLayerBySearchConditions("其他库", sc);
            }
        }