/// <summary> /// Updae PostRelatedIndustry AppService /// </summary> /// <returns>bool<bool></returns> public async Task <bool> UpdatePostRelatedIndustry(PostRelatedIndustryUpdateDTO postRelatedIndustryUpdateDTO) { #region Declare a return type with initial value. bool isUpdated = false; #endregion try { if (postRelatedIndustryUpdateDTO != null) { isUpdated = await PostRelatedIndustryBusinessMapping.UpdatePostRelatedIndustry(postRelatedIndustryUpdateDTO); } } catch (Exception exception) {} return(isUpdated); }
/// <summary> /// Update User Action Activity Log /// </summary> /// <param name=></param> /// <returns>bool</returns> public async Task <bool> UpdatePostRelatedIndustry(PostRelatedIndustryUpdateDTO PostRelatedIndustryUpdateDTO) { #region Declare a return type with initial value. bool isPostRelatedIndustryUpdated = default(bool); #endregion try { if (PostRelatedIndustryUpdateDTO != null) { #region Vars PostRelatedIndustry PostRelatedIndustry = null; #endregion #region Get Activity By Id PostRelatedIndustry = await UnitOfWork.PostRelatedIndustryRepository.GetById(PostRelatedIndustryUpdateDTO.PostRelatedIndustryId); #endregion if (PostRelatedIndustry != null) { #region Mapping PostRelatedIndustry = PostRelatedIndustryMapping.MappingPostRelatedIndustryupdateDTOToPostRelatedIndustry(PostRelatedIndustry, PostRelatedIndustryUpdateDTO); #endregion if (PostRelatedIndustry != null) { #region Update Entity UnitOfWork.PostRelatedIndustryRepository.Update(PostRelatedIndustry); isPostRelatedIndustryUpdated = await UnitOfWork.Commit() > default(int); #endregion } } } } catch (Exception exception) { } return(isPostRelatedIndustryUpdated); }
public async Task <ActionResult <CommonAPIResponse <bool> > > UpdatePostRelatedIndustry(PostRelatedIndustryUpdateDTO PostRelatedIndustryUpdateDTO) { #region Declare return type with initial value. JsonResult jsonResult = GetDefaultJsonResult <bool>(); #endregion try { #region Validate userUpdateDTO for nullability before prepaing the response. if (await PostRelatedIndustryAppService.UpdatePostRelatedIndustry(PostRelatedIndustryUpdateDTO)) { 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> /// Mapping User Activity Log DTO to Action /// </summary> /// <param name=></param> /// <param name=></param> /// <returns></returns> public PostRelatedIndustry MappingPostRelatedIndustryupdateDTOToPostRelatedIndustry(PostRelatedIndustry postRelatedIndustry, PostRelatedIndustryUpdateDTO PostRelatedIndustryUpdateDTO) { #region Declare Return Var with Intial Value PostRelatedIndustry PostRelatedIndustry = postRelatedIndustry; #endregion try { if (PostRelatedIndustryUpdateDTO.PostRelatedIndustryId > default(int)) { PostRelatedIndustry.IndustryId = PostRelatedIndustryUpdateDTO.IndustryId; PostRelatedIndustry.PostId = PostRelatedIndustryUpdateDTO.PostId; PostRelatedIndustry.PostRelatedIndustryId = PostRelatedIndustryUpdateDTO.PostRelatedIndustryId; } } catch (Exception exception) { } return(PostRelatedIndustry); }