protected string GetSideMenu() { StringBuilder ret = new StringBuilder(); Model_AppModule m = new Model_AppModule(); Model_AppAction a = new Model_AppAction(); List <Model_AppModule> cmf = m.getListAppFeature(1); string MainAdminSlug = "~/admin/"; List <Model_AppAction> cmf_child = a.getListAppFeatureAll(); foreach (Model_AppModule item in cmf) { List <Model_AppAction> cmf_s = cmf_child.Where(c => c.ModuleID == item.ModuleID).ToList(); string slug = Page.ResolveClientUrl(MainAdminSlug + item.Slug); bool IsChild = false; string arrow = string.Empty; string child = string.Empty; if (cmf_s.Count() > 0) { slug = "#"; IsChild = true; arrow = "<span class=\"fa arrow\"></span>"; child = String.Join(",", cmf_s.Select(r => r.Slug).ToArray()); } //" + MenuActive(item.Slug, child) + " ret.Append("<li >"); ret.Append("<a href=\"" + slug + "\"><i class=\"" + item.Icon + "\"></i> <span class=\"nav-label\">" + item.Title + "</span>" + arrow + "</a>"); //" + MenuActive(i.Slug) + " if (IsChild) { ret.Append("<ul class=\"nav nav-second-level\">"); foreach (Model_AppAction i in cmf_s) { string slug_child = Page.ResolveClientUrl(MainAdminSlug + item.Slug + "/" + i.Slug + (!string.IsNullOrEmpty(i.QueryString)? "?" + i.QueryString.Trim(): "")); ret.Append("<li ><a href=\"" + slug_child + "\"><i class=\"fa fa-th-large\"></i> <span class=\"nav-label\">" + i.Title + "</span></a></li>"); } ret.Append("</ul>"); } ret.Append("</li>"); } return(ret.ToString()); }
public static List <Model_AppAction> GetActionAll() { Model_AppAction ma = new Model_AppAction(); return(ma.getListAppFeatureAll()); }