public OutPutResult CreateCredentialType(CredentialTypeMsgEntity credentialTypeMsgEntity) { CredentialTypeRequestAPI credentialTypeRequestAPI = credentialTypeBusinessServiceMapper.MapCredentialTypeRequestAPI(credentialTypeMsgEntity); CredentialTypeRequestIPost credentialTypeRequestIPost = credentialTypeBusinessServiceMapper.MapCredentialTypeRequestIPost(credentialTypeMsgEntity, credentialTypeRequestAPI); RestResponse restResponse = katavuccolClient.Post(credentialTypeRequestIPost); CredentialTypeResponseAPI credentialTypeResponseAPI = JsonConvert.DeserializeObject <CredentialTypeResponseAPI>(restResponse.ResponseContent); OutPutResult outPutResult = new OutPutResult(); if (credentialTypeResponseAPI == null) { outPutResult.ResultStatus = ResultStatus.Fail; outPutResult.ResultMessage = new List <ResultMessage> { new ResultMessage() { ErrorCode = katavuccolPortalWebErrorCode.InternalError } }; return(outPutResult); } if (credentialTypeResponseAPI.resultMessages.AnyWithNullCheck()) { outPutResult.ResultStatus = ResultStatus.Fail; outPutResult.ResultMessage = credentialTypeResponseAPI.resultMessages.ToResultMsgEntity(); return(outPutResult); } outPutResult.Key = credentialTypeResponseAPI.id; return(outPutResult); }
public CredentialTypeRequestAPI MapCredentialTypeRequestAPI(CredentialTypeMsgEntity credentialTypeMsgEntity) { return(new CredentialTypeRequestAPI() { description = credentialTypeMsgEntity.Description, isDuplicationAllowed = credentialTypeMsgEntity.IsDuplicationAllowed, isSubitemAllowed = credentialTypeMsgEntity.IsSubitemAllowed, name = credentialTypeMsgEntity.Name }); }
public Result CredentialType(CreateCredentialTypeMsgEntity createCredentialTypeMsgEntity) { CredentialTypeMsgEntity credentialTypeMsgEntity = credentialTypeBusinessServiceMapper.MapCredentialTypeMsgEntity(createCredentialTypeMsgEntity); OutPutResult result = baseCredentialTypeService.CreateCredentialType(credentialTypeMsgEntity); if (result.ResultStatus == ResultStatus.Success) { createCredentialTypeMsgEntity.Id = result.Key; } return(result); }
public CredentialTypeRequestIPost MapCredentialTypeRequestIPost(CredentialTypeMsgEntity credentialTypeMsgEntity, CredentialTypeRequestAPI credentialTypeRequestAPI) { CredentialTypeRequestIPost credentialTypeRequestIPost = new CredentialTypeRequestIPost { Request = credentialTypeRequestAPI, Endpoint = EndPoints.KatavuccolAPIUrl.ToString(), UserId = credentialTypeMsgEntity.UserId }; return(credentialTypeRequestIPost); }