public List<MicroblogVo> CheckFavorite( List<Microblog> list, int viewId )
        {
            List<MicroblogVo> mvList = new List<MicroblogVo>();
            if (list.Count == 0) return mvList;

            String ids = getBlogIds( list );
            if (strUtil.IsNullOrEmpty( ids )) return mvList;

            List<MicroblogFavorite> mfs = MicroblogFavorite.find( "UserId=" + viewId + " and MicroblogId in (" + ids + ")" ).list();
            foreach (Microblog blog in list) {
                if (blog == null) continue;
                MicroblogVo mv = new MicroblogVo();
                mv.Microblog = blog;
                if (hasFavorite( blog, mfs )) mv.IsFavorite = true;
                mvList.Add( mv );
            }

            return mvList;
        }
Example #2
0
        private String getOneBlogHtml( Microblog blog )
        {
            List<MicroblogVo> volist = new List<MicroblogVo>();
            MicroblogVo mbvo = new MicroblogVo();
            mbvo.Microblog = blog;
            mbvo.IsFavorite = false;
            volist.Add( mbvo );

            ctx.SetItem( "_microblogVoList", volist );
            ctx.SetItem( "_showUserFace", true );

            return loadHtml( new Microblogs.MicroblogController().bindBlogs );
        }