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 SercherOnGXMSRQ : ConditionPanel { private Sunny.UI.UILabel uiLabel1; private Sunny.UI.UIDatePicker dpRQStart; private Sunny.UI.UIDatePicker dpRQEnd; private Sunny.UI.UILabel uiLabel2; public SercherOnGXMSRQ() : base() { this.ConditionPanelName = "按管线的埋设日期查询"; this.SetSize(200, 400); InitializeComponent(); } protected override void OnLoad(EventArgs e) { this.dpRQStart.Value = new System.DateTime(DateTime.Now.Year - 5, DateTime.Now.Month, DateTime.Now.Day); this.dpRQEnd.Value = new System.DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day); } public override object Do(DockPanel dockPanel = null) { string sql = string.Format(" MSRQ BETWEEN '{0}' AND '{1}' ", dpRQStart.Value.ToString("yyyy/MM/dd"), dpRQEnd.Value.ToString("yyyy/MM/dd")); return ComsStatic.QueryDataTable(ComsStatic.dvJSLK, sql, ComsStatic.resultFieldsGX); } private void InitializeComponent() { this.uiLabel1 = new Sunny.UI.UILabel(); this.uiLabel2 = new Sunny.UI.UILabel(); this.dpRQStart = new Sunny.UI.UIDatePicker(); this.dpRQEnd = new Sunny.UI.UIDatePicker(); this.SuspendLayout(); // // uiLabel1 // this.uiLabel1.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiLabel1.Location = new System.Drawing.Point(20, 19); this.uiLabel1.Name = "uiLabel1"; this.uiLabel1.Size = new System.Drawing.Size(100, 29); this.uiLabel1.Style = Sunny.UI.UIStyle.Gray; this.uiLabel1.TabIndex = 0; this.uiLabel1.Text = "起始日期:"; this.uiLabel1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // uiLabel2 // this.uiLabel2.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiLabel2.Location = new System.Drawing.Point(20, 109); this.uiLabel2.Name = "uiLabel2"; this.uiLabel2.Size = new System.Drawing.Size(100, 29); this.uiLabel2.Style = Sunny.UI.UIStyle.Gray; this.uiLabel2.TabIndex = 1; this.uiLabel2.Text = "截止日期:"; this.uiLabel2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // dpRQStart // this.dpRQStart.FillColor = System.Drawing.Color.White; this.dpRQStart.Font = new System.Drawing.Font("微软雅黑", 12F); this.dpRQStart.Location = new System.Drawing.Point(20, 56); this.dpRQStart.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.dpRQStart.MaxLength = 10; this.dpRQStart.MinimumSize = new System.Drawing.Size(63, 0); this.dpRQStart.Name = "dpRQStart"; this.dpRQStart.Padding = new System.Windows.Forms.Padding(0, 0, 30, 2); this.dpRQStart.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(140)))), ((int)(((byte)(140)))), ((int)(((byte)(140))))); this.dpRQStart.Size = new System.Drawing.Size(150, 29); this.dpRQStart.Style = Sunny.UI.UIStyle.Gray; this.dpRQStart.SymbolDropDown = 61555; this.dpRQStart.SymbolNormal = 61555; this.dpRQStart.TabIndex = 2; this.dpRQStart.Text = "1900-01-01"; this.dpRQStart.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft; this.dpRQStart.Value = new System.DateTime(1900, 1, 1, 0, 0, 0, 0); // // dpRQEnd // this.dpRQEnd.FillColor = System.Drawing.Color.White; this.dpRQEnd.Font = new System.Drawing.Font("微软雅黑", 12F); this.dpRQEnd.Location = new System.Drawing.Point(20, 147); this.dpRQEnd.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.dpRQEnd.MaxLength = 10; this.dpRQEnd.MinimumSize = new System.Drawing.Size(63, 0); this.dpRQEnd.Name = "dpRQEnd"; this.dpRQEnd.Padding = new System.Windows.Forms.Padding(0, 0, 30, 2); this.dpRQEnd.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(140)))), ((int)(((byte)(140)))), ((int)(((byte)(140))))); this.dpRQEnd.Size = new System.Drawing.Size(150, 29); this.dpRQEnd.Style = Sunny.UI.UIStyle.Gray; this.dpRQEnd.SymbolDropDown = 61555; this.dpRQEnd.SymbolNormal = 61555; this.dpRQEnd.TabIndex = 3; this.dpRQEnd.Text = "1900-01-01"; this.dpRQEnd.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft; this.dpRQEnd.Value = new System.DateTime(1900, 1, 1, 0, 0, 0, 0); // // SercherOnGXMSRQ // this.Controls.Add(this.dpRQEnd); this.Controls.Add(this.dpRQStart); this.Controls.Add(this.uiLabel2); this.Controls.Add(this.uiLabel1); this.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(242)))), ((int)(((byte)(242)))), ((int)(((byte)(244))))); this.Name = "SercherOnGXMSRQ"; this.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(140)))), ((int)(((byte)(140)))), ((int)(((byte)(140))))); this.Size = new System.Drawing.Size(200, 315); this.Style = Sunny.UI.UIStyle.Gray; this.ResumeLayout(false); } } }