Beispiel #1
0
        public bool AskNewEmployeeDetails()
        {
            Employee Employee = new Employee
            {
                ID = Guid.NewGuid()
            };

            Console.Write("\n>>Enter the new employee details\nName : ");
            Employee.FullName = Console.ReadLine().Trim();
            Console.Write("PUID : ");
            Employee.PUID = Console.ReadLine().Trim();
            Console.WriteLine("JobTitle : ");
            Console.WriteLine("1->Senior Technical Lead\n2->Business Analyst\n" +
                              "3->Software Developer\n4->QA Tester");
            Console.Write("Enter the right job number : ");
            Employee.JobTitle = ValidatingKeys.AssigningJob();
            Employee.EmailID  = "";

            Console.Write(">>Assign him/her to the project : \nTeam Name & Project Name : ");
            var project = new List <CFGApplication>
            {
                new CFGApplication()
                {
                    Id = Guid.NewGuid(), TeamName = Console.ReadLine().Trim(), ProjectName = Console.ReadLine().Trim()
                }
            };

            Employee.CFGApplications = project;
            return(employeeValidator.ValidateToUpload(Employee));
        }
Beispiel #2
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;
        }
Beispiel #3
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;
        }
Beispiel #4
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;
        }
Beispiel #5
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;
        }