Ejemplo n.º 1
0
        public override void OnClick()
        {
            Plugin.Application.IAppGisUpdateRef phook = _AppHk as Plugin.Application.IAppGisUpdateRef;
            SysCommon.BottomQueryBar            pBar  = phook.QueryBar;
            if (pBar.m_WorkSpace == null)
            {
                pBar.m_WorkSpace = Plugin.ModuleCommon.TmpWorkSpace;
            }
            if (pBar.ListDataNodeKeys == null)
            {
                pBar.ListDataNodeKeys = Plugin.ModuleCommon.ListUserdataPriID;
            }
            ControlsMapIdentify pTool = _cmd as ControlsMapIdentify;

            pTool.GetQueryBar(pBar);
            _cmd.OnClick();
            if (_tool == null || _cmd == null || _AppHk == null)
            {
                return;
            }
            if (_AppHk.MapControl == null)
            {
                return;
            }
            _AppHk.MapControl.CurrentTool = _tool;
            _AppHk.CurrentTool            = this.Name;
        }
Ejemplo n.º 2
0
        public override void OnClick()
        {
            Plugin.Application.IAppGisUpdateRef phook = _AppHk as Plugin.Application.IAppGisUpdateRef;
            SysCommon.BottomQueryBar            pBar  = phook.QueryBar;
            if (pBar.m_WorkSpace == null)
            {
                pBar.m_WorkSpace = Plugin.ModuleCommon.TmpWorkSpace;
            }
            if (pBar.ListDataNodeKeys == null)
            {
                pBar.ListDataNodeKeys = Plugin.ModuleCommon.ListUserdataPriID;
            }
            ImportPolygonQueryToolClass pTool = _cmd as ImportPolygonQueryToolClass;

            pTool.GetQueryBar(pBar);
            _cmd.OnClick();
            //if (_AppHk.CurrentControl is IMapControl2)
            //{
            //    _AppHk.MapControl.CurrentTool = _tool;
            //}
            //else
            //{
            //    _AppHk.PageLayoutControl.CurrentTool = _tool;
            //}

            _AppHk.CurrentTool = this.Name;
        }
Ejemplo n.º 3
0
 public override void OnClick()
 {
     Plugin.Application.IAppGisUpdateRef phook = _AppHk as Plugin.Application.IAppGisUpdateRef;
     SysCommon.BottomQueryBar            pBar  = phook.QueryBar;
     if (pBar.m_WorkSpace == null)
     {
         pBar.m_WorkSpace = Plugin.ModuleCommon.TmpWorkSpace;
     }
     if (pBar.ListDataNodeKeys == null)
     {
         pBar.ListDataNodeKeys = Plugin.ModuleCommon.ListUserdataPriID;
     }
     if (_AppHk == null)
     {
         return;
     }
     if (m_frm != null)
     {
         m_frm = null;
     }
     m_frm          = new frmXYBufferset(_AppHk.MapControl, m_pAppForm.MainForm);
     m_frm.WriteLog = this.WriteLog;
     m_frm.QueryBar = pBar;
     m_frm.Show();
 }
Ejemplo n.º 4
0
        public override void OnClick()
        {
            Plugin.Application.IAppGisUpdateRef phook = _AppHk as Plugin.Application.IAppGisUpdateRef;
            SysCommon.BottomQueryBar            pBar  = phook.QueryBar;
            if (pBar.m_WorkSpace == null)
            {
                pBar.m_WorkSpace = Plugin.ModuleCommon.TmpWorkSpace;
            }
            if (pBar.ListDataNodeKeys == null)
            {
                pBar.ListDataNodeKeys = Plugin.ModuleCommon.ListUserdataPriID;
            }
            PolygonBufferQueryToolClass pTool = _cmd as PolygonBufferQueryToolClass;

            pTool.WriteLog = WriteLog;//ygc 2012-9-12 是否写日志
            pTool.GetQueryBar(pBar);
            _cmd.OnClick();
            if (_AppHk.CurrentControl is IMapControl2)
            {
                _AppHk.MapControl.CurrentTool = _tool;
            }
            else
            {
                _AppHk.PageLayoutControl.CurrentTool = _tool;
            }

            _AppHk.CurrentTool = this.Name;
        }
