1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- 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 GXfenlei : ConditionPanel
- {
- private GroupBox groupBox2;
- public GXfenlei() : base()
- {
- this.ConditionPanelName = "管线分类统计";
- this.SetSize(200, 400);
- InitializeComponent();
- }
- protected override void OnLoad(EventArgs e)
- {
- Dictionary<string, string> dic = new Dictionary<string, string>();
- 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<string> strField = new List<string>();
- 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;
- }
- return ComsStatic.TongJiFieldGroupCount(ComsStatic.gsGuanXian, strField.ToArray());
- }
- private void InitializeComponent()
- {
- this.groupBox2 = new System.Windows.Forms.GroupBox();
- this.SuspendLayout();
- //
- // groupBox2
- //
- this.groupBox2.Dock = System.Windows.Forms.DockStyle.Fill;
- this.groupBox2.Location = new System.Drawing.Point(0, 0);
- this.groupBox2.Name = "groupBox2";
- this.groupBox2.Size = new System.Drawing.Size(200, 315);
- this.groupBox2.TabIndex = 1;
- this.groupBox2.TabStop = false;
- this.groupBox2.Text = "分类字段";
- //
- // GXfenlei
- //
- this.Controls.Add(this.groupBox2);
- this.Name = "GXfenlei";
- this.Size = new System.Drawing.Size(200, 315);
- this.ResumeLayout(false);
- }
- }
- }
|