private void StartUserController(Employee searchResult)
        {
            ManagerRepository managerRepository = new ManagerRepository(new JsonRepository());

            if (searchResult is Director director)
            {
                DirectoRepository directorRepository = new DirectoRepository(managerRepository);
                new DirectorController(director, directorRepository);
            }
            else if (searchResult is Proger proger)
            {
                new ProgerController(proger);
            }
            else if (searchResult is Freelancer freelancer)
            {
                new FreelancerController(freelancer);
            }
            else
            {
                throw new ArgumentException("Неизвестный тип пользователя");
            }
        }
Exemplo n.º 2
0
 public DirectorController(Director director, DirectoRepository directorRepository)
 {
     this.director           = director;
     this.directorRepository = directorRepository;
     ShowDirectorMenu();
 }