// // GET: /GroupVideoPlay/ public ActionResult Index(int id,int? pageNo,int? playVideoId) { int totalCount=0; VideoChild[] groupVideos = bizVideoChild.ListVideoChilds(pageNo??0,pageSize,out totalCount,id); Video videoGroup = bizVideo.Get(id); Tag[] playVideoTags = bizVideoXTag.ListVideoTags(id); //head ViewData["HeadControl"] = new HeadControl() { SystemCategory = EnumSystemCategory.��Ƶ, SystemCategoryID=videoGroup.CategoryID.Value}; //�����Ƶ Video[] refVideos = null; refVideos = bizVideo.ListReferenceVideoByTags(playVideoTags.Select(x => x.TagID).ToArray(), pageSize, true); ReferenceVideoControl refVideoControl = new ReferenceVideoControl() { ReferenceVideos = refVideos, VideoListStyle = EnumVideoListStyle.horizontal }; //����tagClickCount bizTag.UpdateTagsClickCount(playVideoTags.Select(x => x.TagID).ToArray(), Hotnet.Entity.Enum.EnumTagType.��Ƶ); //����video����� bizVideo.Update(id, x => new Video() { ClickCount = videoGroup.ClickCount + 1 }); ViewData["VideoChildJson"] = ObjectSerializer.SerializeToJson(groupVideos.Select(x => new { GroupID = x.GroupID, VideoID = x.VideoID, Name = x.Name, CoverImagePath = x.CoverImagePath })); ViewData["Categories"] = bizVideoCategory.List(); ViewData["VideoGroup"] = videoGroup; ViewData["PlayVideo"] = playVideoId == null ? groupVideos.Where(x => x.OrderInGroup == 1).First() : groupVideos.Where(x => x.VideoID==playVideoId.Value).First(); ViewData["PlayVideoTags"] = playVideoTags; //��ҳ�� ViewData["PageSize"] = pageSize; ViewData["TotalCount"] = totalCount; ViewData["GroupID"] = id; ViewData["PageNo"] = pageNo ?? 0; ViewData["RefNews"] = bizNews.ListReferenceNewsByTags(playVideoTags.Select(x => x.TagName).ToList(), 14, true); ViewData["RefVideoControl"] = refVideoControl; ViewData["RefPictureGroup"] = new ReferencePictureControl() { ReferencePictures = bizPictureGroup.ListReferenceGroupsByTags(playVideoTags.Select(x => x.TagName).ToList(), 6, true) }; return View(); }
//[FrontFilter(EnumSystemCategory.图片, NeedLoadRelational = true)] /// <summary> /// /// </summary> /// <param name="id">PictureGroup id</param> /// <param name="cId">图片组中 当前显示的图片id</param> /// <returns></returns> public ActionResult Group(int? id,int? cId) { if (id == null) return null; int preId = -1; int nextId = -1; //获得PictureGroup信息,并得到SourceFrom PictureGroup group= BizPictureGroup.GetPictureGroupIncludeSourceFrom(id.Value); //列出此组的所有图片,需要缓存 Picture[] pictures = BizPicture.List(id.Value); //列出相关图片组 ViewData["RelationalGroups"] = BizPictureGroup.ListReferenceGroupsByGroupID(id.Value, 10); //获得图片的Tag List<string> tagNames = BizPictureGroupXTag.ListTagNamesByGroupID(id.Value); //获得相关的视频 ViewData["RefVideoControl"] = new ReferenceVideoControl() { ReferenceVideos = BizVideo.ListReferenceVideoByTags(string.Join(" ", tagNames.ToArray()), 10, true), VideoListStyle = EnumVideoListStyle.horizontal, ModuleTitle = "您可能感兴趣的视频", MoreLink = "/VideoRecommandMore" }; //获得相关的新闻 ViewData["RefNews"] = BizNews.ListReferenceNewsByTags(tagNames,20,true); //header ViewData["HeadControl"] = new HeadControl() { SystemCategory = EnumSystemCategory.图片, SystemCategoryID = group.CategoryID }; Picture currentPicture = null; //处理上一张与下一张图片 int[] pictureIds = pictures.Select(x => x.PictureID).ToArray(); int picturePosition = 0; if (cId == null && pictures != null && pictures.Length > 0) { cId = pictures[0].PictureID; currentPicture = pictures[0]; } else { currentPicture = pictures.Where(x => x.PictureID == cId).First(); } DealPreNext(pictureIds, cId ?? -1, ref preId, ref nextId, ref picturePosition); ViewData["PictureGroupLength"] = pictureIds.Length; ViewData["PicturePosition"] = picturePosition; ViewData["PrePictureID"] = preId; ViewData["NextPictureID"] = nextId; ViewData["PictureGroup"] = group; ViewData["PictureCurrent"] = currentPicture; ViewData["PictureTags"] = BizPictureGroupXTag.ListTagNamesByGroupID(id.Value); //点击数+1 BizPictureGroup.IncreaseClickCount(id.Value, group.ClickCount ?? 0); return View(); }
public ActionResult Category(int id, int? pageNo) { int totalCount; var groups = BizPictureGroup.List(id, pageNo ?? 0, 24, out totalCount); PictureCategory category = BizPictureCategory.Get(id); ViewData["PaginateHelper"] = PaginateHelper.ConstructPaginate(totalCount, pageNo ?? 0, 24, string.Format("/Picture/Category/{0}/", id), null); ViewData["Category"] = category; ViewData["HotPictureGroups"] = BizPictureGroup.ListHotGroups(id, 10); //ViewData["CommendPictureGroups"] = BizPictureGroup.ListRecommendPictureGroup(id, 6); ViewData["CommendPictureGroups"] = BizPictureList.List(EnumPictureListType.推荐图片, id, 6); ViewData["RefVideoControl"] = new ReferenceVideoControl() { ReferenceVideos = BizVideo.ListReferenceVideoByTags(category.Tag, 12, true), VideoListStyle = EnumVideoListStyle.horizontal, ModuleTitle="您可能感兴趣的视频" }; ViewData["PictureRotator"] = new PictureRotatorControl() { Groups = BizPictureList.List( EnumPictureListType.分类焦点图片,id, 6) }; ViewData["RefNews"] = BizNews.ListReferenceNewsByTags(category.Tag, 25, true); ViewData["IsAnchor"] = pageNo != null ? "True" : "False"; ViewData["HeadControl"] = new HeadControl() { SystemCategory = EnumSystemCategory.图片, SystemCategoryID = id }; return View(groups); }
public ActionResult RecommendMore(int? pageNo, EnumOrder? type) { ViewData["HeadControl"] = new HeadControl() { SystemCategory = EnumSystemCategory.����}; type = type ?? EnumOrder.���ʱ��; pageNo = pageNo ?? 0; int totalCount = 0; News[] recommendNews = BizNews.ListRemcommendNews(type.Value, PAGESIZE, pageNo.Value, out totalCount); ViewData["PaginateHelper"] = PaginateHelper.ConstructPaginate(totalCount, pageNo ?? 0, PAGESIZE, "/News/RecommendMore/Index/", new SearchByOrderType() { OrderType = (int)type.Value }); ViewData["RecommendNews"] = recommendNews; ViewData["Time"] = type == EnumOrder.���ʱ�� ? "id='current'" : ""; ViewData["Click"] = type == EnumOrder.������� ? "id='current'" : ""; ViewData["RecommendPicture"] = new ReferencePictureControl() { ModelName = "�Ƽ�ͼƬ", MoreLink = "/PictureRecommendMore", ReferencePictures = BizPictureGroup.ListRecommendPictureGroup(8) }; ViewData["RecommendVideo"] = new ReferenceVideoControl() { MoreLink = "/VideoRecommandMore", ModuleTitle = "�Ƽ���Ƶ", ReferenceVideos = BizVideo.ListMyCommendVideoes(10, EnumOrder.���ʱ��) }; return View(); }