SearchOnJDPT.cs 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. using SuperMap.Data;
  2. using SuperMap.Mapping;
  3. using SuperMap.UI;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Data;
  7. using System.Drawing;
  8. using WeifenLuo.WinFormsUI.Docking;
  9. using WWPipeLine.MapBasic.Conditions;
  10. using WWPipeLine.MapBasic;
  11. using System.Windows.Forms;
  12. namespace WWPipeLine.MapTools.Conditions.Locations
  13. {
  14. public class SearchOnJDPT : ConditionPanel
  15. {
  16. public SearchOnJDPT() : base()
  17. {
  18. this.ConditionPanelName = "按照供水节点定位";
  19. this.SetSize(800, 450);
  20. InitializeComponent();
  21. }
  22. private DatasetVector _dv = ComsStatic.dvJSJDPT;
  23. private GroupBox groupBox1;
  24. private CheckedListBox clbDZMS;
  25. private GroupBox groupBox2;
  26. private CheckedListBox clbCZ;
  27. private GroupBox groupBox3;
  28. private CheckedListBox clbXH;
  29. private GroupBox groupBox4;
  30. private CheckedListBox clbGG;
  31. protected override void OnLoad(EventArgs e)
  32. {
  33. if (_dv == null)
  34. {
  35. Sunny.UI.UIMessageTip.ShowError("当前数据源中不包含相应的矢量数据集", 5000);
  36. this.ParentForm.Close();
  37. return;
  38. }
  39. if (!ComsStatic.HasField(_dv, "xh") || !ComsStatic.HasField(_dv, "cz") || !ComsStatic.HasField(_dv, "gg") || !ComsStatic.HasField(_dv, "dzms"))
  40. {
  41. Sunny.UI.UIMessageTip.ShowError("当前矢量数据集没有相应的信息", 5000);
  42. this.ParentForm.Close();
  43. return;
  44. }
  45. ComsStatic.BindDataTableOnCheckedListBox(_dv, clbXH, "xh");
  46. ComsStatic.BindDataTableOnCheckedListBox(_dv, clbCZ, "cz");
  47. ComsStatic.BindDataTableOnCheckedListBox(_dv, clbGG, "gg");
  48. ComsStatic.BindDataTableOnCheckedListBox(_dv, clbDZMS, "dzms");
  49. }
  50. public override object Do(DockPanel dockPanel = null)
  51. {
  52. Dictionary<string, CheckedListBox> dic = new Dictionary<string, CheckedListBox>();
  53. dic.Add("xh", clbXH); dic.Add("gg", clbGG); dic.Add("cz", clbCZ); dic.Add("dzms", clbDZMS);
  54. return ComsStatic.QueryDataTable(_dv, ComsStatic.getSqlCheckListBox(dic), ComsStatic.resultFields);
  55. }
  56. #region 界面布局
  57. private void InitializeComponent()
  58. {
  59. this.groupBox1 = new System.Windows.Forms.GroupBox();
  60. this.clbDZMS = new System.Windows.Forms.CheckedListBox();
  61. this.groupBox2 = new System.Windows.Forms.GroupBox();
  62. this.clbCZ = new System.Windows.Forms.CheckedListBox();
  63. this.groupBox3 = new System.Windows.Forms.GroupBox();
  64. this.clbXH = new System.Windows.Forms.CheckedListBox();
  65. this.groupBox4 = new System.Windows.Forms.GroupBox();
  66. this.clbGG = new System.Windows.Forms.CheckedListBox();
  67. this.groupBox1.SuspendLayout();
  68. this.groupBox2.SuspendLayout();
  69. this.groupBox3.SuspendLayout();
  70. this.groupBox4.SuspendLayout();
  71. this.SuspendLayout();
  72. //
  73. // groupBox1
  74. //
  75. this.groupBox1.Controls.Add(this.clbDZMS);
  76. this.groupBox1.Location = new System.Drawing.Point(601, 5);
  77. this.groupBox1.Name = "groupBox1";
  78. this.groupBox1.Size = new System.Drawing.Size(194, 350);
  79. this.groupBox1.TabIndex = 14;
  80. this.groupBox1.TabStop = false;
  81. this.groupBox1.Text = "地址描述";
  82. //
  83. // clbDZMS
  84. //
  85. this.clbDZMS.CheckOnClick = true;
  86. this.clbDZMS.Dock = System.Windows.Forms.DockStyle.Fill;
  87. this.clbDZMS.Location = new System.Drawing.Point(3, 25);
  88. this.clbDZMS.Name = "clbDZMS";
  89. this.clbDZMS.Size = new System.Drawing.Size(188, 322);
  90. this.clbDZMS.TabIndex = 0;
  91. //
  92. // groupBox2
  93. //
  94. this.groupBox2.Controls.Add(this.clbCZ);
  95. this.groupBox2.Location = new System.Drawing.Point(205, 5);
  96. this.groupBox2.Name = "groupBox2";
  97. this.groupBox2.Size = new System.Drawing.Size(194, 350);
  98. this.groupBox2.TabIndex = 15;
  99. this.groupBox2.TabStop = false;
  100. this.groupBox2.Text = "材质";
  101. //
  102. // clbCZ
  103. //
  104. this.clbCZ.CheckOnClick = true;
  105. this.clbCZ.Dock = System.Windows.Forms.DockStyle.Fill;
  106. this.clbCZ.Location = new System.Drawing.Point(3, 25);
  107. this.clbCZ.Name = "clbCZ";
  108. this.clbCZ.Size = new System.Drawing.Size(188, 322);
  109. this.clbCZ.TabIndex = 0;
  110. //
  111. // groupBox3
  112. //
  113. this.groupBox3.Controls.Add(this.clbXH);
  114. this.groupBox3.Location = new System.Drawing.Point(7, 5);
  115. this.groupBox3.Name = "groupBox3";
  116. this.groupBox3.Size = new System.Drawing.Size(194, 350);
  117. this.groupBox3.TabIndex = 15;
  118. this.groupBox3.TabStop = false;
  119. this.groupBox3.Text = "型号";
  120. //
  121. // clbXH
  122. //
  123. this.clbXH.CheckOnClick = true;
  124. this.clbXH.Dock = System.Windows.Forms.DockStyle.Fill;
  125. this.clbXH.Location = new System.Drawing.Point(3, 25);
  126. this.clbXH.Name = "clbXH";
  127. this.clbXH.Size = new System.Drawing.Size(188, 322);
  128. this.clbXH.TabIndex = 0;
  129. //
  130. // groupBox4
  131. //
  132. this.groupBox4.Controls.Add(this.clbGG);
  133. this.groupBox4.Location = new System.Drawing.Point(403, 5);
  134. this.groupBox4.Name = "groupBox4";
  135. this.groupBox4.Size = new System.Drawing.Size(194, 350);
  136. this.groupBox4.TabIndex = 15;
  137. this.groupBox4.TabStop = false;
  138. this.groupBox4.Text = "规格";
  139. //
  140. // clbGG
  141. //
  142. this.clbGG.CheckOnClick = true;
  143. this.clbGG.Dock = System.Windows.Forms.DockStyle.Fill;
  144. this.clbGG.Location = new System.Drawing.Point(3, 25);
  145. this.clbGG.Name = "clbGG";
  146. this.clbGG.Size = new System.Drawing.Size(188, 322);
  147. this.clbGG.TabIndex = 0;
  148. //
  149. // SearchOnJDPT
  150. //
  151. this.Controls.Add(this.groupBox4);
  152. this.Controls.Add(this.groupBox2);
  153. this.Controls.Add(this.groupBox3);
  154. this.Controls.Add(this.groupBox1);
  155. this.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(242)))), ((int)(((byte)(242)))), ((int)(((byte)(244)))));
  156. this.Name = "SearchOnJDPT";
  157. this.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(140)))), ((int)(((byte)(140)))), ((int)(((byte)(140)))));
  158. this.Size = new System.Drawing.Size(800, 365);
  159. this.Style = Sunny.UI.UIStyle.Gray;
  160. this.groupBox1.ResumeLayout(false);
  161. this.groupBox2.ResumeLayout(false);
  162. this.groupBox3.ResumeLayout(false);
  163. this.groupBox4.ResumeLayout(false);
  164. this.ResumeLayout(false);
  165. }
  166. #endregion
  167. }
  168. }