private async Task ValdiateIfTechnologyWithSameNameExists(Common.Models.JobTitle jobTitle) { JobTitleDto technologyWithSameName = await _jobTitleRepositoryAdmin.GetByNameAsync(jobTitle.Name); if (technologyWithSameName != null && technologyWithSameName.Id != jobTitle.Id) { throw new ValidationException("Job Title with same Name already exists."); } }
public async Task <int> UpdateAsync(Common.Models.JobTitle jobTitle) { Guard.ArgumentIsNotNull(jobTitle, nameof(jobTitle)); await ValdiateIfTechnologyWithSameNameExists(jobTitle); JobTitleDto dto = _mapper.Map <Common.Models.JobTitle, JobTitleDto>(jobTitle); return(await _jobTitleRepositoryAdmin.UpdateAsync(dto)); }
public void ShowDeleteModal(JobTitleDto jobTitleDto) { if (jobTitleDto != null) { jobTitle = new JobTitle { Id = jobTitleDto.Id, Name = jobTitleDto.Name, Description = jobTitleDto.Description }; deleteModal.Show(); } }
public void ShowJobTitleModal(JobTitleDto jobTitleDto = null) { if (jobTitleDto == null) { isEditing = false; jobTitle = new JobTitle(); updateModal.Show(); } else { isEditing = true; jobTitle = new JobTitle { Id = jobTitleDto.Id, Name = jobTitleDto.Name, Description = jobTitleDto.Description }; updateModal.Show(); } }
public HirePersonCommand(int personId, JobTitleDto jobTitle) { PersonId = personId; JobTitle = jobTitle; }