public UpdateTagResponse UpdateTag(UpdateTagRequest request) { Logger.Current.Verbose("Request to update the tag."); UpdateTagResponse tagresponse = new UpdateTagResponse(); Tag existingTag = tagRepository.FindBy(request.TagViewModel.TagID); if (existingTag != null) { bool isAssociatedWithWorkflow = tagRepository.isAssociatedWithWorkflows(new int[] { existingTag.Id }); bool isAssociatedWithLeadScoreRules = tagRepository.isAssociatedWithLeadScoreRules(new int[] { existingTag.Id }); tagresponse.IsAssociatedWithWorkflows = isAssociatedWithWorkflow; tagresponse.IsAssociatedWithLeadScoreRules = isAssociatedWithLeadScoreRules; if (isAssociatedWithLeadScoreRules || isAssociatedWithWorkflow) { return(tagresponse); } existingTag.TagName = request.TagViewModel.TagName; return(Update(existingTag)); } else { return(new UpdateTagResponse() { Exception = GetTagNotFoundException() }); } }
public HttpResponseMessage ContinuePutTag(TagViewModel viewModel) { UpdateTagResponse response = tagService.ContinueUpdateTag(new UpdateTagRequest() { TagViewModel = viewModel }); return(Request.BuildResponse(response)); }
public static UpdateTagResponse Unmarshall(UnmarshallerContext _ctx) { UpdateTagResponse updateTagResponse = new UpdateTagResponse(); updateTagResponse.HttpResponse = _ctx.HttpResponse; updateTagResponse.RequestId = _ctx.StringValue("UpdateTag.RequestId"); updateTagResponse.Data = _ctx.StringValue("UpdateTag.Data"); return(updateTagResponse); }