Ejemplo n.º 1
0
        /// <summary>
        /// 添加项目查看者
        /// </summary>
        public void AddViewer(int userId, string userName, string avator)
        {
            var viewer = new ProjectViewer()
            {
                UserId      = userId,
                UserName    = userName,
                Avatar      = avator,
                CreatedTime = DateTime.Now
            };

            //如果不在查看列表中,需添加
            if (!Viewers.Any(b => b.UserId == userId))
            {
                Viewers.Add(viewer);

                //添加查看项目
                AddDomainEvent(new ProjectViewedEvent
                {
                    Company       = this.Company,
                    Introduction  = this.Introduction,
                    Avatar        = this.Avatar,
                    ProjectViewer = viewer
                });
            }
        }
Ejemplo n.º 2
0
 public void AddViewer(ProjectViewer projectViewer)
 {
     if (!this.Viewers.Any(v => v.UserId == projectViewer.UserId))
     {
         this.Viewers.Add(projectViewer);
         this.AddDomainEvent(new ProjectViewedEvent
         {
             ProjectViewer = projectViewer,
             Company       = this.Company,
             Introduction  = this.Company
         });
     }
 }
Ejemplo n.º 3
0
        public void AddvViewer(int userid, string username, string vavtar)
        {
            var viewer = new ProjectViewer {
                UserId = userid, UserName = username, Avatar = vavtar, CreatedTime = DateTime.Now
            };


            if (Viewers.All(v => v.UserId != userid))
            {
                Viewers.Add(viewer);
                AddDomainEvent(new ProjectViewedEvent {
                    Viewer = viewer
                });
            }
        }
Ejemplo n.º 4
0
        public void AddViewer(int userId, string userName, string avatar)
        {
            var viewer = new ProjectViewer
            {
                UserId   = userId,
                UserName = userName,
                Avatar   = avatar
            };

            if (!Viewers.Any(v => v.UserId == userId))
            {
                this.AddDomainEvent(new ProjectViewedEvent {
                    Viewer = viewer
                });
                Viewers.Add(viewer);
            }
        }
Ejemplo n.º 5
0
        public void AddViewer(string userId, string userName, string avatar)
        {
            var viewer = new ProjectViewer
            {
                UserId      = userId,
                UserName    = userName,
                Avatar      = avatar,
                CreatedTime = DateTime.Now
            };

            if (!Viewers.Any(v => v.UserId == UserId))
            {
                Viewers.Add(viewer);
                AddDomainEvent(new ProjectViewedEvent {
                    Viewer = viewer
                });
            }
        }
Ejemplo n.º 6
0
        public void AddViewer(int userId, string userName, string avatar)
        {
            var viewer = new ProjectViewer
            {
                UserId     = userId,
                UserName   = userName,
                Avatar     = avatar,
                CreateTime = DateTime.Now
            };


            if (!Viewers.Any(v => v.UserId == userId))
            {
                Viewers.Add(viewer);
                AddDomainEvent(new ProjectViewedEvent {
                    Viewer = viewer, Company = Company, Introduction = Introduction
                });
            }
        }
Ejemplo n.º 7
0
        public void AddViewer(int userId, string userName, string avatar)
        {
            var viewer = new ProjectViewer()
            {
                UserId     = userId,
                UserName   = userName,
                Avatar     = avatar,
                CreateTime = DateTime.Now
            };

            if (!this.Viewer.Any(x => x.UserId == userId))
            {
                this.Viewer.Add(viewer);
                this.AddDomainEvent(new ProjectViewedEvent()
                {
                    Viewer = viewer
                });
            }
        }
Ejemplo n.º 8
0
        public void AddViewer(string userName, string avator, int userid)
        {
            if (ProjectViewers.Any(x => x.UserId == userid))
            {
                return;
            }
            var item = new ProjectViewer()
            {
                Avator     = avator,
                CreateTime = DateTime.Now,
                ProjectId  = Id,
                UserName   = userName,
                UserId     = userid
            };

            ProjectViewers.Add(item);
            AddDomainEvent(new ProejctViewedEvent()
            {
                ProjectViewer = item
            });
        }
Ejemplo n.º 9
0
        public void AddViewer(int userId, string userName, string avatar)
        {
            var viewer = new ProjectViewer
            {
                UserId   = userId,
                UserName = userName,
                Avatar   = avatar
            };

            if (Viewers.All(v => v.UserId != userId))
            {
                this.AddDomainEvent(new ProjectViewedEvent
                {
                    Viewer = viewer
                    ,
                    Company = this.Company
                    ,
                    Introduction = this.Introduction
                    ,
                    Avatar = this.Avatar
                });
                Viewers.Add(viewer);
            }
        }