2016-10-24 01:01:29 +08:00
|
|
|
|
using Bootstrap.DataAccess;
|
2016-11-05 23:15:07 +08:00
|
|
|
|
using System.Collections.Generic;
|
2016-11-12 15:26:40 +08:00
|
|
|
|
using System.Linq;
|
2016-10-24 01:01:29 +08:00
|
|
|
|
using System.Web;
|
|
|
|
|
|
|
|
|
|
namespace Bootstrap.Admin.Models
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class HeaderBarModel : ModelBase
|
|
|
|
|
{
|
|
|
|
|
public HeaderBarModel()
|
|
|
|
|
{
|
2016-10-25 12:16:00 +08:00
|
|
|
|
var user = UserHelper.RetrieveUsersByName(HttpContext.Current.User.Identity.Name);
|
|
|
|
|
DisplayName = user.DisplayName;
|
2016-11-08 20:37:14 +08:00
|
|
|
|
UserName = user.UserName;
|
2016-10-25 12:16:00 +08:00
|
|
|
|
UserID = user.ID;
|
2016-10-24 01:01:29 +08:00
|
|
|
|
HomeUrl = "~/";
|
2016-11-08 20:37:14 +08:00
|
|
|
|
Menus = MenuHelper.RetrieveLinksByUserName(UserName);
|
2016-11-12 15:26:40 +08:00
|
|
|
|
var notis = NotificationHelper.RetrieveNotifications();
|
|
|
|
|
NotifiCount = notis.Count();
|
|
|
|
|
Notifications = notis.Take(6);
|
2016-10-24 01:01:29 +08:00
|
|
|
|
}
|
2016-11-08 20:37:14 +08:00
|
|
|
|
public string UserName { get; protected set; }
|
2016-10-24 01:01:29 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
2016-11-05 23:15:07 +08:00
|
|
|
|
public int UserID { get; protected set; }
|
2016-10-25 12:16:00 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
2016-11-05 23:15:07 +08:00
|
|
|
|
public string DisplayName { get; protected set; }
|
2016-10-24 01:01:29 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
2016-11-05 23:15:07 +08:00
|
|
|
|
public bool ShowMenu { get; protected set; }
|
2016-10-24 01:01:29 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
2016-11-05 23:15:07 +08:00
|
|
|
|
public string HomeUrl { get; protected set; }
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获得/设置 前台菜单
|
|
|
|
|
/// </summary>
|
|
|
|
|
public IEnumerable<Menu> Menus { get; private set; }
|
2016-11-10 18:16:21 +08:00
|
|
|
|
/// <summary>
|
2016-11-12 15:26:40 +08:00
|
|
|
|
/// 获得/设置 通知内容集合
|
2016-11-10 18:16:21 +08:00
|
|
|
|
/// </summary>
|
2016-11-11 21:05:41 +08:00
|
|
|
|
public IEnumerable<Notification> Notifications { get; set; }
|
2016-11-12 15:26:40 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获得/设置 通知数量
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int NotifiCount { get; set; }
|
2016-10-24 01:01:29 +08:00
|
|
|
|
}
|
2016-10-20 17:55:29 +08:00
|
|
|
|
}
|