Example #1
0
        public BookCreate GetBookEdit(Guid bookId)
        {
            SBook book     = GetSingle(bookId);
            var   bookEdit = BuidBookCreate(book.CategoryId, book.EditorId, book.FirmId);

            bookEdit.Book = book;
            return(bookEdit);
        }
Example #2
0
        public BookDetails GetDetails(Guid id)
        {
            SBook book  = GetSingle(id);
            var   model = new BookDetails
            {
                Book             = book,
                Responsabilities = ResponsabilityRepository.GetList(r => r.BookId == book.Id).Select(SResponsability.DtoS).ToList(),
                Notes            = NoteRepository.GetList(n => n.BookId == book.Id).Select(SNote.DtoS).ToList()
            };

            return(model);
        }
Example #3
0
 private DBook StoD(SBook book)
 {
     return(new DBook
     {
         Id = book.Id,
         Title = book.Title,
         Description = book.Description,
         NumberOfPages = book.NumberOfPages,
         ReleaseDate = book.ReleaseDate,
         FirmId = book.FirmId,
         EditorId = book.EditorId,
         CategoryId = book.CategoryId
     });
 }
Example #4
0
 public void Update(SBook author)
 {
     BookRepository.Update(StoD(author));
 }
Example #5
0
 public void Add(SBook author)
 {
     BookRepository.Add(StoD(author));
 }