コード例 #1
0
 private void Btn_DeleteBook_Click(object sender, RoutedEventArgs e)
 {
     if (_selectedBook != null)
     {
         _selectedBook.DeleteBook();
     }
     _deleteBtnClicked = true;
     BooksGrid.UnselectAll();
     ShowOrRefreshBookGrid();
     Btn_DeleteBook.IsEnabled = false;
     Btn_EditBook.IsEnabled   = false;
 }
コード例 #2
0
        public void DeleteItem()
        {
            string id             = _view.ID;
            string author         = _view.Author;
            string name           = _view.Name;
            string publisher      = _view.Publisher;
            int    datePublishing = _view.DatePublishing;
            int    periodicity    = _view.Periodicity;

            var bookitem = new Book(id, author, name, publisher, datePublishing);

            _bookModel.GetAllBooks().Find(x => x.ID == bookitem.ID);
            _bookModel.DeleteBook(bookitem);

            var magazineitem = new Magazine(id, author, name, publisher, datePublishing, periodicity);

            _magazineModel.GetAllMagazines().Find(x => x.ID == magazineitem.ID);
            _magazineModel.DeleteMagazine(magazineitem);
        }
コード例 #3
0
 public ActionResult Delete(int id)
 {
     BookModel.DeleteBook(id);
     return(null);
 }