Ejemplo n.º 1
0
        public void RunCreateView()
        {
            string title  = null;
            string author = null;
            string genre  = null;
            string status = null;

            Console.Clear();
            Console.WriteLine("C cliked");
            Console.WriteLine(MediaCommonOutputText.GetColumnHeadings());
            Console.WriteLine();
            Console.WriteLine(MediaCommonOutputText.GetColumnHeadings());
            Console.WriteLine();
            Console.Write("Title : ");
            title = Console.ReadLine();
            Console.Write("Author : ");
            author = Console.ReadLine();
            Console.Write("Genre : ");
            genre = Console.ReadLine();
            Console.Write("Status : ");
            status = Console.ReadLine();
            Console.WriteLine();
            Console.Write("Press S to save");

            ConsoleKey consoleKey = Console.ReadKey().Key;

            if (consoleKey == ConsoleKey.S)
            {
                _collectie.Add(MediaObjectFactory.CreateNewMedia(title, author, genre, status));
            }
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            bool vari = false;

            //string sSearch;
            Collectie        collectie        = new Collectie();
            MediaRecordsView mediaRecordsView = MediaObjectFactory.MediaRecordsViewObject(collectie);



            //Console.WriteLine("Who do you want to find?");
            //sSearch = Console.ReadLine();

            while (!vari)
            {
                Console.Clear();
                Console.WriteLine(MediaCommonOutputText.GetApplicationHeading());
                mediaRecordsView.RunRecordsView();
                Console.WriteLine();
                Console.WriteLine(MediaCommonOutputText.GetInstructions());
                ConsoleKey instructionKeys = Console.ReadKey().Key;
                switch (instructionKeys)
                {
                case ConsoleKey.C:
                    MediaCreateView mediaCreateView = MediaObjectFactory.MediaCreateViewObject(collectie);
                    mediaCreateView.RunCreateView();
                    break;

                case ConsoleKey.R:
                    break;

                case ConsoleKey.U:
                    break;

                case ConsoleKey.D:
                    break;

                case ConsoleKey.O:
                    MediaSearchView mediaSearchView = MediaObjectFactory.MediaSearchViewObject(collectie);
                    mediaSearchView.RunSearchView();
                    break;

                default:
                    vari = true;
                    break;
                }
            }
        }