public void DeAsociateGenreMovie(string movieName, string genreName)
        {
            var mov = movieDataAccess.GetMovie(movieName);
            var gen = genreDataAccess.GetGenre(genreName);

            asociationService.DeAsociateGenreMovie(mov, gen);
        }
Beispiel #2
0
 public Movie GetMovie(string name)
 {
     try
     {
         return(movieDataAcces.GetMovie(name));
     }
     catch (DataBaseException)
     {
         return(null);
     }
 }
        public bool AddFavoriteMovie(string nickName, string movieName)
        {
            try
            {
                var movieInDb = movieDataAccess.GetMovie(movieName);
                var userInDb  = usersDataAccess.Get(nickName);


                if (!userInDb.FavoriteMovies.Contains(movieName))
                {
                    userInDb.FavoriteMovies.Add(movieName);
                }

                var action = $"{nickName} added {movieName} to his favorites";
                loger.EventCreator("ADDFAV", action);

                return(true);
            }
            catch (DataBaseException)
            {
                return(false);
            }
        }
Beispiel #4
0
 public Movie GetMovie(string name)
 {
     return(movieDataA.GetMovie(name));
 }
Beispiel #5
0
        public void Delete(string mov)
        {
            var movieToDelete = movieDataA.GetMovie(mov);

            movieDataA.Delete(movieToDelete);
        }