Example #1
0
        private static void UpdateSerie()
        {
            Console.WriteLine("3- To update serie");

            Console.WriteLine("Type the Id of the serie: ");
            int id = int.Parse(Console.ReadLine());

            foreach (int item in Enum.GetValues(typeof(Genres)))
            {
                Console.WriteLine("{0}-{1}", item, Enum.GetName(typeof(Genres), item));
            }

            Console.Write("Choose a genre referring to the items above: ");
            int genre = int.Parse(Console.ReadLine());

            Console.Write("Type the title of the series: ");
            string title = Console.ReadLine();

            Console.Write("Type the release year of the serie: ");
            int year = int.Parse(Console.ReadLine());

            Console.Write("Type the description of the serie: ");
            string description = Console.ReadLine();

            Serie updateSerie = new Serie(id: repository.NextId(), genres: (Genres)genre, title: title, year: year, description: description);

            repository.Update(id, updateSerie);
        }
        private static void InsertSerie()
        {
            Console.WriteLine("Insert new serie");

            foreach (int i in Enum.GetValues(typeof(Genre)))
            {
                Console.WriteLine("{0}-{1}", i, Enum.GetName(typeof(Genre), i));
            }

            Console.Write("Enter the desired option: ");
            int inGenre = int.Parse(Console.ReadLine());

            Console.Write("Enter with serie title: ");
            string inTitle = Console.ReadLine();

            Console.Write("Enter with serie year: ");
            int inYear = int.Parse(Console.ReadLine());

            Console.Write("Enter with serie description: ");
            string inDescription = Console.ReadLine();

            Serie newSerie =
                new Serie(id: repository.NextId(),
                          genre: (Genre)inGenre,
                          title: inTitle,
                          year: inYear,
                          description: inDescription);

            repository.Insert(newSerie);
        }
Example #3
0
        private static void InsertSerie()
        {
            Console.WriteLine("Inserir nova série");

            foreach (int i in Enum.GetValues(typeof(Genre)))
            {
                Console.WriteLine("{0} - {1}", i, Enum.GetName(typeof(Genre), i));
            }

            Console.Write("Digite o gênero entre as opções acima: ");
            int genreEntry = int.Parse(Console.ReadLine());

            Console.Write("Digite o Título da Série: ");
            string titleEntry = Console.ReadLine();

            Console.Write("Digite o Ano de Inicio da Série: ");
            int yearEntry = int.Parse(Console.ReadLine());

            Console.Write("Digite a Descrição da Série: ");
            string descriptionEntry = Console.ReadLine();

            Serie newSerie = new Serie(id: repository.NextId(),
                                       genre: (Genre)genreEntry,
                                       title: titleEntry,
                                       year: yearEntry,
                                       description: descriptionEntry);

            repository.Insert(newSerie);
        }
Example #4
0
        private static void AddSerie()
        {
            Console.WriteLine("Add a new serie");

            foreach (int i in Enum.GetValues(typeof(Genre)))
            {
                Console.WriteLine("{0}-{1}", i, Enum.GetName(typeof(Genre), i));
            }
            Console.Write("Select the category between the options above: ");
            int genryEntry = int.Parse(Console.ReadLine());

            Console.Write("Inform the Serie Title: ");
            string titleEntry = Console.ReadLine();

            Console.Write("Inform the Serie release year: ");
            int yearEntry = int.Parse(Console.ReadLine());

            Console.Write("Inform the Serie description: ");
            string descriptionEntry = Console.ReadLine();

            Serie newSerie = new Serie(id: repository.NextId(),
                                       genre: (Genre)genryEntry,
                                       title: titleEntry,
                                       year: yearEntry,
                                       description: descriptionEntry);

            repository.Add(newSerie);
        }