Example #1
0
        private void FillgroupList()
        {
            this.grouplist.Items.Clear();
            System.Collections.Generic.List <GroupInfo> groupByBillFlag = GroupInfo.GetGroupByBillFlag(1);
            foreach (GroupInfo current in groupByBillFlag)
            {
                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;
        }
Example #2
0
        public BillingRptParaGpAddDlg()
        {
            this.InitializeComponent();
            this.grouplist.Items.Clear();
            System.Collections.Generic.List <GroupInfo> groupByBillFlag = GroupInfo.GetGroupByBillFlag(0);
            foreach (GroupInfo current in groupByBillFlag)
            {
                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 = current.ID.ToString();
                this.grouplist.Items.Add(listViewItem);
            }
        }