Beispiel #1
0
        private static MenuActionService Initialize(MenuActionService actionService)
        {
            actionService.AddNewAction(1, "Add visit", "Main");
            actionService.AddNewAction(2, "Remove visit ", "Main");
            actionService.AddNewAction(3, "Show details", "Main");
            actionService.AddNewAction(4, "List of visits", "Main");

            actionService.AddNewAction(1, "Okulista", "AddNewVisitMenu");
            actionService.AddNewAction(2, "Ginekolog ", "AddNewVisitMenu");
            actionService.AddNewAction(3, "Pediatra", "AddNewVisitMenu");
            actionService.AddNewAction(4, "Lekarz medycyny pracy", "AddNewVisitMenu");
            return(actionService);
        }
Beispiel #2
0
        public ConsoleKeyInfo AddNewItemView(MenuActionService actionService)
        {
            var addNewItemView = actionService.GetMenuActionsByMenuName("AddNewVisitMenu");

            Console.WriteLine("Please select visit type:");
            for (int i = 0; i < addNewItemView.Count; i++)
            {
                Console.WriteLine($"{ addNewItemView[i].Id},{addNewItemView[i].Name}");
            }
            var operation = Console.ReadKey();

            return(operation);
        }
Beispiel #3
0
        //wprzywitanie
        //wybor akcji(ewizyta,recepta
        //
        //dodawanie wizyt
        //usuwanie wizyt
        // odznaczenie, ze wykonano
        //zwrocenie listy(po jakims filtrze np Id)

        public static void Main(string[] args)
        {
            MenuActionService actionService = new MenuActionService();

            actionService = Initialize(actionService);
            Console.WriteLine("Welcome");
            Console.WriteLine("What Do you want?");
            var mainMenu = actionService.GetMenuActionsByMenuName("Main");

            for (int i = 0; i < mainMenu.Count; i++)
            {
                Console.WriteLine($"{mainMenu[i].Id}.{mainMenu[i].Name}");
            }

            var operation = Console.ReadKey(); //tylko cyfra

            switch (operation.KeyChar)         //keychar

            {
            case '1':
                break;

            case '2':
                break;

            case '3':
                break;

            case '4':
                break;

            default:
                Console.WriteLine("Nie wybrano operacji do wykonania");
                break;
            }
        }