Beispiel #1
0
        public void Run()
        {
            while (true)
            {
                ConstantInformation.PrintAvailableKeyCodes();
                var keyCommand = ConsoleInput.ReadLine();
                switch (keyCommand)
                {
                case "1":
                {
                    RegistrationModel.RegisterUser();
                }
                    return;

                case "2":
                {
                    var user = LoginModel.UserLogin();

                    ICommandParser        comandParser = new CommandParser();
                    ICorierServiceContext dbContext    = new CorierServiceContext();
                    var entryPointSQL = new EntryPointToSQL(dbContext, comandParser);

                    while (true)
                    {
                        int userId     = user[0].Id;
                        int userTypeId = user[0].UserTypeId;

                        if (userTypeId == 1)
                        {
                            entryPointSQL.AssignItams(userId);
                            return;
                        }
                        else
                        {
                            entryPointSQL.CommitDistribution(userId);
                            return;
                        }
                    }
                }

                case "3":
                {
                    ConsoleOutput.PrintLine(Constant.EXIT_SUCCESSFUL);
                }
                    return;

                default:
                {
                    ConsoleOutput.PrintLine(Constant.WRONG_SYMBOL);
                }
                break;
                }
            }
        }