コード例 #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();
     }
 }
コード例 #5
0
 public HirePersonCommand(int personId, JobTitleDto jobTitle)
 {
     PersonId = personId;
     JobTitle = jobTitle;
 }