SercherOnGXQSDW.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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.Sercher
  8. {
  9. public class SercherOnGXQSDW : ConditionPanel
  10. {
  11. private System.Windows.Forms.CheckedListBox clb;
  12. public SercherOnGXQSDW() : base()
  13. {
  14. this.ConditionPanelName = "按管线的权属单位描述查询";
  15. InitializeComponent();
  16. }
  17. protected override void OnLoad(EventArgs e)
  18. {
  19. if (!ComsStatic.HasField(ComsStatic.dvJSLK, "qsdw"))
  20. {
  21. Sunny.UI.UIMessageTip.ShowError("当前矢量数据集没有权属单位信息"); return;
  22. }
  23. ComsStatic.BindDataTableOnCheckedListBox(ComsStatic.dvJSLK, clb, "qsdw");
  24. }
  25. public override object Do(DockPanel dockPanel = null)
  26. {
  27. string sql = " 1=2 ";
  28. #region 组合AND OR 多选项查询条件
  29. if (clb.CheckedItems.Count > 0)
  30. {
  31. foreach (string str in clb.CheckedItems)
  32. {
  33. if (str == "未知")
  34. sql += string.Format(" OR qsdw is null ", str);
  35. else
  36. sql += string.Format(" OR qsdw='{0}'", str);
  37. }
  38. }
  39. #endregion
  40. return ComsStatic.QueryDataTable(ComsStatic.dvJSLK, sql, new string[] { "cz", "gj", "cd", "dzms", "qsdw" });
  41. }
  42. private void InitializeComponent()
  43. {
  44. this.clb = new System.Windows.Forms.CheckedListBox();
  45. this.SuspendLayout();
  46. //
  47. // clb
  48. //
  49. this.clb.Dock = System.Windows.Forms.DockStyle.Fill;
  50. this.clb.Location = new System.Drawing.Point(0, 0);
  51. this.clb.Name = "clb";
  52. this.clb.Size = new System.Drawing.Size(500, 300);
  53. this.clb.TabIndex = 0;
  54. //
  55. // SercherOnGXQSDW
  56. //
  57. this.Controls.Add(this.clb);
  58. this.Name = "SercherOnGXQSDW";
  59. this.Size = new System.Drawing.Size(500, 300);
  60. this.ResumeLayout(false);
  61. }
  62. }
  63. }