public ActionResult EditSinglePictureList(int id,EnumPictureListType 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);
            Picture image = BizPicture.Get(id);
            string folder = "";
            switch (listType)
            {
                case EnumPictureListType.首页焦点图片:
                    folder = Biz.Properties.Settings.Default.首页焦点图片文件夹;
                    break;
                case EnumPictureListType.分类焦点图片:
                    folder = Biz.Properties.Settings.Default.分类焦点图片文件夹;
                    break;
                default:
                    break;
            }
            PictureList pl = new PictureList();
            pl.GroupID = image.GroupID;
            pl.ListType = (int)listType;
            pl.AddTime = DateTime.Now;
            pl.IsPublished = (int)EnumPublishState.发布;
            if (listType != EnumPictureListType.推荐图片)
            {
                string imageName = null;
                string dir = StringUtility.GetSavePath(id, out imageName);
                string LocalPath = dir + imageName + "_o" + Path.GetExtension(image.LocalPath);

                string filename = CutPhotoHelp.SaveCutPic(Server.MapPath(Biz.Properties.Settings.Default.UploadFolder + image.LocalPath), Server.MapPath(folder+LocalPath), 0, 0, dropWidth,
                                        dropHeight, cutLeft, cutTop, imageWidth, imageHeight);
                pl.CoverImageSrc = LocalPath;
            }
            BizPictureList.Delete(pl.GroupID,listType);
            BizPictureList.Insert(pl);

            return RedirectToAction("EditPictureList", new { id=image.GroupID,listType=(int)listType });
        }
        public ActionResult SetRecommendPictureList(int id)
        {
            PictureList plist = new PictureList();
            plist.ListType = (int)EnumPictureListType.推荐图片;
            plist.GroupID = BizPicture.Get(id).GroupID;
            plist.AddTime = DateTime.Now;
            plist.IsPublished = (int)EnumPublishState.发布;

            plist.CoverImageSrc = BizPicture.Get(id).ThumbnailPath;
            BizPictureList.Delete(plist.GroupID, EnumPictureListType.推荐图片);
            BizPictureList.Insert(plist);
            return Content("设置推荐列表成功");
        }
 public static string GetPictureListImageSrc(PictureList pictureList)
 {
     EnumPictureListType listType = (EnumPictureListType)pictureList.ListType;
     switch (listType)
     {
         case EnumPictureListType.推荐图片:
             return Biz.Properties.Settings.Default.UploadFolder+pictureList.CoverImageSrc;
         case EnumPictureListType.首页焦点图片:
             return Biz.Properties.Settings.Default.首页焦点图片文件夹 + pictureList.CoverImageSrc;
         case EnumPictureListType.分类焦点图片:
             return Biz.Properties.Settings.Default.分类焦点图片文件夹 + pictureList.CoverImageSrc; ;
         default:
             break;
     }
     return "";
 }
示例#4
0
		private void detach_PictureList(PictureList entity)
		{
			this.SendPropertyChanging();
			entity.PictureGroup = null;
		}
示例#5
0
 partial void DeletePictureList(PictureList instance);
示例#6
0
 partial void UpdatePictureList(PictureList instance);
示例#7
0
 partial void InsertPictureList(PictureList instance);