public override UploadInfo CreateValue(IFieldUpload upload, IFieldValueProvider provider)
        {
            TkDebug.AssertArgumentNull(upload, "upload", this);
            TkDebug.AssertArgumentNull(provider, "provider", this);

            string fileName = provider.GetValue(upload.FileNameField);

            if (string.IsNullOrEmpty(fileName))
            {
                return(null);
            }

            UploadInfo info = new UploadInfo
            {
                FileName    = fileName,
                ContentType = provider.GetValue(upload.MimeTypeField),
                ServerPath  = provider.GetValue(upload.ServerPathField),
                FileSize    = provider.GetValue <int>(upload.SizeField),
                WebPath     = provider.GetValue(upload.ContentField)
            };

            return(info);
        }
        public string DisplayValue(object value, Tk5FieldInfoEx field, IFieldValueProvider rowValue)
        {
            TkDebug.AssertArgumentNull(field, "field", this);

            if (DisplayUtil.IsNull(value))
            {
                return(string.Empty);
            }

            if (field.Upload != null)
            {
                Tk5UploadConfig   upload    = field.AssertUpload();
                IUploadProcessor2 processor = upload.CreateUploadProcessor2();
                //IFieldValueProvider provider = new DataRowFieldValueProvider(row, row.Table.DataSet);
                string url = processor.Display(upload, rowValue);

                return(string.Format(ObjectUtil.SysCulture, "<a href=\"{2}\" target=\"_blank\">{0}{1}</a>",
                                     StringUtil.EscapeHtml(rowValue.GetValue(upload.FileNameField)),
                                     BaseUploadProcessor.FormatSize(rowValue.GetValue <int>(upload.SizeField)),
                                     StringUtil.EscapeHtmlAttribute(url)));
            }
            return(string.Empty);
        }
 public override string Display(IFieldUpload upload, IFieldValueProvider provider)
 {
     return(provider.GetValue(upload.ContentField));
 }
        public override string Display(IFieldUpload upload, IFieldValueProvider provider)
        {
            string url = GetWebPath(provider.GetValue(upload.ContentField));

            return(url);
        }
        public override string Display(IFieldUpload upload, IFieldValueProvider provider)
        {
            string url = provider.GetValue(upload.ServerPathField);

            return(WebUtil.ResolveUrl(url));
        }