using SuperMap.Data; using System; using System.Collections.Generic; using WeifenLuo.WinFormsUI.Docking; using WWPipeLine.MapBasic.Conditions; using WWPipeLine.MapBasic; using System.Windows.Forms; using Sunny.UI; using System.Data; using SuperMap.Mapping; using System.Drawing; namespace WWPipeLine.MapTools.Conditions.Statistics { public class GDfenlei : ConditionPanel { private GroupBox groupBox1; private GroupBox groupBox2; private UIComboBox uicbxLayer; public GDfenlei() : base() { this.ConditionPanelName = "管点分类统计"; this.SetSize(200, 400); InitializeComponent(); } protected override void OnLoad(EventArgs e) { ComsStatic.BindUICombox(uicbxLayer, false); Dictionary dic = new Dictionary(); dic.Add("gg", "规格"); dic.Add("cz", "材质"); dic.Add("gj", "管径"); dic.Add("dzms", "地址描述"); dic.Add("qsdw", "权属单位"); foreach (string key in dic.Keys) { UICheckBox uiCheckBox = new UICheckBox() { Name = key, Text = dic[key], Location = new Point(20, 30 + groupBox2.Controls.Count * 28), Style = Sunny.UI.UIStyle.Gray }; groupBox2.Controls.Add(uiCheckBox); } } public override object Do(DockPanel dockPanel = null) { List strField = new List(); foreach (Control ct in groupBox2.Controls) { UICheckBox ck = ct as UICheckBox; if (ck.Checked) strField.Add(ck.Name); } if (strField.Count == 0) { Sunny.UI.UIMessageTip.ShowError("请先选择需要统计的字段"); return false; } DoListItem item = (DoListItem)uicbxLayer.SelectedItem; DatasetVector dv = ComsStatic.Datasource.Datasets[item.Key] as DatasetVector; return ComsStatic.TongJiFieldGroupCount(dv, strField.ToArray()); } private void InitializeComponent() { this.groupBox1 = new System.Windows.Forms.GroupBox(); this.uicbxLayer = new Sunny.UI.UIComboBox(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.groupBox1.SuspendLayout(); this.SuspendLayout(); // // groupBox1 // this.groupBox1.Controls.Add(this.uicbxLayer); this.groupBox1.Dock = System.Windows.Forms.DockStyle.Top; this.groupBox1.Location = new System.Drawing.Point(0, 0); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(200, 69); this.groupBox1.TabIndex = 0; this.groupBox1.TabStop = false; this.groupBox1.Text = "管点类型"; // // uicbxLayer // this.uicbxLayer.DataSource = null; this.uicbxLayer.DropDownStyle = Sunny.UI.UIDropDownStyle.DropDownList; this.uicbxLayer.FillColor = System.Drawing.Color.White; this.uicbxLayer.Font = new System.Drawing.Font("微软雅黑", 12F); this.uicbxLayer.Location = new System.Drawing.Point(16, 32); this.uicbxLayer.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.uicbxLayer.MinimumSize = new System.Drawing.Size(63, 0); this.uicbxLayer.Name = "uicbxLayer"; this.uicbxLayer.Padding = new System.Windows.Forms.Padding(0, 0, 30, 2); this.uicbxLayer.Size = new System.Drawing.Size(167, 28); this.uicbxLayer.TabIndex = 5; this.uicbxLayer.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft; // // groupBox2 // this.groupBox2.Dock = System.Windows.Forms.DockStyle.Fill; this.groupBox2.Location = new System.Drawing.Point(0, 69); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(200, 246); this.groupBox2.TabIndex = 1; this.groupBox2.TabStop = false; this.groupBox2.Text = "分类字段"; // // GDfenlei // this.Controls.Add(this.groupBox2); this.Controls.Add(this.groupBox1); this.Name = "GDfenlei"; this.Size = new System.Drawing.Size(200, 315); this.groupBox1.ResumeLayout(false); this.ResumeLayout(false); } } }