Exemplo n.º 1
0
        private void SubCommandLoop(string projectName)
        {
SubMenu:
            PrintSubMenu();
AgainEnterKey:
            var key = Console.ReadLine().Trim();
            var result = ValidatingKeys.IsValidKey(key);

            if (result.Item1 && result.Item2 >= 0 && result.Item2 < 3)
            {
                switch (result.Item2)
                {
                case 1:
                    EmployeeUI employeeUI = container.Resolve <EmployeeUI>();
                    employeeUI.CommandLoop(projectName);
                    goto SubMenu;

                case 2:
                    ProjectUI projectUI = container.Resolve <ProjectUI>();
                    projectUI.CommandLoop(projectName);
                    goto SubMenu;

                default:
                    return;
                }
            }
            logger.Info("Provide right key to navigate ur'self (1-> Employee Site, 2-> Project Site, 0-> exit)!");
            Console.ForegroundColor = ConsoleColor.Red;
            Console.Write("WARNING : ");
            Console.ForegroundColor = ConsoleColor.White;
            Console.Write("Try again with right numeric key \nKey : ");
            goto AgainEnterKey;
        }
Exemplo n.º 2
0
        internal void CommandLoop()
        {
MainMenu:
            PrintMainMenu();
AgainEnterKey:
            var key = Console.ReadLine().Trim();
            var result = ValidatingKeys.IsValidKey(key);

            if (result.Item1 && result.Item2 >= 0 && result.Item2 < 3)
            {
                switch (result.Item2)
                {
                case 1:
                    HaveQuery();
                    goto MainMenu;

                case 2:
                    var ConsoleView = container.Resolve <ConsoleView>();
                    ConsoleView.ViewNGteams();
                    goto MainMenu;

                default:
                    return;
                }
            }
            logger.Info("Provide right key to navigate ur'self (1-> Have query, 2-> View NG teams, 0-> exit)!");
            Console.ForegroundColor = ConsoleColor.Red;
            Console.Write("WARNING : ");
            Console.ForegroundColor = ConsoleColor.White;
            Console.Write("Try again with right numeric key \nKey : ");
            goto AgainEnterKey;
        }
Exemplo n.º 3
0
        public void CommandLoop(string ProjectName)
        {
ProjectMenu:
            PrintProjectMenu();
AgainEnterKey:
            var key = Console.ReadLine().Trim();
            var result = ValidatingKeys.IsValidKey(key);

            if (result.Item1 && result.Item2 >= 0 && result.Item2 < 7)
            {
                bool Status;
                switch (result.Item2)
                {
                case 1:
                    Status = _viewer.AskNewQuery(ProjectName);
                    Check(Status);
                    goto ProjectMenu;

                case 2:
                    _viewer.ShowQueryDetails(ProjectName);
                    goto ProjectMenu;

                case 3:
                    Status = _viewer.ModifyQuery(ProjectName);
                    Check(Status);
                    goto ProjectMenu;

                case 4:
                    Status = _viewer.RemoveQuery(ProjectName);
                    Check(Status);
                    goto ProjectMenu;

                case 5:
                    Status = _viewer.AskNewProjectDetails();
                    Check(Status);
                    goto ProjectMenu;

                case 6:
                    Status = _viewer.RemoveProject();
                    Check(Status);
                    goto ProjectMenu;

                case 0:
                    return;
                }
            }
            logger.Info("Provide right value/key to perform operation on application!");
            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("Enter the RIGHT key(numberic)!");
            Console.ForegroundColor = ConsoleColor.White;
            Console.Write("Try again :)\nKey : ");
            goto AgainEnterKey;
        }
Exemplo n.º 4
0
        public void CommandLoop(string ProjectName)
        {
SubMenu:
            SubMenu();
AgainEnterKey:

            var key = Console.ReadLine().Trim();
            var result = ValidatingKeys.IsValidKey(key);

            if (result.Item1 && result.Item2 >= 0 && result.Item2 < 5)
            {
                bool Status;
                switch (result.Item2)
                {
                case 1:
                    Status = _viewer.AskNewEmployeeDetails();
                    Check(Status);
                    goto SubMenu;

                case 2:
                    Status = _viewer.RemoveEmployee();
                    Check(Status);
                    goto SubMenu;

                case 3:
                    Status = _viewer.ModifyEmployeeDetails();
                    Check(Status);
                    goto SubMenu;

                case 4:
                    _viewer.AskEmployeePUID();
                    goto SubMenu;

                case 0:
                    return;
                }
            }
            logger.Info("Provide right value/key to perform operation on employee!");
            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("Enter the RIGHT key(numberic)!");
            Console.ForegroundColor = ConsoleColor.White;
            Console.Write("Try again :)\nKey : ");
            goto AgainEnterKey;
        }