Ejemplo n.º 1
0
        public FormStart()
        {
            Console.WriteLine(Header);
            Console.WriteLine("Commands Help - 5");
            Console.WriteLine("Type a command, and then press Enter: ");
            int command = Convert.ToInt32(Console.ReadLine());

            var formFactory = new FormFactory();

            formFactory.GetForm(command);
        }
Ejemplo n.º 2
0
        public FormHelp()
        {
            Console.WriteLine(Header);
            Console.WriteLine("Commands Help");
            Console.WriteLine("1 - Add note");
            Console.WriteLine("2 - List of notes");
            Console.WriteLine("3 - Delete note");
            Console.WriteLine("4 - Edit Note");
            Console.WriteLine("5 - Help");
            Console.WriteLine("6 - Exit");
            Console.WriteLine("Press Enter to go back.");
            Console.ReadLine();
            var formFactory = new FormFactory();

            formFactory.GetForm(0);
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            //bool endApp = false;
            try
            {
                formFactory.GetForm(0);
            }
            catch
            {
                Console.WriteLine("Wrong command!");
            }

            /*
             * while (!endApp)
             * {
             *  FormStart start = new FormStart();
             * }
             * return;
             */
        }
Ejemplo n.º 4
0
        public FormList()
        {
            Console.WriteLine(Header);
            NoteRepository noteRepository = new NoteRepository();

            Dictionary <int, Note> allNotes = noteRepository.GetAllNotes();

            if (allNotes.Count == 0)
            {
                Console.WriteLine("No notes yet...");
                Console.WriteLine("Press Enter to go back.");
                Console.ReadLine();
                var formFactory = new FormFactory();
                formFactory.GetForm(0);
            }
            else
            {
                foreach (KeyValuePair <int, Note> note in allNotes)
                {
                    Console.WriteLine("[{0}] - {1}", note.Key, note.Value.Title);
                }
            }
        }