public async Task <ActionResult <CommonAPIResponse <bool> > > AddPostJobRole(PostJobRoleAddDTO PostJobRoleAddDTO) { #region Declare return type with initial value. JsonResult jsonResult = GetDefaultJsonResult <bool>(); #endregion try { #region Validate AddPostJobRole for nullability before prepaing the response. if (await PostJobRoleAppService.AddPostJobRole(PostJobRoleAddDTO)) { 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); }
/// <summary> /// Add PostJobRole AppService /// </summary> /// <returns>bool<bool></returns> public async Task <bool> AddPostJobRole(PostJobRoleAddDTO postJobRoleAddDTO) { #region Declare a return type with initial value. bool isCreated = false; #endregion try { if (postJobRoleAddDTO != null) { isCreated = await PostJobRoleBusinessMapping.AddPostJobRole(postJobRoleAddDTO); } } catch (Exception exception) {} return(isCreated); }
/// <summary> /// Mapping user Action Actitvity Log /// </summary> /// <param name=></ param > /// <returns>Task<PostJobRole></returns> public PostJobRole MappingPostJobRoleAddDTOToPostJobRole(PostJobRoleAddDTO PostJobRoleAddDTO) { #region Declare a return type with initial value. PostJobRole PostJobRole = null; #endregion try { PostJobRole = new PostJobRole { JobRoleId = PostJobRoleAddDTO.JobRoleId, PostId = PostJobRoleAddDTO.PostId, CreationDate = DateTime.Now, IsDeleted = (byte)DeleteStatusEnum.NotDeleted }; } catch (Exception exception) { } return(PostJobRole); }
/// <summary> /// Create User Action Activity Log /// </summary> /// <param name=></param> /// <returns>bool</returns> public async Task <bool> AddPostJobRole(PostJobRoleAddDTO PostJobRoleAddDTO) { #region Declare a return type with initial value. bool isPostJobRoleCreated = default(bool); #endregion try { #region Vars PostJobRole PostJobRole = null; #endregion PostJobRole = PostJobRoleMapping.MappingPostJobRoleAddDTOToPostJobRole(PostJobRoleAddDTO); if (PostJobRole != null) { await UnitOfWork.PostJobRoleRepository.Insert(PostJobRole); isPostJobRoleCreated = await UnitOfWork.Commit() > default(int); } } catch (Exception exception) { } return(isPostJobRoleCreated); }