Ejemplo n.º 1
0
        public ToMeModel GetToMe(int userId, MessageSort sortedBy, bool des, PagerModel pager, int? projectId = null, int? addresserId = null)
        {
            ToMeModel model = new ToMeModel();

            model.Messages = new List<ToMeItemModel>
            {
                new ToMeItemModel
                {
                    Id=11,
                    PublishTime=new DateTime(2015,1,13,12,11,0),
                    Project=getProject(1),
                    Task=new ViewModel.Task.LiteItemModel{ Id=3, Title="编辑任务时不能修改项目组" },
                    Addresser=new UserModel{Id=14, Name="叶子" },
                    Content="发布时改变下拉列表值也不能生效"
                },
                new ToMeItemModel
                {
                    Id=21,
                    PublishTime=new DateTime(2015,1,12,12,31,0),
                    Project=getProject(2),
                    Task=new ViewModel.Task.LiteItemModel{ Id=23, Title="博客页面的“上一篇”“下一篇”部分报错" },
                    Addresser=new UserModel{ Id=24,Name="叶子" },
                    Content="ViewModel冲突:Main.Blog.BlogPreAndNextModel和Main.PreAndNextModel"
                },
                new ToMeItemModel
                {
                    Id=31,
                    PublishTime=new DateTime(2015,1,11,1,11,0),
                    ReadTime=new DateTime(2015,1,11,11,12,10),
                    Project=getProject(3),
                    Task=new ViewModel.Task.LiteItemModel{ Id=33, Title="准备数据" },
                    Addresser=new UserModel{ Id=34,Name="自由飞" },
                    Content="重心明显移后,劳动人口的绝对数量开始步入下降通道"
                },
                new ToMeItemModel
                {
                    Id=41,
                    PublishTime=new DateTime(2015,1,11,1,11,0),
                    ReadTime=new DateTime(2015,1,11,1,13,0),
                    Project=getProject(4),
                    Task=new ViewModel.Task.LiteItemModel{ Id=43, Title="整理/Blog/{bloggerName} " },
                    Addresser=new UserModel{ Id=44,Name="心情" },
                    Content="整理/Blog/{bloggerName},能跑起来,先"
                }
            };
            model.Addressers = model.Messages.Select(m => m.Addresser).Distinct().ToList();
            model.Projects = new List<_LiteralLinkedModel>();

            return model;
        }
Ejemplo n.º 2
0
        public ToMeModel GetToMe(int userId,
            MessageSort sortedBy, bool des,
            PagerModel pager,
            int? projectId = null, int? addresserId = null)
        {
            ToMeModel model = new ToMeModel();

            model.Addressers = getCommunicators(userId, MessageFor.Addressee);
            model.Projects = getProjects(userId, MessageFor.Addressee);

            var messages = _querySource.Get(addresserId, userId, projectId, MessageFor.Addressee)
                .Sort(sortedBy, des)
                .Paged(pager)
                .ToList();

            model.Messages = new List<ToMeItemModel>();
            model.Messages.FilledBy(messages);

            return model;
        }