Exemplo n.º 1
0
        public ICollection <ReferenceDate> Resolve(DynamicsEntity source, PersonalInfo destination, ICollection <ReferenceDate> referenceDates, ResolutionContext context)
        {
            List <ReferenceDate> dates = new List <ReferenceDate>();

            if (source.Date1 != null)
            {
                ReferenceDate referenceDate = new ReferenceDate
                {
                    Index = 0,
                    Key   = source.Date1Label,
                    Value = new DateTimeOffset((DateTime)source.Date1)
                };
                dates.Add(referenceDate);
            }
            if (source.Date2 != null)
            {
                ReferenceDate referenceDate = new ReferenceDate
                {
                    Index = 1,
                    Key   = source.Date2Label,
                    Value = new DateTimeOffset((DateTime)source.Date2)
                };
                dates.Add(referenceDate);
            }
            return(dates);
        }
Exemplo n.º 2
0
        private async Task <bool> CreateResultTransaction(DynamicsEntity o)
        {
            if (_sourceIdentifier != null)
            {
                SSG_SearchRequestResultTransaction trans = new SSG_SearchRequestResultTransaction()
                {
                    SourceIdentifier  = _sourceIdentifier,
                    SearchApiRequest  = _searchApiRequest,
                    InformationSource = _providerDynamicsID
                };

                if (o != null)
                {
                    switch (o.GetType().Name)
                    {
                    case "SSG_Person": trans.Person = (SSG_Person)o; break;

                    case "SSG_Identifier": trans.ResultIdentifier = (SSG_Identifier)o; break;

                    case "SSG_Address": trans.Address = (SSG_Address)o; break;

                    case "SSG_PhoneNumber": trans.PhoneNumber = (SSG_PhoneNumber)o; break;

                    case "SSG_Aliase": trans.Name = (SSG_Aliase)o; break;

                    case "SSG_Employment": trans.Employment = (SSG_Employment)o; break;

                    case "SSG_Identity": trans.RelatedPerson = (SSG_Identity)o; break;

                    case "SSG_Asset_BankingInformation": trans.BankInfo = (SSG_Asset_BankingInformation)o; break;

                    case "SSG_Asset_Vehicle": trans.Vehicle = (SSG_Asset_Vehicle)o; break;

                    case "SSG_Asset_Other": trans.OtherAsset = (SSG_Asset_Other)o; break;

                    case "SSG_Asset_WorkSafeBcClaim": trans.CompensationClaim = (SSG_Asset_WorkSafeBcClaim)o; break;

                    case "SSG_Asset_ICBCClaim": trans.InsuranceClaim = (SSG_Asset_ICBCClaim)o; break;

                    case "SSG_SafetyConcernDetail": trans.SafetyConcern = (SSG_SafetyConcernDetail)o; break;

                    case "SSG_Email": trans.Email = (SSG_Email)o; break;

                    default: return(false);
                    }
                }

                await _searchRequestService.CreateTransaction(trans, _cancellationToken);

                return(true);
            }
            return(false);
        }