Example #1
0
 private void ProcessBookLine(string libraryFile, string line)
 {
     InpBookRecord bookRecord = new InpBookRecord(line);
     if (bookRecord.BookNumber > lastBookIdFromDatabase && bookRecord.BookLanguage.Equals("ru") && bookRecord.BookFormat.Equals("fb2"))
     {
         BookSources bookSources = new BookSources(bookRecord, GetBookFileName(libraryFile, bookRecord.BookNumber));
         if (File.Exists(bookSources.BookFileName))
         {
             ApplicationLogger.WriteStringToLog("Start processing book: " + Path.GetFileName(bookSources.BookFileName));
             try
             {
                 BookUploader bookUploader = new BookUploader(bookSources);
             }
             finally
             {
                 File.Delete(bookSources.BookFileName);
             }
             ApplicationLogger.WriteStringToLog("Finished process book: " + Path.GetFileName(bookSources.BookFileName));
         }
     }
 }
Example #2
0
 public BookUploader(BookSources bookSources)
 {
     this.bookSources = bookSources;
     UploadBookAndEntities();
 }
Example #3
0
 public BookUploader(BookSources bookSources)
 {
     this.bookSources = bookSources;
     UploadBookAndEntities();
 }