public PartialViewResult SideAdminPanel(bool isDropDown) { var count = 0; var settings = SettingsService.GetSettings(); if (LoggedOnReadOnlyUser != null) { count = _privateMessageService.NewPrivateMessageCount(LoggedOnReadOnlyUser.Id); } //if (count > 0) //{ // TempData[AppConstants.MessageViewBagName] = new GenericMessageViewModel // { // Message = LocalizationService.GetResourceString("Member.HasNewPrivateMessages"), // MessageType = GenericMessages.info // }; //} var viewModel = new ViewAdminSidePanelViewModel { CurrentUser = LoggedOnReadOnlyUser, NewPrivateMessageCount = count, CanViewPrivateMessages = settings.EnablePrivateMessages && LoggedOnReadOnlyUser != null && LoggedOnReadOnlyUser.DisablePrivateMessages != true, IsDropDown = isDropDown }; return PartialView(viewModel); }
public PartialViewResult SideAdminPanel(bool isDropDown) { var count = 0; var settings = SettingsService.GetSettings(); if (LoggedOnReadOnlyUser != null) { count = _privateMessageService.NewPrivateMessageCount(LoggedOnReadOnlyUser.Id); } var canViewPms = settings.EnablePrivateMessages && LoggedOnReadOnlyUser != null && LoggedOnReadOnlyUser.DisablePrivateMessages != true; var viewModel = new ViewAdminSidePanelViewModel { CurrentUser = LoggedOnReadOnlyUser, NewPrivateMessageCount = canViewPms ? count : 0, CanViewPrivateMessages = canViewPms, IsDropDown = isDropDown }; return PartialView(viewModel); }
public PartialViewResult SideAdminPanel(bool isDropDown) { var privateMessageCount = 0; var moderateCount = 0; var settings = SettingsService.GetSettings(); if (LoggedOnReadOnlyUser != null) { var allowedCategories = _categoryService.GetAllowedCategories(UsersRole); privateMessageCount = _privateMessageService.NewPrivateMessageCount(LoggedOnReadOnlyUser.Id); var pendingTopics = _topicService.GetPendingTopics(allowedCategories, UsersRole); var pendingPosts = _postService.GetPendingPosts(allowedCategories, UsersRole); moderateCount = (pendingTopics.Count + pendingPosts.Count); } var canViewPms = settings.EnablePrivateMessages && LoggedOnReadOnlyUser != null && LoggedOnReadOnlyUser.DisablePrivateMessages != true; var viewModel = new ViewAdminSidePanelViewModel { CurrentUser = LoggedOnReadOnlyUser, NewPrivateMessageCount = canViewPms ? privateMessageCount : 0, CanViewPrivateMessages = canViewPms, ModerateCount = moderateCount, IsDropDown = isDropDown }; return PartialView(viewModel); }