Пример #1
0
        public void SetBookItem(Book newDetailItem)
        {
            if (newBook != newDetailItem) {
                newBook = newDetailItem;

                // attempt to set it manually
                newBook.title = newDetailItem.getTitle ();
                newBook.author = newDetailItem.getAuthor ();
                newBook.publisher = newDetailItem.getPublisher ();
                newBook.summary = newDetailItem.getSummary ();
                newBook.isbn = newDetailItem.getIsbn ();
                newBook.dateadded = newDetailItem.getDateAdded ();
                timeAdded = newDetailItem.getDateAdded ();
                Console.Out.WriteLine ("Time added: " + timeAdded.ToString ());

                Console.Out.WriteLine ("Set Book Item entered: " + newBook.getTitle ());
            }
        }
Пример #2
0
			public void deleteFromDatabase(Book oldBook)
			{
				Console.Out.WriteLine("Book " + oldBook.getTitle() + " deleted from database.");

				using (var db = new SQLite.SQLiteConnection(_pathToDatabase))
				{
					Console.Out.WriteLine ("object deleted: " + oldBook.getDateAdded ());
					db.Delete (oldBook);
					//return Delete
				}
			}