public async Task OnPostGroup() { JobCompetenciesKnowledge = await _jobCompetencyService.GetJobCompetenciesByTypeId(1); JobCompetenciesTechnical = await _jobCompetencyService.GetJobCompetenciesByTypeId(2); JobCompetenciesBehavioural = await _jobCompetencyService.GetJobCompetenciesByTypeId(3); JobCompetenciesExecutive = await _jobCompetencyService.GetJobCompetenciesByTypeId(4); JobCertificates = await _jobCompetencyService.GetJobCertificates(); JobGroupPositions = await _jobCompetencyService.GetJobGroupPositionsById(JobGroupId); JobGroups = await _jobCompetencyService.GetJobGroups(); CurrentSelectedJobGroup = await _jobCompetencyService.GetJobGroupById(JobGroupId); foreach (var cid in AddedKnowledgeCompetencyIds.Split("-")) { if (!string.IsNullOrEmpty(cid)) { var cidc = cid.Split("&")[0]; var clevel = cid.Split("&")[1]; if (!string.IsNullOrEmpty(cidc) && !string.IsNullOrEmpty(clevel)) { var cidInt = int.Parse(cidc); var cLevel = int.Parse(clevel); var competency = await _jobCompetencyService.GetJobCompetencyLevelByIdLevelId(cidInt, cLevel); AddedKnowledgeCompetencies.Add(competency); } } } foreach (var cid in AddedCertificateIds.Split("-")) { if (!string.IsNullOrEmpty(cid)) { // var cidc = cid.Split("&")[0]; // var clevel = cid.Split("&")[1]; // if (!string.IsNullOrEmpty(cidc) && !string.IsNullOrEmpty(clevel)) // { var cidInt = int.Parse(cid); // var cLevel = int.Parse(clevel); var certificateDto = await _jobCompetencyService.GetJobCertificateById(cidInt); AddedCertificates.Add(certificateDto); //} } } }
public async Task OnPostGroup() { JobCompetenciesKnowledge = await _jobCompetencyService.GetJobCompetenciesByTypeId(1); JobCompetenciesTechnical = await _jobCompetencyService.GetJobCompetenciesByTypeId(2); JobCompetenciesBehavioural = await _jobCompetencyService.GetJobCompetenciesByTypeId(3); JobCompetenciesExecutive = await _jobCompetencyService.GetJobCompetenciesByTypeId(4); JobCertificates = await _jobCompetencyService.GetJobCertificates(); JobGroupPositions = await _jobCompetencyService.GetSubGroupLevelsByGroupId(JobGroupId); JobGroups = await _jobCompetencyService.GetJobGroups(); JobCertificateDescriptions = await _jobCompetencyService.GetAllJobCertificateDescriptions(); CurrentSelectedJobGroup = await _jobCompetencyService.GetJobGroupById(JobGroupId); SubJobGroupId = JobGroupPositions.FirstOrDefault().SubJobGroupId; JobGroupLevelId = JobGroupPositions.FirstOrDefault().LevelId; LevelCode = JobGroupPositions.FirstOrDefault().LevelCode; RegionIds = string.Empty; foreach (var id in SelectedRegionIds) { RegionIds += id + "-"; } foreach (var cid in AddedKnowledgeCompetencyIds.Split("-")) { if (!string.IsNullOrEmpty(cid)) { var cidc = cid.Split("&")[0]; var clevel = cid.Split("&")[1]; if (!string.IsNullOrEmpty(cidc) && !string.IsNullOrEmpty(clevel)) { var cidInt = int.Parse(cidc); var cLevel = int.Parse(clevel); var competency = await _jobCompetencyService.GetJobCompetencyLevelByIdLevelId(cidInt, cLevel); AddedKnowledgeCompetencies.Add(competency); } } } foreach (var cid in AddedTechnicalCompetencyIds.Split("-")) { if (!string.IsNullOrEmpty(cid)) { var cidc = cid.Split("&")[0]; var clevel = cid.Split("&")[1]; if (!string.IsNullOrEmpty(cidc) && !string.IsNullOrEmpty(clevel)) { var cidInt = int.Parse(cidc); var cLevel = int.Parse(clevel); var competency = await _jobCompetencyService.GetJobCompetencyLevelByIdLevelId(cidInt, cLevel); AddedTechnicalCompetencies.Add(competency); } } } foreach (var cid in AddedBehaviouralCompetencyIds.Split("-")) { if (!string.IsNullOrEmpty(cid)) { var cidc = cid.Split("&")[0]; var clevel = cid.Split("&")[1]; if (!string.IsNullOrEmpty(cidc) && !string.IsNullOrEmpty(clevel)) { var cidInt = int.Parse(cidc); var cLevel = int.Parse(clevel); var competency = await _jobCompetencyService.GetJobCompetencyLevelByIdLevelId(cidInt, cLevel); AddedBehaviouralCompetencies.Add(competency); } } } foreach (var cid in AddedExecutiveCompetencyIds.Split("-")) { if (!string.IsNullOrEmpty(cid)) { var cidc = cid.Split("&")[0]; var clevel = cid.Split("&")[1]; if (!string.IsNullOrEmpty(cidc) && !string.IsNullOrEmpty(clevel)) { var cidInt = int.Parse(cidc); var cLevel = int.Parse(clevel); var competency = await _jobCompetencyService.GetJobCompetencyLevelByIdLevelId(cidInt, cLevel); AddedExecutiveCompetencies.Add(competency); } } } foreach (var cid in AddedCertificateIds.Split("-")) { if (!string.IsNullOrEmpty(cid)) { var cidInt = int.Parse(cid.Split("&")[0]); var certificateDto = await _jobCompetencyService.GetJobCertificateById(cidInt); certificateDto.CertificateDescId = int.Parse(cid.Split("&")[1]); AddedCertificates.Add(certificateDto); } } }