예제 #1
0
        public virtual List <NotifyDispItem> ComposeDispItems(IEnumerable <ThreadBase> msgThreads)
        {
            var userId    = UserSession.CurrentUserId;
            var dispItems = new List <NotifyDispItem>();

            foreach (var item in msgThreads)
            {
                var lastMsg  = item.ThreadItems.Last();
                var dispItem = new NotifyDispItem
                {
                    ItemId   = item.EntityKey,
                    Title    = item.ThreadTitle,
                    Date     = lastMsg.Date,
                    Comment  = lastMsg.Text,
                    UserId   = lastMsg.SenderId,
                    UserName = lastMsg.SenderName,
                };
                if (lastMsg.SenderId == userId && item.EntityUserMaps.Any(mp => mp.UserId != userId))
                {
                    var map = item.EntityUserMaps.First(mp => mp.UserId != userId);
                    dispItem.UserId   = map.UserId;
                    dispItem.UserName = map.UserName;
                    dispItem.IsReply  = true;
                }
                dispItems.Add(dispItem);
            }
            return(dispItems);
        }
예제 #2
0
        public override List <NotifyDispItem> ComposeDispItems(IEnumerable <ThreadBase> msgThreads)
        {
            var userId    = UserSession.CurrentUserId;
            var dispItems = new List <NotifyDispItem>();

            foreach (var item in msgThreads)
            {
                var lastMsg  = item.ThreadItems.Last();
                var dispItem = new NotifyDispItem
                {
                    ItemId   = item.EntityKey,
                    Title    = item.ThreadTitle,
                    Date     = lastMsg.Date,
                    Comment  = lastMsg.Text,
                    UserId   = lastMsg.SenderId,
                    UserName = lastMsg.SenderName,
                    IsReply  = true
                };
                if (lastMsg.SenderId == userId)
                {
                    var map = item.EntityUserMaps.First(mp => mp.UserId != userId);
                    dispItem.UserId   = map.UserId;
                    dispItem.UserName = map.UserName;
                }
                if (item.ThreadItems.Count() == 1)
                {
                    dispItem.Comment = (item as Discussion).Content;
                    dispItem.IsReply = false;
                }
                dispItems.Add(dispItem);
            }
            return(dispItems);
        }
예제 #3
0
 public virtual List<NotifyDispItem> ComposeDispItems(IEnumerable<ThreadBase> msgThreads)
 {
     var userId = UserSession.CurrentUserId;
     var dispItems = new List<NotifyDispItem>();
     foreach (var item in msgThreads)
     {
         var lastMsg = item.ThreadItems.Last();
         var dispItem = new NotifyDispItem
         {
             ItemId = item.EntityKey,
             Title = item.ThreadTitle,
             Date = lastMsg.Date,
             Comment = lastMsg.Text,
             UserId = lastMsg.SenderId,
             UserName = lastMsg.SenderName,
         };
         if (lastMsg.SenderId == userId && item.EntityUserMaps.Any(mp => mp.UserId != userId))
         {
             var map = item.EntityUserMaps.First(mp => mp.UserId != userId);
             dispItem.UserId = map.UserId;
             dispItem.UserName = map.UserName;
             dispItem.IsReply = true;
         }
         dispItems.Add(dispItem);
     }
     return dispItems;
 }
예제 #4
0
 public override List<NotifyDispItem> ComposeDispItems(IEnumerable<ThreadBase> msgThreads)
 {
     var userId = UserSession.CurrentUserId;
     var dispItems = new List<NotifyDispItem>();
     foreach (var item in msgThreads)
     {
         var lastMsg = item.ThreadItems.Last();
         var dispItem = new NotifyDispItem
         {
             ItemId = item.EntityKey,
             Title = item.ThreadTitle,
             Date = lastMsg.Date,
             Comment = lastMsg.Text,
             UserId = lastMsg.SenderId,
             UserName = lastMsg.SenderName,
             IsReply = true
         };
         if (lastMsg.SenderId == userId)
         {
             var map = item.EntityUserMaps.First(mp => mp.UserId != userId);
             dispItem.UserId = map.UserId;
             dispItem.UserName = map.UserName;
         }
         if (item.ThreadItems.Count() == 1)
         {
             dispItem.Comment = (item as Discussion).Content;
             dispItem.IsReply = false;
         }
         dispItems.Add(dispItem);
     }
     return dispItems;
 }
예제 #5
0
        public List <NotifyDispItem> ComposeDispItems(IEnumerable <MentorShip> mentorships)
        {
            var userId    = UserSession.CurrentUserId;
            var dispItems = new List <NotifyDispItem>();

            foreach (var item in mentorships)
            {
                var lastMsg  = item.Messages.Last();
                var dispItem = new NotifyDispItem
                {
                    ItemId   = item.EntityKey,
                    Date     = lastMsg.Date,
                    Comment  = lastMsg.Text,
                    UserId   = lastMsg.SenderId,
                    UserName = lastMsg.SenderName,
                };
                if (lastMsg.SenderId == userId)
                {
                }
                dispItems.Add(dispItem);
            }
            return(dispItems);
        }
예제 #6
0
        public List<NotifyDispItem> ComposeDispItems(IEnumerable<MentorShip> mentorships)
        {
            var userId = UserSession.CurrentUserId;
            var dispItems = new List<NotifyDispItem>();
            foreach (var item in mentorships)
            {
                var lastMsg = item.Messages.Last();
                var dispItem = new NotifyDispItem
                {
                    ItemId = item.EntityKey,
                    Date = lastMsg.Date,
                    Comment = lastMsg.Text,
                    UserId = lastMsg.SenderId,
                    UserName = lastMsg.SenderName,
                };
                if (lastMsg.SenderId == userId)
                {

                }
                dispItems.Add(dispItem);
            }
            return dispItems;
        }