public static File CloneFile(IYZDbProvider provider, IDbConnection cn, int fileid) { File file = GetFileByID(provider, cn, fileid); AttachmentInfo attachmentInfo = AttachmentManager.GetAttachmentInfo(provider, cn, file.FileID); string newFileName = GetNewFileName(provider, cn, file.FolderID, attachmentInfo.Name); attachmentInfo = AttachmentManager.CloneFile(provider, cn, attachmentInfo, newFileName); file.FileID = attachmentInfo.FileID; file.OrderIndex = YZSoft.FileSystem.DirectoryManager.GetFileNextOrderIndex(provider, cn, file.FolderID); Insert(provider, cn, file); return(file); }