public void DisplayDropdownMenu() { MySqlConnection conn = CMain.GetConnection(ApplicationSession.DBName); if (ApplicationSession.SalesType.IsCatering()) { //Category: List <CCategory> lst = CCategory.ListOfCategoryZero(conn, ApplicationSession.StoreID, ApplicationSession.OutletID); foreach (CCategory cat in lst) { HtmlGenericControl li = new HtmlGenericControl("li"); tabs.Controls.Add(li); HtmlGenericControl anchor = new HtmlGenericControl("a"); string url = "CategoryPage.aspx?id=" + cat.ID.ToString(); anchor.Attributes.Add("href", url); //anchor.Attributes.Add("runat", "server"); //anchor.Attributes.Add("onclick", "return MyFunction();"); anchor.InnerText = cat.Caption; li.Controls.Add(anchor); } } else { //ItemGroups: List <CItemGroup> lst = COutlet.ListOfItemGroups(conn, ApplicationSession.StoreID, ApplicationSession.OutletID); foreach (CItemGroup ig in lst) { HtmlGenericControl li = new HtmlGenericControl("li"); tabs.Controls.Add(li); HtmlGenericControl anchor = new HtmlGenericControl("a"); string url = "MenuItemPage.aspx?id=" + ig.ID.ToString(); anchor.Attributes.Add("href", url); //anchor.Attributes.Add("runat", "server"); //anchor.Attributes.Add("onclick", "return MyFunction();"); anchor.InnerText = ig.Name; li.Controls.Add(anchor); } } //DeliveryMethods: List <CDeliveryMode> lstDelMode = COutlet.ListOfDeliveryModes(conn, ApplicationSession.StoreID, ApplicationSession.OutletID); foreach (CDeliveryMode delMode in lstDelMode) { HtmlGenericControl li = new HtmlGenericControl("li"); delTabs.Controls.Add(li); HtmlGenericControl anchor = new HtmlGenericControl("a"); //string url = "MenuItemPage.aspx?id=" + ig.ID.ToString(); //anchor.Attributes.Add("href", url); //anchor.Attributes.Add("runat", "server"); //anchor.Attributes.Add("onclick", "return MyFunction();"); anchor.InnerText = delMode.Name; li.Controls.Add(anchor); } }
private void DisplayItemGroups() { MySqlConnection conn = CMain.GetConnection(ApplicationSession.DBName); COutlet outlet = new COutlet(ApplicationSession.OutletID, conn); lblTitle.InnerText = outlet.Name; lblSlogan.Text = "Welcome!"; List <CItemGroup> lst = COutlet.ListOfItemGroups(conn, outlet.StoreID, outlet.ID); lvItemGroup.DataSource = lst; lvItemGroup.DataBind(); }