private static void insertBookShort(Book book) { var query = string.Format( @"INSERT INTO Books ('Title', 'Image', 'Status') values ('{0}', '{1}', '{2}')", book.Title, book.Image, DbSelectCommand.GetStatesLike(book.Status)[0]); }
//TODO: make multiple authors and genres public static void PinnAuthorToBook(Book book, Author author) { var query = string.Format("INSERT INTO BookAuthors ('Book', 'Author') values ('{0}', '{1}')", DbSelectCommand.GetBooksWithTitle(book.Title)[0].Id, DbSelectCommand.GetAuthorsLike(author.Name)[0]); DbConnection.Update(query); }
public static bool IsBookWithTitleExist(string title) { if (DbSelectCommand.FindBookWithTitle(title).Count > 0) { return(true); } return(false); }
private static void insertBook(Book book) { var query = string.Format( @"INSERT INTO Books ('Title', 'Image', 'Series', 'Status', 'Rating', 'Comment', 'Link') values ('{0}', '{1}', '{2}', '{3}', '{4}', '{5}', '{6}')", book.Title, book.Image, DbSelectCommand.GetSeriesLike(book.Series)[0], DbSelectCommand.GetStatesLike(book.Status)[0], book.Rating, book.Comment, book.Link); }
public static bool IsBookExist(string title, string author) { if (DbSelectCommand.FindBook(title, author).Count > 0) { return(true); } return(false); }
public static bool IsBookExist(int id) { if (DbSelectCommand.GetBook(id) != null) { return(true); } return(false); }
public static bool IsStatusExist(string param) { if (DbSelectCommand.GetStatesLike(param).Count > 0) { return(true); } return(false); }
public static bool IsAuthorExist(string param) { if (DbSelectCommand.GetAuthorsLike(param).Count > 0) { return(true); } return(false); }
public static void PinnGenreToBook(Book book, Genre genre) { var query = string.Format("INSERT INTO BookGenres ('Book', 'Genre') values ('{0}', '{1}')", DbSelectCommand.GetBooksWithTitle(book.Title)[0].Id, DbSelectCommand.GetGenresLike(genre.Name)[0]); DbConnection.Update(query); }