Exemplo n.º 1
0
        private void AddMovieButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                Movie movieToAdd = new Movie(titleInput.Text, Int32.Parse(releaseYearInput.Text));
                //string tryString = Convert.ToString(releaseYearInput.Text);
            }
            catch
            {
                MessageBox.Show("put in an int");
                titleInput.Clear();
                releaseYearInput.Clear();
                animationStudioInput.Clear();
                animationTypeInput.Clear();
                return;
            }

            //string adjusted = Convert.ToString(releaseYearInput);

            if (animationTypeInput.Text != "" || animationStudioInput.Text != "")
            {
                AnimatedMovie animatedMovieToAdd = new AnimatedMovie(titleInput.Text, Int32.Parse(releaseYearInput.Text), animationStudioInput.Text, animationTypeInput.Text);
                MovieList.Add(animatedMovieToAdd);
                animationStudioInput.Clear();
                animationTypeInput.Clear();
            }
            else
            {
                Movie movieToAdd = new Movie(titleInput.Text, Int32.Parse(releaseYearInput.Text));
                MovieList.Add(movieToAdd);
            }

            titleInput.Clear();
            releaseYearInput.Clear();
        }
Exemplo n.º 2
0
        private void AddAnimatedMovieButton_Click(object sender, RoutedEventArgs e)
        {
            int year;

            try
            {
                year = int.Parse(releaseYearInput.Text);
            }
            catch (FormatException d)
            {
                MessageBox.Show("Please enter a valid year.");
                return;
            }
            string Title  = titleInput.Text;
            int    Year   = int.Parse(releaseYearInput.Text);
            string Studio = animationStudio.Text;
            string Type   = animationType.Text;

            AnimatedMovie movieToAdd = new AnimatedMovie(Title, Year, Studio, Type);

            MovieList.Add(movieToAdd);

            titleInput.Clear();
            releaseYearInput.Clear();
            animationStudio.Clear();
            animationType.Clear();
        }
Exemplo n.º 3
0
        private void AddAnimatedMovieButton_Click(object sender, RoutedEventArgs e)
        {
            AnimatedMovie animated = new AnimatedMovie(titleInput.Text, Convert.ToInt32(releaseYearInput.Text), studio_input.Text, type_input.Text);

            MovieList.Add(animated);
            //clear text box
            titleInput.Clear();
            releaseYearInput.Clear();
            studio_input.Clear();
            type_input.Clear();
        }
Exemplo n.º 4
0
        private void AddAnimatedButton_Click(object sender, RoutedEventArgs e)
        {
            Movie animatedmovieToAdd = new AnimatedMovie(titleInput.Text, animationStudioInput.Text, animationStudioInput.Text, animationTypeInput.Text);

            MovieList.Add(animatedmovieToAdd);

            titleInput.Clear();
            releaseYearInput.Clear();
            animationStudioInput.Clear();
            animationTypeInput.Clear();
        }
Exemplo n.º 5
0
        private void AnimatedMovieButton(object sender, RoutedEventArgs e)
        {
            AnimatedMovie movieToAdd = new AnimatedMovie(titleInput.Text, int.Parse(releaseYearInput.Text), animationStudio.Text, animationType.Text);

            MovieList.Add(movieToAdd);

            titleInput.Clear();
            releaseYearInput.Clear();
            animationStudio.Clear();
            animationType.Clear();
        }
Exemplo n.º 6
0
        private void AddAniamtedMovieButton_Click(object sender, RoutedEventArgs e)
        {
            string title           = titleInput.Text;
            string releaseYear     = releaseYearInput.Text;
            string animationStudio = AnimationStudio.Text;
            string animationType   = AnimationType.Text;

            AnimatedMovie animated = new AnimatedMovie(animationType, animationStudio);

            MovieList.Add(animated);
            AnimationStudioInput.Clear();
            AnimationTypeInput.Clear();
        }
Exemplo n.º 7
0
        private void AddAnimatedMovie_Click(object sender, RoutedEventArgs e)
        {
            string        uhh    = titleInput.Text;
            int           ohh    = Convert.ToInt32(releaseYearInput.Text);
            string        reee   = animationStudioInput.Text;
            string        doodoo = animationTypeInput.Text;
            AnimatedMovie eeee   = new AnimatedMovie(uhh, ohh, reee, doodoo);

            MovieList.Add(eeee);
            titleInput.Clear();
            releaseYearInput.Clear();
            animationTypeInput.Clear();
            animationStudioInput.Clear();
        }
Exemplo n.º 8
0
        private void AddAnimatedMovieButton_Click(object sender, RoutedEventArgs e)
        {
            string title           = titleInput.Text;
            int    releaseYear     = int.Parse(releaseYearInput.Text);
            string animationStudio = animationStudioInput.Text;
            string animationType   = animationTypeInput.Text;

            AnimatedMovie movieToAdd = new AnimatedMovie(title, releaseYear, animationStudio, animationType);

            MovieList.Add(movieToAdd);

            titleInput.Clear();
            releaseYearInput.Clear();
            animationStudioInput.Clear();
            animationTypeInput.Clear();
        }
Exemplo n.º 9
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                Movie movieToAdd = new AnimatedMovie(titleInput.Text, int.Parse(releaseYearInput.Text), textBox.Text, textBox1.Text);

                MovieList.Add(movieToAdd);

                titleInput.Clear();
                releaseYearInput.Clear();
                textBox.Clear();
                textBox1.Clear();
            }
            catch (Exception)
            {
                MessageBox.Show("Put valid input");
            }
        }
Exemplo n.º 10
0
        private void AddAnimatedButton_Click(object sender, RoutedEventArgs e)
        {
            int?year = null;

            try
            {
                year = Convert.ToInt32(releaseYearInput.Text);
            }
            catch
            {
            }
            Movie animatedMovieToAdd = new AnimatedMovie(titleInput.Text, year, animationStudioInput.Text, animationTypeInput.Text);

            MovieList.Add(animatedMovieToAdd);

            titleInput.Clear();
            releaseYearInput.Clear();
            animationStudioInput.Clear();
            animationTypeInput.Clear();
        }
Exemplo n.º 11
0
        private void AddAnimatedMovieButton_Click(object sender, RoutedEventArgs e)
        {
            int releaseYear = 2003;

            try
            {
                releaseYear = int.Parse(releaseYearInput.Text);
            }
            catch (Exception)
            {
                MessageBox.Show("Please enter in an int value for ReleaseYear.");
            }

            Movie movieToAdd = new AnimatedMovie(titleInput.Text, releaseYear, animationStudio.Text, animationType.Text);

            MovieList.Add(movieToAdd);

            titleInput.Clear();
            releaseYearInput.Clear();
            animationStudio.Clear();
            animationType.Clear();
        }