public IActionResult Index() { if (HttpContext.Session.GetString("Name") == null) { return(RedirectToAction("Login", "Admin")); } ViewModel mymodel = new ViewModel(); mymodel.Sliders = sliderService.GetAll().Data; return(View(mymodel)); }
public IActionResult Index() { AdminIndexViewModel model = new AdminIndexViewModel { CategoryCount = _categoryImageService.GetAll().Data.Count, GalleryCount = _galleryService.GetAll().Data.Count, PageCount = _pageService.GetAll().Data.Count, SlideCount = _sliderService.GetAll().Data.Count, SocialCount = _socialService.GetAll().Data.Count }; return(View(model)); }
public ActionResult Index() { var veriler = _sliderService.GetAll(); List <string> resimler = new List <string>(); for (int i = 0; i < veriler.Count(); i++) { var base64 = Convert.ToBase64String(veriler[i].SliderFoto); var imagesrc = string.Format("data:image/gif;base64,{0}", base64); resimler.Add(imagesrc); } ViewBag.resimler = resimler; return(View()); }
public IActionResult SliderList() { return(View(new SliderListModel() { Sliders = _sliderService.GetAll() })); }
public IActionResult Index() { var aboutEntity = _aboutService.GetAbout(); List <News> newsModelList = _newsService.GetAll().TakeLast(3).ToList(); var serviceList = _aboutServicesService.GetAll(); var clientsLogoList = _clientsLogoService.GetAll(); return(View(new HomeModel() { Sliders = _sliderService.GetAll(), InfoModel = GetInfo(), AboutModel = new AboutModel() { AboutTitle = aboutEntity.AboutTitle, AboutDescription = aboutEntity.AboutDescription, Founder = aboutEntity.Founder, Rank = aboutEntity.Rank, YoutubeUrl = aboutEntity.YoutubeUrl, YoutubeHomeImageUrl = aboutEntity.YoutubeHomeImageUrl, Mission = aboutEntity.Mission, Vision = aboutEntity.Vision, WorkProcess = aboutEntity.WorkProcess }, NewsListModel = newsModelList, Services = serviceList, ClientsLogos = clientsLogoList })); }
public async Task <IActionResult> Index() { var audioCmsList = await _audioCmsService.GetAll().ToListAsync(); var sliderList = await _sliderService.GetAll().ToListAsync(); var imageList = await _imageCmsService.GetAll().AsNoTracking().ToListAsync(); var model = new Tuple <List <AudioCms>, List <Slider>, List <ImageCms> >(audioCmsList, sliderList, imageList); return(View(model)); }
public IActionResult Index() { #region Alt Banner ViewBag.LowerBanner = _bannerService.GetLowerAll(); #endregion const int pageSize = 6; const int page = 1; const int pageStandOut = 1; //öne çıkan ürünler var slider = _sliderService.GetAll(); ViewBag.Success = TempData["Success"]; ViewBag.Products = _productService.GetAll(page, pageSize); ViewBag.PopularProducts = _productService.GetPopularProduct(pageStandOut, pageSize); ViewBag.Blogs = _blogService.GetAll(); ViewBag.BlogsUsers = _userService.GetAll(); ViewBag.Banner = _bannerService.GetAll(); #region Günün Ürünü var todayProduct = _orderService.GetPopularProduct(); var productDetails = _productService.GetById(todayProduct); var liste = new List <FarmerProduct>() { productDetails }; ViewBag.TodayProduct = liste; #endregion var entity = _productService.GetAll(); ViewBag.AnimalsProduct = entity; return(View(slider)); }
public async Task <IViewComponentResult> InvokeAsync() { var slider = await _sliderService.GetAll().AsNoTracking().Include(s => s.Files).FirstOrDefaultAsync(s => s.Name == "MainPage"); if (slider == null) { slider = new Slider { Name = "MainPage", CreationTime = DateTime.Now }; await _sliderService.Create(slider); } return(View(slider)); }
public IEnumerable <SelectListItem> SlideDropdown(ISliderService _sildeService) { var model = _sildeService.GetAll().Where(x => x.isTrash == false); List <SelectListItem> options = new List <SelectListItem>(); foreach (var item in model) { options.Add(new SelectListItem() { Value = item.sliderId.ToString(), Text = item.sliderName }); } return(options); }
public IActionResult Index() { var result = _sliderService.GetAll(); if (result.Success) { var result2 = _pageService.GetByType(1); if (result2.Success) { HomePageDto homePageDto = new HomePageDto { Sliders = result.Data.Where(x => x.IsActive == true).ToList(), Pages = result2.Data.Where(x => x.IsActive == true).ToList() }; return(View(homePageDto)); } } return(View()); }
public async Task <IActionResult> AddFileToSlider(short id) { var result = false; try { var slider = await _sliderService.GetAll().AsNoTracking().FirstOrDefaultAsync(s => s.Name == "MainPage"); var file = await _fileService.GetAll().AsNoTracking().FirstOrDefaultAsync(f => f.Id == id); file.SliderId = slider.Id; await _fileService.Update(file); result = true; } catch { } return(new JsonResult(new { result = result })); }
// GET: Home //[Route("anasayfa")] public ActionResult Index() { //Session["language"] = Session["language"] != null ? Session["language"] : ""; if (Session["language"] != null) { Session["language"] = Session["language"]; } else { Session["language"] = ""; } HamburgerMenuViewModel hvm = new HamburgerMenuViewModel(); hvm.menu = _menuService.GetAll(); hvm.slider = _sliderService.GetAll(); //hvm.product = _productService.GetAll(); return(View(hvm)); }
public ActionResult GetAll([FromBody] PageLimitViewModel model) { if (model.Kind == "album") { if (model.OrderBy == "last") { var morLiked = _categoryService.GetTopByType("1", model.PageNumber, model.PageSize, "", true).Select( p => new AppHomeViewModel { Id = p.Id, Title = p.Title, // Artist = p.CategoryTags != null ? (string.Join(",", p.CategoryTags.Where(t => t.Type == "artist").Select(x => x.Tag).Select(a => a.Title))) : null, Artist = p.CategoryTags? .Where(t => t.Type == "artist").Select(art => new ArtistViewModel { ArtistId = art.Tag.Id, ArtistName = art.Tag.Title }).ToList(), Thumbnail = string.IsNullOrEmpty(p.Thumbnail) ? "" : "http://mousigha.com/content/files/album/" + p.Thumbnail, Pic = string.IsNullOrEmpty(p.Pic) ? "" : "http://mousigha.com/content/files/album/" + p.Pic, Type = "last", Kind = "album", TypeName = "آخرین ها", LikeCount = p.LikeCount, VisitCount = p.VisitCount, Rate = 5, ShareLink = "http://mousigha.com/album/detail/" + p.Id }); return(Ok(morLiked)); } if (model.OrderBy == "like") { var lk = _categoryService.GetTopByLike("1", model.PageNumber, model.PageSize, true).Select( p => new AppHomeViewModel { Id = p.Id, Title = p.Title, //Artist = (string.Join(",", p.CategoryTags.Where(t => t.Type == "artist").Select(x => x.Tag).Select(a => a.Title))), // Artist = p.CategoryTags != null ? (string.Join(",", p.CategoryTags.Where(t => t.Type == "artist").Select(x => x.Tag).Select(a => a.Title))) : null, Artist = p.CategoryTags? .Where(t => t.Type == "artist").Select(art => new ArtistViewModel { ArtistId = art.Tag.Id, ArtistName = art.Tag.Title }).ToList(), Thumbnail = string.IsNullOrEmpty(p.Thumbnail) ? "" : "http://mousigha.com/content/files/album/" + p.Thumbnail, Pic = string.IsNullOrEmpty(p.Pic) ? "" : "http://mousigha.com/content/files/album/" + p.Pic, Type = "like", Kind = "album", TypeName = "محبوب ترین ها", LikeCount = p.LikeCount, VisitCount = p.VisitCount, Rate = 5, ShareLink = "http://mousigha.com/album/detail/" + p.Id }); return(Ok(lk)); } } if (model.Kind == "video") { var moreLike = new List <AppHomeViewModel>(); if (model.PageNumber == 1) { moreLike = (_contentFileService.GetTopByTypeAsync("video", 1, 6, "", "like").Result).ToList() .Select(p => new AppHomeViewModel { Id = p.Id, Title = p.Title, VideoArtist = p.Content.Category.CategoryTags != null ? (string.Join(",", p.Content.Category.CategoryTags.Where(t => t.Type == "artist").Select(x => x.Tag) .Select(a => a.Title))) : "", Thumbnail = string.IsNullOrEmpty(p.Thumbnail) ? "" : "http://mousigha.com/content/files/album/" + p.Thumbnail, Pic = string.IsNullOrEmpty(p.Thumbnail) ? "" : "http://mousigha.com/content/files/album/" + p.Thumbnail, Video = "http://mousigha.com/content/files/album/" + p.FileName, Type = "last", Kind = "video", TypeName = "آخرین ویدئوها", LikeCount = p.LikeCount, VisitCount = p.VisitCount, ShareLink = "http://mousigha.com/video/detail/" + p.Id }).ToList(); } var videos = (_contentFileService.GetTopByTypeAsync("video", model.PageNumber, model.PageSize, "", "").Result).ToList() .Select(p => new AppHomeViewModel { Id = p.Id, Title = p.Title, VideoArtist = p.Content.Category.CategoryTags != null ? (string.Join(",", p.Content.Category.CategoryTags.Where(t => t.Type == "artist").Select(x => x.Tag).Select(a => a.Title))) : "", Thumbnail = string.IsNullOrEmpty(p.Thumbnail) ? "" : "http://mousigha.com/content/files/album/" + p.Thumbnail, Pic = string.IsNullOrEmpty(p.Thumbnail) ? "" : "http://mousigha.com/content/files/album/" + p.Thumbnail, Video = "http://mousigha.com/content/files/album/" + p.FileName, Type = "last", Kind = "video", TypeName = "آخرین ویدئوها", LikeCount = p.LikeCount, VisitCount = p.VisitCount, ShareLink = "http://mousigha.com/video/detail/" + p.Id }); return(Ok(new { videos, moreLike })); } if (model.Kind == "tag") { // if (model.OrderBy == "last") { var tag = _tagService.GetPagedTagsAsync(1, 10, SortOrder.Descending, "tag", null, "last", true, null).Result.Tags.ToList(); var tags = tag.Select(p => new AppHomeViewModel { Id = p.Id, Title = "#" + p.Title.Replace(" ", "_"), Pic = string.IsNullOrEmpty(p.Pic) ? "" : "http://mousigha.com/content/files/tag/" + p.Pic, Thumbnail = string.IsNullOrEmpty(p.Pic) ? "" : "http://mousigha.com/content/files/tag/" + p.Thumbnail, Type = "last", Kind = "tag", TypeName = "تگ ها", LikeCount = p.LikeCount, ShareLink = "http://mousigha.com/tag/detail/" + p.Id }); return(Ok(tags)); } } if (model.Kind == "style") { // if (model.OrderBy == "last") { var tag = _tagService.GetPagedTagsAsync(model.PageNumber, model.PageSize, SortOrder.Descending, model.Kind, null, "", true, null).Result.Tags.ToList(); var tags = tag.Select(p => new AppHomeViewModel { Id = p.Id, Title = p.Title, Pic = string.IsNullOrEmpty(p.Pic) ? "" : "http://mousigha.com/content/files/tag/" + p.Pic, Thumbnail = string.IsNullOrEmpty(p.Pic) ? "" : "http://mousigha.com/content/files/tag/" + p.Thumbnail, Type = "last", Kind = "style", TypeName = "سبک ها", LikeCount = p.LikeCount, VisitCount = p.VisitCount, ShareLink = "http://mousigha.com/style/detail/" + p.Id }); return(Ok(tags)); } } if (model.Kind == "music") { // if (model.OrderBy == "last") { var tag = _tagService.GetPagedTagsAsync(model.PageNumber, model.PageSize, SortOrder.Descending, "music", null, "last", true, null).Result.Tags.ToList(); var tags = tag.Select(p => new AppHomeViewModel { Id = p.Id, Title = p.Title, Pic = string.IsNullOrEmpty(p.Pic) ? "" : "http://mousigha.com/content/files/tag/" + p.Pic, Thumbnail = string.IsNullOrEmpty(p.Pic) ? "" : "http://mousigha.com/content/files/tag/" + p.Thumbnail, Type = "last", Kind = "music", TypeName = "ساز ها", LikeCount = p.LikeCount, VisitCount = p.VisitCount, ShareLink = "http://mousigha.com/music/detail/" + p.Id }); return(Ok(tags)); } } if (model.Kind == "artist") { if (model.OrderBy == "last") { var tag = _tagService.GetPagedTagsAsync(model.PageNumber, model.PageSize, SortOrder.Descending, model.Kind, null, "last", true, null).Result.Tags.ToList(); var tags = tag.Select(p => new AppHomeViewModel { Id = p.Id, Title = p.Title, Pic = string.IsNullOrEmpty(p.Pic) ? "" : "http://mousigha.com/content/files/tag/" + p.Pic, Thumbnail = string.IsNullOrEmpty(p.Pic) ? "" : "http://mousigha.com/content/files/tag/" + p.Thumbnail, Type = "last", Kind = "artist", TypeName = "هنرمندان", LikeCount = p.LikeCount, VisitCount = p.VisitCount, Rate = 0, ShareLink = "http://mousigha.com/artist/detail/" + p.Id }); return(Ok(tags)); } } if (model.Kind == "all") { var latest = _categoryService.GetTopByType("1", model.PageNumber, model.PageSize, "", true).Select( p => new AppHomeViewModel { Id = p.Id, Title = p.Title, // Artist = p.CategoryTags != null ? (string.Join(",", p.CategoryTags.Where(t => t.Type == "artist").Select(x => x.Tag).Select(a => a.Title))) : null, Artist = p.CategoryTags? .Where(t => t.Type == "artist").Select(art => new ArtistViewModel { ArtistId = art.Tag.Id, ArtistName = art.Tag.Title }).ToList(), Thumbnail = string.IsNullOrEmpty(p.Thumbnail) ? "" : "http://mousigha.com/content/files/album/" + p.Thumbnail, Pic = string.IsNullOrEmpty(p.Pic) ? "" : "http://mousigha.com/content/files/album/" + p.Pic, Type = "album-last", Kind = "album", OrderBy = "last", TypeName = "آخرین ها", LikeCount = p.LikeCount, VisitCount = p.VisitCount, Rate = 5, ShareLink = "http://mousigha.com/album/detail/" + p.Id }); var morLiked = _categoryService.GetTopByLike("1", model.PageNumber, model.PageSize, true).Select( p => new AppHomeViewModel { Id = p.Id, Title = p.Title, // Artist = p.CategoryTags != null ? (string.Join(",", p.CategoryTags.Where(t => t.Type == "artist").Select(x => x.Tag).Select(a => a.Title))) : null, Artist = p.CategoryTags? .Where(t => t.Type == "artist").Select(art => new ArtistViewModel { ArtistId = art.Tag.Id, ArtistName = art.Tag.Title }).ToList(), Thumbnail = string.IsNullOrEmpty(p.Thumbnail) ? "" : "http://mousigha.com/content/files/album/" + p.Thumbnail, Pic = string.IsNullOrEmpty(p.Pic) ? "" : "http://mousigha.com/content/files/album/" + p.Pic, Type = "album-like", Kind = "album", OrderBy = "like", TypeName = "محبوب ترین ها", LikeCount = p.LikeCount, VisitCount = p.VisitCount, Rate = 5, ShareLink = "http://mousigha.com/album/detail/" + p.Id }); var style = _tagService.GetPagedTagsAsync(1, 10, SortOrder.Descending, "style", null, "", true, null).Result.Tags.ToList(); var styles = style.Select(p => new AppHomeViewModel { Id = p.Id, Title = p.Title, // Artist = (string.Join(",", p.CategoryTags.Where(t => t.Type == "artist").Select(x => x.Tag).Select(a => a.Title))), Pic = string.IsNullOrEmpty(p.Pic) ? "" : "http://mousigha.com/content/files/tag/" + p.Pic, Thumbnail = string.IsNullOrEmpty(p.Pic) ? "" : "http://mousigha.com/content/files/tag/" + p.Thumbnail, Video = null, Type = "style-last", Kind = "style", OrderBy = "last", TypeName = "سبک ها", LikeCount = p.LikeCount, VisitCount = p.VisitCount, Rate = 0, ShareLink = "http://mousigha.com/style/detail/" + p.Id }); var tag = _tagService.GetPagedTagsAsync(1, 10, SortOrder.Descending, "tag", null, "", true, null).Result.Tags.ToList(); var tags = tag.Select(p => new AppHomeViewModel { Id = p.Id, Title = "#" + p.Title.Replace(" ", "_"), Pic = string.IsNullOrEmpty(p.Pic) ? "" : "http://mousigha.com/content/files/tag/" + p.Pic, Thumbnail = string.IsNullOrEmpty(p.Pic) ? "" : "http://mousigha.com/content/files/tag/" + p.Thumbnail, Type = "tag-last", Kind = "tag", OrderBy = "last", TypeName = "تگ ها", LikeCount = p.LikeCount, VisitCount = p.VisitCount, Rate = 0, ShareLink = "http://mousigha.com/tag/detail/" + p.Id }); var videos = (_contentFileService.GetTopByTypeAsync("video", model.PageNumber, model.PageSize, "", "").Result).ToList() .Select(p => new AppHomeViewModel { Id = p.Id, Title = p.Title, VideoArtist = p.Content.Category.CategoryTags != null ? (string.Join(",", p.Content.Category.CategoryTags.Where(t => t.Type == "artist").Select(x => x.Tag).Select(a => a.Title))) : null, //VideoArtist = p.CategoryTags? // .Where(t => t.Type == "artist").Select(art => new ArtistViewModel // { // ArtistId = art.Tag.Id, // ArtistName = art.Tag.Title // }).ToList(), Thumbnail = string.IsNullOrEmpty(p.Thumbnail) ? "" : "http://mousigha.com/content/files/album/" + p.Thumbnail, Pic = string.IsNullOrEmpty(p.Thumbnail) ? "" : "http://mousigha.com/content/files/album/" + p.Thumbnail, Video = string.IsNullOrEmpty(p.FileName) ? "" : "http://mousigha.com/content/files/album/" + p.FileName, Type = "video-last", Kind = "video", OrderBy = "last", TypeName = "آخرین ویدئوها", LikeCount = p.LikeCount, VisitCount = p.VisitCount, Rate = 0, ShareLink = "https://www.mousigha.com/album/detail/" + p.Id }); var sliders = (_sliderService.GetAll(1, "enable", model.PageNumber, model.PageSize)).ToList() .Select(p => new AppHomeViewModel { Title = p.Title, Pic = string.IsNullOrEmpty(p.Pic) ? "" : "https://www.mousigha.com/content/files/slider/" + p.Pic, Video = "", //Type = p.Link.StartsWith("https://www.mousigha.com/album")==true?"album":"100", Kind = "slider", OrderBy = "last", TypeName = "اسلایدر", Type = SetType(p.Link), Link = p.Link, Rate = 0, SubTitle = p.SubTitle, Id = SetType(p.Link) == "album" ? Convert.ToInt32(Regex.Match(p.Link, @"\d+$").Value) : p.Id }); var merged = sliders.Union(styles).ToList(); merged = merged.Union(latest.ToList()).ToList(); merged = merged.Union(tags.ToList()).ToList(); merged = merged.Union(morLiked.ToList()).ToList(); merged = merged.Union(videos.ToList()).ToList(); //merged = merged.Union(sliders.ToList()).ToList(); //var merged = morLiked.Union(latest).ToList(); //merged = merged.Union(styles.ToList()).ToList(); //merged = merged.Union(videos.ToList()).ToList(); //merged = merged.Union(tags.ToList()).ToList(); //merged = merged.Union(sliders.ToList()).ToList(); return(Ok(merged)); } return(Ok()); }
public ActionResult Slider() { var slider = _sliderService.GetAll(); return(PartialView(slider)); }
public async Task <ViewViewComponentResult> InvokeAsync() { var slider = await _sliderService.GetAll().AsNoTracking().Include(s => s.Files).FirstOrDefaultAsync(s => s.Name == "MainPage"); return(View(slider)); }
public virtual PartialViewResult Slider() { var list = _sliderService.GetAll(); return(PartialView(MVC.Home.Views._MainSlider, list)); }
public IActionResult Get() { var sliders = service.GetAll(x => x.isActive == true).Data; return(Ok(sliders)); }
//GET: Admin/Sliders public ActionResult Index() { var viewModel = Mapper.Map <List <Slider>, List <SliderViewModel> >(_sliderService.GetAll()); return(View(viewModel)); }
//yeni slider resim ekleme public ActionResult AddSlider() { return(View(_sliderService.GetAll())); }
public virtual ActionResult Index() { var list = _sliderService.GetAll(); return(View(list)); }
public ActionResult _SliderPartialView() { var viewModel = Mapper.Map <List <Slider>, List <SliderViewModel> >(_sliderService.GetAll()); return(PartialView(viewModel)); }
public IActionResult GetAllSliders() => Ok(_mapper.Map <List <FarmerSliderDTO> >(_sliderService.GetAll()));