Example #1
0
        public IActionResult CreateProjectDeveloper()
        {
            var developers = developerRepository.GetAll();

            ViewBag.Developers = new SelectList(developers, "DeveloperId", "DeveloperName");
            var projects = projectRepository.GetAll();

            ViewBag.Projects = new SelectList(projects, "ProjectId", "ProjectName");

            return(View());
        }
Example #2
0
        public void UpdateKnowledgeDeveloper(string[] selectedDeveloper, KnowledgeVM knowledgeToUpdate)
        {
            if (knowledgeToUpdate.KnowledgeDeveloper == null)
            {
                knowledgeToUpdate.KnowledgeDeveloper = new List <KnowledgeDeveloperVM>();
            }

            var all = developerRepository.GetAll();
            var selectedDeveloperHS = new HashSet <string>(selectedDeveloper);
            var knowledgeDeveloper  = new HashSet <int>(knowledgeToUpdate.KnowledgeDeveloper.Select(c => c.Developer.Id));

            knowledgeDesignerRepository.RemoveAll(knowledgeToUpdate.Id);

            foreach (var developer in all)
            {
                if (selectedDeveloperHS.Contains(developer.Id.ToString()))
                {
                    if (!knowledgeDeveloper.Contains(developer.Id))
                    {
                        knowledgeToUpdate.KnowledgeDeveloper.Add(new KnowledgeDeveloperVM {
                            KnowledgeId = knowledgeToUpdate.Id, DeveloperId = developer.Id
                        });
                    }
                }
                else
                {
                    if (knowledgeDeveloper.Contains(developer.Id))
                    {
                        var knowledgeToRemove = knowledgeToUpdate.KnowledgeDeveloper.SingleOrDefault(i => i.DeveloperId == developer.Id);
                        knowledgeDeveloperRepository.Remove(mapper.Map <KnowledgeDeveloper>(knowledgeToRemove));
                    }
                }
            }
        }
Example #3
0
        public async Task <IEnumerable <Developer> > GetAll()
        {
            var users = await _repository.GetAll();

            var result = users != null?_mapper.Map <IEnumerable <Developer> >(users) : null;

            return(result);
        }
Example #4
0
        public IActionResult GetDevelopers()
        {
            try
            {
                ObjectResult results = new ObjectResult(_developerRepostiory.GetAll())
                {
                    StatusCode = (int)HttpStatusCode.OK
                };
                Request.HttpContext.Response.Headers.Add("X-Total-Count", _developerRepostiory.GetAll().Count().ToString());

                return(results);
            }
            catch (Exception ex)
            {
                return(new StatusCodeResult(500));
            }
        }
Example #5
0
        public List <DeveloperDTO> List()
        {
            List <DeveloperDTO> retour = new List <DeveloperDTO>();
            List <Developer>    liste  = _repo.GetAll();

            retour = MapDeveloperDTO.ToDto(liste);
            return(retour);
        }
 //GET all Developers
 public List <Developer> GetAll()
 {
     try
     {
         return(DeveloperRepository.GetAll());
     }
     catch (RepositoryException ex)
     {
         throw new RepositoryException(ex.Message, ex);
     }
 }
Example #7
0
 public IActionResult GetAll()
 {
     try
     {
         var data = _developerRepository.GetAll();
         return(Ok(data));
     }
     catch (Exception ex)
     {
         return(new StatusCodeResult(500));
     }
 }
Example #8
0
 public IEnumerable <Developer> GetAll()
 {
     return(_repo.GetAll());
 }
Example #9
0
        public async Task <List <DeveloperDto> > GetAllApplicants()
        {
            var developers = await _developerRepository.GetAll();

            return(_mapper.Map <List <DeveloperDto> >(developers));
        }
Example #10
0
 public IEnumerable <DeveloperVM> GetAll()
 {
     return(developerRepository.GetAll().ProjectTo <DeveloperVM>(mapper.ConfigurationProvider).ToList());
 }
Example #11
0
        public async Task <IEnumerable <DeveloperViewModel> > GetAll()
        {
            var developers = _mapper.Map <IEnumerable <DeveloperViewModel> >(await _developerRepository.GetAll());

            return(developers);
        }
Example #12
0
 public async Task <IActionResult> Index()
 {
     return(View(await _developerRepository.GetAll()));
 }