public void addUcMenuGroup(int catalogueid, int CurrentPage) { if (catalogueid > 0) { if (this.totalPage == 0) { this.totalPage = CatalogeService.GetCategoryByCatalogueID(catalogueid).Count(); } var data = CatalogeService.GetCategoryByCatalogueID(catalogueid, CurrentPage); this.CurrentPage = CurrentPage; if (data.Count() > 0) { flpIncludesGroup.Controls.Clear(); foreach (var item in data) { UCGroup ucGroup = new UCGroup(); ucGroup.lblNameGroup.Text = item.CategoryName; ucGroup.Tag = item; flpIncludesGroup.Controls.Add(ucGroup); } addButton(catalogueid); backButton(catalogueid); nextButton(catalogueid); } else { addButton(catalogueid); } } }
private void addUcMenuGroup() { string[] array = { "Coffee", "Smoothie", "Juice" }; List<string> lst = new List<string>(); foreach (string str in array) { lst.Add(str); } for (int i = 0; i < lst.Count; i++) { UCGroup ucGroup = new UCGroup(); ucGroup.lblNameGroup.Text = lst[i].ToString(); ucGroup.Tag = lst[i]; ucGroup.Click += ucGroup_Click; flpIncludesGroup.Controls.Add(ucGroup); } }