Ejemplo n.º 5
0
 public override void OnClick()
 {
     Plugin.Application.IAppGisUpdateRef phook = _AppHk as Plugin.Application.IAppGisUpdateRef;
     SysCommon.BottomQueryBar            pBar  = phook.QueryBar;
     if (pBar.m_WorkSpace == null)
     {
         pBar.m_WorkSpace = Plugin.ModuleCommon.TmpWorkSpace;
     }
     if (pBar.ListDataNodeKeys == null)
     {
         pBar.ListDataNodeKeys = Plugin.ModuleCommon.ListUserdataPriID;
     }
     if (_AppHk == null)
     {
         return;
     }
     /// ZQ 2011 1125 modify
     if (m_frmSelectBuffer == null)
     {
         m_frmSelectBuffer              = new frmSelectBuffer(_AppHk.ArcGisMapControl, m_pAppForm.MainForm);
         m_frmSelectBuffer.WriteLog     = this.WriteLog;
         m_frmSelectBuffer._pMapControl = _AppHk.MapControl;
         m_frmSelectBuffer.FormClosed  += new System.Windows.Forms.FormClosedEventHandler(m_frmSelectBuffer_FormClosed);
         m_frmSelectBuffer.QueryBar     = pBar;
         m_frmSelectBuffer.Show();
     }
     else
     {
         m_frmSelectBuffer.Activate();
     }
 }
Ejemplo n.º 6
0
        public override void OnClick()
        {
            Plugin.Application.IAppGisUpdateRef phook = _AppHk as Plugin.Application.IAppGisUpdateRef;
            SysCommon.BottomQueryBar            pBar  = phook.QueryBar;
            if (pBar.m_WorkSpace == null)
            {
                pBar.m_WorkSpace = Plugin.ModuleCommon.TmpWorkSpace;
            }
            if (pBar.ListDataNodeKeys == null)
            {
                pBar.ListDataNodeKeys = Plugin.ModuleCommon.ListUserdataPriID;
            }
            if (_AppHk == null)
            {
                return;
            }
            if (_AppHk.MapControl == null)
            {
                return;
            }
            IMap pMap = _AppHk.MapControl.Map;

            if (frmSQL != null)
            {
                frmSQL.Close();
                frmSQL = null;
            }
            frmSQL           = new FrmSQLQuery(_AppHk.MapControl, Plugin.ModuleCommon.TmpWorkSpace);
            frmSQL._QueryBar = pBar;
            frmSQL.Show((_AppHk as Plugin.Application.IAppFormRef).MainForm);
            if (WriteLog)
            {
                Plugin.LogTable.Writelog("自定义查询"); //ygc 2012-9-14 写日志
            }
        }
Ejemplo n.º 7
0
        private void QueryForestByGeometry(IGeometry pGeometry, IMap pMap)
        {
            //加进度条 xisheng 2011.06.28
            SysCommon.CProgress vProgress = new SysCommon.CProgress("进度条");
            vProgress.EnableCancel = true;
            vProgress.EnableUserCancel(true);


            vProgress.ShowDescription = true;
            vProgress.FakeProgress    = true;
            vProgress.TopMost         = true;
            vProgress.ShowProgress();
            vProgress.SetProgress("开始查询");
            try
            {
                string strNodeKey = SysCommon.ModSysSetting.GetLinBanLayerNodeKey(Plugin.ModuleCommon.TmpWorkSpace);
                ILayer pLayer     = SysCommon.ModuleMap.GetLayerByNodeKey(null, pMap, strNodeKey, null, true);
                SysCommon.BottomQueryBar pQueryBar = _hook.QueryBar;
                if (pQueryBar.m_WorkSpace == null)
                {
                    pQueryBar.m_WorkSpace = Plugin.ModuleCommon.TmpWorkSpace;
                }
                if (pQueryBar.ListDataNodeKeys == null)
                {
                    pQueryBar.ListDataNodeKeys = Plugin.ModuleCommon.ListUserdataPriID;
                }
                pQueryBar.m_pMapControl = _hook.MapControl;
                //构造查询过滤器
                ISpatialFilter pQueryFilter = new SpatialFilterClass();
                pQueryFilter.Geometry   = pGeometry;
                pQueryFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelContains;
                esriSelectionResultEnum pSelectionResult = esriSelectionResultEnum.esriSelectionResultNew;

                pQueryBar.m_pMapControl = _hook.MapControl;
                vProgress.SetProgress("获取查询结果...");
                pQueryBar.EmergeQueryData(pLayer as IFeatureLayer, pQueryFilter, vProgress);
                vProgress.Close();
                //pQueryBar.EmergeQueryData(pMap, pGeometry, esriSpatialRelEnum.esriSpatialRelIntersects);
                try
                {
                    DevComponents.DotNetBar.Bar pBar = pQueryBar.Parent.Parent as DevComponents.DotNetBar.Bar;
                    if (pBar != null)
                    {
                        pBar.AutoHide = false;
                        //pBar.SelectedDockTab = 1;
                        int tmpindex = pBar.Items.IndexOf("dockItemDataCheck");
                        pBar.SelectedDockTab = tmpindex;
                    }
                }
                catch
                { }
            }
            catch
            {
                vProgress.Close();
            }
            vProgress = null;
        }
