Ejemplo n.º 1
0
        /// <summary>
        /// 获取所有页面的头部导航菜单
        /// </summary>
        /// <returns></returns>
        public ActionResult GetHeader()
        {
            var account = Session["Account"] as AccountInfo;

            if (account != null)
            {
                if (account.IsAdmin)
                {
                    var repairService = new RepairService();
                    ViewData["RepairUnFinishCount"] = repairService.GetUnFinishCount();

                    var adviceService = new AdviceService();
                    ViewData["AdviceUnReplyCount"] = adviceService.GetUnReplyCount();
                }
                else
                {
                    var feeService = new FeeService();
                    ViewData["FeeUnFinishCount"] = feeService.GetUnFinishCountForOwner(account.Id);

                    var announService = new AnnouncementService();
                    ViewData["AnnounUnReadCount"] = announService.GetUnReadCountForOwner(account.Id);

                    var ownerService = new OwnerService();
                    ViewData["NewReplyCount"] = ownerService.GetNewReplyCount(account.Id);
                }
            }
            return(PartialView("Header"));
        }