private void setUserDetails() { var session = new SLLITPage(); var user = new UserBL().GetUserByID(session.CurrentUserID); lblUserName.Text = user.DisplayName; }
private void CreateSideMenu() { var session = new SLLITPage(); var menu = new UserRoleBL().GetMenuByUserID(session.CurrentUserID); string html = ""; liItems.InnerHtml = String.Empty; var tempHtml = string.Empty; var finalHtml = string.Empty; var currentRoleName = string.Empty; finalHtml += "<!-- DOC: To remove the sidebar toggler from the sidebar you just need to completely remove the below 'sidebar-toggler-wrapper' LI element -->"; finalHtml += "<li class='sidebar-toggler-wrapper'>"; finalHtml += " <!-- BEGIN SIDEBAR TOGGLER BUTTON -->"; finalHtml += " <div class='sidebar-toggler'>"; finalHtml += " </div>"; finalHtml += " <!-- END SIDEBAR TOGGLER BUTTON -->"; finalHtml += "</li>"; finalHtml += "<li class='start active'>"; finalHtml += " <a href='" + ResolveUrl("~/Default.aspx") + "'>"; finalHtml += " <i class='icon-home'></i>"; finalHtml += " <span class='title'>Home</span>"; finalHtml += " <span class='selected'></span>"; finalHtml += " </a>"; finalHtml += "</li>"; foreach (var item in menu) { if (currentRoleName == string.Empty)//first case { currentRoleName = item.RoleName; finalHtml += "<li>"; finalHtml += " <a href='javascript:;'>"; finalHtml += " <i class='fa " + item.RoleIcon + "'></i>"; finalHtml += " <span class='title'>" + item.RoleName + "</span>"; finalHtml += " <span class='arrow '></span>"; finalHtml += " </a>"; finalHtml += "<ul class='sub-menu'>"; } if (currentRoleName != item.RoleName)//if role changes { currentRoleName = item.RoleName; finalHtml += tempHtml; finalHtml += " </ul>"; finalHtml += " </li>"; finalHtml += "<li>"; finalHtml += " <a href='javascript:;'>"; finalHtml += " <i class='fa " + item.RoleIcon + "'></i>"; finalHtml += " <span class='title'>" + item.RoleName + "</span>"; finalHtml += " <span class='arrow '></span>"; finalHtml += " </a>"; finalHtml += "<ul class='sub-menu'>"; tempHtml = string.Empty; } tempHtml += " <li><a href='" + ResolveUrl(item.MenuHomePage) + "'>" + item.MenuDisplayName + "</a></li>"; } finalHtml += tempHtml; finalHtml += " </ul>"; finalHtml += "</li>"; liItems.InnerHtml = finalHtml; }