예제 #1
0
        /// <summary>
        /// 添加系统板块视频
        /// </summary>
        /// <param name="categoryId">一级分类ID</param>
        /// <param name="videoId">视频ID</param>
        /// <returns></returns>
        public int CreatePlateCategoryVideo(int categoryId, int sortNum, int isHot, int isRecommend, int videoId)
        {
            CheckCategoryId(categoryId);
            CheckVideoId(videoId);
            Video video;

            CheckVideoId(videoId, out video);
            PlateVideo pv;

            CheckPlateCategoryVideoId(categoryId, videoId, out pv);//检测板块一级分类视频信息是否已经存在
            var plateVideo = new PlateVideo()
            {
                PlateId        = 0,
                CategoryId     = categoryId,
                VideoId        = video.Id,
                SortNum        = sortNum,
                IsHot          = isHot == 1,
                IsRecommend    = isRecommend == 1,
                CreateTime     = DateTime.Now,
                CreateManageId = UserId
            };

            this._plateVideoRepository.CreateEntity(plateVideo);
            return(plateVideo.Id);
        }
예제 #2
0
        private void CheckPlateVideoId(int plateId, int videoId, out PlateVideo plateVideo)
        {
            var condtions = new List <Condtion>()
            {
                CondtionPlateId(plateId),
                CondtionVideoId(videoId)
            };

            plateVideo = this._plateVideoRepository.GetEntity(condtions);
            AssertUtil.IsNull(plateVideo, LanguageUtil.Translate("api_Business_PlateVideo_CheckPlateVideoId_plateVideo"));
        }
예제 #3
0
        /// <summary>
        /// 检测板块一级分类视频是否是否存在
        /// </summary>
        /// <param name="categoryId"></param>
        /// <param name="videoId"></param>
        /// <param name="plateVideo"></param>
        private void CheckPlateCategoryVideoId(int id, int categoryId, int videoId)
        {
            var condtions = new List <Condtion>()
            {
                ConditionNotEqualId(id),
                CondtionPlateId(0),
                CondtionVideoId(videoId),
                CondtionCategoryId(categoryId)
            };
            PlateVideo plateVideo = this._plateVideoRepository.GetEntity(condtions);

            AssertUtil.IsNull(plateVideo, LanguageUtil.Translate("api_Business_PlateVideo_CheckPlateCategoryVideoId"));
        }
예제 #4
0
        public Result UpdatePlateVideoSort()
        {
            PlateVideo         plateVideo;
            IList <PlateVideo> plateList = new List <PlateVideo>();
            var data = JObject.Value <JArray>("data");

            for (int i = 0; i < data.Count; i++)
            {
                plateVideo         = new PlateVideo();
                plateVideo.Id      = Convert.ToInt32(data[i]["Id"].ToString());
                plateVideo.SortNum = Convert.ToInt32(data[i]["SortNum"].ToString());
                plateList.Add(plateVideo);
            }
            return(CommonResult(() => this._plateVideoBusiness.UpdatePlateVideoSort(plateList), (r) => Console.WriteLine(r.ToJSON())));
        }
예제 #5
0
 /// <summary>
 /// 检测板块视频编号是否存在
 /// </summary>
 /// <param name="id"></param>
 /// <param name="plateVideo"></param>
 private void CheckId(int id, out PlateVideo plateVideo)
 {
     plateVideo = this._plateVideoRepository.GetEntity(ConditionEqualId(id));
     AssertUtil.IsNotNull(plateVideo, LanguageUtil.Translate("api_Business_PlateVideo_CheckId_plateVideo"));
 }
예제 #6
0
 public bool DeleteEntity(PlateVideo entity)
 {
     return(base.DeleteEntity <PlateVideo>(entity));
 }
예제 #7
0
 public bool UpdateEntity(PlateVideo entity)
 {
     return(base.UpdateEntity <PlateVideo>(entity));
 }
예제 #8
0
 public bool CreateEntity(PlateVideo entity)
 {
     return(base.CreateEntity <PlateVideo>(entity));
 }