Ejemplo n.º 8
0
        public override void OnClick()
        {
            _AppHk.MapControl.CurrentTool = _tool;
            Plugin.Application.AppGIS phook = _AppHk as Plugin.Application.AppGIS;
            SysCommon.BottomQueryBar  pBar  = phook.QueryBar;
            if (pBar.m_WorkSpace == null)
            {
                pBar.m_WorkSpace = Plugin.ModuleCommon.TmpWorkSpace;
            }
            ControlsResPointBufferQueryToolClass pTool = _cmd as ControlsResPointBufferQueryToolClass;

            pTool.GetQueryBar(pBar);
            _AppHk.CurrentTool = this.Name;
        }
        public override void OnClick()
        {
            _AppHk.MapControl.CurrentTool = _tool;
            Plugin.Application.AppGIS phook = _AppHk as Plugin.Application.AppGIS;
            SysCommon.BottomQueryBar  pBar  = phook.QueryBar;
            if (pBar.m_WorkSpace == null)
            {
                pBar.m_WorkSpace = Plugin.ModuleCommon.TmpWorkSpace;
            }
            if (pBar.ListDataNodeKeys == null)
            {
                pBar.ListDataNodeKeys = Plugin.ModuleCommon.ListUserdataPriID;
            }
            PolygonBufferQueryToolClass pTool = _cmd as PolygonBufferQueryToolClass;

            pTool.GetQueryBar(pBar);
            _AppHk.CurrentTool = this.Name;
        }
Ejemplo n.º 10
0
        public override void OnClick()
        {
            if (_tool == null || _cmd == null || _AppHk == null)
            {
                return;
            }
            if (_AppHk.MapControl == null)
            {
                return;
            }
            Plugin.Application.AppGIS phook = _AppHk as Plugin.Application.AppGIS;
            SysCommon.BottomQueryBar  pBar  = phook.QueryBar;
            if (pBar.m_WorkSpace == null)
            {
                pBar.m_WorkSpace = Plugin.ModuleCommon.TmpWorkSpace;
            }
            ControlsMapIdentify pTool = _cmd as ControlsMapIdentify;

            pTool.GetQueryBar(pBar);
            _AppHk.MapControl.CurrentTool = _tool;
            _AppHk.CurrentTool            = this.Name;
        }
Ejemplo n.º 11
0
        public override void OnClick()
        {
            Plugin.Application.AppGIS phook = _AppHk as Plugin.Application.AppGIS;
            SysCommon.BottomQueryBar pBar= phook.QueryBar;
            if (pBar.m_WorkSpace == null)
            {
                pBar.m_WorkSpace = Plugin.ModuleCommon.TmpWorkSpace;
            }
            LineBufferQueryToolClass pTool = _cmd as LineBufferQueryToolClass;
            pTool.WriteLog = this.WriteLog; //ygc 2012-9-12 ÊÇ·ñдÈÕÖ¾
            pTool.GetQueryBar(pBar);
            _cmd.OnClick();
            //if (_AppHk.CurrentControl is IMapControl2)
            //{
               _AppHk.MapControl.CurrentTool = _tool;
            //}
            //else
            //{
            //    _AppHk.PageLayoutControl.CurrentTool = _tool;
            //}

            _AppHk.CurrentTool = this.Name;
        }
 public void GetQueryBar(SysCommon.BottomQueryBar QueryBar)
 {
     _QuerBar = QueryBar;
 }
