public PartialViewResult GetGallerybyText(string text) { var keyword = _keywordPoolService.GetByKeyword(text); if (keyword != null) { var galleryList = new List <GalleryPoolDTO>(); var galleryIdList = _galleryKeywordService.GetAllbyKeywordId(keyword.Id); foreach (var item in galleryIdList) { var gallery = _galleryPoolService.GetByGalleryId(item.GalleryId); galleryList.Add(gallery); } return(PartialView(galleryList)); } return(PartialView()); }
public IActionResult Insert(string imageNamePrefix, int KeywordPool, string ImageCategoryName, IFormFile ImageFile, int AnaSayfa_401x289, int AnaSayfa_401x592, int Genellogo_168_57, int AnaSayfa_815x289, int AnasayfaSlider_1440_534, int AnasayfaSlider_1440_800, int KategoriDetay_285x285, int KategoriAltDetay_389_280, int TourDetail_1440_550, int TourGallery_257_257) { string randomFileName = $"{imageNamePrefix}-{Guid.NewGuid().ToString()}"; if (KeywordPool == 0 && !string.IsNullOrEmpty(ImageCategoryName)) { var isNewKeywordPool = _keywordPoolService.Add(new KeywordPoolDTO() { Keyword = ImageCategoryName }); if (isNewKeywordPool) { var keywordResult = _keywordPoolService.GetByKeyword(ImageCategoryName); KeywordPool = keywordResult.Id; } } if (AnaSayfa_401x289 == 1) { GalleryPoolHelper.SaveGalleryPool(randomFileName, ImageFile, nameof(AnaSayfa_401x289), _galleryKeywordService, _galleryPoolService, KeywordPool, 401, 289); } if (AnaSayfa_401x592 == 1) { GalleryPoolHelper.SaveGalleryPool(randomFileName, ImageFile, nameof(AnaSayfa_401x592), _galleryKeywordService, _galleryPoolService, KeywordPool, 401, 592); } if (Genellogo_168_57 == 1) { GalleryPoolHelper.SaveGalleryPool(randomFileName, ImageFile, nameof(Genellogo_168_57), _galleryKeywordService, _galleryPoolService, KeywordPool, 168, 57); } if (AnaSayfa_815x289 == 1) { GalleryPoolHelper.SaveGalleryPool(randomFileName, ImageFile, nameof(AnaSayfa_815x289), _galleryKeywordService, _galleryPoolService, KeywordPool, 815, 289); } if (AnasayfaSlider_1440_534 == 1) { GalleryPoolHelper.SaveGalleryPool(randomFileName, ImageFile, nameof(AnasayfaSlider_1440_534), _galleryKeywordService, _galleryPoolService, KeywordPool, 1440, 534); } if (AnasayfaSlider_1440_800 == 1) { GalleryPoolHelper.SaveGalleryPool(randomFileName, ImageFile, nameof(AnasayfaSlider_1440_800), _galleryKeywordService, _galleryPoolService, KeywordPool, 1440, 800); } if (KategoriDetay_285x285 == 1) { GalleryPoolHelper.SaveGalleryPool(randomFileName, ImageFile, nameof(KategoriDetay_285x285), _galleryKeywordService, _galleryPoolService, KeywordPool, 285, 285); } if (KategoriAltDetay_389_280 == 1) { GalleryPoolHelper.SaveGalleryPool(randomFileName, ImageFile, nameof(KategoriAltDetay_389_280), _galleryKeywordService, _galleryPoolService, KeywordPool, 389, 280); } if (TourDetail_1440_550 == 1) { GalleryPoolHelper.SaveGalleryPool(randomFileName, ImageFile, nameof(TourDetail_1440_550), _galleryKeywordService, _galleryPoolService, KeywordPool, 1440, 550); } if (TourGallery_257_257 == 1) { GalleryPoolHelper.SaveGalleryPool(randomFileName, ImageFile, nameof(TourGallery_257_257), _galleryKeywordService, _galleryPoolService, KeywordPool, 257, 257); } return(RedirectToAction("List")); }