Ejemplo n.º 1
0
        public ResultContainer AddMovie(string movieName)
        {
            ResultContainer result = new ResultContainer();
            GetImdbMedia    getter = new GetImdbMedia();
            Movie           movie;

            movie = getter.getMovie(movieName);

            if (movie.Title == null)
            {
                result.result       = false;
                result.errorMessage = "Not found";
                return(result);
            }

            if (checkIfMovieIsInDB(movie))
            {
                result.result       = false;
                result.errorMessage = "Already added";
                return(result);
            }

            database.Add(movie);
            database.SaveChanges();

            result.result = true;
            return(result);
        }
Ejemplo n.º 2
0
 public DatabaseOLD()
 {
     // Make connection to database
     sql_connection = new SQLiteConnection("Data Source=Database.sqlite;Version=3;");
     sql_connection.Open();
     imdbAPI = new GetImdbMedia();
 }