GXchangduQY.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using SuperMap.Data;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Data;
  5. using WeifenLuo.WinFormsUI.Docking;
  6. using WWPipeLine.MapBasic.Conditions;
  7. using WWPipeLine.MapBasic;
  8. using SuperMap.Mapping;
  9. using SuperMap.UI;
  10. namespace WWPipeLine.MapTools.Conditions.Statistics
  11. {
  12. public partial class GXchangduQY : ConditionPanel
  13. {
  14. GeoRegion m_geo = null;
  15. public GXchangduQY() : base()
  16. {
  17. this.ConditionPanelName = "区域管线长度统计";
  18. InitializeComponent();
  19. IsLoadBtnOKClick = true;
  20. }
  21. protected override void OnLoad(EventArgs e)
  22. {
  23. int index = MapControl.Map.TrackingLayer.IndexOf(ComsStatic.ControlToolsTrackingName);
  24. if (index == -1)
  25. {
  26. Sunny.UI.UIMessageTip.ShowError("请先绘制查询区域");
  27. this.FindForm().Close(); return;
  28. }
  29. m_geo = MapControl.Map.TrackingLayer.Get(index) as GeoRegion;
  30. }
  31. public override object Do(DockPanel dockPanel = null)
  32. {
  33. DataTable dt = new DataTable();
  34. dt.Columns.Add("统计图层");
  35. dt.Columns.Add("管线长度");
  36. //dt.Columns.Add("管线数量");
  37. DataRow dr;
  38. dr = dt.NewRow();
  39. dr["统计图层"] = "供水管线";
  40. Recordset rd = ComsStatic.gsGuanXian.Query(m_geo, 1, CursorType.Static);
  41. dr["管线长度"] = Math.Round(rd.Statistic("cd", StatisticMode.Sum), 2);
  42. //dr["管线数量"] = dvJSLK_cp.RecordCount;
  43. dt.Rows.Add(dr);
  44. ComsStatic.RecordsetDispose(rd);
  45. return dt;
  46. }
  47. }
  48. }