Exemplo n.º 1
0
        protected override object DeleteAttachment(IDbDataSource host,
                                                   IFieldUpload upload, DataRow row, string path)
        {
            AttachmentResolver resolver = new AttachmentResolver(host);

            resolver.SetCommands(AdapterCommand.Delete);
            resolver.Delete(row[upload.ContentField].Value <int>(), false);
            return(resolver);
        }
Exemplo n.º 2
0
        protected override object UpdateAttachment(IDbDataSource host,
                                                   IFieldUpload upload, DataRow row, string oldPath, string newPath)
        {
            AttachmentResolver resolver = new AttachmentResolver(host);

            resolver.SetCommands(AdapterCommand.Update);
            resolver.Update(row[upload.ContentField].Value <int>(), row[upload.FileNameField].ToString(), newPath,
                            row[upload.MimeTypeField].ToString(),
                            File.ReadAllBytes(newPath), false);

            fDelFile = newPath;
            return(resolver);
        }
Exemplo n.º 3
0
        protected override object InsertAttachment(IDbDataSource host,
                                                   IFieldUpload upload, DataRow row, string path)
        {
            AttachmentResolver resolver = new AttachmentResolver(host);

            resolver.SetCommands(AdapterCommand.Insert);
            byte[] fileData = File.ReadAllBytes(path);
            row[upload.ContentField] = resolver.Insert(
                row[upload.FileNameField].ToString(), path,
                row[upload.MimeTypeField].ToString(), fileData, false);

            fDelFile = path;
            return(resolver);
        }