Exemplo n.º 1
0
        private void GenerateBookRecord(ImportObject importerObj, ref EBook book)
        {
            book.Author    = _authorRepository.CreateIfAuthorIsNotExists(importerObj.AuthorName);
            book.Publisher = _publisherRepository.CreatePublisherIfNotExists(importerObj.PublisherName);
            book.Genre     = _genreRepository.CreateGenreIfNotExists(importerObj.GenreName);
            book.Serie     = _seriesRepository.CreateSeriesIfNotExists(importerObj.SerieName, book.Publisher);
            book.Rack      = _rackRepository.GetRackByRackNumber(int.Parse(importerObj.RackId));
            book.Shelf     = _shelfRepository.GetShelfById(int.Parse(importerObj.ShelfId));

            book.Name            = importerObj.BookName;
            book.PublishDate     = int.Parse(importerObj.Publishdate);
            book.No              = ConvertToRomanIntegers(importerObj.No);
            book.SkinType        = importerObj.Skintype.Equals("ciltli", StringComparison.InvariantCulture) ? SkinType.Ciltli : SkinType.Ciltsiz;
            book.CreatedDateTime = DateTime.Now;
            book.Users.Add(importerObj.User);
        }