Пример #1
0
 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);
     }
 }
Пример #2
0
 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);
     }
 }
Пример #3
0
 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);
     }
 }
Пример #4
0
 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);
     }
 }
Пример #5
0
 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);
     }
 }
Пример #6
0
 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));
     }
 }
Пример #7
0
 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));
     }
 }
Пример #8
0
 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));
     }
 }