/// <summary> /// Add JobSeekerRole AppService /// </summary> /// <returns>bool<bool></returns> public async Task <bool> AddJobSeekerRole(JobSeekerRoleAddDTO jobSeekerRoleAddDTO) { #region Declare a return type with initial value. bool isCreated = false; #endregion try { if (jobSeekerRoleAddDTO != null) { isCreated = await JobSeekerRoleBusinessMapping.AddJobSeekerRole(jobSeekerRoleAddDTO); } } catch (Exception exception) {} return(isCreated); }
/// <summary> /// Mapping user Action Actitvity Log /// </summary> /// <param name=></ param > /// <returns>Task<JobSeekerRole></returns> public JobSeekerRole MappingJobSeekerRoleAddDTOToJobSeekerRole(JobSeekerRoleAddDTO JobSeekerRoleAddDTO) { #region Declare a return type with initial value. JobSeekerRole JobSeekerRole = null; #endregion try { JobSeekerRole = new JobSeekerRole { JobSeekerId = JobSeekerRoleAddDTO.JobSeekerId, JobRoleId = JobSeekerRoleAddDTO.JobRoleId, CreationDate = DateTime.Now, IsDeleted = (byte)DeleteStatusEnum.NotDeleted }; } catch (Exception exception) { } return(JobSeekerRole); }
/// <summary> /// Create User Action Activity Log /// </summary> /// <param name=></param> /// <returns>bool</returns> public async Task <bool> AddJobSeekerRole(JobSeekerRoleAddDTO JobSeekerRoleAddDTO) { #region Declare a return type with initial value. bool isJobSeekerRoleCreated = default(bool); #endregion try { #region Vars JobSeekerRole JobSeekerRole = null; #endregion JobSeekerRole = JobSeekerRoleMapping.MappingJobSeekerRoleAddDTOToJobSeekerRole(JobSeekerRoleAddDTO); if (JobSeekerRole != null) { await UnitOfWork.JobSeekerRoleRepository.Insert(JobSeekerRole); isJobSeekerRoleCreated = await UnitOfWork.Commit() > default(int); } } catch (Exception exception) { } return(isJobSeekerRoleCreated); }
public async Task <ActionResult <CommonAPIResponse <bool> > > AddJobSeekerRole(JobSeekerRoleAddDTO JobSeekerRoleAddDTO) { #region Declare return type with initial value. JsonResult jsonResult = GetDefaultJsonResult <bool>(); #endregion try { #region Validate AddJobSeekerRole for nullability before prepaing the response. if (await JobSeekerRoleAppService.AddJobSeekerRole(JobSeekerRoleAddDTO)) { jsonResult = JsonResultResponse(CommonHelper.GetResponseMessage(APIResponseMessage.Success, CurrentLanguagId), true, HttpStatusCode.OK); } else { jsonResult = JsonResultResponse(CommonHelper.GetResponseMessage(APIResponseMessage.InvalidCredentials, CurrentLanguagId), false, HttpStatusCode.BadRequest); } #endregion } catch (Exception exception) { } return(jsonResult); }