Пример #1
0
        public static PrivateMessageCollection GetCurrentUserInboxPrivateMessages(int StartIndex, int PageSize, out int totalRecords)
        {
            PrivateMessageCollection result = new PrivateMessageCollection();

            if (PageSize <= 0)
            {
                PageSize = 10;
            }
            if (PageSize == int.MaxValue)
            {
                PageSize = int.MaxValue - 1;
            }

            int PageIndex = StartIndex / PageSize;

            totalRecords = 0;

            if (NopContext.Current.User == null)
            {
                return(result);
            }

            result = ForumManager.GetAllPrivateMessages(0, NopContext.Current.User.CustomerId, null, null, false,
                                                        string.Empty, PageSize, PageIndex, out totalRecords);
            return(result);
        }
Пример #2
0
        protected string GetUnreadPrivateMessages()
        {
            string result = string.Empty;

            if (NopContext.Current.User != null && !NopContext.Current.User.IsGuest)
            {
                int totalRecords = 0;
                PrivateMessageCollection privateMessages = ForumManager.GetAllPrivateMessages(0,
                                                                                              NopContext.Current.User.CustomerID, false, null, false, string.Empty, 1, 0, out totalRecords);

                if (totalRecords > 0)
                {
                    result = string.Format(GetLocaleResourceString("PrivateMessages.TotalUnread"), totalRecords);
                }
            }
            return(result);
        }
Пример #3
0
        public static PrivateMessageCollection GetCurrentUserInboxPrivateMessages(int StartIndex, int PageSize, out int totalRecords)
        {
            PrivateMessageCollection result = new PrivateMessageCollection();
            if (PageSize <= 0)
                PageSize = 10;
            if (PageSize == int.MaxValue)
                PageSize = int.MaxValue - 1;

            int PageIndex = StartIndex / PageSize;

            totalRecords = 0;

            if (NopContext.Current.User == null)
                return result;

            result = ForumManager.GetAllPrivateMessages(0, NopContext.Current.User.CustomerID, null, null, false,
                string.Empty, PageSize, PageIndex, out totalRecords);
            return result;
        }
Пример #4
0
        private static PrivateMessageCollection DBMapping(DBPrivateMessageCollection dbCollection)
        {
            if (dbCollection == null)
                return null;

            PrivateMessageCollection collection = new PrivateMessageCollection();
            foreach (DBPrivateMessage dbItem in dbCollection)
            {
                PrivateMessage item = DBMapping(dbItem);
                collection.Add(item);
            }

            return collection;
        }