Beispiel #1
0
        public bool DeleteBook(int id)
        {
            var success = false;

            var book = GetBookById(id);

            using (var data = new BookData())
            {
                var result = data.DeleteBook(id);
                success = result;
            }

            if (success)
            {
                try
                {
                    var sender = new MessageSender();
                    sender.SendMessageConfigurationManager("*****@*****.**", "Eliminación de libro de la base de datos", $"Nombre: {book.NameBook}");
                }
                catch (Exception ex)
                {
                    Logger.logger.Error(ex);
                }
            }

            return(success);
        }
Beispiel #2
0
 public bool DeleteBook(int id)
 {
     using (var data = new BookData())
     {
         var result = data.DeleteBook(id);
         return(result);
     }
 }