private void vTreeResult_DoubleClick(object sender, EventArgs e)
 {
     try
     {
         if (this.WriteLog)
         {
             Plugin.LogTable.Writelog("最大林斑号查询");
         }
         if (vTreeResult.SelectedNode.Level == 3)
         {
             IFeature pFeature = CommnClass.Query(vTreeResult.SelectedNode.Text);
             if (pFeature == null)
             {
                 MessageBox.Show("未找到该行政区林斑号信息!", "提示!");
                 return;
             }
             ///ZQ 20111020 定位范围扩大1.5倍
             IEnvelope pExtent = pFeature.Extent;
             SysCommon.ModPublicFun.ResizeEnvelope(pExtent, 1.5);
             //先刷新,后闪烁问题
             m_MapControl.Extent = pExtent;
             m_MapControl.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewBackground, null, null);
             m_MapControl.ActiveView.ScreenDisplay.UpdateWindow();
             m_MapControl.FlashShape(pFeature.ShapeCopy, 3, 200, null);
         }
     }
     catch { }
 }
        private void cmbBoxVillage_TextChanged(object sender, EventArgs e)
        {
            ComboBoxItem pComboBoxItem = cmbBoxVillage.SelectedItem as ComboBoxItem;

            CommnClass.m_cmbBoxVillage   = pComboBoxItem.Tag.ToString();
            CommnClass.m_cmbBoxNeighbour = "";
            cmbBoxNeighbour.Items.Clear();
            CommnClass.SetcmbBoxNeighbourVale(cmbBoxNeighbour); //wgf 20111014 从数据中获取修改为从行政区字典中获取
        }
        private void btt_Click(object sender, EventArgs e)
        {
            if (this.WriteLog)
            {
                Plugin.LogTable.Writelog("最大林斑号查询");
            }
            error.Clear();
            if (CommnClass.m_cmbBoxCountry == "")
            {
                error.SetError(cmbBoxCountry, "县级行政区代码不能为空!");
                return;
            }

            //进度条
            SysCommon.CProgress pgss = new SysCommon.CProgress("正在查询,请稍候...");
            pgss.EnableCancel    = false;
            pgss.ShowDescription = false;
            pgss.FakeProgress    = true;
            pgss.TopMost         = true;
            pgss.ShowProgress();
            if (CommnClass.m_cmbBoxVillage == "" && CommnClass.m_cmbBoxNeighbour == "")
            {
                CommnClass.SetvTreeCountry(vTreeResult);
                vTreeResult.ExpandAll();
            }
            else if (CommnClass.m_cmbBoxNeighbour == "")
            {
                CommnClass.SetvTreeVillage(vTreeResult);
                vTreeResult.ExpandAll();
            }
            else
            {
                IFeature pFeature = CommnClass.Query(CommnClass.m_cmbBoxNeighbour);
                if (pFeature == null)
                {
                    pgss.Close();
                    MessageBox.Show("未找到行政区林斑号信息!", "提示!");
                    return;
                }
                CommnClass.SetLinBanTreeNeighbour(vTreeResult);
                vTreeResult.ExpandAll();
                ///ZQ 20111020 定位范围扩大1.5倍
                IEnvelope pExtent = pFeature.Extent;
                SysCommon.ModPublicFun.ResizeEnvelope(pExtent, 1.5);
                //先刷新,后闪烁问题
                m_MapControl.Extent = pExtent;
                m_MapControl.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewBackground, null, null);
                m_MapControl.ActiveView.ScreenDisplay.UpdateWindow();
                m_MapControl.FlashShape(pFeature.ShapeCopy, 3, 200, null);
            }
            ///ZQ  20111109  modfiy 修改点击查询,界面最小化
            Application.DoEvents();
            pgss.Close();
        }
        public frmMaxCadastraQuery(IFeatureClass JFFeatureClass, IFeatureClass ZDFeatureClass, AxMapControl pMapControl, IWorkspace pWorkspace)
        {
            InitializeComponent();
            CommnClass.m_JFFeatureClass  = JFFeatureClass;
            CommnClass.m_ZDFeatureClass  = ZDFeatureClass;
            CommnClass.m_cmbBoxCountry   = "";
            CommnClass.m_cmbBoxVillage   = "";
            CommnClass.m_cmbBoxNeighbour = "";
            CommnClass.m_JFLike          = "%";
            CommnClass.m_ZDLike          = "%";
            CommnClass.m_Workspace       = pWorkspace;
            m_MapControl        = pMapControl;
            CommnClass.m_ZDLike = CommnClass.GetDescriptionOfWorkspace((ZDFeatureClass as IDataset).Workspace);
            CommnClass.m_JFLike = CommnClass.GetDescriptionOfWorkspace((JFFeatureClass as IDataset).Workspace);
            CommnClass.SetcmbBoxCountryVale(cmbBoxCountry);  //wgf 20111014 从数据中获取修改为从行政区字典中获取

            //?/????
        }
        /// <summary>
        /// 根据用户输入的表达式进行查询
        /// </summary>
        /// <param name="pLabel"></param>
        /// <param name="strTable"></param>
        /// <param name="StrQueryValue"></param>
        /// <param name="pFeatureClass"></param>
        /// <param name="pDataGridView"></param>
        public static void Query(DevComponents.DotNetBar.LabelX pLabel, string strTable, string StrQueryValue, IFeatureClass pFeatureClass, DevComponents.DotNetBar.Controls.DataGridViewX pDataGridView)
        {
            //进度条
            SysCommon.CProgress pgss = new SysCommon.CProgress("正在查询,请稍候...");
            pgss.EnableCancel    = false;
            pgss.ShowDescription = false;
            pgss.FakeProgress    = true;
            pgss.TopMost         = true;
            pgss.ShowProgress();
            try
            {
                IFeatureWorkspace pFeatureWorkspace = m_Workspace as IFeatureWorkspace;
                ITable            pTable            = pFeatureWorkspace.OpenTable(strTable);
                string            strFieldName      = pLabel.Tag.ToString();
                string            strLike           = CommnClass.GetDescriptionOfWorkspace((pFeatureClass as IDataset).Workspace);
                pDataGridView.Columns["CumQueryName"].HeaderText = pLabel.Text.Substring(0, pLabel.Text.Length - 1);
                pDataGridView.Rows.Clear();
                IField       pField       = pTable.Fields.get_Field(pTable.FindField(strFieldName));
                IQueryFilter pQueryFilter = new QueryFilterClass();
                pQueryFilter.WhereClause = pField.Name + " Like '" + strLike + StrQueryValue + strLike + "'";
                ICursor pCursor = pTable.Search(pQueryFilter, false);
                IRow    pRow    = pCursor.NextRow();

                while (pRow != null)
                {
                    string strFieldVlaue = pRow.get_Value(pRow.Fields.FindField(strFieldName)).ToString();
                    string strDJHVlaue   = pRow.get_Value(pRow.Fields.FindField("DJH")).ToString();
                    string strFeatureID  = GetFeatuerID(pFeatureClass, strDJHVlaue);
                    pDataGridView.Rows.Add(strFieldVlaue, strDJHVlaue, strFeatureID);
                    pRow = pCursor.NextRow();
                }
                System.Runtime.InteropServices.Marshal.ReleaseComObject(pCursor);
                pCursor = null;

                pgss.Close();
            }
            catch
            {
            }
            finally
            {
                pgss.Close();
            }
        }
        public frmMaxCadastraQuery(IFeatureClass ZDFeatureClass, string LinBanCodeField, string XzqField, AxMapControl pMapControl, IWorkspace pWorkspace)
        {
            InitializeComponent();
            _LinBanCodeFieldName         = LinBanCodeField;
            _XzqFieldName                = XzqField;
            CommnClass._DJHFieldName     = LinBanCodeField;
            CommnClass._JFDMFieldName    = XzqField;
            CommnClass._JFMCFieldName    = XzqField;
            CommnClass.m_JFFeatureClass  = null;
            CommnClass.m_ZDFeatureClass  = ZDFeatureClass;
            CommnClass.m_cmbBoxCountry   = "";
            CommnClass.m_cmbBoxVillage   = "";
            CommnClass.m_cmbBoxNeighbour = "";
            CommnClass.m_JFLike          = "%";
            CommnClass.m_ZDLike          = "%";
            CommnClass.m_Workspace       = pWorkspace;
            m_MapControl        = pMapControl;
            CommnClass.m_ZDLike = CommnClass.GetDescriptionOfWorkspace((ZDFeatureClass as IDataset).Workspace);
            //CommnClass.m_JFLike = CommnClass.GetDescriptionOfWorkspace((JFFeatureClass as IDataset).Workspace);
            CommnClass.SetcmbBoxCountryVale(cmbBoxCountry);  //wgf 20111014 从数据中获取修改为从行政区字典中获取

            //?/????
        }