SercherOnGXGJ2.cs 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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. namespace WWPipeLine.MapTools.Conditions
  8. {
  9. public class SercherOnGXGJ2 : ConditionPanel
  10. {
  11. private DatasetVector _dv;
  12. private Sunny.UI.UIGroupBox uiGroupBox1;
  13. private Sunny.UI.UICheckBox ubMin;
  14. private Sunny.UI.UIDoubleUpDown dudMax;
  15. private Sunny.UI.UICheckBox ubMax;
  16. private Sunny.UI.UIDoubleUpDown dudMin;
  17. private DatasetVectorEx _dvEx;
  18. public SercherOnGXGJ2() : base()
  19. {
  20. this.ConditionPanelName = "按管线的管径范围查询";
  21. InitializeComponent();
  22. }
  23. protected override void OnLoad(EventArgs e)
  24. {
  25. _dv = this.DatasourceMapControl.Datasets["JSLK"] as DatasetVector;
  26. if (_dv == null)
  27. {
  28. Sunny.UI.UIMessageTip.ShowError("当前数据源中不包含相应的矢量数据集");
  29. return;
  30. }
  31. }
  32. public override object Do(DockPanel dockPanel = null)
  33. {
  34. _dvEx = new DatasetVectorEx(_dv.Name) { DatasetVector = _dv };
  35. string sql = " SmID > 0 ";
  36. if (ubMin.Checked)
  37. {
  38. sql += " And gj >= " + this.dudMin.Value;
  39. }
  40. if (ubMax.Checked)
  41. {
  42. sql += " And gj <= " + this.dudMax.Value;
  43. }
  44. _dvEx = new DatasetVectorEx("管线") { DatasetVector = _dv };
  45. _dvEx.ResultFields.AddRange(new string[] { "cz", "gj", "cd", "dzms", "qsdw" });
  46. return _dvEx.Query(sql);
  47. }
  48. private void InitializeComponent()
  49. {
  50. this.uiGroupBox1 = new Sunny.UI.UIGroupBox();
  51. this.ubMin = new Sunny.UI.UICheckBox();
  52. this.dudMin = new Sunny.UI.UIDoubleUpDown();
  53. this.dudMax = new Sunny.UI.UIDoubleUpDown();
  54. this.ubMax = new Sunny.UI.UICheckBox();
  55. this.uiGroupBox1.SuspendLayout();
  56. this.SuspendLayout();
  57. //
  58. // uiGroupBox1
  59. //
  60. this.uiGroupBox1.Controls.Add(this.dudMax);
  61. this.uiGroupBox1.Controls.Add(this.ubMax);
  62. this.uiGroupBox1.Controls.Add(this.dudMin);
  63. this.uiGroupBox1.Controls.Add(this.ubMin);
  64. this.uiGroupBox1.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(242)))), ((int)(((byte)(242)))), ((int)(((byte)(244)))));
  65. this.uiGroupBox1.Font = new System.Drawing.Font("微软雅黑", 12F);
  66. this.uiGroupBox1.Location = new System.Drawing.Point(226, 5);
  67. this.uiGroupBox1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
  68. this.uiGroupBox1.MinimumSize = new System.Drawing.Size(1, 1);
  69. this.uiGroupBox1.Name = "uiGroupBox1";
  70. this.uiGroupBox1.Padding = new System.Windows.Forms.Padding(0, 32, 0, 0);
  71. this.uiGroupBox1.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(140)))), ((int)(((byte)(140)))), ((int)(((byte)(140)))));
  72. this.uiGroupBox1.Size = new System.Drawing.Size(270, 290);
  73. this.uiGroupBox1.Style = Sunny.UI.UIStyle.Gray;
  74. this.uiGroupBox1.TabIndex = 0;
  75. this.uiGroupBox1.Text = "管线管径(毫米mm)";
  76. this.uiGroupBox1.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
  77. //
  78. // ubMin
  79. //
  80. this.ubMin.CheckBoxColor = System.Drawing.Color.FromArgb(((int)(((byte)(140)))), ((int)(((byte)(140)))), ((int)(((byte)(140)))));
  81. this.ubMin.Checked = true;
  82. this.ubMin.Cursor = System.Windows.Forms.Cursors.Hand;
  83. this.ubMin.Font = new System.Drawing.Font("微软雅黑", 12F);
  84. this.ubMin.Location = new System.Drawing.Point(15, 61);
  85. this.ubMin.MinimumSize = new System.Drawing.Size(1, 1);
  86. this.ubMin.Name = "ubMin";
  87. this.ubMin.Padding = new System.Windows.Forms.Padding(22, 0, 0, 0);
  88. this.ubMin.Size = new System.Drawing.Size(77, 29);
  89. this.ubMin.Style = Sunny.UI.UIStyle.Gray;
  90. this.ubMin.TabIndex = 0;
  91. this.ubMin.Text = "最小:";
  92. //
  93. // dudMin
  94. //
  95. this.dudMin.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(242)))), ((int)(((byte)(242)))), ((int)(((byte)(244)))));
  96. this.dudMin.Font = new System.Drawing.Font("微软雅黑", 12F);
  97. this.dudMin.Location = new System.Drawing.Point(116, 60);
  98. this.dudMin.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
  99. this.dudMin.MinimumSize = new System.Drawing.Size(100, 0);
  100. this.dudMin.Name = "dudMin";
  101. this.dudMin.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(140)))), ((int)(((byte)(140)))), ((int)(((byte)(140)))));
  102. this.dudMin.Size = new System.Drawing.Size(139, 29);
  103. this.dudMin.Style = Sunny.UI.UIStyle.Gray;
  104. this.dudMin.TabIndex = 1;
  105. this.dudMin.Text = "uiDoubleUpDown1";
  106. this.dudMin.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
  107. this.dudMin.Value = 0D;
  108. //
  109. // dudMax
  110. //
  111. this.dudMax.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(242)))), ((int)(((byte)(242)))), ((int)(((byte)(244)))));
  112. this.dudMax.Font = new System.Drawing.Font("微软雅黑", 12F);
  113. this.dudMax.Location = new System.Drawing.Point(116, 120);
  114. this.dudMax.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
  115. this.dudMax.MinimumSize = new System.Drawing.Size(100, 0);
  116. this.dudMax.Name = "dudMax";
  117. this.dudMax.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(140)))), ((int)(((byte)(140)))), ((int)(((byte)(140)))));
  118. this.dudMax.Size = new System.Drawing.Size(139, 29);
  119. this.dudMax.Style = Sunny.UI.UIStyle.Gray;
  120. this.dudMax.TabIndex = 4;
  121. this.dudMax.Text = "uiDoubleUpDown2";
  122. this.dudMax.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
  123. this.dudMax.Value = 0D;
  124. //
  125. // ubMax
  126. //
  127. this.ubMax.CheckBoxColor = System.Drawing.Color.FromArgb(((int)(((byte)(140)))), ((int)(((byte)(140)))), ((int)(((byte)(140)))));
  128. this.ubMax.Cursor = System.Windows.Forms.Cursors.Hand;
  129. this.ubMax.Font = new System.Drawing.Font("微软雅黑", 12F);
  130. this.ubMax.Location = new System.Drawing.Point(15, 121);
  131. this.ubMax.MinimumSize = new System.Drawing.Size(1, 1);
  132. this.ubMax.Name = "ubMax";
  133. this.ubMax.Padding = new System.Windows.Forms.Padding(22, 0, 0, 0);
  134. this.ubMax.Size = new System.Drawing.Size(77, 29);
  135. this.ubMax.Style = Sunny.UI.UIStyle.Gray;
  136. this.ubMax.TabIndex = 3;
  137. this.ubMax.Text = "最大:";
  138. //
  139. // SercherOnGXGJ2
  140. //
  141. this.Controls.Add(this.uiGroupBox1);
  142. this.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(242)))), ((int)(((byte)(242)))), ((int)(((byte)(244)))));
  143. this.Name = "SercherOnGXGJ2";
  144. this.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(140)))), ((int)(((byte)(140)))), ((int)(((byte)(140)))));
  145. this.Size = new System.Drawing.Size(500, 300);
  146. this.Style = Sunny.UI.UIStyle.Gray;
  147. this.uiGroupBox1.ResumeLayout(false);
  148. this.ResumeLayout(false);
  149. }
  150. }
  151. }