예제 #1
0
 public ThermGenRptParaGpAddDlg(int existgpnum)
 {
     this.InitializeComponent();
     this.m_existgpnum = existgpnum;
     this.grouplist.Items.Clear();
     System.Collections.Generic.List <GroupInfo> groupByThermalFlag = GroupInfo.GetGroupByThermalFlag(0);
     foreach (GroupInfo current in groupByThermalFlag)
     {
         ListViewItem listViewItem = new ListViewItem();
         string       text         = "";
         string       groupType;
         if ((groupType = current.GroupType) != null)
         {
             if (!(groupType == "zone"))
             {
                 if (groupType == "rack" || groupType == "allrack")
                 {
                     text = LangRes.Group_TPRack;
                 }
             }
             else
             {
                 text = LangRes.Group_TPZone;
             }
         }
         if (text.Length != 0)
         {
             listViewItem.Text = EcoLanguage.getMsg(text, new string[0]);
             listViewItem.SubItems.Add(current.GroupName);
             listViewItem.Tag = current.ID.ToString();
             this.grouplist.Items.Add(listViewItem);
         }
     }
 }
예제 #2
0
        private void FillgroupList()
        {
            this.grouplist.Items.Clear();
            System.Collections.Generic.List <GroupInfo> groupByThermalFlag = GroupInfo.GetGroupByThermalFlag(1);
            foreach (GroupInfo current in groupByThermalFlag)
            {
                ListViewItem listViewItem = new ListViewItem();
                string       skey         = "";
                string       groupType;
                switch (groupType = current.GroupType)
                {
                case "zone":
                    skey = LangRes.Group_TPZone;
                    break;

                case "rack":
                case "allrack":
                    skey = LangRes.Group_TPRack;
                    break;

                case "dev":
                case "alldev":
                    skey = LangRes.Group_TPDev;
                    break;

                case "outlet":
                case "alloutlet":
                    skey = LangRes.Group_TPOutlet;
                    break;
                }
                listViewItem.Text = EcoLanguage.getMsg(skey, new string[0]);
                listViewItem.SubItems.Add(current.GroupName);
                listViewItem.Tag = string.Concat(new string[]
                {
                    current.ID.ToString(),
                    "|",
                    current.Members,
                    "|",
                    current.GroupType
                });
                this.grouplist.Items.Add(listViewItem);
            }
            if (this.grouplist.SelectedItems.Count <= 0)
            {
                this.btndel.Enabled = false;
                return;
            }
            this.btndel.Enabled = true;
        }