1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- using SuperMap.Data;
- using System;
- using System.Collections.Generic;
- using WeifenLuo.WinFormsUI.Docking;
- using WWPipeLine.MapBasic.Conditions;
- using WWPipeLine.MapBasic;
- using System.Data;
- namespace WWPipeLine.MapTools.Conditions.Sercher
- {
- public class SercherOnGXCZ : ConditionPanel
- {
- private System.Windows.Forms.CheckedListBox clb;
- public SercherOnGXCZ() : base()
- {
- this.ConditionPanelName = "按管线的材质查询";
- InitializeComponent();
- }
- protected override void OnLoad(EventArgs e)
- {
- if (!ComsStatic.HasField(ComsStatic.dvJSLK, "cz"))
- {
- Sunny.UI.UIMessageTip.ShowError("当前矢量数据集没有材质信息");
- return;
- }
- ComsStatic.BindDataTableOnCheckedListBox(ComsStatic.dvJSLK, clb, "cz");
- }
- 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 cz is null ");
- else
- sql += string.Format(" OR cz='{0}'", str);
- }
- }
- #endregion
- return ComsStatic.QueryDataTable(ComsStatic.dvJSLK, sql, new string[] { "cz", "gj", "cd", "dzms", "qsdw" });
- }
- private void InitializeComponent()
- {
- this.clb = new System.Windows.Forms.CheckedListBox();
- this.SuspendLayout();
- //
- // clb
- //
- 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(211, 157);
- this.clb.TabIndex = 0;
- //
- // SercherOnGXCZ
- //
- this.Controls.Add(this.clb);
- this.Name = "SercherOnGXCZ";
- this.Size = new System.Drawing.Size(211, 157);
- this.ResumeLayout(false);
- }
- }
- }
|