Пример #1
0
 public InpBookLoader(InpBookRecord bookRecord, AuthorLoader authorLoader, GenresLoader genresLoader, SeriesLoader seriesLoader, Entities context)
 {
     this.bookRecord   = bookRecord;
     this.authorLoader = authorLoader;
     this.genresLoader = genresLoader;
     this.seriesLoader = seriesLoader;
     this.context      = context;
     ProcessBook();
 }
Пример #2
0
 public InpBookLoader(InpBookRecord bookRecord, AuthorLoader authorLoader, GenresLoader genresLoader, SeriesLoader seriesLoader, Entities context)
 {
     this.bookRecord = bookRecord;
     this.authorLoader = authorLoader;
     this.genresLoader = genresLoader;
     this.seriesLoader = seriesLoader;
     this.context = context;
     ProcessBook();
 }
Пример #3
0
 public GenresLoader(InpBookRecord bookRecord, Entities context)
 {
     this.bookRecord = bookRecord;
     this.context    = context;
     ProcessGenres(bookRecord.Genres);
     if (genres == null || genres.Count == 0)
     {
         Genre defaultGenre;
         if (IsGenreExist(DEFAULT_GENRE_NAME, out defaultGenre))
         {
             if (genres == null)
             {
                 genres = new List <Genre>();
             }
             genres.Add(defaultGenre);
         }
     }
 }
Пример #4
0
 public GenresLoader(InpBookRecord bookRecord, Entities context)
 {
     this.bookRecord = bookRecord;
     this.context = context;
     ProcessGenres(bookRecord.Genres);
     if (genres == null || genres.Count == 0)
     {
         Genre defaultGenre;
         if (IsGenreExist(DEFAULT_GENRE_NAME, out defaultGenre))
         {
             if (genres == null)
             {
                 genres = new List<Genre>();
             }
             genres.Add(defaultGenre);
         }
     }
 }
Пример #5
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));
         }
     }
 }
Пример #6
0
 public AuthorLoader(InpBookRecord bookRecord, Entities context)
 {
     this.bookRecord = bookRecord;
     this.context    = context;
     ProcessAuthorsArray(bookRecord.Authors);
 }
Пример #7
0
 public AuthorLoader(InpBookRecord bookRecord, Entities context)
 {
     this.bookRecord = bookRecord;
     this.context = context;
     ProcessAuthorsArray(bookRecord.Authors);
 }
Пример #8
0
 public SeriesLoader(InpBookRecord bookRecord, Entities context)
 {
     this.bookRecord = bookRecord;
     this.context = context;
     ProcesSeries();
 }
Пример #9
0
 public SeriesLoader(InpBookRecord bookRecord, Entities context)
 {
     this.bookRecord = bookRecord;
     this.context    = context;
     ProcesSeries();
 }