Exemple #1
0
        public async Task upload_ResultTransaction_should_success()
        {
            var trans = new SSG_SearchRequestResultTransaction()
            {
            };

            var result = await _sut.CreateTransaction(trans, CancellationToken.None);

            Assert.AreEqual("11111", result.SourceIdentifier.Identification);
        }
Exemple #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);
        }
 public async Task <SSG_SearchRequestResultTransaction> CreateTransaction(SSG_SearchRequestResultTransaction transaction, CancellationToken cancellationToken)
 {
     return(await this._oDataClient.For <SSG_SearchRequestResultTransaction>().Set(transaction).InsertEntryAsync(cancellationToken));
 }