private void SaveCampaign(ChaseOutboundViewModel model, long customerId, long chaseOutboundId) { var chaseCampaignType = _chaseCampaignTypeRepository.GetByName(model.CampaignType) ?? _chaseCampaignTypeRepository.Save(new ChaseCampaignType { Name = model.CampaignType, Alias = model.CampaignType.Trim().Replace(" ", "") }); var chaseCampaign = _chaseCampaignRepository.Save(new ChaseCampaign { CampaignId = model.CampaignId, CampaignFileId = model.CampaignFileId, CampaignName = model.CampaignName, CampaignCode = model.CampaignCode, CampaignHouseholdId = model.CampaignHouseholdId, ChaseCampaignTypeId = chaseCampaignType.Id }); // _chaseCampaignRepository.DeactivateAllCustomerCampaigns(customerId); _chaseCampaignRepository.SaveCustomerChaseCampaign(new CustomerChaseCampaign { ChaseOutboundId = chaseOutboundId, CustomerId = customerId, ChaseCampaignId = chaseCampaign.Id, IsActive = true }); }
private ChaseOutboundViewModel GetChaseOutboundModel(DataRow row) { var model = new ChaseOutboundViewModel { TenantId = GetRowValue(row, ChaseOutboundColumn.TenantId), CampaignId = GetRowValue(row, ChaseOutboundColumn.CampaignId), IndividualId = GetRowValue(row, ChaseOutboundColumn.IndividualIdNumber), VendorCD = GetRowValue(row, ChaseOutboundColumn.VendorCd), ClientId = GetRowValue(row, ChaseOutboundColumn.ClientId), ContractNumber = GetRowValue(row, ChaseOutboundColumn.ContractNumber), ContractPersonNumber = GetRowValue(row, ChaseOutboundColumn.ContractPersonNumber), ConsumerId = GetRowValue(row, ChaseOutboundColumn.ConsumerId), CampaignFileId = GetRowValue(row, ChaseOutboundColumn.CampaignFileId), CampaignName = GetRowValue(row, ChaseOutboundColumn.CampaignName), BusinessCaseId = GetRowValue(row, ChaseOutboundColumn.BusinessCaseId), CampaignCode = GetRowValue(row, ChaseOutboundColumn.CampaignCode), CampaignHouseholdId = GetRowValue(row, ChaseOutboundColumn.CampaignHouseholdId), CampaignType = GetRowValue(row, ChaseOutboundColumn.CampaignType), CampaignMemberId = GetRowValue(row, ChaseOutboundColumn.CampaignMemberId), DistributionId = GetRowValue(row, ChaseOutboundColumn.DistributionId), SubscriberIndicator = GetRowValue(row, ChaseOutboundColumn.SubcriberIndicator).ToLower() == IndicatorY, FirstName = GetRowValue(row, ChaseOutboundColumn.FirstName), MiddleInitial = GetRowValue(row, ChaseOutboundColumn.MiddleInitial), LastName = GetRowValue(row, ChaseOutboundColumn.LastName), DateOfBirth = GetRowValue(row, ChaseOutboundColumn.BirthDate), GenderCode = GetRowValue(row, ChaseOutboundColumn.GenderCode), Ssn = GetRowValue(row, ChaseOutboundColumn.Ssn), AddressLine1 = GetRowValue(row, ChaseOutboundColumn.AddressLine1), AddressLine2 = GetRowValue(row, ChaseOutboundColumn.AddressLine2), AddressCity = GetRowValue(row, ChaseOutboundColumn.AddressCity), AddressState = GetRowValue(row, ChaseOutboundColumn.AddressState), AddressZipCode = GetRowValue(row, ChaseOutboundColumn.AddressZipCode), AddressCountyName = GetRowValue(row, ChaseOutboundColumn.AddressCountyName), AddressCountyCode = GetRowValue(row, ChaseOutboundColumn.AddressCountyCode), Email = GetRowValue(row, ChaseOutboundColumn.AddressEmail), RelationshipCode = GetRowValue(row, ChaseOutboundColumn.RelationshipCode), RelationshipDescription = GetRowValue(row, ChaseOutboundColumn.RelationshipDescription), IdentifiedIndicator = GetRowValue(row, ChaseOutboundColumn.IdentifiedIndicator).ToLower() == IndicatorYes, PhoneNumber = GetRowValue(row, ChaseOutboundColumn.PhoneContactNumber), WorkPhoneNumber = GetRowValue(row, ChaseOutboundColumn.WorkPhoneNumber), OutboundCallIndicator = GetRowValue(row, ChaseOutboundColumn.OutboundCallIndicator).ToLower() == IndicatorY, WirelessIndicator = GetRowValue(row, ChaseOutboundColumn.WirelessIndicator).ToLower() == IndicatorY, LanguagePreferenceCode = GetRowValue(row, ChaseOutboundColumn.LanguagePreferenceCode), PriorityCode = GetRowValue(row, ChaseOutboundColumn.PriorityCode), KeyCode = GetRowValue(row, ChaseOutboundColumn.KeyCode), MedicareIndicator = GetRowValue(row, ChaseOutboundColumn.MedicareIndicator).ToLower() == IndicatorY, GroupNumber = GetRowValue(row, ChaseOutboundColumn.GroupNumber), GroupDivision = GetRowValue(row, ChaseOutboundColumn.GroupDivision), GroupName = GetRowValue(row, ChaseOutboundColumn.GroupName), HmoLobIndicator = GetRowValue(row, ChaseOutboundColumn.HmoLobIndicator).ToLower() == IndicatorY, ProductLevel1 = GetRowValue(row, ChaseOutboundColumn.ProductLevel1), ProductLevel2 = GetRowValue(row, ChaseOutboundColumn.ProductLevel2), ProductLevel3 = GetRowValue(row, ChaseOutboundColumn.ProductLevel3), ProductLevel4 = GetRowValue(row, ChaseOutboundColumn.ProductLevel4), ProductLevel5 = GetRowValue(row, ChaseOutboundColumn.ProductLevel5), Hicn = GetRowValue(row, ChaseOutboundColumn.Hicn), ReferMemberTo = GetRowValue(row, ChaseOutboundColumn.ReferMemberTo), ProviderOfRecordFullName = GetRowValue(row, ChaseOutboundColumn.ProviderOfRecordFullName), ProviderOfRecordPhoneNumber = GetRowValue(row, ChaseOutboundColumn.ProviderOfRecordPhoneNumber), ProviderOfRecordGroupName = GetRowValue(row, ChaseOutboundColumn.ProviderOfRecordGroupName), ProviderOfRecordGroupNumber = GetRowValue(row, ChaseOutboundColumn.ProviderOfRecordGroupNumber), ProviderOfRecordAddressLine1 = GetRowValue(row, ChaseOutboundColumn.ProviderAddressLine1), ProviderOfRecordAddressLine2 = GetRowValue(row, ChaseOutboundColumn.ProviderAddressLine2), ProviderOfRecordAddressCity = GetRowValue(row, ChaseOutboundColumn.ProviderAddressCity), ProviderOfRecordAddressState = GetRowValue(row, ChaseOutboundColumn.ProviderAddressState), ProviderOfRecordAddressZipCode = GetRowValue(row, ChaseOutboundColumn.ProviderAddressZipCode), ChannelLevel2 = GetRowValue(row, ChaseOutboundColumn.ChannelLevel2), ChannelLevel3 = GetRowValue(row, ChaseOutboundColumn.ChannelLevel3), ClosestRetailCenter = GetRowValue(row, ChaseOutboundColumn.ClosestRetailCenter), ConfidenceScore = GetRowValue(row, ChaseOutboundColumn.ConfidenceScore), LocationCode = GetRowValue(row, ChaseOutboundColumn.LocationCode), ForecastedOutreachDate = GetRowValue(row, ChaseOutboundColumn.ForecastedOutreachDate), RecordProcessDate = GetRowValue(row, ChaseOutboundColumn.RecordProcessDate), AgentContextNameValueSet = GetRowValue(row, ChaseOutboundColumn.AgentContextNameValueSet), HomeAddressLine1 = GetRowValue(row, ChaseOutboundColumn.HomeAddressLine1), HomeAddressLine2 = GetRowValue(row, ChaseOutboundColumn.HomeAddressLine2), HomeAddressCity = GetRowValue(row, ChaseOutboundColumn.HomeAddressCity), HomeAddressState = GetRowValue(row, ChaseOutboundColumn.HomeAddressState), HomeAddressZipCode = GetRowValue(row, ChaseOutboundColumn.HomeAddressZipCode), HomeAddressCountyName = GetRowValue(row, ChaseOutboundColumn.HomeAddressCountyName), HomeAddressCountyCode = GetRowValue(row, ChaseOutboundColumn.HomeAddressCountyCode), CustomTags = GetRowValue(row, ChaseOutboundColumn.CustomTags, false) }; return(model); }