using Bootstrap.DataAccess;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Bootstrap.Admin.Models
{
///
///
///
public class HeaderBarModel : ModelBase
{
public HeaderBarModel()
{
var user = UserHelper.RetrieveUsersByName(HttpContext.Current.User.Identity.Name);
Icon = user.Icon;
DisplayName = user.DisplayName;
UserName = user.UserName;
UserID = user.ID;
HomeUrl = "~/";
Menus = MenuHelper.RetrieveLinksByUserName(UserName);
var notis = NotificationHelper.RetrieveNotifications();
NotifiCount = notis.Count();
Notifications = notis.Take(6);
var msgs = MessageHelper.RetrieveMessagesHeader(UserName);
MessageCount = msgs.Count();
Messages = msgs.Take(6);
MessageList = MessageHelper.RetrieveMessages(UserName);
var tasks = TaskHelper.RetrieveTasks();
TaskCount = tasks.Count();
Tasks = tasks.Take(6);
}
public string UserName { get; protected set; }
///
///
///
public int UserID { get; protected set; }
///
///
///
public string DisplayName { get; protected set; }
///
///
///
public bool ShowMenu { get; protected set; }
///
///
///
public string HomeUrl { get; protected set; }
///
/// 获得/设置 前台菜单
///
public IEnumerable