protected override void SaveToSQLDb(ScannedFile file) { FilesDeletedTableAdapter filesDeletedTableAdapter = new FilesDeletedTableAdapter(); ApplicationSettings appSettings = new ApplicationSettings(); filesDeletedTableAdapter.Connection.ConnectionString = appSettings.getDbConnectionString(); filesDeletedTableAdapter.Insert(file.Filename, file.Filepath, DateTime.Now, String.Empty, "SYSTEM", file.LastAccessTime, file.LastWriteTime, file.Filesize); if (file.doUpdateRequireOnRescan) { FileYetToProcessDbManager yetToProcess = new FileYetToProcessDbManager(); yetToProcess.Update(file, 0, "deleted on " + DateTime.Now.ToString()); } }
protected override ScannedFiles GetFromSQLDb() { FilesDeletedTableAdapter filesDeletedTableAdapter = new FilesDeletedTableAdapter(); ScannedFile scannedfile = new ScannedFile(); ScannedFiles scannedfiles = new ScannedFiles(); ApplicationSettings appSettings = new ApplicationSettings(); filesDeletedTableAdapter.Connection.ConnectionString = appSettings.getDbConnectionString(); dsFFC.FilesDeletedDataTable filesDeleted = filesDeletedTableAdapter.GetData(); foreach (dsFFC.FilesDeletedRow file in filesDeleted.Rows) { scannedfile = new ScannedFile(); scannedfile.Filename = file.fileName; scannedfile.Filepath = file.filePath; scannedfile.performedAction = enums.ActionToPerform.FileDeleted; scannedfiles.Add(scannedfile); } return(scannedfiles); }