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);
|
2016-11-16 17:27:03 +08:00
|
|
|
|
Icon = user.Icon;
|
2016-10-25 12:16:00 +08:00
|
|
|
|
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-11-12 20:52:48 +08:00
|
|
|
|
var msgs = MessageHelper.RetrieveMessagesHeader(UserName);
|
|
|
|
|
MessageCount = msgs.Count();
|
|
|
|
|
Messages = msgs.Take(6);
|
2016-11-14 09:42:59 +08:00
|
|
|
|
MessageList = MessageHelper.RetrieveMessages(UserName);
|
2016-11-17 09:41:13 +08:00
|
|
|
|
var tasks = TaskHelper.RetrieveTasks();
|
|
|
|
|
TaskCount = tasks.Count();
|
|
|
|
|
Tasks = tasks.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-11-12 15:44:25 +08:00
|
|
|
|
/// <summary>
|
2016-11-12 20:52:48 +08:00
|
|
|
|
/// 获得/设置 消息列表
|
2016-11-12 15:44:25 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
public IEnumerable<Message> Messages { get; set; }
|
2016-11-12 20:52:48 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获得/设置 消息数量
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int MessageCount { get; set; }
|
2016-11-14 09:42:59 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获得/设置 消息列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
public IEnumerable<Message> MessageList { get; set; }
|
2016-11-15 11:15:38 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
2016-11-16 17:27:03 +08:00
|
|
|
|
public string Icon { get; set; }
|
2016-11-17 09:41:13 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取/设置 任务数量
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int TaskCount { get; set; }
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取/设置 任务内容集合
|
|
|
|
|
/// </summary>
|
|
|
|
|
public IEnumerable<Task> Tasks { get; set; }
|
2016-11-14 09:42:59 +08:00
|
|
|
|
|
2016-10-24 01:01:29 +08:00
|
|
|
|
}
|
2016-10-20 17:55:29 +08:00
|
|
|
|
}
|