/// <summary> /// Add PostIndustry AppService /// </summary> /// <returns>bool<bool></returns> public async Task <bool> AddPostIndustry(PostIndustryAddDTO postIndustryAddDTO) { #region Declare a return type with initial value. bool isCreated = false; #endregion try { if (postIndustryAddDTO != null) { isCreated = await PostIndustryBusinessMapping.AddPostIndustry(postIndustryAddDTO); } } catch (Exception exception) {} return(isCreated); }
/// <summary> /// Mapping user Action Actitvity Log /// </summary> /// <param name=></ param > /// <returns>Task<PostIndustry></returns> public PostIndustry MappingPostIndustryAddDTOToPostIndustry(PostIndustryAddDTO PostIndustryAddDTO) { #region Declare a return type with initial value. PostIndustry PostIndustry = null; #endregion try { PostIndustry = new PostIndustry { IndustryId = PostIndustryAddDTO.IndustryId, PostId = PostIndustryAddDTO.PostId, CreationDate = DateTime.Now, IsDeleted = (byte)DeleteStatusEnum.NotDeleted }; } catch (Exception exception) { } return(PostIndustry); }
/// <summary> /// Create User Action Activity Log /// </summary> /// <param name=></param> /// <returns>bool</returns> public async Task <bool> AddPostIndustry(PostIndustryAddDTO PostIndustryAddDTO) { #region Declare a return type with initial value. bool isPostIndustryCreated = default(bool); #endregion try { #region Vars PostIndustry PostIndustry = null; #endregion PostIndustry = PostIndustryMapping.MappingPostIndustryAddDTOToPostIndustry(PostIndustryAddDTO); if (PostIndustry != null) { await UnitOfWork.PostIndustryRepository.Insert(PostIndustry); isPostIndustryCreated = await UnitOfWork.Commit() > default(int); } } catch (Exception exception) { } return(isPostIndustryCreated); }
public async Task <ActionResult <CommonAPIResponse <bool> > > AddPostIndustry(PostIndustryAddDTO PostIndustryAddDTO) { #region Declare return type with initial value. JsonResult jsonResult = GetDefaultJsonResult <bool>(); #endregion try { #region Validate AddPostIndustry for nullability before prepaing the response. if (await PostIndustryAppService.AddPostIndustry(PostIndustryAddDTO)) { 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); }