private void LoadMessage(string Folder, int UserID, int OrderBy, int SortBy, int PageIndex, int PageSize) { ProviderPrivateMessageViewInbox GetMessage = new ProviderPrivateMessageViewInbox(); GetMessage.Param(Folder, UserID, OrderBy, SortBy, PageIndex, PageSize); PagerLinks Pager = PagerLinks.GetInstance(); Pager.PagerLinksParam(PageIndex, PageSize, GetMessage.TotalCount); string ParamURL = Request.CurrentExecutionFilePath + "?"; lbPagerLink.Text = Pager.DisplayNumericPagerLinkPrivateMessage(ParamURL, OrderBy, SortBy, PageIndex, Folder); lblRecpage.Text = Pager.GetBottomPagerCounterCustomPaging; GetTopImageReadUnreadTopAndLabel(GetMessage, Folder); PMViewInbox.DataSource = GetMessage.GetMessages(); PMViewInbox.DataBind(); GetMessage = null; }
private void GetTopImageReadUnreadTopAndLabel(ProviderPrivateMessageViewInbox GetMessage, string Folder) { if (string.IsNullOrEmpty(Request.QueryString["folder"]) || Folder == "inbox") { if (GetMessage.UnreadCount == 0) { IsNewImageTop.ImageUrl = "images/oldmsg_icon2.gif"; lblcountunreadmsg.Text = "You have 0 new messages"; } else { IsNewImageTop.ImageUrl = "images/newmsg_icon.gif"; lblcountunreadmsg.Text = "You have " + GetMessage.UnreadCount + " new messages"; } } else if (Folder == "sentitems") { if (GetMessage.UnreadCount == 0) { IsNewImageTop.ImageUrl = "images/oldmsg_icon2.gif"; lblcountunreadmsg.Text = "You have 0 sent messages"; } else { IsNewImageTop.ImageUrl = "images/newmsg_icon.gif"; lblcountunreadmsg.Text = "You have " + GetMessage.UnreadCount + " unread sent messages"; } } else if (Folder == "trash") { lblcountunreadmsg.Text = "You have " + GetMessage.TotalCount + " trash messages"; } }