示例#1
0
 public static string GetPhotoUrl(Maticsoft.Model.SNS.Photos PhotosInfo)
 {
     if (!string.IsNullOrWhiteSpace(PhotosInfo.StaticUrl))
     {
         return PhotosInfo.StaticUrl;
     }
     Maticsoft.BLL.SNS.UserAlbumDetail detail = new Maticsoft.BLL.SNS.UserAlbumDetail();
     Maticsoft.BLL.SNS.UserAlbums albums = new Maticsoft.BLL.SNS.UserAlbums();
     string valueByCache = Maticsoft.BLL.SysManage.ConfigSystem.GetValueByCache("PhotoStaticRoot");
     valueByCache = (valueByCache.LastIndexOf("/") > -1) ? valueByCache : (valueByCache + "/");
     List<Maticsoft.Model.SNS.UserAlbumDetail> modelList = detail.GetModelList("Type=0 and TargetID=" + PhotosInfo.PhotoID);
     if ((modelList != null) && (modelList.Count > 0))
     {
         Maticsoft.Model.SNS.UserAlbums modelByCache = albums.GetModelByCache(modelList.FirstOrDefault<Maticsoft.Model.SNS.UserAlbumDetail>().AlbumID);
         if (modelByCache != null)
         {
             return string.Concat(new object[] { valueByCache, PinyinHelper.GetPinyin(modelByCache.AlbumName), "/", PhotosInfo.PhotoID, ".html" }).Replace("--", "-").ToLower();
         }
     }
     return "";
 }