Пример #1
0
 public GalleryPoolController(GalleryPoolService galleryPoolService, KeywordPoolService keywordPoolService, GalleryKeywordService galleryKeywordService, IHostingEnvironment environment)
 {
     _galleryPoolService    = galleryPoolService;
     _keywordPoolService    = keywordPoolService;
     _galleryKeywordService = galleryKeywordService;
     _environment           = environment;
 }
Пример #2
0
 public TourController(TourPlanService tourPlanListService, TourService tourService, CategoryService categoryService, TourCategoriesService tourCategoryService, KeywordPoolService keywordPoolService, GalleryKeywordService galleryKeywordService, GalleryPoolService galleryPoolService, TourGalleriesService tourGalleryService)
 {
     _tourService           = tourService;
     _categoryService       = categoryService;
     _tourCategoryService   = tourCategoryService;
     _keywordPoolService    = keywordPoolService;
     _galleryKeywordService = galleryKeywordService;
     _galleryPoolService    = galleryPoolService;
     _tourGalleryService    = tourGalleryService;
     _tourPlanListService   = tourPlanListService;
 }
Пример #3
0
        public static void SaveGalleryPool(string randomFileName, IFormFile ImageFile, string size, GalleryKeywordService _galleryKeywordService
                                           , GalleryPoolService _galleryPoolService, int KeywordPool, int width, int height)
        {
            //var img = Path.Combine(_environment.ContentRootPath, "Content/UI/Image", $"large-{randomFileName}{Path.GetExtension(ImageFile.FileName)}");
            try
            {
                var imageFile           = Alice.Admin.Helper.ImageSizeHelper.Resize(randomFileName, ImageFile, size, width, height, Path.GetExtension(ImageFile.FileName));
                var imageFile_Thumbnail = Alice.Admin.Helper.ImageSizeHelper.Resize(randomFileName, ImageFile, $"{size}_Thumbnail", 70, 70, Path.GetExtension(ImageFile.FileName));
                _galleryKeywordService.Add(new GalleryKeywordDTO()
                {
                    GalleryId = randomFileName,
                    KeywordId = KeywordPool
                });

                _galleryPoolService.Add(new GalleryPoolDTO()
                {
                    GalleryId     = randomFileName,
                    Thumbnail     = imageFile_Thumbnail,
                    ImagePath     = imageFile,
                    ImageSize     = size,
                    PathExtension = Path.GetExtension(ImageFile.FileName),
                    RecordDate    = DateTime.Now
                });
            }
            catch (Exception e)
            {
                _galleryPoolService.Add(new GalleryPoolDTO()
                {
                    GalleryId     = "12334556123",
                    Thumbnail     = e.Message,
                    ImagePath     = "",
                    ImageSize     = size,
                    PathExtension = Path.GetExtension(ImageFile.FileName),
                    RecordDate    = DateTime.Now
                });
                throw;
            }
        }