Ejemplo n.º 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();
 }
Ejemplo n.º 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();
 }
Ejemplo n.º 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);
         }
     }
 }
Ejemplo n.º 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);
         }
     }
 }
Ejemplo n.º 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));
         }
     }
 }
Ejemplo n.º 6
0
 public AuthorLoader(InpBookRecord bookRecord, Entities context)
 {
     this.bookRecord = bookRecord;
     this.context    = context;
     ProcessAuthorsArray(bookRecord.Authors);
 }
Ejemplo n.º 7
0
 public AuthorLoader(InpBookRecord bookRecord, Entities context)
 {
     this.bookRecord = bookRecord;
     this.context = context;
     ProcessAuthorsArray(bookRecord.Authors);
 }
Ejemplo n.º 8
0
 public SeriesLoader(InpBookRecord bookRecord, Entities context)
 {
     this.bookRecord = bookRecord;
     this.context = context;
     ProcesSeries();
 }
Ejemplo n.º 9
0
 public SeriesLoader(InpBookRecord bookRecord, Entities context)
 {
     this.bookRecord = bookRecord;
     this.context    = context;
     ProcesSeries();
 }