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(); }
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); } } }
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); } } }
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)); } } }
public AuthorLoader(InpBookRecord bookRecord, Entities context) { this.bookRecord = bookRecord; this.context = context; ProcessAuthorsArray(bookRecord.Authors); }
public SeriesLoader(InpBookRecord bookRecord, Entities context) { this.bookRecord = bookRecord; this.context = context; ProcesSeries(); }