public bool DeleteMagazine(int id)
 {
     try
     {
         _magazineRepository.Delete(id);
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Beispiel #2
0
        public ActionResult Delete(MagazineModel edition, string deleteConfirm)
        {
            if (deleteConfirm == "Yes")
            {
                _magazineRepository.Delete(edition);
                _magazineRepository.Save();

                return(RedirectToAction("Index"));
            }

            return(RedirectToAction("Index", "Home"));
        }
 public void Delete(DeleteAllPublicationView publication)
 {
     if (publication.Type == nameof(Book))
     {
         _bookRepository.Delete(publication.Id);
     }
     if (publication.Type == nameof(Magazine))
     {
         _magazineRepository.Delete(publication.Id);
     }
     if (publication.Type == nameof(Brochure))
     {
         _brochureRepository.Delete(publication.Id);
     }
 }
Beispiel #4
0
        public void DeleteMagazine(string id)
        {
            var Magazine = GetMagazineById(id);
            var publicationInPublisihngHouses = _publicationInPublisihngHouses.Where(x => x.Publication.Id == Magazine.Publication.Id).ToList();

            foreach (var publicationInPublisihngHouse in publicationInPublisihngHouses)
            {
                _publicationInPublisihngHouseRepository.Delete(publicationInPublisihngHouse.Id);
                _publicationInPublisihngHouseRepository.Save();
            }
            _publicationRepository.Delete(Magazine.Publication.Id);
            _publicationRepository.Save();

            _magazineRepository.Delete(id);
            _magazineRepository.Save();
        }
 public /*async*/ void Delete(int id)
 {
     /*await*/ magazineRepository.Delete(id);
 }
        public void Delete(int id)
        {
            Magazine magazineModel = _magazineRepository.Get(id);

            _magazineRepository.Delete(magazineModel);
        }
Beispiel #7
0
 public async Task Delete(int id)
 {
     await _magazineRepository.Delete(id);
 }
 public void Delete(int id)
 {
     _magazineRepository.Delete(id);
 }