protected CustomerChaseChannelEntity(SerializationInfo info, StreamingContext context) : base(info, context) { if (SerializationHelper.Optimization != SerializationOptimization.Fast) { _chaseChannelLevel = (ChaseChannelLevelEntity)info.GetValue("_chaseChannelLevel", typeof(ChaseChannelLevelEntity)); if (_chaseChannelLevel != null) { _chaseChannelLevel.AfterSave += new EventHandler(OnEntityAfterSave); } _chaseOutbound = (ChaseOutboundEntity)info.GetValue("_chaseOutbound", typeof(ChaseOutboundEntity)); if (_chaseOutbound != null) { _chaseOutbound.AfterSave += new EventHandler(OnEntityAfterSave); } _customerProfile = (CustomerProfileEntity)info.GetValue("_customerProfile", typeof(CustomerProfileEntity)); if (_customerProfile != null) { _customerProfile.AfterSave += new EventHandler(OnEntityAfterSave); } base.FixupDeserialization(FieldInfoProviderSingleton.GetInstance()); } // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor // __LLBLGENPRO_USER_CODE_REGION_END }
protected ResultArchiveUploadLogEntity(SerializationInfo info, StreamingContext context) : base(info, context) { if (SerializationHelper.Optimization != SerializationOptimization.Fast) { _customerProfile = (CustomerProfileEntity)info.GetValue("_customerProfile", typeof(CustomerProfileEntity)); if (_customerProfile != null) { _customerProfile.AfterSave += new EventHandler(OnEntityAfterSave); } _resultArchiveUpload = (ResultArchiveUploadEntity)info.GetValue("_resultArchiveUpload", typeof(ResultArchiveUploadEntity)); if (_resultArchiveUpload != null) { _resultArchiveUpload.AfterSave += new EventHandler(OnEntityAfterSave); } _test = (TestEntity)info.GetValue("_test", typeof(TestEntity)); if (_test != null) { _test.AfterSave += new EventHandler(OnEntityAfterSave); } base.FixupDeserialization(FieldInfoProviderSingleton.GetInstance()); } // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor // __LLBLGENPRO_USER_CODE_REGION_END }
protected CustomerIcdCodeEntity(SerializationInfo info, StreamingContext context) : base(info, context) { if (SerializationHelper.Optimization != SerializationOptimization.Fast) { _customerProfile = (CustomerProfileEntity)info.GetValue("_customerProfile", typeof(CustomerProfileEntity)); if (_customerProfile != null) { _customerProfile.AfterSave += new EventHandler(OnEntityAfterSave); } _icdCodes = (IcdCodesEntity)info.GetValue("_icdCodes", typeof(IcdCodesEntity)); if (_icdCodes != null) { _icdCodes.AfterSave += new EventHandler(OnEntityAfterSave); } _organizationRoleUser = (OrganizationRoleUserEntity)info.GetValue("_organizationRoleUser", typeof(OrganizationRoleUserEntity)); if (_organizationRoleUser != null) { _organizationRoleUser.AfterSave += new EventHandler(OnEntityAfterSave); } base.FixupDeserialization(FieldInfoProviderSingleton.GetInstance()); } // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor // __LLBLGENPRO_USER_CODE_REGION_END }
protected CustomerUnsubscribedSmsNotificationEntity(SerializationInfo info, StreamingContext context) : base(info, context) { if (SerializationHelper.Optimization != SerializationOptimization.Fast) { _customerProfile = (CustomerProfileEntity)info.GetValue("_customerProfile", typeof(CustomerProfileEntity)); if (_customerProfile != null) { _customerProfile.AfterSave += new EventHandler(OnEntityAfterSave); } _lookup = (LookupEntity)info.GetValue("_lookup", typeof(LookupEntity)); if (_lookup != null) { _lookup.AfterSave += new EventHandler(OnEntityAfterSave); } _smsReceived = (SmsReceivedEntity)info.GetValue("_smsReceived", typeof(SmsReceivedEntity)); if (_smsReceived != null) { _smsReceived.AfterSave += new EventHandler(OnEntityAfterSave); } base.FixupDeserialization(FieldInfoProviderSingleton.GetInstance()); } // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor // __LLBLGENPRO_USER_CODE_REGION_END }
/// <summary> setups the sync logic for member _customerProfile</summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> private void SetupSyncCustomerProfile(IEntity2 relatedEntity) { if (_customerProfile != relatedEntity) { DesetupSyncCustomerProfile(true, true); _customerProfile = (CustomerProfileEntity)relatedEntity; base.PerformSetupSyncRelatedEntity(_customerProfile, new PropertyChangedEventHandler(OnCustomerProfilePropertyChanged), "CustomerProfile", ReferralEntity.Relations.CustomerProfileEntityUsingReferedCustomerId, true, new string[] { }); } }
/// <summary> Initializes the class members</summary> protected virtual void InitClassMembers() { _customerProfile = null; PerformDependencyInjection(); // __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers // __LLBLGENPRO_USER_CODE_REGION_END OnInitClassMembersComplete(); }
/// <summary> setups the sync logic for member _customerProfile</summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> private void SetupSyncCustomerProfile(IEntity2 relatedEntity) { if (_customerProfile != relatedEntity) { DesetupSyncCustomerProfile(true, true); _customerProfile = (CustomerProfileEntity)relatedEntity; base.PerformSetupSyncRelatedEntity(_customerProfile, new PropertyChangedEventHandler(OnCustomerProfilePropertyChanged), "CustomerProfile", CustomerUnsubscribedSmsNotificationEntity.Relations.CustomerProfileEntityUsingCustomerId, true, new string[] { }); } }
public async Task ChangeProfileStatus(string customerId, CustomerProfileStatus status, TransactionContext txContext = null) { using (var context = _contextFactory.CreateDataContext(txContext)) { var entity = new CustomerProfileEntity { CustomerId = customerId }; context.CustomerProfiles.Attach(entity); entity.Status = status; await context.SaveChangesAsync(); } }
protected CustomerAccountGlocomNumberEntity(SerializationInfo info, StreamingContext context) : base(info, context) { if (SerializationHelper.Optimization != SerializationOptimization.Fast) { _calls = (CallsEntity)info.GetValue("_calls", typeof(CallsEntity)); if (_calls != null) { _calls.AfterSave += new EventHandler(OnEntityAfterSave); } _customerProfile = (CustomerProfileEntity)info.GetValue("_customerProfile", typeof(CustomerProfileEntity)); if (_customerProfile != null) { _customerProfile.AfterSave += new EventHandler(OnEntityAfterSave); } base.FixupDeserialization(FieldInfoProviderSingleton.GetInstance()); } // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor // __LLBLGENPRO_USER_CODE_REGION_END }
public async Task <CustomerProfileErrorCodes> CreateIfNotExistAsync(ICustomerProfile customerProfile) { using (var context = _contextFactory.CreateDataContext()) { var lowerCasedEmail = _encryptionService.EncryptValue(customerProfile.Email.ToLower()); //Note: Here we pull only customers that are Active (Not Archived/Deleted) and if there are none we create a new profile. // We might want to give option for Profile Restore instead of creating new one if the person had a profile previously. var existentCustomerProfile = await context.CustomerProfiles .Include(x => x.LoginProviders) .IgnoreQueryFilters() .FirstOrDefaultAsync(c => c.CustomerId == customerProfile.CustomerId || c.Email == customerProfile.Email || c.LowerCasedEmail == lowerCasedEmail); if (existentCustomerProfile != null) { var registrationProvider = customerProfile.LoginProviders.First(); var hasDifferentProvider = existentCustomerProfile.LoginProviders .Any(x => x.LoginProvider != registrationProvider); return(hasDifferentProvider ? CustomerProfileErrorCodes.CustomerProfileAlreadyExistsWithDifferentProvider : CustomerProfileErrorCodes.CustomerProfileAlreadyExists); } var entity = CustomerProfileEntity.Create(customerProfile); entity = _encryptionService.Encrypt(entity); context.CustomerProfiles.Add(entity); await context.SaveChangesAsync(); return(CustomerProfileErrorCodes.None); } }
public CustomerProfileHistoryEntity CustomerProfileHistoryEntity(CustomerProfileEntity customerProfileEntity, UserEntity userEntity, long createdBy, CustomerEligibility customerEligibility, CustomerWarmTransferEntity customerWarmTransfer, CustomerTargetedEntity customerTargeted) { var billingAddress = customerProfileEntity.BillingAddressId.HasValue ? _addressRepository.GetAddress(customerProfileEntity.BillingAddressId.Value) : null; var homeAddress = _addressRepository.GetAddress(userEntity.HomeAddressId); var entity = new CustomerProfileHistoryEntity { IsNew = true, CustomerId = customerProfileEntity.CustomerId, FirstName = userEntity.FirstName, MiddleName = userEntity.MiddleName, LastName = userEntity.LastName, HomeAddress1 = homeAddress.StreetAddressLine1, HomeAddress2 = homeAddress.StreetAddressLine2, HomeCity = homeAddress.City, HomeState = homeAddress.State, HomeZipCode = homeAddress.ZipCode.Zip, HomeCountry = homeAddress.Country, PhoneOffice = userEntity.PhoneOffice, PhoneCell = userEntity.PhoneCell, PhoneHome = userEntity.PhoneHome, Email1 = userEntity.Email1, Email2 = userEntity.Email2, Picture = userEntity.Picture, Dob = userEntity.Dob, DefaultRoleId = userEntity.Role.RoleId, PhoneOfficeExtension = userEntity.PhoneOfficeExtension, Ssn = userEntity.Ssn, DisplayId = customerProfileEntity.DisplayId, BillingAddress1 = billingAddress != null ? billingAddress.StreetAddressLine1 : string.Empty, BillingAddress2 = billingAddress != null ? billingAddress.StreetAddressLine2 : string.Empty, BillingCity = billingAddress != null ? billingAddress.City : string.Empty, BillingState = billingAddress != null ? billingAddress.State : string.Empty, BillingZipCode = billingAddress != null ? billingAddress.ZipCode.Zip : string.Empty, BillingCountry = billingAddress != null ? billingAddress.Country : string.Empty, Waist = customerProfileEntity.Waist, Height = customerProfileEntity.Height, Weight = customerProfileEntity.Weight, Gender = customerProfileEntity.Gender, Race = customerProfileEntity.Race, TrackingMarketingId = customerProfileEntity.TrackingMarketingId, AddedByRoleId = customerProfileEntity.AddedByRoleId, Employer = customerProfileEntity.Employer, EmergencyContactName = customerProfileEntity.EmergencyContactName, EmergencyContactRelationship = customerProfileEntity.EmergencyContactRelationship, EmergencyContactPhoneNumber = customerProfileEntity.EmergencyContactPhoneNumber, DoNotContactReasonId = customerProfileEntity.DoNotContactReasonId, DoNotContactReasonNotesId = customerProfileEntity.DoNotContactReasonNotesId, RequestNewsLetter = customerProfileEntity.RequestNewsLetter, EmployeeId = customerProfileEntity.EmployeeId, InsuranceId = customerProfileEntity.InsuranceId, PreferredLanguage = customerProfileEntity.PreferredLanguage, BestTimeToCall = customerProfileEntity.BestTimeToCall, Hicn = customerProfileEntity.Hicn, EnableTexting = customerProfileEntity.EnableTexting, MedicareAdvantageNumber = customerProfileEntity.MedicareAdvantageNumber, Tag = customerProfileEntity.Tag, MedicareAdvantagePlanName = customerProfileEntity.MedicareAdvantagePlanName, LanguageId = customerProfileEntity.LanguageId, LabId = customerProfileEntity.LabId, Copay = customerProfileEntity.Copay, Lpi = customerProfileEntity.Lpi, Market = customerProfileEntity.Market, Mrn = customerProfileEntity.Mrn, GroupName = customerProfileEntity.GroupName, IsIncorrectPhoneNumber = customerProfileEntity.IsIncorrectPhoneNumber, IsLanguageBarrier = customerProfileEntity.IsLanguageBarrier, DoNotContactTypeId = customerProfileEntity.DoNotContactTypeId, EnableVoiceMail = customerProfileEntity.EnableVoiceMail, AdditionalField1 = customerProfileEntity.AdditionalField1, AdditionalField2 = customerProfileEntity.AdditionalField2, AdditionalField3 = customerProfileEntity.AdditionalField3, AdditionalField4 = customerProfileEntity.AdditionalField4, ActivityId = customerProfileEntity.ActivityId, DoNotContactUpdateDate = customerProfileEntity.DoNotContactUpdateDate, DateCreated = DateTime.Now, CreatedBy = createdBy, DoNotContactUpdateSource = customerProfileEntity.DoNotContactUpdateSource, LanguageBarrierMarkedDate = customerProfileEntity.LanguageBarrierMarkedDate, IncorrectPhoneNumberMarkedDate = customerProfileEntity.IncorrectPhoneNumberMarkedDate, IsSubscribed = customerProfileEntity.IsSubscribed, PreferredContactType = customerProfileEntity.PreferredContactType, Mbi = customerProfileEntity.Mbi, PhoneHomeConsentId = customerProfileEntity.PhoneHomeConsentId, PhoneCellConsentId = customerProfileEntity.PhoneCellConsentId, PhoneOfficeConsentId = customerProfileEntity.PhoneOfficeConsentId, PhoneHomeConsentUpdateDate = customerProfileEntity.PhoneHomeConsentUpdateDate, PhoneCellConsentUpdateDate = customerProfileEntity.PhoneCellConsentUpdateDate, PhoneOfficeConsentUpdateDate = customerProfileEntity.PhoneOfficeConsentUpdateDate, AcesId = customerProfileEntity.AcesId, BillingMemberId = customerProfileEntity.BillingMemberId, BillingMemberPlan = customerProfileEntity.BillingMemberPlan, BillingMemberPlanYear = customerProfileEntity.BillingMemberPlanYear, EnableEmail = customerProfileEntity.EnableEmail, EnableEmailUpdateDate = customerProfileEntity.EnableEmailUpdateDate, MemberUploadSourceId = customerProfileEntity.MemberUploadSourceId, ProductTypeId = customerProfileEntity.ProductTypeId, AcesClientId = customerProfileEntity.AcesClientId, }; if (customerEligibility != null) { entity.IsEligble = customerEligibility.IsEligible; entity.EligibilityForYear = customerEligibility.ForYear; } if (customerWarmTransfer != null) { entity.IsWarmTransfer = customerWarmTransfer.IsWarmTransfer; entity.WarmTransferYear = customerWarmTransfer.WarmTransferYear; } if (customerTargeted != null) { entity.TargetedYear = customerTargeted.ForYear; entity.IsTargeted = customerTargeted.IsTargated; } return(entity); }
/// <summary> Removes the sync logic for member _customerProfile</summary> /// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param> /// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param> private void DesetupSyncCustomerProfile(bool signalRelatedEntity, bool resetFKFields) { base.PerformDesetupSyncRelatedEntity(_customerProfile, new PropertyChangedEventHandler(OnCustomerProfilePropertyChanged), "CustomerProfile", ReferralEntity.Relations.CustomerProfileEntityUsingReferedCustomerId, true, signalRelatedEntity, "Referral", resetFKFields, new int[] { (int)ReferralFieldIndex.ReferedCustomerId }); _customerProfile = null; }
/// <summary> Removes the sync logic for member _customerProfile</summary> /// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param> /// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param> private void DesetupSyncCustomerProfile(bool signalRelatedEntity, bool resetFKFields) { base.PerformDesetupSyncRelatedEntity(_customerProfile, new PropertyChangedEventHandler(OnCustomerProfilePropertyChanged), "CustomerProfile", CustomerAccountGlocomNumberEntity.Relations.CustomerProfileEntityUsingCustomerId, true, signalRelatedEntity, "CustomerAccountGlocomNumber", resetFKFields, new int[] { (int)CustomerAccountGlocomNumberFieldIndex.CustomerId }); _customerProfile = null; }
public CustomerProfileEntity CreateCustomerEntity(Customer customer, long organizationRoleUserId) { NullArgumentChecker.CheckIfNull(customer, "customer"); var entity = new CustomerProfileEntity(customer.CustomerId) { CustomerId = customer.CustomerId == 0 ? organizationRoleUserId : customer.CustomerId, DateCreated = customer.DateCreated != DateTime.MinValue ? customer.DateCreated : DateTime.Now, DateModified = DateTime.Now, Gender = customer.Gender != Gender.Unspecified && ((long)customer.Gender > 0) ? customer.Gender.ToString() : null, Height = customer.Height == null ? null : customer.Height.TotalInches.ToString(), IsActive = true, Race = (int)customer.Race > 0 ? customer.Race.ToString() : null, Weight = customer.Weight == null ? null : (double?)customer.Weight.Pounds, TrackingMarketingId = customer.MarketingSource, AddedByRoleId = customer.AddedByRoleId, BillingAddressId = customer.BillingAddress != null ? customer.BillingAddress.Id : customer.Address.Id, Employer = customer.Employer, EmergencyContactName = customer.EmergencyContactName, EmergencyContactRelationship = customer.EmergencyContactRelationship, EmergencyContactPhoneNumber = customer.EmergencyContactPhoneNumber != null ? customer.EmergencyContactPhoneNumber.AreaCode + customer.EmergencyContactPhoneNumber.Number : string.Empty, DoNotContactTypeId = customer.DoNotContactTypeId, DoNotContactReasonId = customer.DoNotContactReasonId, DoNotContactReasonNotesId = customer.DoNotContactTypeId.HasValue ? customer.DoNotContactReasonNotesId : null, RequestNewsLetter = customer.RequestForNewsLetter, EmployeeId = customer.EmployeeId, InsuranceId = customer.InsuranceId, PreferredLanguage = customer.PreferredLanguage, BestTimeToCall = customer.BestTimeToCall.HasValue && customer.BestTimeToCall.Value > 0 ? customer.BestTimeToCall.Value : (long?)null, Waist = customer.Waist.HasValue && customer.Waist.Value > 0 ? customer.Waist.Value : (decimal?)null, Tag = customer.Tag, Hicn = customer.Hicn, EnableTexting = customer.EnableTexting, MedicareAdvantageNumber = customer.MedicareAdvantageNumber, MedicareAdvantagePlanName = customer.MedicareAdvantagePlanName, //IsEligble = customer.IsEligible, //Column Moved from this table LabId = customer.LabId, LanguageId = customer.LanguageId, IsNew = customer.CustomerId <= 0, Copay = customer.Copay ?? "", Lpi = customer.Lpi ?? "", Market = customer.Market ?? "", Mrn = customer.Mrn ?? "", GroupName = customer.GroupName ?? "", IsIncorrectPhoneNumber = customer.IsIncorrectPhoneNumber, IsLanguageBarrier = customer.IsLanguageBarrier, EnableVoiceMail = customer.EnableVoiceMail, AdditionalField1 = customer.AdditionalField1, AdditionalField2 = customer.AdditionalField2, AdditionalField3 = customer.AdditionalField3, AdditionalField4 = customer.AdditionalField4, ActivityId = customer.ActivityId, DoNotContactUpdateDate = customer.DoNotContactUpdateDate, //IsDuplicate = customer.IsDuplicate DoNotContactUpdateSource = customer.DoNotContactUpdateSource, IsSubscribed = customer.IsSubscribed, LanguageBarrierMarkedDate = customer.LanguageBarrierMarkedDate, IncorrectPhoneNumberMarkedDate = customer.IncorrectPhoneNumberMarkedDate, PreferredContactType = customer.PreferredContactType, Mbi = customer.Mbi, AcesId = customer.AcesId, PhoneHomeConsentId = customer.PhoneHomeConsentId == 0 ? (long)PatientConsent.Unknown : customer.PhoneHomeConsentId, PhoneCellConsentId = customer.PhoneCellConsentId == 0 ? (long)PatientConsent.Unknown : customer.PhoneCellConsentId, PhoneOfficeConsentId = customer.PhoneOfficeConsentId == 0 ? (long)PatientConsent.Unknown : customer.PhoneOfficeConsentId, PhoneHomeConsentUpdateDate = customer.PhoneHomeConsentUpdateDate, PhoneCellConsentUpdateDate = customer.PhoneCellConsentUpdateDate, PhoneOfficeConsentUpdateDate = customer.PhoneOfficeConsentUpdateDate, BillingMemberId = customer.BillingMemberId, BillingMemberPlan = customer.BillingMemberPlan, BillingMemberPlanYear = customer.BillingMemberPlanYear, EnableEmail = customer.EnableEmail, EnableEmailUpdateDate = customer.EnableEmailUpdateDate, MemberUploadSourceId = customer.MemberUploadSourceId, ActivityTypeIsManual = customer.ActivityTypeIsManual, ProductTypeId = customer.ProductTypeId, AcesClientId = customer.AcesClientId, }; //if (!string.IsNullOrEmpty(customer.LastScreeningDate)) // entity.UserDefined1 = customer.LastScreeningDate; // entity.Fields["DoNotContactTypeId"].IsChanged = true; entity.Fields["DoNotContactReasonId"].IsChanged = true; entity.Fields["DoNotContactReasonNotesId"].IsChanged = true; entity.Fields["BestTimeToCall"].IsChanged = true; entity.Fields["Tag"].IsChanged = true; entity.Fields["Hicn"].IsChanged = true; entity.Fields["MedicareAdvantageNumber"].IsChanged = true; entity.Fields["MedicareAdvantagePlanName"].IsChanged = true; entity.Fields["Copay"].IsChanged = true; entity.Fields["Lpi"].IsChanged = true; entity.Fields["Market"].IsChanged = true; entity.Fields["Mrn"].IsChanged = true; entity.Fields["GroupName"].IsChanged = true; entity.Fields["AdditionalField1"].IsChanged = true; entity.Fields["AdditionalField2"].IsChanged = true; entity.Fields["AdditionalField3"].IsChanged = true; entity.Fields["AdditionalField4"].IsChanged = true; entity.Fields["ActivityId"].IsChanged = true; entity.Fields["DoNotContactUpdateDate"].IsChanged = true; entity.Fields["DoNotContactUpdateSource"].IsChanged = true; entity.Fields["LanguageBarrierMarkedDate"].IsChanged = true; entity.Fields["IncorrectPhoneNumberMarkedDate"].IsChanged = true; entity.Fields["PreferredContactType"].IsChanged = true; entity.Fields["IsSubscribed"].IsChanged = true; entity.Fields["Mbi"].IsChanged = true; entity.Fields["AcesId"].IsChanged = true; entity.Fields["PhoneHomeConsentId"].IsChanged = true; entity.Fields["PhoneCellConsentId"].IsChanged = true; entity.Fields["PhoneOfficeConsentId"].IsChanged = true; entity.Fields["PhoneHomeConsentUpdateDate"].IsChanged = true; entity.Fields["PhoneCellConsentUpdateDate"].IsChanged = true; entity.Fields["PhoneOfficeConsentUpdateDate"].IsChanged = true; entity.Fields["BillingMemberId"].IsChanged = true; entity.Fields["BillingMemberPlan"].IsChanged = true; entity.Fields["BillingMemberPlanYear"].IsChanged = true; entity.Fields["EnableEmailUpdateDate"].IsChanged = true; entity.Fields["MemberUploadSourceId"].IsChanged = true; entity.Fields["ProductTypeId"].IsChanged = true; entity.Fields["AcesClientId"].IsChanged = true; return(entity); }
/// <summary> Removes the sync logic for member _customerProfile</summary> /// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param> /// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param> private void DesetupSyncCustomerProfile(bool signalRelatedEntity, bool resetFKFields) { base.PerformDesetupSyncRelatedEntity(_customerProfile, new PropertyChangedEventHandler(OnCustomerProfilePropertyChanged), "CustomerProfile", EventPaymentDetailsEntity.Relations.CustomerProfileEntityUsingCustomerId, true, signalRelatedEntity, "EventPaymentDetails", resetFKFields, new int[] { (int)EventPaymentDetailsFieldIndex.CustomerId }); _customerProfile = null; }
/// <summary> Removes the sync logic for member _customerProfile</summary> /// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param> /// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param> private void DesetupSyncCustomerProfile(bool signalRelatedEntity, bool resetFKFields) { base.PerformDesetupSyncRelatedEntity(_customerProfile, new PropertyChangedEventHandler(OnCustomerProfilePropertyChanged), "CustomerProfile", CustomerUnsubscribedSmsNotificationEntity.Relations.CustomerProfileEntityUsingCustomerId, true, signalRelatedEntity, "CustomerUnsubscribedSmsNotification", resetFKFields, new int[] { (int)CustomerUnsubscribedSmsNotificationFieldIndex.CustomerId }); _customerProfile = null; }
public Customer CreateCustomer(Customer customer, Address billingAddress, CustomerProfileEntity customersEntity) { NullArgumentChecker.CheckIfNull(customer, "customer"); NullArgumentChecker.CheckIfNull(customersEntity, "customersEntity"); customer.AddedByRoleId = customersEntity.AddedByRoleId; customer.CustomerId = customersEntity.CustomerId; customer.Gender = !string.IsNullOrEmpty(customersEntity.Gender) ? (Gender)Enum.Parse(typeof(Gender), customersEntity.Gender, true) : Gender.Unspecified; var height = !string.IsNullOrEmpty(customersEntity.Height) ? Convert.ToDouble(customersEntity.Height) : 0; if (height != 0) { var inches = height % 12; var feet = (height - inches) / 12; customer.Height = new Height(feet, inches); } customer.MarketingSource = customersEntity.TrackingMarketingId; customer.Race = !string.IsNullOrEmpty(customersEntity.Race) ? (Race)Enum.Parse(typeof(Race), customersEntity.Race, true) : Race.None; customer.Weight = new Weight(customersEntity.Weight ?? 0); customer.BillingAddress = billingAddress; customer.DateCreated = customersEntity.DateCreated; customer.DateModified = customersEntity.DateModified; customer.DisplayCode = customersEntity.DisplayId.HasValue ? customersEntity.DisplayId.Value.ToString() : string.Empty; customer.Employer = customersEntity.Employer; customer.EmergencyContactName = customersEntity.EmergencyContactName; customer.EmergencyContactRelationship = customersEntity.EmergencyContactRelationship; customer.EmergencyContactPhoneNumber = _phoneNumberFactory.CreatePhoneNumber(customersEntity.EmergencyContactPhoneNumber, PhoneNumberType.Office); customer.DoNotContactTypeId = customersEntity.DoNotContactTypeId; customer.DoNotContactReasonId = customersEntity.DoNotContactReasonId; customer.DoNotContactReasonNotesId = customersEntity.DoNotContactReasonNotesId; customer.RequestForNewsLetter = customersEntity.RequestNewsLetter; //customer.LastScreeningDate = customersEntity.UserDefined1; customer.EmployeeId = customersEntity.EmployeeId; customer.InsuranceId = customersEntity.InsuranceId; customer.PreferredLanguage = customersEntity.PreferredLanguage; customer.BestTimeToCall = customersEntity.BestTimeToCall; customer.Waist = customersEntity.Waist.HasValue && customersEntity.Waist.Value > 0 ? customersEntity.Waist.Value : (decimal?)null; customer.Tag = customersEntity.Tag ?? string.Empty; customer.Hicn = customersEntity.Hicn; customer.EnableTexting = customersEntity.EnableTexting; customer.MedicareAdvantageNumber = customersEntity.MedicareAdvantageNumber; customer.MedicareAdvantagePlanName = customersEntity.MedicareAdvantagePlanName; //customer.IsEligible = customersEntity.IsEligble; //Column Moved from this table customer.LabId = customersEntity.LabId; customer.LanguageId = customersEntity.LanguageId; customer.Copay = customersEntity.Copay; customer.Lpi = customersEntity.Lpi; customer.Market = customersEntity.Market; customer.Mrn = customersEntity.Mrn; customer.GroupName = customersEntity.GroupName; customer.IsIncorrectPhoneNumber = customersEntity.IsIncorrectPhoneNumber; customer.IsLanguageBarrier = customersEntity.IsLanguageBarrier; customer.EnableVoiceMail = customersEntity.EnableVoiceMail; customer.AdditionalField1 = customersEntity.AdditionalField1; customer.AdditionalField2 = customersEntity.AdditionalField2; customer.AdditionalField3 = customersEntity.AdditionalField3; customer.AdditionalField4 = customersEntity.AdditionalField4; customer.ActivityId = customersEntity.ActivityId; customer.DoNotContactUpdateDate = customersEntity.DoNotContactUpdateDate; //customer.IsDuplicate = customersEntity.IsDuplicate; customer.DoNotContactUpdateSource = customersEntity.DoNotContactUpdateSource; customer.IsSubscribed = customersEntity.IsSubscribed; customer.LanguageBarrierMarkedDate = customersEntity.LanguageBarrierMarkedDate; customer.IncorrectPhoneNumberMarkedDate = customersEntity.IncorrectPhoneNumberMarkedDate; customer.PreferredContactType = customersEntity.PreferredContactType; customer.AcesId = customersEntity.AcesId; customer.Mbi = customersEntity.Mbi; customer.PhoneCellConsentId = customersEntity.PhoneCellConsentId; customer.PhoneHomeConsentId = customersEntity.PhoneHomeConsentId; customer.PhoneOfficeConsentId = customersEntity.PhoneOfficeConsentId; customer.PhoneHomeConsentUpdateDate = customersEntity.PhoneHomeConsentUpdateDate; customer.PhoneCellConsentUpdateDate = customersEntity.PhoneCellConsentUpdateDate; customer.PhoneOfficeConsentUpdateDate = customersEntity.PhoneOfficeConsentUpdateDate; customer.BillingMemberId = customersEntity.BillingMemberId; customer.BillingMemberPlan = customersEntity.BillingMemberPlan; customer.BillingMemberPlanYear = customersEntity.BillingMemberPlanYear; customer.EnableEmail = customersEntity.EnableEmail; customer.EnableEmailUpdateDate = customersEntity.EnableEmailUpdateDate; customer.MemberUploadSourceId = customersEntity.MemberUploadSourceId; customer.ActivityTypeIsManual = customersEntity.ActivityTypeIsManual; customer.ProductTypeId = customersEntity.ProductTypeId; customer.AcesClientId = customersEntity.AcesClientId; return(customer); }
/// <summary> Removes the sync logic for member _customerProfile</summary> /// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param> /// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param> private void DesetupSyncCustomerProfile(bool signalRelatedEntity, bool resetFKFields) { base.PerformDesetupSyncRelatedEntity(_customerProfile, new PropertyChangedEventHandler(OnCustomerProfilePropertyChanged), "CustomerProfile", CustomerCallAttemptsEntity.Relations.CustomerProfileEntityUsingCustomerId, true, signalRelatedEntity, "CustomerCallAttempts", false, new int[] { (int)CustomerCallAttemptsFieldIndex.CustomerId }); _customerProfile = null; }