Esempio n. 1
0
 public FileResourcePhoto(FirmaHomePageImage firmaHomePage)
 {
     PrimaryKey              = firmaHomePage.FirmaHomePageImageID;
     FileResourceInfo        = firmaHomePage.FileResourceInfo;
     DeleteUrl               = firmaHomePage.GetDeleteUrl();
     IsKeyPhoto              = false;
     Caption                 = firmaHomePage.Caption;
     CaptionOnFullView       = firmaHomePage.GetCaptionOnFullView();
     CaptionOnGallery        = firmaHomePage.GetCaptionOnGallery();
     PhotoUrl                = firmaHomePage.GetPhotoUrl();
     PhotoUrlScaledThumbnail = firmaHomePage.GetPhotoUrlScaledThumbnail();
     EditUrl                 = firmaHomePage.GetEditUrl();
     AdditionalCssClasses    = new List <string>();
 }
 public static string GetDeleteUrl(this FirmaHomePageImage firmaHomePageImage)
 {
     return(SitkaRoute <FirmaHomePageImageController> .BuildUrlFromExpression(x =>
                                                                              x.DeleteFirmaHomePageImage(firmaHomePageImage.FirmaHomePageImageID)));
 }
 public static string GetPhotoUrlScaledForPrint(this FirmaHomePageImage firmaHomePageImage) => firmaHomePageImage.FileResourceInfo.GetFileResourceUrlScaledForPrint();
 public static string GetPhotoUrlScaledThumbnail(this FirmaHomePageImage firmaHomePageImage) => firmaHomePageImage.FileResourceInfo.FileResourceUrlScaledThumbnail(150);
 public static string GetCaptionOnGallery(this FirmaHomePageImage firmaHomePageImage) => $"{firmaHomePageImage.Caption}\r\n{firmaHomePageImage.FileResourceInfo.GetFileResourceDataLengthString()}";
 public static string GetCaptionOnFullView(this FirmaHomePageImage firmaHomePageImage) => $"{firmaHomePageImage.GetCaptionOnGallery()}";
 public static void DeleteFirmaHomePageImage(this IQueryable <FirmaHomePageImage> firmaHomePageImages, FirmaHomePageImage firmaHomePageImageToDelete)
 {
     DeleteFirmaHomePageImage(firmaHomePageImages, new List <FirmaHomePageImage> {
         firmaHomePageImageToDelete
     });
 }