GXfenlei.cs 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. using SuperMap.Data;
  2. using System;
  3. using System.Collections.Generic;
  4. using WeifenLuo.WinFormsUI.Docking;
  5. using WWPipeLine.MapBasic.Conditions;
  6. using WWPipeLine.MapBasic;
  7. using System.Windows.Forms;
  8. using Sunny.UI;
  9. using System.Data;
  10. using SuperMap.Mapping;
  11. using System.Drawing;
  12. namespace WWPipeLine.MapTools.Conditions.Statistics
  13. {
  14. public class GXfenlei : ConditionPanel
  15. {
  16. private GroupBox groupBox2;
  17. public GXfenlei() : base()
  18. {
  19. this.ConditionPanelName = "管线分类统计";
  20. this.SetSize(200, 400);
  21. InitializeComponent();
  22. }
  23. protected override void OnLoad(EventArgs e)
  24. {
  25. Dictionary<string, string> dic = new Dictionary<string, string>();
  26. dic.Add("gg", "规格"); dic.Add("cz", "材质"); dic.Add("gj", "管径"); dic.Add("dzms", "地址描述"); dic.Add("qsdw", "权属单位");
  27. foreach (string key in dic.Keys)
  28. {
  29. UICheckBox uiCheckBox = new UICheckBox() { Name = key, Text = dic[key], Location = new Point(20, 30 + groupBox2.Controls.Count * 28), Style = Sunny.UI.UIStyle.Gray };
  30. groupBox2.Controls.Add(uiCheckBox);
  31. }
  32. }
  33. public override object Do(DockPanel dockPanel = null)
  34. {
  35. List<string> strField = new List<string>();
  36. foreach (Control ct in groupBox2.Controls)
  37. {
  38. UICheckBox ck = ct as UICheckBox;
  39. if (ck.Checked) strField.Add(ck.Name);
  40. }
  41. if (strField.Count == 0)
  42. {
  43. Sunny.UI.UIMessageTip.ShowError("请先选择需要统计的字段"); return false;
  44. }
  45. return ComsStatic.TongJiFieldGroupCount(ComsStatic.gsGuanXian, strField.ToArray());
  46. }
  47. private void InitializeComponent()
  48. {
  49. this.groupBox2 = new System.Windows.Forms.GroupBox();
  50. this.SuspendLayout();
  51. //
  52. // groupBox2
  53. //
  54. this.groupBox2.Dock = System.Windows.Forms.DockStyle.Fill;
  55. this.groupBox2.Location = new System.Drawing.Point(0, 0);
  56. this.groupBox2.Name = "groupBox2";
  57. this.groupBox2.Size = new System.Drawing.Size(200, 315);
  58. this.groupBox2.TabIndex = 1;
  59. this.groupBox2.TabStop = false;
  60. this.groupBox2.Text = "分类字段";
  61. //
  62. // GXfenlei
  63. //
  64. this.Controls.Add(this.groupBox2);
  65. this.Name = "GXfenlei";
  66. this.Size = new System.Drawing.Size(200, 315);
  67. this.ResumeLayout(false);
  68. }
  69. }
  70. }