Ejemplo n.º 1
0
        public MainViewModel GetTestGame(int testGameId)
        {
            TestGame      testGame = _TestGameService.TestGames.Where(tg => tg.Id == testGameId).FirstOrDefault();
            MainViewModel mainVM   = new MainViewModel();

            mainVM.listEmployee = new List <Employee>();
            testGame.EmployeesID.ForEach(id => mainVM.listEmployee.Add(_EmployeeService.GetEmployeeByID(id)));

            mainVM.listProject = new List <ProjectWrapper>();
            testGame.ProjectsID.ForEach(id => mainVM.listProject.Add(new ProjectWrapper(_ProjectService.GetProjectByID(id))));
            mainVM.config = _ConfigService.Configs.Where(config => config.Id == testGame.ConfigID).FirstOrDefault();
            mainVM.listProject.ForEach(projectW =>
            {
                _ProjectService.AssignAllEmployeeToProject(mainVM.listEmployee, projectW.project);
            });


            return(mainVM);
        }