BootstrapAdmin/Bootstrap.Admin/Models/NavigatorBarModel.cs

21 lines
647 B
C#
Raw Normal View History

2016-10-21 16:35:26 +08:00
using Bootstrap.DataAccess;
using System;
2016-10-21 16:35:26 +08:00
using System.Collections.Generic;
using System.Linq;
2016-10-21 16:35:26 +08:00
namespace Bootstrap.Admin.Models
{
public class NavigatorBarModel : HeaderBarModel
{
public NavigatorBarModel(string url)
2016-10-21 16:35:26 +08:00
{
Navigations = MenuHelper.RetrieveNavigationsByUserName(UserName);
Navigations.ToList().ForEach(m => m.Active = m.Url.Equals(url, StringComparison.OrdinalIgnoreCase) ? "active" : "");
HomeUrl = "~/Admin/Index";
2016-10-21 16:35:26 +08:00
}
/// <summary>
///
/// </summary>
public IEnumerable<Menu> Navigations { get; set; }
2016-10-21 16:35:26 +08:00
}
2016-10-20 17:55:29 +08:00
}