コード例 #1
0
        public MergeCustomerUploadLog GetUploadLog(DataRow row, long uploadId)
        {
            var mergeCustomerUploadLog = new MergeCustomerUploadLog
            {
                CustomerId          = ConvertToLong(GetRowValue(row, CustomerId)),
                DuplicateCustomerId = GetRowValue(row, DuplicateCustomerId),
                StatusId            = (long)MergeCustomerUploadStatus.Uploaded,
                IsSuccessful        = false,
                UploadId            = uploadId
            };


            if (mergeCustomerUploadLog.CustomerId <= 0)
            {
                mergeCustomerUploadLog.IsSuccessful = false;
                mergeCustomerUploadLog.StatusId     = (long)MergeCustomerUploadStatus.ParseFailed;
                mergeCustomerUploadLog.ErrorMessage = "Invalid CustomerId :" + GetRowValue(row, CustomerId);
            }

            if (mergeCustomerUploadLog.DuplicateCustomerId.IsNullOrEmpty())
            {
                mergeCustomerUploadLog.IsSuccessful = false;
                mergeCustomerUploadLog.StatusId     = (long)MergeCustomerUploadStatus.ParseFailed;
                mergeCustomerUploadLog.ErrorMessage = "Duplicate Customer(s) is empty";
            }

            return(mergeCustomerUploadLog);
        }
コード例 #2
0
        public void Invalid_CustomerId()
        {
            //arrange
            var mergeCustomerUpload = new MergeCustomerUploadLog
            {
                CustomerId          = 175812915,
                DuplicateCustomerId = "abcd,1758129",
            };

            _mergeCustomerUploadService.ParseMergeCustomerLog(mergeCustomerUpload, 1);
        }
コード例 #3
0
        public void ValidDuplicate_DoesNotMatch()
        {
            //arrange
            var mergeCustomerUpload = new MergeCustomerUploadLog
            {
                CustomerId          = 1758129,
                DuplicateCustomerId = "1832909|1118317",
            };

            _mergeCustomerUploadService.ParseMergeCustomerLog(mergeCustomerUpload, 1);
        }
コード例 #4
0
        public void ValidDuplicate_Match()
        {
            //arrange
            var mergeCustomerUpload = new MergeCustomerUploadLog
            {
                CustomerId          = 748974,
                DuplicateCustomerId = "727728",
            };

            _mergeCustomerUploadService.ParseMergeCustomerLog(mergeCustomerUpload, 1);
        }
コード例 #5
0
        public MergeCustomerUploadLog Save(MergeCustomerUploadLog domain)
        {
            using (var adapter = PersistenceLayer.GetDataAccessAdapter())
            {
                var entity = AutoMapper.Mapper.Map <MergeCustomerUploadLog, MergeCustomerUploadLogEntity>(domain);
                if (!adapter.SaveEntity(entity, true))
                {
                    throw new PersistenceFailureException("Could not save Call Upload Log");
                }

                return(AutoMapper.Mapper.Map <MergeCustomerUploadLogEntity, MergeCustomerUploadLog>(entity));
            }
        }