Ejemplo n.º 13
0
        public override void OnClick()
        {
            Plugin.Application.IAppGisUpdateRef phook = _AppHk as Plugin.Application.IAppGisUpdateRef;
            SysCommon.BottomQueryBar            pBar  = phook.QueryBar;
            if (pBar.m_WorkSpace == null)
            {
                pBar.m_WorkSpace = Plugin.ModuleCommon.TmpWorkSpace;
            }
            if (pBar.ListDataNodeKeys == null)
            {
                pBar.ListDataNodeKeys = Plugin.ModuleCommon.ListUserdataPriID;
            }
            if (_AppHk == null)
            {
                return;
            }
            if (_AppHk.MapControl == null)
            {
                return;
            }
            IMap pMap = _AppHk.MapControl.Map;

            string strDMFL = "", strDM = "";

            List <ILayer>        pListLayers = null;
            List <IFeatureClass> pListFeatureClasses = null;
            List <string>        pListLayerNames = null;
            List <string>        pListNodeKeys = null;

            SysCommon.ModSysSetting.CopyConfigXml(Plugin.ModuleCommon.TmpWorkSpace, "查询配置", ModQuery.m_QueryPath); //added by chulili 20111110先从业务库拷贝配置文件
            try
            {                                                                                                      //获取地名地物类
                ModQuery.GetPlaceNameQueryConfig(pMap, out pListNodeKeys, out pListLayers, out pListFeatureClasses, out pListLayerNames, out strDM);
                //检查地名字段
                if (pListFeatureClasses == null)
                {
                    MessageBox.Show("找不到地名数据,请检查配置文件!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }
                if (pListFeatureClasses.Count == 0)
                {
                    MessageBox.Show("找不到地名数据,请检查配置文件!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }
                for (int i = 0; i < pListFeatureClasses.Count; i++)
                {
                    IFeatureClass pTmpFeaCls = pListFeatureClasses[i];
                    if (pTmpFeaCls.FindField(strDM) < 0)
                    {
                        MessageBox.Show("找不到地名数据名称属性,请检查配置文件!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;
                    }
                }
                frmQueryDomain fmQD = new frmQueryDomain(Plugin.ModuleCommon.TmpWorkSpace, _pAppForm.MainForm, _AppHk.MapControl, pListNodeKeys, pListLayers, pListFeatureClasses, pListLayerNames, strDM);
                fmQD.WriteLog = this.WriteLog;
                fmQD.QueryBar = pBar;
                fmQD.Show(_pAppForm.MainForm);
                //IQueryFilter pQF = new QueryFilterClass();
                //pQF.WhereClause = fmQD.SqlWhere;
                //frmQuery fmQ = new frmQuery(_AppHk.MapControl);
                ////用查询地物类,查询条件 填充查询窗体
                //if (fmQD._QueryTag.Equals("XZ"))
                //{
                //    fmQ.FillData(pXZFeaClass, pQF,false);
                //}
                //else
                //{
                //    fmQ.FillData(pZRFeaClass, pQF,false);
                //}
                //fmQ.Show((_AppHk as Plugin.Application.IAppFormRef).MainForm);
            }
            catch (Exception ex)
            {
                ErrorHandle.ShowFrmErrorHandle("提示", ex.Message);
            }
        }
Ejemplo n.º 14
0
        public override void OnClick()
        {
            Plugin.Application.IAppGisUpdateRef phook = _AppHk as Plugin.Application.IAppGisUpdateRef;
            SysCommon.BottomQueryBar            pBar  = phook.QueryBar;
            if (pBar.m_WorkSpace == null)
            {
                pBar.m_WorkSpace = Plugin.ModuleCommon.TmpWorkSpace;
            }
            if (_AppHk == null)
            {
                return;
            }
            if (_AppHk.MapControl == null)
            {
                return;
            }
            IMap pMap = _AppHk.MapControl.Map;

            if (frmSQL != null)
            {
                frmSQL.Close();
                frmSQL = null;
            }
            if (WriteLog)
            {
                Plugin.LogTable.Writelog("打开查询方案"); //ygc 2012-9-14 写日志
            }
            SysCommon.CProgress vProgress = new SysCommon.CProgress("进度条");
            vProgress.EnableCancel = true;
            vProgress.EnableUserCancel(true);

            vProgress.ShowDescription = false;
            vProgress.FakeProgress    = true;
            vProgress.TopMost         = true;
            //vProgress.ShowProgress();
            vProgress.SetProgress("开始查询");
            FrmOpenSQLCondition newfrm = new FrmOpenSQLCondition(Plugin.ModuleCommon.TmpWorkSpace);

            newfrm.m_TableName    = "SQLSOLUTION";
            newfrm.m_showAllLayer = true;
            if (newfrm.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            vProgress.ShowProgress();
            string strSQL    = newfrm.m_Condition;
            string layerName = newfrm.m_LayerName;

            if (strSQL == "")
            {
                MessageBox.Show("未选择查看的查询方案!", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Stop);
                return;
            }
            IFeatureLayer pFeatureLayer = GetLayerByName(layerName, pMap);

            if (pFeatureLayer == null)
            {
                MessageBox.Show("当前地图无该查询方案图层!", "提示");
                return;
            }
            //构造查询过滤器
            IQueryFilter pQueryFilter = new QueryFilterClass();

            pQueryFilter.WhereClause = strSQL;
            esriSelectionResultEnum pSelectionResult = esriSelectionResultEnum.esriSelectionResultNew;

            vProgress.SetProgress("正在查询符合条件的结果");
            pBar.m_pMapControl = _AppHk.MapControl;
            pBar.EmergeQueryData(_AppHk.MapControl.Map, pFeatureLayer, pQueryFilter, pSelectionResult, vProgress);
            vProgress.Close();

            try
            {
                DevComponents.DotNetBar.Bar pBar0 = pBar.Parent.Parent as DevComponents.DotNetBar.Bar;
                if (pBar0 != null)
                {
                    pBar0.AutoHide = false;
                    //pBar0.SelectedDockTab = 1;
                    int tmpindex = pBar0.Items.IndexOf("dockItemDataCheck");
                    pBar0.SelectedDockTab = tmpindex;
                }
            }
            catch
            { }
        }
Ejemplo n.º 15
0
        private void QueryForestByAttri(DevComponents.AdvTree.Node pXZQnode, IMap pMap)
        {
            if (pXZQnode == null)
            {
                return;
            }
            //加进度条 xisheng 2011.06.28
            SysCommon.CProgress vProgress = new SysCommon.CProgress("进度条");
            vProgress.EnableCancel = true;
            vProgress.EnableUserCancel(true);


            vProgress.ShowDescription = true;
            vProgress.FakeProgress    = true;
            vProgress.TopMost         = true;
            vProgress.ShowProgress();
            vProgress.SetProgress("开始查询");
            try
            {
                string strTag  = pXZQnode.Tag.ToString();
                string strCode = pXZQnode.Name;
                if (strTag.ToUpper() == "TOWN")
                {
                    DevComponents.AdvTree.Node pParentNode = pXZQnode.Parent;
                    string strTmpCode = pParentNode.Name;
                    strCode = strTmpCode + strCode.Substring(1, 2);
                }
                string strNodeKey = SysCommon.ModSysSetting.GetLinBanLayerNodeKey(Plugin.ModuleCommon.TmpWorkSpace);
                ILayer pLayer     = SysCommon.ModuleMap.GetLayerByNodeKey(null, pMap, strNodeKey, null, true);
                SysCommon.BottomQueryBar pQueryBar = _hook.QueryBar;
                if (pQueryBar.m_WorkSpace == null)
                {
                    pQueryBar.m_WorkSpace = Plugin.ModuleCommon.TmpWorkSpace;
                }
                if (pQueryBar.ListDataNodeKeys == null)
                {
                    pQueryBar.ListDataNodeKeys = Plugin.ModuleCommon.ListUserdataPriID;
                }
                esriSelectionResultEnum pSelectionResult = esriSelectionResultEnum.esriSelectionResultNew;
                //构造查询过滤器
                IQueryFilter pQueryFilter = new QueryFilterClass();
                //ygc 20130326 根据山西数据格式修改条件合成方式
                if (strTag.ToUpper() == "TOWN")
                {
                    pQueryFilter.WhereClause = "xiang ='" + strCode + "00'";
                }
                else if (strTag.ToUpper() == "County")
                {
                    pQueryFilter.WhereClause = "XIANG = '" + strCode + "'";
                }
                else if (strTag.ToUpper() == "City")
                {
                    pQueryFilter.WhereClause = "shi = '" + strCode + "00'";
                }
                else
                {
                    pQueryFilter.WhereClause = "XIANG like '" + strCode + "%'";
                }

                pQueryBar.m_pMapControl = _hook.MapControl;
                vProgress.SetProgress("获取查询结果...");
                pQueryBar.EmergeQueryData(pLayer as IFeatureLayer, pQueryFilter, vProgress);
                vProgress.Close();
                try
                {
                    DevComponents.DotNetBar.Bar pBar = pQueryBar.Parent.Parent as DevComponents.DotNetBar.Bar;
                    if (pBar != null)
                    {
                        pBar.AutoHide = false;
                        //pBar.SelectedDockTab = 1;
                        int tmpindex = pBar.Items.IndexOf("dockItemDataCheck");
                        pBar.SelectedDockTab = tmpindex;
                    }
                }
                catch
                { }
            }
            catch
            {
                vProgress.Close();
            }
            vProgress = null;
        }