Exemplo n.º 1
0
 public static string GetAbsolutePath(this BO.FileData @this)
 {
     using (new zAppDev.DotNet.Framework.Profiling.Profiler("FileData", zAppDev.DotNet.Framework.Profiling.AppDevSymbolType.ClassOperation, "GetAbsolutePath")) {
         if ((@this?.StorageMedium == DSS4_ECompliance.BO.StorageMedium.DataBase))
         {
             return(null);
         }
         string relativePath = System.IO.Path.Combine((@this?.FolderPath ?? ""), (@this?.FileName ?? ""));
         return(zAppDev.DotNet.Framework.Utilities.Web.MapPath(System.IO.Path.Combine("~/App_Data/Uploads", relativePath)));
     }
 }
Exemplo n.º 2
0
 public static System.Collections.Generic.List <System.Byte> GetThumbnail(this BO.FileData @this, int?width, int?height)
 {
     using (new zAppDev.DotNet.Framework.Profiling.Profiler("FileData", zAppDev.DotNet.Framework.Profiling.AppDevSymbolType.ClassOperation, "GetThumbnail")) {
         if ((@this?.StorageMedium == DSS4_ECompliance.BO.StorageMedium.DataBase))
         {
             return(zAppDev.DotNet.Framework.Utilities.Imaging.GetThumbnail(@this?.Blob, (width).GetValueOrDefault(0), (height).GetValueOrDefault(0)));;
         }
         else
         {
             System.Byte[] image = System.IO.File.ReadAllBytes((@this?.GetAbsolutePath() ?? ""));
             return(zAppDev.DotNet.Framework.Utilities.Imaging.GetThumbnail(image, (width).GetValueOrDefault(0), (height).GetValueOrDefault(0)));;
         }
     }
 }