Esempio n. 1
0
 public CommentEntity(BasicUser user, Guid targetId, Guid fatherId, string content)
     : base(user, targetId, content)
 {
     FatherId   = fatherId;
     ChildrenId = new List <Guid>();
     Position   = 0;
 }
Esempio n. 2
0
 public BlogEntity()
 {
     EntityType = TYPE;
     User       = new BasicUser();
     CreateTime = DateTime.Now;
     HasDeleted = false;
 }
Esempio n. 3
0
 public BlogEntity(BasicUser user, Guid targetId, string content)
 {
     Id         = Guid.NewGuid();
     User       = user;
     TargetId   = targetId;
     Content    = content;
     CreateTime = DateTime.Now;
     HasDeleted = false;
 }
Esempio n. 4
0
        public BlogEntity(BasicUser user, Guid targetId, string content) : base()
        {
            EntityType = TYPE;

            User       = user;
            TargetId   = targetId;
            Content    = content;
            CreateTime = DateTime.Now;
            HasDeleted = false;
        }
Esempio n. 5
0
 public BlogPostEntity(BasicUser user, Guid targetId, string title, string content)
     : base(user, targetId, content)
 {
     Title       = title;
     IsActivated = false;
     ModifyTime  = DateTime.Now;
     this.Asset  = new List <Asset>();
     EntityType  = TYPE;
     BlogType    = TYPE;
 }
Esempio n. 6
0
 public BlogPostEntity(BasicUser user, Guid targetId, string title, string content)
     : base(user, targetId, content)
 {
     Title          = title;
     IsActivated    = false;
     ModifyTime     = DateTime.Now;
     this.Asset     = new Asset();
     readTimes      = 0;
     likedTimes     = 0;
     reprintedTimes = 0;
     rating         = 0;
 }
Esempio n. 7
0
 public BlogEntity()
 {
     EntityType = TYPE;
     User       = new BasicUser();
     CreateTime = DateTime.Now;
     HasDeleted = false;
     //ReadTimes = 0;
     //LikedTimes = 0;
     ReprientedTimes = 0;
     Rating          = 0;
     //FavoriteTimes = 0;
 }
Esempio n. 8
0
 public BlogEntity(BasicUser user, Guid targetId, string content) : base()
 {
     EntityType = TYPE;
     User       = user;
     TargetId   = targetId;
     Content    = content;
     CreateTime = DateTime.Now;
     HasDeleted = false;
     //ReadTimes = 0;
     //LikedTimes = 0;
     ReprientedTimes = 0;
     Rating          = 0;
     //FavoriteTimes = 0;
 }
Esempio n. 9
0
 public BlogPostEntity(BasicUser user, Guid targetId, string title, string content, List <Asset> asset)
     : base(user, targetId, content)
 {
     Title          = title;
     IsActivated    = false;
     ModifyTime     = DateTime.Now;
     this.Asset     = new List <Asset>();
     readTimes      = 0;
     likedTimes     = 0;
     reprintedTimes = 0;
     rating         = 0;
     EntityType     = TYPE;
     BlogType       = TYPE;
     Asset          = Asset;
 }
Esempio n. 10
0
        public virtual void AddComment(BasicUser user, Guid targetId, Guid fatherId, string content)
        {
            //先计算楼层
            Dictionary <string, object> queryDict = new Dictionary <string, object>();

            queryDict.Add("TargetId", targetId);
            QueryObject <CommentEntity> queryObject = new QueryObject <CommentEntity>(EntityRepository);

            queryObject.AppendQuery(queryDict, QueryLogic.And);
            int position = Convert.ToInt32(EntityRepository.FindCountOfResult(queryObject)) + 1;
            //加入数据库
            CommentEntity newComment = new CommentEntity(user, targetId, fatherId, content);

            newComment.Position = position;
            EntityRepository.SaveOne(newComment);
            //当存在father时
            //在father的children中加入该comment
            if (fatherId != Guid.Empty)
            {
                CommentEntity father = FindOneById(fatherId);
                father.ChildrenId.Add(newComment.Id);
                EntityRepository.SaveOne(father);
            }
        }
Esempio n. 11
0
        public void AddBlogPost(BasicUser user, Guid targetId, string title, string content)
        {
            BlogPostEntity blogPostEntity = new BlogPostEntity(user, targetId, title, content);

            blogPostRepository.SaveOne(blogPostEntity);
        }
Esempio n. 12
0
        public virtual void AddBlogPost(BasicUser user, Guid targetId, string title, string content, List <Asset> asset)
        {
            BlogPostEntity blogPostEntity = new BlogPostEntity(user, targetId, title, content, asset);

            EntityRepository.SaveOne(blogPostEntity);
        }