Esempio 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);
        }
Esempio 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);
        }
Esempio 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);
        }