123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158 |
- using SuperMap.Data;
- using System;
- using System.Collections.Generic;
- using WeifenLuo.WinFormsUI.Docking;
- using WWPipeLine.MapBasic.Conditions;
- using WWPipeLine.MapBasic;
- namespace WWPipeLine.MapTools.Conditions
- {
- public class SercherOnGXGJ2 : ConditionPanel
- {
- private DatasetVector _dv;
- private Sunny.UI.UIGroupBox uiGroupBox1;
- private Sunny.UI.UICheckBox ubMin;
- private Sunny.UI.UIDoubleUpDown dudMax;
- private Sunny.UI.UICheckBox ubMax;
- private Sunny.UI.UIDoubleUpDown dudMin;
- private DatasetVectorEx _dvEx;
- public SercherOnGXGJ2() : base()
- {
- this.ConditionPanelName = "按管线的管径范围查询";
- InitializeComponent();
- }
- protected override void OnLoad(EventArgs e)
- {
- _dv = this.DatasourceMapControl.Datasets["JSLK"] as DatasetVector;
- if (_dv == null)
- {
- Sunny.UI.UIMessageTip.ShowError("当前数据源中不包含相应的矢量数据集");
- return;
- }
- }
- public override object Do(DockPanel dockPanel = null)
- {
- _dvEx = new DatasetVectorEx(_dv.Name) { DatasetVector = _dv };
- string sql = " SmID > 0 ";
- if (ubMin.Checked)
- {
- sql += " And gj >= " + this.dudMin.Value;
- }
- if (ubMax.Checked)
- {
- sql += " And gj <= " + this.dudMax.Value;
- }
- _dvEx = new DatasetVectorEx("管线") { DatasetVector = _dv };
- _dvEx.ResultFields.AddRange(new string[] { "cz", "gj", "cd", "dzms", "qsdw" });
- return _dvEx.Query(sql);
- }
- private void InitializeComponent()
- {
- this.uiGroupBox1 = new Sunny.UI.UIGroupBox();
- this.ubMin = new Sunny.UI.UICheckBox();
- this.dudMin = new Sunny.UI.UIDoubleUpDown();
- this.dudMax = new Sunny.UI.UIDoubleUpDown();
- this.ubMax = new Sunny.UI.UICheckBox();
- this.uiGroupBox1.SuspendLayout();
- this.SuspendLayout();
- //
- // uiGroupBox1
- //
- this.uiGroupBox1.Controls.Add(this.dudMax);
- this.uiGroupBox1.Controls.Add(this.ubMax);
- this.uiGroupBox1.Controls.Add(this.dudMin);
- this.uiGroupBox1.Controls.Add(this.ubMin);
- this.uiGroupBox1.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(242)))), ((int)(((byte)(242)))), ((int)(((byte)(244)))));
- this.uiGroupBox1.Font = new System.Drawing.Font("微软雅黑", 12F);
- this.uiGroupBox1.Location = new System.Drawing.Point(226, 5);
- this.uiGroupBox1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
- this.uiGroupBox1.MinimumSize = new System.Drawing.Size(1, 1);
- this.uiGroupBox1.Name = "uiGroupBox1";
- this.uiGroupBox1.Padding = new System.Windows.Forms.Padding(0, 32, 0, 0);
- this.uiGroupBox1.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(140)))), ((int)(((byte)(140)))), ((int)(((byte)(140)))));
- this.uiGroupBox1.Size = new System.Drawing.Size(270, 290);
- this.uiGroupBox1.Style = Sunny.UI.UIStyle.Gray;
- this.uiGroupBox1.TabIndex = 0;
- this.uiGroupBox1.Text = "管线管径(毫米mm)";
- this.uiGroupBox1.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
- //
- // ubMin
- //
- this.ubMin.CheckBoxColor = System.Drawing.Color.FromArgb(((int)(((byte)(140)))), ((int)(((byte)(140)))), ((int)(((byte)(140)))));
- this.ubMin.Checked = true;
- this.ubMin.Cursor = System.Windows.Forms.Cursors.Hand;
- this.ubMin.Font = new System.Drawing.Font("微软雅黑", 12F);
- this.ubMin.Location = new System.Drawing.Point(15, 61);
- this.ubMin.MinimumSize = new System.Drawing.Size(1, 1);
- this.ubMin.Name = "ubMin";
- this.ubMin.Padding = new System.Windows.Forms.Padding(22, 0, 0, 0);
- this.ubMin.Size = new System.Drawing.Size(77, 29);
- this.ubMin.Style = Sunny.UI.UIStyle.Gray;
- this.ubMin.TabIndex = 0;
- this.ubMin.Text = "最小:";
- //
- // dudMin
- //
- this.dudMin.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(242)))), ((int)(((byte)(242)))), ((int)(((byte)(244)))));
- this.dudMin.Font = new System.Drawing.Font("微软雅黑", 12F);
- this.dudMin.Location = new System.Drawing.Point(116, 60);
- this.dudMin.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
- this.dudMin.MinimumSize = new System.Drawing.Size(100, 0);
- this.dudMin.Name = "dudMin";
- this.dudMin.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(140)))), ((int)(((byte)(140)))), ((int)(((byte)(140)))));
- this.dudMin.Size = new System.Drawing.Size(139, 29);
- this.dudMin.Style = Sunny.UI.UIStyle.Gray;
- this.dudMin.TabIndex = 1;
- this.dudMin.Text = "uiDoubleUpDown1";
- this.dudMin.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
- this.dudMin.Value = 0D;
- //
- // dudMax
- //
- this.dudMax.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(242)))), ((int)(((byte)(242)))), ((int)(((byte)(244)))));
- this.dudMax.Font = new System.Drawing.Font("微软雅黑", 12F);
- this.dudMax.Location = new System.Drawing.Point(116, 120);
- this.dudMax.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
- this.dudMax.MinimumSize = new System.Drawing.Size(100, 0);
- this.dudMax.Name = "dudMax";
- this.dudMax.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(140)))), ((int)(((byte)(140)))), ((int)(((byte)(140)))));
- this.dudMax.Size = new System.Drawing.Size(139, 29);
- this.dudMax.Style = Sunny.UI.UIStyle.Gray;
- this.dudMax.TabIndex = 4;
- this.dudMax.Text = "uiDoubleUpDown2";
- this.dudMax.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
- this.dudMax.Value = 0D;
- //
- // ubMax
- //
- this.ubMax.CheckBoxColor = System.Drawing.Color.FromArgb(((int)(((byte)(140)))), ((int)(((byte)(140)))), ((int)(((byte)(140)))));
- this.ubMax.Cursor = System.Windows.Forms.Cursors.Hand;
- this.ubMax.Font = new System.Drawing.Font("微软雅黑", 12F);
- this.ubMax.Location = new System.Drawing.Point(15, 121);
- this.ubMax.MinimumSize = new System.Drawing.Size(1, 1);
- this.ubMax.Name = "ubMax";
- this.ubMax.Padding = new System.Windows.Forms.Padding(22, 0, 0, 0);
- this.ubMax.Size = new System.Drawing.Size(77, 29);
- this.ubMax.Style = Sunny.UI.UIStyle.Gray;
- this.ubMax.TabIndex = 3;
- this.ubMax.Text = "最大:";
- //
- // SercherOnGXGJ2
- //
- this.Controls.Add(this.uiGroupBox1);
- this.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(242)))), ((int)(((byte)(242)))), ((int)(((byte)(244)))));
- this.Name = "SercherOnGXGJ2";
- this.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(140)))), ((int)(((byte)(140)))), ((int)(((byte)(140)))));
- this.Size = new System.Drawing.Size(500, 300);
- this.Style = Sunny.UI.UIStyle.Gray;
- this.uiGroupBox1.ResumeLayout(false);
- this.ResumeLayout(false);
- }
- }
- }
|