Example #1
0
 public bool AddBook(BookViewModel bookViewModel)
 {
     try
     {
         Book book = Mapper.Map <BookViewModel, Book>(bookViewModel);
         Save.AddItem(book, "../Books");
         _bookRepository.Add(book);
         return(true);
     }
     catch
     {
         return(false);
     }
 }
 public bool AddPublicationHouse(PublicationHouseViewModel publicationHouseViewModel)
 {
     try
     {
         PublicationHouse publicationHouse = Mapper.Map <PublicationHouseViewModel, PublicationHouse>(publicationHouseViewModel);
         Save.AddItem(publicationHouse, "../PublicationHouses");
         _publicationHouseRepository.Add(publicationHouse);
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Example #3
0
 public bool AddMagazine(MagazineViewModel magazineViewModel)
 {
     try
     {
         Magazine magazine = Mapper.Map <MagazineViewModel, Magazine>(magazineViewModel);
         Save.AddItem(magazine, "../Magazines");
         _magazineRepository.Add(magazine);
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Example #4
0
 public bool AddBrochure(BrochureViewModel brochureViewModel)
 {
     try
     {
         Brochure brochure = Mapper.Map <BrochureViewModel, Brochure>(brochureViewModel);
         Save.AddItem(brochure, "../Brochures");
         _brochureRepository.Add(brochure);
         return(true);
     }
     catch
     {
         return(false);
     }
 }