Exemple #1
0
        public override TransitAccountFeedItem GetTransitInstance(ManagedSecurityContext sec)
        {
            TransitAccountFeedItem t_instance = base.GetTransitInstance(sec);

            t_instance.CommentCount = ManagedDiscussion.GetDiscussionPostCount(
                Session, mInstance.AccountFeed.Account.Id, typeof(AccountFeedItem), mInstance.Id);
            return(t_instance);
        }
Exemple #2
0
        public override TransitAccountStoryPicture GetTransitInstance(ManagedSecurityContext sec)
        {
            TransitAccountStoryPicture t_instance = base.GetTransitInstance(sec);

            t_instance.Counter = ManagedStats.FindByUri(Session, "AccountStoryPictureView.aspx", mInstance.Id, sec);
            t_instance.SetWithinCollection(mInstance, mInstance.AccountStory.AccountStoryPictures);
            t_instance.CommentCount = ManagedDiscussion.GetDiscussionPostCount(
                Session, mInstance.AccountStory.Account.Id, typeof(AccountStoryPicture), mInstance.Id);
            return(t_instance);
        }
        public override TransitAccountBlogPost GetTransitInstance(ManagedSecurityContext sec)
        {
            ManagedAccountBlog     m_blog = new ManagedAccountBlog(Session, mInstance.AccountBlog);
            TransitAccountBlogPost t_post = base.GetTransitInstance(sec);

            t_post.CanEdit          = (GetACL().Apply(sec, DataOperation.Update) == ACLVerdict.Allowed);
            t_post.CanDelete        = (GetACL().Apply(sec, DataOperation.Delete) == ACLVerdict.Allowed);
            t_post.AccountName      = ManagedAccount.GetAccountNameWithDefault(Session, mInstance.AccountId);
            t_post.AccountPictureId = ManagedAccount.GetRandomAccountPictureId(Session, mInstance.AccountId);
            t_post.CommentCount     = ManagedDiscussion.GetDiscussionPostCount(
                Session, mInstance.AccountBlog.Account.Id, typeof(AccountBlogPost), mInstance.Id);
            return(t_post);
        }
Exemple #4
0
        public override TransitAccountPicture GetTransitInstance(ManagedSecurityContext sec)
        {
            TransitAccountPicture t_instance = base.GetTransitInstance(sec);
            List <AccountPicture> collection = new List <AccountPicture>();

            foreach (AccountPicture pic in Collection <AccountPicture> .GetSafeCollection(mInstance.Account.AccountPictures))
            {
                if (!pic.Hidden)
                {
                    collection.Add(pic);
                }
            }
            t_instance.SetWithinCollection(mInstance, collection);
            t_instance.CommentCount = ManagedDiscussion.GetDiscussionPostCount(
                Session, mInstance.Account.Id,
                typeof(AccountPicture), mInstance.Id);
            t_instance.Counter = ManagedStats.FindByUri(Session, "AccountPicture.aspx", mInstance.Id, sec);
            return(t_instance);
        }
 public TransitAccountStory(ISession session, AccountStory value)
     : base(value)
 {
     CommentCount = ManagedDiscussion.GetDiscussionPostCount(session, value.Account.Id,
                                                             typeof(AccountStory), value.Id);
 }