protected void Page_Load(object sender, EventArgs e) { MyAccountItem context = (MyAccountItem)Sitecore.Context.Item; litSeeAllNotificationsLabel.Text = DictionaryConstants.SeeAllNotificationsLabel; hrefNotificationsLink.HRef = MainsectionItem.GetHomePageItem().GetMyAccountFolder().GetMyNotificationsPage().GetUrl(); hrefNotificationsLink.InnerText = context.SeeAllNotificationsText; if (Notifications != null) { litNotifCount.Text = Notifications.Count().ToString(); pnlEmptyText.Visible = false; } else { pnlEmptyText.Visible = true; } var filterNotifs = Notifications; if (Notifications != null) { filterNotifs = Notifications.OrderByDescending(x => x.NotificationDate).Take(3).ToList(); } lvNotifications.DataSource = filterNotifs; lvNotifications.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { HeaderFolder = HeaderFolderItem.GetHeader(); if (IsUserLoggedIn) { phLoggedIn.Visible = true; MyAccountPageItem = MyAccountItem.GetMyAccountPage(); UserDisplayName = !string.IsNullOrWhiteSpace(CurrentMember.FirstName) ? CurrentMember.FirstName.Trim() : "Guest"; //sets up the global hero image along with the notifications var user = TelligentService.GetUser(CurrentMember.ScreenName); if (user != null) { imgUserAvatar.ImageUrl = user.AvatarUrl; } else { imgUserAvatar.ImageUrl = Constants.Settings.AnonymousAvatar; } // TODO: review this code if necessary int totalNotifications = (Notifications != null) ? Notifications.Count() : 0; int totalConversations = (Conversations != null) ? Conversations.Count() : 0; lblNotificationNumber.Text = (totalConversations + totalConversations).ToString(); } else { phNotLoggedIn.Visible = true; } GetCompanyLogoDetail(); SetLanguageItemsRepeater(); GetUtilityNavigationItems(); }
public void It_should_return_one_error() { Assert.AreEqual(1, Notifications.Count()); }
public void It_should_not_return_any_notifications() { Assert.AreEqual(0, Notifications.Count()); }
protected override void Count(NotificationsQuery query, Action <int> success, Action <GetSocialError> error) { Notifications.Count(query, success, error); }