Ejemplo n.º 1
0
        public ContactData GetContactByContactId(GetContactByContactIdRequest request)
        {
            ContactData result = null;

            try
            {
                IRestClient client = new JsonServiceClient();
                //[Route("/{Context}/{Version}/{ContractNumber}/Contact/{ContactId}", "GET")]
                var url = Common.Helper.BuildURL(string.Format("{0}/{1}/{2}/{3}/Contact/{4}",
                                                               DDContactServiceUrl,
                                                               "NG",
                                                               request.Version,
                                                               request.ContractNumber,
                                                               request.ContactId), request.UserId);

                GetContactByContactIdDataResponse dataDomainResponse = client.Get <GetContactByContactIdDataResponse>(url);

                if (dataDomainResponse != null)
                {
                    result = dataDomainResponse.Contact;
                }
                return(result);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 2
0
        public GetContactByContactIdResponse Get(GetContactByContactIdRequest request)
        {
            GetContactByContactIdResponse response = new GetContactByContactIdResponse();

            try
            {
                if (base.Request != null)
                {
                    request.Token = base.Request.Headers["Token"] as string;
                }
                ValidateTokenResponse result = null;
                result = Security.IsUserValidated(request.Version, request.Token, request.ContractNumber);
                if (result.UserId.Trim() != string.Empty)
                {
                    request.UserId   = result.UserId;
                    response.Contact = ContactManager.GetContactByContactId(request);
                }
                else
                {
                    throw new UnauthorizedAccessException();
                }
            }
            catch (Exception ex)
            {
                CommonFormatter.FormatExceptionResponse(response, base.Response, ex);
                if ((ex is WebServiceException) == false)
                {
                    ContactManager.LogException(ex);
                }
            }
            finally
            {
                //List<string> patientIds = new List<string>();
                //patientIds.Add(request.PatientId);
                //if (result != null)
                //{
                //    string browser = (base.Request != null) ? base.Request.UserAgent : unknownBrowserType;
                //    string hostAddress = (base.Request != null) ? base.Request.UserHostAddress : unknownUserHostAddress;
                //    AuditUtil.LogAuditData(request, result.SQLUserId, patientIds, browser, hostAddress, request.GetType().Name);
                //}
            }
            return(response);
        }
Ejemplo n.º 3
0
        public Contact GetContactByContactId(GetContactByContactIdRequest request)
        {
            Contact contact = null;

            try
            {
                ContactData contactData = EndpointUtil.GetContactByContactId(request);
                if (contactData != null)
                {
                    contact = Mapper.Map <Contact>(contactData);
                    if (!string.IsNullOrEmpty(contactData.PatientId))
                    {
                        contact.IsPatient = true;
                    }

                    if (!string.IsNullOrEmpty(contactData.UserId))
                    {
                        contact.IsUser = true;
                    }
                }
                return(contact);
            }
            catch (Exception ex) { throw ex; }
        }
Ejemplo n.º 4
0
 public DTO.Contact GetContactByContactId(GetContactByContactIdRequest request)
 {
     throw new NotImplementedException();
 }