Esempio n. 1
0
		public IEnumerable<SearchLegalPartyDto> Search(SearchLegalPartyQueryDto legalPartySearchQuery)
		{
			var uri = _urlServices.GetServiceUri(Constants.ServiceLegalPartySearch);

			ExcludeNoneFeatureSpecificSearchParameters(legalPartySearchQuery);

			string result;

			try
			{
				result = _httpClientProxy.Post(uri.ToString(), "v1.1/SearchLegalParties", legalPartySearchQuery);
			}
			catch (HttpRequestException e)
			{
				if (e.Message.Contains("403 (Forbidden)"))
				{
					throw new InvalidProgramException("You do not have permission to operate this page. Please contact your system administrator for more details.");
				}
				throw;
			}
			catch (TimeoutException e)
			{
				throw new TimeoutException("The search information you have provided is too vague.  Please refine your search and try again.", e);
			}

			if (!string.IsNullOrEmpty(result))
			{
				return JsonConvert.DeserializeObject<List<SearchLegalPartyDto>>(result);
			}

			return null;
		}
Esempio n. 2
0
        public BaseValueSegmentDto Save(int baseValueSegmentId, int assessmentEventId, BaseValueSegmentDto baseValueSegmentDto)
        {
            var uri = _urlServices.GetServiceUri(Constants.FacadeBaseValueSegment);

            var saveResult = _httpClientProxy.Post(uri.ToString(),
                                                   "v1.1/BaseValueSegments/" + baseValueSegmentId + "/AssessmentEventId/" + assessmentEventId,
                                                   baseValueSegmentDto);

            if (!string.IsNullOrEmpty(saveResult))
            {
                return(JsonConvert.DeserializeObject <BaseValueSegmentDto>(saveResult));
            }

            return(null);
        }