SearchOnSBPT.cs 6.2 KB

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