public async Task <ActionResult <CommonAPIResponse <PostJobRoleReturnDTO> > > GetPostJobRoleById(int id) { #region Vars PostJobRoleReturnDTO PostJobRoleReturnDTO = null; #endregion #region Declare return type with initial value. JsonResult jsonResult = GetDefaultJsonResult <object>(); #endregion try { if (id != default(int)) { PostJobRoleReturnDTO = await PostJobRoleAppService.GetPostJobRoleById(id); } #region Validate userIdentityDTO for nullability before prepaing the response. if (PostJobRoleReturnDTO != null) { jsonResult = JsonResultResponse(CommonHelper.GetResponseMessage(APIResponseMessage.Success, CurrentLanguagId), PostJobRoleReturnDTO, HttpStatusCode.OK); } else { jsonResult = JsonResultResponse(CommonHelper.GetResponseMessage(APIResponseMessage.InvalidCredentials, CurrentLanguagId), new object(), HttpStatusCode.BadRequest); } #endregion } catch (Exception exception) { } return(jsonResult); }
/// <summary> /// Get PostJobRole By Id /// </summary> /// <returns>PostJobRoleReturnDTO<PostJobRoleReturnDTO></returns> public async Task <PostJobRoleReturnDTO> GetPostJobRoleById(int PostJobRoleId) { #region Declare a return type with initial value. PostJobRoleReturnDTO PostJobRole = null; #endregion try { if (PostJobRoleId > default(int)) { PostJobRole = await PostJobRoleBusinessMapping.GetPostJobRoleById(PostJobRoleId); } } catch (Exception exception) {} return(PostJobRole); }
public PostJobRoleReturnDTO MappingPostJobRoleToPostJobRoleReturnDTO(PostJobRole PostJobRole) { #region Declare a return type with initial value. PostJobRoleReturnDTO PostJobRoleReturnDTO = null; #endregion try { if (PostJobRole != null) { PostJobRoleReturnDTO = new PostJobRoleReturnDTO { JobRoleId = PostJobRole.JobRoleId, PostId = PostJobRole.PostId, PostJobRoleId = PostJobRole.PostJobRoleId }; } } catch (Exception exception) { } return(PostJobRoleReturnDTO); }
/// <summary> /// Get user Action Activity Log By Id /// </summary> /// <returns>List<PostJobRoleReturnDTO></returns> public async Task <PostJobRoleReturnDTO> GetPostJobRoleById(int PostJobRoleId) { #region Declare a return type with initial value. PostJobRoleReturnDTO PostJobRole = new PostJobRoleReturnDTO(); #endregion try { PostJobRole postJobRole = await UnitOfWork.PostJobRoleRepository.GetById(PostJobRoleId); if (postJobRole != null) { if (postJobRole.IsDeleted != (byte)DeleteStatusEnum.Deleted) { PostJobRole = PostJobRoleMapping.MappingPostJobRoleToPostJobRoleReturnDTO(postJobRole); } } } catch (Exception exception) { } return(PostJobRole); }