Exemplo n.º 1
0
 public static int getDataCount( PhotoAlbum album )
 {
     if (album.DataCount > 0) return album.DataCount;
     int count = PhotoPost.find( "AppId=" + album.AppId + " and PhotoAlbum.Id=" + album.Id ).count();
     album.DataCount = count;
     album.update( "DataCount" );
     return count;
 }
Exemplo n.º 2
0
        public static string getCover( PhotoAlbum album )
        {
            if (strUtil.HasText( album.Logo )) return sys.Path.GetPhotoThumb( album.Logo, "sx" );

            PhotoPost photo = PhotoPost.find( "AppId=" + album.AppId + " and PhotoAlbum.Id=" + album.Id ).first();
            if (photo != null) {

                album.Logo = photo.DataUrl;
                album.update( "Logo" );

                return photo.ImgThumbUrl;
            }

            return strUtil.Join( sys.Path.Img, "/m/album.jpg" );
        }
Exemplo n.º 3
0
 private int getDataCount( PhotoAlbum album )
 {
     int count = PhotoPost.find( "AppId=" + ctx.app.Id + " and PhotoAlbum.Id=" + album.Id ).count();
     album.DataCount = count;
     if (album.DataCount != count) {
         album.update( "DataCount" );
     }
     return count;
 }