SercherOnGXMSRQ.cs 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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 SercherOnGXMSRQ : ConditionPanel
  10. {
  11. private Sunny.UI.UILabel uiLabel1;
  12. private Sunny.UI.UIDatePicker dpRQStart;
  13. private Sunny.UI.UIDatePicker dpRQEnd;
  14. private Sunny.UI.UILabel uiLabel2;
  15. public SercherOnGXMSRQ() : base()
  16. {
  17. this.ConditionPanelName = "按管线的埋设日期查询";
  18. this.SetSize(200, 400);
  19. InitializeComponent();
  20. }
  21. protected override void OnLoad(EventArgs e)
  22. {
  23. this.dpRQStart.Value = new System.DateTime(DateTime.Now.Year - 5, DateTime.Now.Month, DateTime.Now.Day);
  24. this.dpRQEnd.Value = new System.DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
  25. }
  26. public override object Do(DockPanel dockPanel = null)
  27. {
  28. string sql = string.Format(" MSRQ BETWEEN '{0}' AND '{1}' ", dpRQStart.Value.ToString("yyyy/MM/dd"), dpRQEnd.Value.ToString("yyyy/MM/dd"));
  29. return ComsStatic.QueryDataTable(ComsStatic.dvJSLK, sql, ComsStatic.resultFieldsGX);
  30. }
  31. private void InitializeComponent()
  32. {
  33. this.uiLabel1 = new Sunny.UI.UILabel();
  34. this.uiLabel2 = new Sunny.UI.UILabel();
  35. this.dpRQStart = new Sunny.UI.UIDatePicker();
  36. this.dpRQEnd = new Sunny.UI.UIDatePicker();
  37. this.SuspendLayout();
  38. //
  39. // uiLabel1
  40. //
  41. this.uiLabel1.Font = new System.Drawing.Font("微软雅黑", 12F);
  42. this.uiLabel1.Location = new System.Drawing.Point(20, 19);
  43. this.uiLabel1.Name = "uiLabel1";
  44. this.uiLabel1.Size = new System.Drawing.Size(100, 29);
  45. this.uiLabel1.Style = Sunny.UI.UIStyle.Gray;
  46. this.uiLabel1.TabIndex = 0;
  47. this.uiLabel1.Text = "起始日期:";
  48. this.uiLabel1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
  49. //
  50. // uiLabel2
  51. //
  52. this.uiLabel2.Font = new System.Drawing.Font("微软雅黑", 12F);
  53. this.uiLabel2.Location = new System.Drawing.Point(20, 109);
  54. this.uiLabel2.Name = "uiLabel2";
  55. this.uiLabel2.Size = new System.Drawing.Size(100, 29);
  56. this.uiLabel2.Style = Sunny.UI.UIStyle.Gray;
  57. this.uiLabel2.TabIndex = 1;
  58. this.uiLabel2.Text = "截止日期:";
  59. this.uiLabel2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
  60. //
  61. // dpRQStart
  62. //
  63. this.dpRQStart.FillColor = System.Drawing.Color.White;
  64. this.dpRQStart.Font = new System.Drawing.Font("微软雅黑", 12F);
  65. this.dpRQStart.Location = new System.Drawing.Point(20, 56);
  66. this.dpRQStart.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
  67. this.dpRQStart.MaxLength = 10;
  68. this.dpRQStart.MinimumSize = new System.Drawing.Size(63, 0);
  69. this.dpRQStart.Name = "dpRQStart";
  70. this.dpRQStart.Padding = new System.Windows.Forms.Padding(0, 0, 30, 2);
  71. this.dpRQStart.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(140)))), ((int)(((byte)(140)))), ((int)(((byte)(140)))));
  72. this.dpRQStart.Size = new System.Drawing.Size(150, 29);
  73. this.dpRQStart.Style = Sunny.UI.UIStyle.Gray;
  74. this.dpRQStart.SymbolDropDown = 61555;
  75. this.dpRQStart.SymbolNormal = 61555;
  76. this.dpRQStart.TabIndex = 2;
  77. this.dpRQStart.Text = "1900-01-01";
  78. this.dpRQStart.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft;
  79. this.dpRQStart.Value = new System.DateTime(1900, 1, 1, 0, 0, 0, 0);
  80. //
  81. // dpRQEnd
  82. //
  83. this.dpRQEnd.FillColor = System.Drawing.Color.White;
  84. this.dpRQEnd.Font = new System.Drawing.Font("微软雅黑", 12F);
  85. this.dpRQEnd.Location = new System.Drawing.Point(20, 147);
  86. this.dpRQEnd.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
  87. this.dpRQEnd.MaxLength = 10;
  88. this.dpRQEnd.MinimumSize = new System.Drawing.Size(63, 0);
  89. this.dpRQEnd.Name = "dpRQEnd";
  90. this.dpRQEnd.Padding = new System.Windows.Forms.Padding(0, 0, 30, 2);
  91. this.dpRQEnd.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(140)))), ((int)(((byte)(140)))), ((int)(((byte)(140)))));
  92. this.dpRQEnd.Size = new System.Drawing.Size(150, 29);
  93. this.dpRQEnd.Style = Sunny.UI.UIStyle.Gray;
  94. this.dpRQEnd.SymbolDropDown = 61555;
  95. this.dpRQEnd.SymbolNormal = 61555;
  96. this.dpRQEnd.TabIndex = 3;
  97. this.dpRQEnd.Text = "1900-01-01";
  98. this.dpRQEnd.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft;
  99. this.dpRQEnd.Value = new System.DateTime(1900, 1, 1, 0, 0, 0, 0);
  100. //
  101. // SercherOnGXMSRQ
  102. //
  103. this.Controls.Add(this.dpRQEnd);
  104. this.Controls.Add(this.dpRQStart);
  105. this.Controls.Add(this.uiLabel2);
  106. this.Controls.Add(this.uiLabel1);
  107. this.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(242)))), ((int)(((byte)(242)))), ((int)(((byte)(244)))));
  108. this.Name = "SercherOnGXMSRQ";
  109. this.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(140)))), ((int)(((byte)(140)))), ((int)(((byte)(140)))));
  110. this.Size = new System.Drawing.Size(200, 315);
  111. this.Style = Sunny.UI.UIStyle.Gray;
  112. this.ResumeLayout(false);
  113. }
  114. }
  115. }