protected void submit_Click(object sender, EventArgs e)
        {
            string movieTitle    = txt_movietitleID.Text;
            string movieDirector = txt_moviedirectorID.Text;
            string movieGenre    = dropdown_moviegenre.SelectedValue;

            Genre currentGenre = new Genre()
            {
                GenreName = movieGenre
            };

            Movie newMovie = new Movie()
            {
                Genre = currentGenre, MovieDirector = movieDirector, MovieName = movieTitle
            };
            bool success = BLLMovie.RegisterNewMovie(newMovie);

            Console.WriteLine(success ? $"Movie {newMovie} Registered" : "Movie Registration Failed");


            lbl_movieregistrationMSG.Text = "movie successfully registered";
        }
Esempio n. 2
0
        private static void RegisterNewMovie()
        {
            Console.Write("Enter movietitle >> ");
            string movieTitle = Console.ReadLine();

            Console.Write("Enter moviedirector >> ");
            string movieDirector = Console.ReadLine();

            Console.Write("Enter genre with first letter uppercase >> ");
            string movieGenre = Console.ReadLine();

            Genre currentGenre = new Genre()
            {
                GenreName = movieGenre
            };

            Movie newMovie = new Movie()
            {
                Genre = currentGenre, MovieDirector = movieDirector, MovieName = movieTitle
            };
            bool success = BLLMovie.RegisterNewMovie(newMovie);

            Console.WriteLine(success ? $"Movie {newMovie} Registered" : "Movie Registration Failed");
        }