public List <DocumentVO> FindByFileName(string fileName, bool isExact) { FileDAO dao = new FileDAO(); List <FileVO> files = dao.FindFilesByName(fileName, isExact); dao.CloseConnection(); NoRepeatList <DocumentVO> result = new NoRepeatList <DocumentVO>(); foreach (FileVO file in files) { result.AddDistinct(file.Document); } FullLoadList(result); return(result); }
public List <DocumentVO> FindByFileArchivingDate(Common.Search.DateRange range) { FileDAO dao = new FileDAO(); List <FileVO> files = dao.FindFilesByArchivingDate(range); dao.CloseConnection(); NoRepeatList <DocumentVO> result = new NoRepeatList <DocumentVO>(); foreach (FileVO file in files) { result.AddDistinct(file.Document); } FullLoadList(result); return(result); }
public void FullLoad(DocumentVO doc) { DocumentCategoryDAO dao = new DocumentCategoryDAO(); List <int> categoriesIds = dao.GetAssociationsOfFirstTable(doc); dao.CloseConnection(); CategoryDAO catDao = new CategoryDAO(); List <CategoryVO> result = new List <CategoryVO>(); foreach (int item in categoriesIds) { result.Add(catDao.GetItem(item)); } catDao.CloseConnection(); doc.Categories = result; FileDAO fileDao = new FileDAO(); doc.Files = fileDao.GetFilesOfDocument(doc); fileDao.CloseConnection(); }
public bool BackupDataBase(string backupFileName) { string statement = string.Format("BACKUP DATABASE {0} to disk ='{1}\\{2}'", ConfigurationManager., ConfigurationManager.FtpDirectoryOnServer, backupFileName); bool result = executer.ExecuteNonQuery(statement, null); if (result) { try { StringBuilder sB = new StringBuilder(); sB.Append(ConfigurationManager.FtpDirectoryOnServer); sB.Append("\\"); sB.Append(backupFileName); byte[] file = FTPClient.DownloadFile(backupFileName); return(FileDAO.StoreFile(file)); } catch { return(false); } } return(result); }
public bool BackupFile(string serverFilePath) { byte[] file = FTPClient.DownloadFile(serverFilePath); return(FileDAO.StoreFile(file)); }
private byte[] ReadStream(string filePath) { FileStream fStream = new FileStream(filePath, FileMode.Open, FileAccess.Read); return(FileDAO.ReadFully(fStream)); }