public ActionResult VideoCategory(int categoryId) { var user = AuthService.CurrentUser; /*if (user == null) * return RedirectToAction<SimpleRegController>(c => c.Registration(Request.Url.AbsolutePath, "ВИДЕОСАЙТ"));*/ if (categoryId == 0) { return(null); } var category = VideoCategoryService.GetByPK(categoryId); if (category == null) { return(null); } var videos = VideoService.GetAll(x => x.CategoryId == categoryId && x.IsActive).OrderByDescending(x => x.VideoID).ToList(); var model = new VideoCategoryVM { Category = category, Videos = videos }; return(BaseViewWithModel(new VideoCategoryView(), model)); }
public void AddControlSpecialistTV(SimplePageVM model) { VideoService.LoadWith(x => x.VideoCategory); var videos = VideoService.GetAll(x => x.IsActive && x.IsNew).OrderByDescending(x => x.VideoID).ToList(); var newVideos = VideoService.GetAll(x => x.IsActive) .OrderByDescending(x => x.VideoID).Take(3).ToList(); var videoCategories = VideoCategoryService.GetAll().Where(x => x.ParentId == null).ToList(); model.Controls.Add( new SimplePageVM.Control(Views.Page.Videos, new VideosVM { Videos = videos, NewVideos = newVideos, Categories = videoCategories })); }
public VideoCategoryController() { _UserService = new UserService(); _VideoCategoryService = new VideoCategoryService(); }