BootstrapAdmin/Bootstrap.Admin/Models/HeaderBarModel.cs

48 lines
1.4 KiB
C#
Raw Normal View History

using Bootstrap.DataAccess;
using System.Collections.Generic;
using System.Web;
namespace Bootstrap.Admin.Models
{
/// <summary>
///
/// </summary>
public class HeaderBarModel : ModelBase
{
public HeaderBarModel()
{
var user = UserHelper.RetrieveUsersByName(HttpContext.Current.User.Identity.Name);
DisplayName = user.DisplayName;
UserName = user.UserName;
UserID = user.ID;
HomeUrl = "~/";
Menus = MenuHelper.RetrieveLinksByUserName(UserName);
2016-11-11 21:05:41 +08:00
Notifications = NotificationHelper.RetrieveNotifications();
}
public string UserName { get; protected set; }
/// <summary>
///
/// </summary>
public int UserID { get; protected set; }
/// <summary>
///
/// </summary>
public string DisplayName { get; protected set; }
/// <summary>
///
/// </summary>
public bool ShowMenu { get; protected set; }
/// <summary>
///
/// </summary>
public string HomeUrl { get; protected set; }
/// <summary>
/// 获得/设置 前台菜单
/// </summary>
public IEnumerable<Menu> Menus { get; private set; }
/// <summary>
///
/// </summary>
2016-11-11 21:05:41 +08:00
public IEnumerable<Notification> Notifications { get; set; }
}
2016-10-20 17:55:29 +08:00
}