예제 #1
0
        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.");
            }
        }
예제 #2
0
        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));
        }
예제 #3
0
 public void ShowDeleteModal(JobTitleDto jobTitleDto)
 {
     if (jobTitleDto != null)
     {
         jobTitle = new JobTitle
         {
             Id          = jobTitleDto.Id,
             Name        = jobTitleDto.Name,
             Description = jobTitleDto.Description
         };
         deleteModal.Show();
     }
 }
예제 #4
0
 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;
 }