public AllergyData InitializeAllergy(PostInitializeAllergyRequest request) { try { AllergyData result = null; IRestClient client = new JsonServiceClient(); //[Route("/{Version}/{ContractNumber}/Allergy/Initialize", "POST")] var url = Common.Helper.BuildURL(string.Format("{0}/{1}/{2}/{3}/Allergy/Initialize", DDAllergyUrl, "NG", request.Version, request.ContractNumber), request.UserId); PutInitializeAllergyDataResponse dataDomainResponse = client.Put <PutInitializeAllergyDataResponse>(url, new PutInitializeAllergyDataRequest { Context = "NG", ContractNumber = request.ContractNumber, AllergyName = request.AllergyName, UserId = request.UserId, Version = request.Version } as object); if (dataDomainResponse != null) { result = dataDomainResponse.AllergyData; } return(result); } catch (WebServiceException ex) { throw new WebServiceException("AD:InitializeAllergy()::" + ex.Message, ex.InnerException); } }
public void InitializeAllergy_Test() { PutInitializeAllergyDataRequest request = new PutInitializeAllergyDataRequest { AllergyName = "testing name", Context = context, ContractNumber = contractNumber, UserId = userId, Version = version }; //[Route("/{Context}/{Version}/{ContractNumber}/Allergy/Initialize", "PUT")] PutInitializeAllergyDataResponse response = client.Put <PutInitializeAllergyDataResponse>( string.Format("{0}/{1}/{2}/{3}/Allergy/Initialize", url, context, version, contractNumber), request); Assert.IsNotNull(response); }
public PutInitializeAllergyDataResponse Put(PutInitializeAllergyDataRequest request) { PutInitializeAllergyDataResponse response = new PutInitializeAllergyDataResponse { Version = request.Version }; try { RequireUserId(request); response.AllergyData = Manager.InitializeAllergy(request); } catch (Exception ex) { RaiseException(response, ex); } return(response); }