public bool InsertNewUser(string id_chat, SqlConnection dbReference) { try { ReceiverQuery.GenericInsertInto($"Insert into users(id_chat)values('{id_chat}')", dbReference); return(true); } catch (Exception e) { Debug.Print(e.Message); return(false); } }
public string InsertPreferencesDirector(int id_user, int id_director, int rating, SqlConnection dbReference) { try { ReceiverQuery.GenericInsertInto($"Insert into director_rating(id_user,id_director,rating)values('{id_user}',{id_director},{rating})", dbReference); return("ok"); } catch (Exception e) { Debug.Print(e.Message); return(ReceiverQuery.GenericSelect($"Select director_name from director where id_director = {id_director}", dbReference)); } }
public string InsertPrferencesGenre(int id_user, int id_genre, int rating, SqlConnection dbReference) { try { ReceiverQuery.GenericInsertInto($"Insert into genre_rating(id_user,id_genre,rating)values('{id_user}',{id_genre},{rating})", dbReference); return("ok"); } catch (Exception e) { Debug.Print(e.Message); return(ReceiverQuery.GenericSelect($"Select genre_name from genre where id_genre = {id_genre}", dbReference)); } }
public string InsertPreferencesMovie(int id_user, int id_movie, int rating, SqlConnection dbReference) { try { ReceiverQuery.GenericInsertInto($"Insert into movie_rating(id_user,id_movie,rating)values('{id_user}',{id_movie},{rating})", dbReference); return("ok"); } catch (Exception e) { Debug.Print(e.Message); return(ReceiverQuery.GenericSelect($"Select movie_title from movie where id_movie = {id_movie}", dbReference)); } }