1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- using SuperMap.Data;
- using System;
- using System.Collections.Generic;
- using System.Data;
- using WeifenLuo.WinFormsUI.Docking;
- using WWPipeLine.MapBasic.Conditions;
- using WWPipeLine.MapBasic;
- using SuperMap.Mapping;
- using SuperMap.UI;
- namespace WWPipeLine.MapTools.Conditions.Statistics
- {
- public partial class GXchangduQY : ConditionPanel
- {
- GeoRegion m_geo = null;
- public GXchangduQY() : base()
- {
- this.ConditionPanelName = "区域管线长度统计";
- InitializeComponent();
- IsLoadBtnOKClick = true;
- }
- protected override void OnLoad(EventArgs e)
- {
- int index = MapControl.Map.TrackingLayer.IndexOf(ComsStatic.ControlToolsTrackingName);
- if (index == -1)
- {
- Sunny.UI.UIMessageTip.ShowError("请先绘制查询区域");
- this.FindForm().Close(); return;
- }
- m_geo = MapControl.Map.TrackingLayer.Get(index) as GeoRegion;
- }
- public override object Do(DockPanel dockPanel = null)
- {
- DataTable dt = new DataTable();
- dt.Columns.Add("统计图层");
- dt.Columns.Add("管线长度");
- //dt.Columns.Add("管线数量");
- DataRow dr;
- dr = dt.NewRow();
- dr["统计图层"] = "供水管线";
- Recordset rd = ComsStatic.gsGuanXian.Query(m_geo, 1, CursorType.Static);
- dr["管线长度"] = Math.Round(rd.Statistic("cd", StatisticMode.Sum), 2);
- //dr["管线数量"] = dvJSLK_cp.RecordCount;
- dt.Rows.Add(dr);
- ComsStatic.RecordsetDispose(rd);
- return dt;
- }
- }
- }
|