Example #1
0
        public override object GetTemplateContent()
        {
            var image = new Content.Image();

            var fileIdStr = GetProperty("fileID");
            if (string.IsNullOrEmpty(fileIdStr) == false)
                image.FileID = new Guid(fileIdStr);

            image.IsNew = image.FileID == null;
            if (image.IsNew == false)
            {
                var file = Page.GetFile(image.FileID);
                if (file != null)
                {
                    image.FileExists = true;
                    image.CanDisplay = file.HasPermission(_user.Identity.Name, Permissions.Read);
                    image.Name = file.Name;
                    image.Ext = file.Ext;
                }
            }

            image.Res = GetProperty("res") ?? "high";
            //image.Name = GetProperty("Name");
            //image.Ext = GetProperty("ext");

            return image;
        }
Example #2
0
        /// <summary>
        /// 添加推送置顶图片
        /// </summary>
        /// <param name="contentId">内容编号</param>
        /// <param name="photoPath">图片路径</param>
        /// <returns>操作状态</returns>
        public static CBB.ExceptionHelper.OperationResult AddPushImage(String contentId, String photoPath)
        {
            Content.ImageContent imagecontent = new Content.ImageContent(contentId);
            TopImagePush.ImagePushCount pushcount = new BiZ.TopImagePush.ImagePushCount();
            List<Content.Image> listImage = new List<Content.Image>();
            Content.Image image = new Content.Image(photoPath);
            listImage.Add(image);
            BiZ.TopImagePush.ImagePush imagepush = new BiZ.TopImagePush.ImagePush(
                contentId,
                imagecontent.MemberID,
                listImage,
                imagecontent.Content,
                pushcount,
                DateTime.Now,
                Comm.DeletedFlag.Yes);

            imagepush.Save(imagepush);

            return new CBB.ExceptionHelper.OperationResult(true);
        }