コード例 #1
0
        /// <summary>
        /// 播放视频
        /// </summary>
        /// <returns></returns>
        public ActionResult PlayVideo()
        {
            int id        = int.Parse(Request["id"]);
            var videoInfo = VideoFileInfoService.LoadEntities(a => a.ID == id).FirstOrDefault();

            ViewBag.VideoInfo = videoInfo;
            return(View());
        }
コード例 #2
0
        public ActionResult AddVideo(VideoFileInfo videoInfo)
        {
            videoInfo.AddDate    = DateTime.Now;
            videoInfo.DelFlag    = 0;
            videoInfo.ImageUrl   = "/Videos/Flv/" + Request["ImageUrl"] + ".jpg";
            videoInfo.ModifyDate = DateTime.Now;
            videoInfo.VideoPath  = "/Videos/Flv/" + Request["ImageUrl"] + ".flv";
            int classId = int.Parse(Request["videoClass"]);

            return(Content(VideoFileInfoService.AddVideoFileInfo(classId, videoInfo) ? "ok" : "no"));
        }
コード例 #3
0
        /// <summary>
        /// 加载视频数据.
        /// </summary>
        /// <returns></returns>
        public ActionResult GetVideoInfo()
        {
            int pageIndex = Request["page"] != null?int.Parse(Request["page"]) : 1;  //当前页码。

            int pageSize = Request["rows"] != null?int.Parse(Request["rows"]) : 5;

            int totalCount;
            var videoFileInfoList = VideoFileInfoService.LoadPageEntities <int>(pageIndex, pageSize, out totalCount, p => p.DelFlag == 0, p => p.ID, true);

            var temp = from p in videoFileInfoList
                       select new { ID = p.ID, Title = p.Title, AddDate = p.AddDate, Author = p.Author, Orgin = p.Orgin, ClassName = from c in p.VideoClass select c.ClassName };

            return(Json(new { rows = temp, total = totalCount }, JsonRequestBehavior.AllowGet));
        }