internal List <OutgoingChatItem> GetDocumentationNavigation(int id)
        {
            var result = new List <OutgoingChatItem>();

            Context.DocumentationCategory
            .Include(x => x.DocumentationCategoryField)
            .Select(x => x)
            .ToList().ForEach(x => {
                var cItem = new OutgoingChatItem
                {
                    InternalId = x.Id,
                    // NodeId = i++,
                    NodeText    = x.CategoryName,
                    IconCss     = "fa-list-alt",
                    Link        = "",
                    ChannelType = 0,
                    IsParent    = true,
                    ParentId    = x.Id,
                    IsExpand    = 1,
                    NodeChild   = x.DocumentationCategoryField.Select(y => new OutgoingChatItemChild {
                        InternalId = y.Id,
                        // NodeId = i++,
                        NodeText = y.PageName,
                        IconCss  = "fa fa-file",
                        Link     = "",
                        ParentId = y.CategoryId.Value
                    }).ToList()
                };
                result.Add(cItem);
            });
            return(result);
        }
Exemplo n.º 2
0
        private List <OutgoingChatItem> GetPersonalMessageNavigation(int userId, List <OutgoingChatItem> result)
        {
            var personalMesages = Context.AssociatedChatPersonalMessages.Include(x => x.Sender)
                                  .Where(x => x.ReciverId == userId)
                                  .Select(x => new
            {
                Email = x.Sender.Email,
                Id    = x.Sender.Id
            })
                                  .Distinct()
                                  .ToList();
            var pMessageCategory = new OutgoingChatItem
            {
                InternalId  = -1,
                IconCss     = "icon-th icon",
                ChannelType = 0,
                NodeText    = "Personal Messages",
                IsParent    = true,
                ParentId    = -1,
                Link        = "",
                NodeChild   = new List <OutgoingChatItemChild>()
            };

            personalMesages.ForEach(x =>
            {
                pMessageCategory.NodeChild.Add(new OutgoingChatItemChild
                {
                    InternalId = x.Id,
                    // NodeId = i++,
                    NodeText    = x.Email,
                    ChannelType = 0,
                    IconCss     = "icon-circle-thin icon",
                    Link        = "",
                    IsPersonal  = true,
                    ParentId    = -1
                });
            });
            result.Add(pMessageCategory);
            return(result);
        }