예제 #1
0
 public ActionResult SetVideoList(int id,EnumVideoListType listType)
 {
     Video video = bizVideo.Get(id);
     VideoList vl = new VideoList() {
         IsPublished=(int)EnumPublishState.发布,
         ListType=(int)listType,
         VideoID=id,
         CoverImageSrc=video.CoverImagePath.Substring(24),
          AddTime=DateTime.Now
     };
     bizVideoList.Insert(vl);
     return Content(Convert.ToString((int)EnumOperateState.成功));
 }
예제 #2
0
 public static string GetVideoListImageSrc(VideoList videolist)
 {
     EnumVideoListType listType = (EnumVideoListType)videolist.ListType;
     switch (listType)
     {
         case EnumVideoListType.推荐视频:
         case EnumVideoListType.大网站焦点视频:
         case EnumVideoListType.分类焦点视频:
             return Biz.Properties.Settings.Default.VideoCoverImageFolder + videolist.CoverImageSrc;
         case EnumVideoListType.首页焦点视频:
             return Biz.Properties.Settings.Default.首页焦点视频文件夹 + videolist.CoverImageSrc;
         default:
             break;
     }
     return "";
 }
예제 #3
0
        public ActionResult EditSingleVideoList(int id, EnumVideoListType listType, string txt_width, string txt_height, string txt_top, string txt_left, string txt_DropWidth, string txt_DropHeight)
        {
            int imageWidth = Int32.Parse(txt_width);
            int imageHeight = Int32.Parse(txt_height);
            int cutTop = Int32.Parse(txt_top);
            int cutLeft = (int)double.Parse(txt_left);
            int dropWidth = Int32.Parse(txt_DropWidth);
            int dropHeight = Int32.Parse(txt_DropHeight);
            Video video = bizVideo.Get(id);
            string folder = "";
            switch (listType)
            {
                case EnumVideoListType.推荐视频:
                    break;
                case EnumVideoListType.大网站焦点视频:
                    break;
                case EnumVideoListType.首页焦点视频:
                    folder = Hotnet.Biz.Properties.Settings.Default.首页焦点视频文件夹;
                    break;
                case EnumVideoListType.分类焦点视频:
                    break;
                default:
                    break;
            }
            VideoList vl = new VideoList();
            vl.VideoID = video.VideoID;
            vl.IsPublished = (int)EnumPublishState.发布;
            vl.ListType = (int)listType;
            vl.AddTime = DateTime.Now;

            if (listType == EnumVideoListType.首页焦点视频)
            {
                string imageName = null;
                string dir = StringUtility.GetSavePath(id, out imageName);
                string LocalPath = dir + imageName + "_o" + Path.GetExtension(video.CoverImagePath);

                string filename = CutPhotoHelp.SaveCutPic(Server.MapPath(video.CoverImagePath), Server.MapPath(folder + LocalPath), 0, 0, dropWidth,
                                        dropHeight, cutLeft, cutTop, imageWidth, imageHeight);
                vl.CoverImageSrc = LocalPath;
            }
            bizVideoList.Delete(vl.VideoID, listType);
            bizVideoList.Insert(vl);

            return RedirectToAction("SetVideoList", new { id = video.VideoID, listType = (int)listType });
        }
예제 #4
0
		private void detach_VideoList(VideoList entity)
		{
			this.SendPropertyChanging();
			entity.Video = null;
		}
예제 #5
0
		private void attach_VideoList(VideoList entity)
		{
			this.SendPropertyChanging();
			entity.Video = this;
		}
예제 #6
0
 partial void DeleteVideoList(VideoList instance);
예제 #7
0
 partial void UpdateVideoList(VideoList instance);
예제 #8
0
 partial void InsertVideoList(VideoList instance);