123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- using SuperMap.Data;
- using System;
- using System.Collections.Generic;
- using WeifenLuo.WinFormsUI.Docking;
- using WWPipeLine.MapBasic.Conditions;
- using WWPipeLine.MapBasic;
- namespace WWPipeLine.MapTools.Conditions.Sercher
- {
- public class SercherOnGXQSDW : ConditionPanel
- {
- private System.ComponentModel.IContainer components;
- private System.Windows.Forms.ToolTip toolTip1;
- private System.Windows.Forms.CheckedListBox clb;
- public SercherOnGXQSDW() : base()
- {
- this.ConditionPanelName = "按管线的权属单位查询";
- this.SetSize(200, 400);
- InitializeComponent();
- }
- protected override void OnLoad(EventArgs e)
- {
- if (!ComsStatic.HasField(ComsStatic.dvJSLK, "qsdw"))
- {
- Sunny.UI.UIMessageTip.ShowError("当前矢量数据集没有权属单位信息"); return;
- }
- ComsStatic.BindDataTableOnCheckedListBox(ComsStatic.dvJSLK, clb, "qsdw");
- }
- public override object Do(DockPanel dockPanel = null)
- {
- string sql = " 1=2 ";
- #region 组合AND OR 多选项查询条件
- if (clb.CheckedItems.Count > 0)
- {
- foreach (string str in clb.CheckedItems)
- {
- if (str == "未知")
- sql += string.Format(" OR qsdw is null ", str);
- else
- sql += string.Format(" OR qsdw='{0}'", str);
- }
- }
- #endregion
- return ComsStatic.QueryDataTable(ComsStatic.dvJSLK, sql, ComsStatic.resultFieldsGX);
- }
- private void InitializeComponent()
- {
- this.components = new System.ComponentModel.Container();
- this.clb = new System.Windows.Forms.CheckedListBox();
- this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
- this.SuspendLayout();
- //
- // clb
- //
- this.clb.CheckOnClick = true;
- this.clb.Dock = System.Windows.Forms.DockStyle.Fill;
- this.clb.Location = new System.Drawing.Point(0, 0);
- this.clb.Name = "clb";
- this.clb.Size = new System.Drawing.Size(200, 315);
- this.clb.TabIndex = 0;
- this.clb.MouseMove += new System.Windows.Forms.MouseEventHandler(ComsStatic.CheckedListBox_MouseMove);
- //
- // SercherOnGXQSDW
- //
- this.Controls.Add(this.clb);
- this.Name = "SercherOnGXQSDW";
- this.Size = new System.Drawing.Size(200, 315);
- this.ResumeLayout(false);
- }
- }
- }
|