SercherOnGXQSDW.cs 2.1 KB

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