public string GetMovieNameFromId(int id_movie, SqlConnection dbReference) { try { return(ReceiverQuery.GenericSelect($"select movie_title from movie where id_movie='{id_movie}'", dbReference)); } catch (Exception e) { Debug.Print(e.Message); return(null); } }
public string GetIdUserFromIdChat(string id_chat, SqlConnection dbReference) { try { return(ReceiverQuery.GenericSelect($"select id_user from users where id_chat='{id_chat}'", dbReference)); } catch (Exception e) { Debug.Print(e.Message); return(null); } }
public string GetGenreIdFromName(string genreName, SqlConnection dbReference) { try { return(ReceiverQuery.GenericSelect($"select id_genre from genre where genre_name='{genreName}'", dbReference)); } catch (Exception e) { Debug.Print(e.Message); return(null); } }
public string GetActorIdFromName(string actorName, SqlConnection dbReference) { try { return(ReceiverQuery.GenericSelect($"select id_actor from actor where actor_name='{actorName}'", dbReference)); } catch (Exception e) { Debug.Print(e.Message); return(null); } }
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)); } }