Exemplo n.º 1
0
        public UserLogin CreateUserLogin(UserLoginEntity userLoginEntity)
        {
            NullArgumentChecker.CheckIfNull(userLoginEntity, "userLoginEntity");


            string hintAnswer = string.Empty;

            if (!string.IsNullOrEmpty(userLoginEntity.HintAnswer))
            {
                hintAnswer = _cryptographyService.Decrypt(userLoginEntity.HintAnswer);
            }

            return(new UserLogin(userLoginEntity.UserLoginId)
            {
                UserName = userLoginEntity.UserName,
                Password = userLoginEntity.Password,
                Salt = userLoginEntity.Salt,
                Locked = userLoginEntity.IsLocked,
                FailedAttempts = (long)userLoginEntity.LoginAttempts,
                IsSecurityQuestionVerified = userLoginEntity.IsSecurityQuestionVerified,
                UserVerified = userLoginEntity.UserVerified,
                HintAnswer = hintAnswer,
                HintQuestion = userLoginEntity.HintQuestion,
                LastLogged = userLoginEntity.LastLogged,
                DateCreated = userLoginEntity.DateCreated,
                DateModified = userLoginEntity.DateModified,
                IsActive = userLoginEntity.IsActive,
                LastPasswordChangeDate = userLoginEntity.LastPasswordChangeDate,
                IsTwoFactorAuthrequired = userLoginEntity.IsTwoFactorAuthrequired,
                LastLoginAttemptAt = userLoginEntity.LastLoginAttemptAt
            });
        }
Exemplo n.º 2
0
        public sealed override Domain Map(Entity entity)
        {
            NullArgumentChecker.CheckIfNull(entity, "entity");
            var domainObject = new Domain();

            MapDomainFields(entity, domainObject);
            return(domainObject);
        }
Exemplo n.º 3
0
        public sealed override Entity Map(Domain domainObject)
        {
            NullArgumentChecker.CheckIfNull(domainObject, "domainObject");
            var entity = new Entity {
                IsNew = domainObject.Id == 0
            };

            MapEntityFields(domainObject, entity);
            return(entity);
        }
Exemplo n.º 4
0
        // TODO: This Factory needs rethinking ..
        public Physician CreatePhysician(Physician physician, PhysicianProfileEntity physicianProfile)
        {
            NullArgumentChecker.CheckIfNull(physician, "physician");
            NullArgumentChecker.CheckIfNull(physicianProfile, "PhysicianProfileEntity");

            physician.PhysicianId     = physicianProfile.PhysicianId;
            physician.MedicalVendorId = physicianProfile.OrganizationRoleUser.OrganizationId;

            physician.SignatureFile = physicianProfile.DigitalSignatureFileId != null
                                          ? new File(physicianProfile.DigitalSignatureFileId.Value)
                                          : null;

            physician.ResumeFile = physicianProfile.ResumeFileId != null
                                         ? new File(physicianProfile.ResumeFileId.Value)
                                         : null;
            physician.SpecializationId = physicianProfile.SpecializationId.HasValue
                                             ? physicianProfile.SpecializationId.Value
                                             : 0;
            physician.CanSeeEarnings      = physicianProfile.ShowEarningAmount;
            physician.CanDoAuthorizations = physicianProfile.IsAuthorizationAllowed;
            physician.SkipAudit           = physicianProfile.SkipAudit;
            physician.CutOffDate          = physicianProfile.CutOffDate;

            if (!physicianProfile.PhysicianPermittedTest.IsNullOrEmpty())
            {
                physician.PermittedTests =
                    physicianProfile.PhysicianPermittedTest.ToList().Select(test => test.TestId).ToList();
            }

            if (!physicianProfile.PhysicianLicense.IsNullOrEmpty())
            {
                physician.AuthorizedStateLicenses =
                    _licenseMapper.MapMultiple(physicianProfile.PhysicianLicense).ToList();
            }

            if (!physicianProfile.PhysicianPod.IsNullOrEmpty())
            {
                physician.AssignedPodIds =
                    physicianProfile.PhysicianPod.ToList().Select(tpr => tpr.PodId).ToList();
            }

            if (physicianProfile.PhysicianCustomerPayRate != null)
            {
                physician.StandardRate = physicianProfile.PhysicianCustomerPayRate.StandardRate;
                physician.OverReadRate = physicianProfile.PhysicianCustomerPayRate.OverReadRate;
            }
            physician.IsDefault         = physicianProfile.IsDefaultPhysician;
            physician.DisplayName       = physicianProfile.DisplayName;
            physician.UpdateResultEntry = physicianProfile.UpdateResultEntry;
            physician.Npi = physicianProfile.Npi;
            return(physician);
        }
Exemplo n.º 5
0
        protected override void MapEntityFields(Order domainObject, OrderEntity entityToMapTo)
        {
            NullArgumentChecker.CheckIfNull(domainObject.DataRecorderMetaData,
                                            "order.DataRecorderMetaData");
            NullArgumentChecker.CheckIfNull(domainObject.DataRecorderMetaData.DataRecorderCreator,
                                            "order.DataRecorderMetaData.DataRecorderCreator");

            entityToMapTo.OrderId = domainObject.Id;
            entityToMapTo.Type    = (byte)domainObject.OrderType;
            entityToMapTo.OrganizationRoleUserCreatorId = domainObject.DataRecorderMetaData.
                                                          DataRecorderCreator.Id;
            entityToMapTo.DateCreated = domainObject.DataRecorderMetaData.DateCreated;
            entityToMapTo.IsNew       = domainObject.Id == 0;
        }
Exemplo n.º 6
0
 protected override void MapEntityFields(Refund domainObject, RefundEntity entityToMapTo)
 {
     NullArgumentChecker.CheckIfNull(domainObject.DataRecorderMetaData,
                                     "refund.DataRecorderMetaData");
     NullArgumentChecker.CheckIfNull(domainObject.DataRecorderMetaData.DataRecorderCreator,
                                     "refund.DataRecorderMetaData.DataRecorderCreator",
                                     "The given Refund to convert to an entity requires DataRecorderMetaData with a Creator.");
     entityToMapTo.Amount      = domainObject.Price;
     entityToMapTo.RefundId    = domainObject.Id;
     entityToMapTo.DateCreated = domainObject.DataRecorderMetaData.DateCreated;
     entityToMapTo.ReasonId    = (short)domainObject.RefundReason;
     entityToMapTo.Notes       = domainObject.Notes;
     entityToMapTo.OrganizationRoleUserCreatorId = domainObject.DataRecorderMetaData.
                                                   DataRecorderCreator.Id;
 }
Exemplo n.º 7
0
        public HostDeposit Save(HostDeposit hostDeposit)
        {
            NullArgumentChecker.CheckIfNull(hostDeposit, "hostDeposit");

            var hostPaymentEntity = _hostDepositFactory.CreateHostPayment(hostDeposit);

            using (IDataAccessAdapter myAdapter = PersistenceLayer.GetDataAccessAdapter())
            {
                if (!myAdapter.SaveEntity(hostPaymentEntity, true))
                {
                    throw new PersistenceFailureException();
                }
                var address = _addressRepository.GetAddress(hostPaymentEntity.MailingAddressId.Value);
                return(_hostDepositFactory.CreateHostDeposit(hostPaymentEntity, address));
            }
        }
Exemplo n.º 8
0
        public TerritoryEntity CreateTerritoryEntity(Territory territory, DateTime dateCreated,
                                                     DateTime dateModified)
        {
            NullArgumentChecker.CheckIfNull(territory, "territory");
            TerritoryEntity territoryEntity;

            switch (territory.TerritoryType)
            {
            case TerritoryType.Franchisee:
                territoryEntity = _franchiseeTerritoryMapper.
                                  Map((FranchiseeTerritory)territory);
                break;

            case TerritoryType.HospitalPartner:
                territoryEntity = _hospitalPartnerTerritoryMapper.
                                  Map((HospitalPartnerTerritory)territory);
                break;

            case TerritoryType.ReadingPhysician:
                territoryEntity = _readingPhysicianTerritoryMapper.
                                  Map((ReadingPhysicianTerritory)territory);
                break;

            case TerritoryType.Advertiser:
                territoryEntity = _advertiserTerritoryMapper.
                                  Map((AdvertiserTerritory)territory);
                break;

            case TerritoryType.SalesRep:
                territoryEntity = _salesRepTerritoryMapper.Map((SalesRepTerritory)territory);
                break;

            case TerritoryType.Pod:
                territoryEntity = _podTerritoryMapper.Map((PodTerritory)territory);
                break;

            default:
                throw new NotSupportedException(string.Format
                                                    ("The given territory type {0} is currently unsupported.",
                                                    territory.TerritoryType));
            }
            territoryEntity.DateCreated  = dateCreated;
            territoryEntity.DateModified = dateModified;
            territoryEntity.IsActive     = true;
            return(territoryEntity);
        }
Exemplo n.º 9
0
        private Address Save(Address address, bool isActive)
        {
            NullArgumentChecker.CheckIfNull(address, "address");

            ValidateAddress(address);

            var addressEntity = _addressFactory.CreateAddressEntity(address);

            addressEntity.IsActive = isActive;
            using (IDataAccessAdapter myAdapter = PersistenceLayer.GetDataAccessAdapter())
            {
                if (!myAdapter.SaveEntity(addressEntity, true))
                {
                    throw new PersistenceFailureException();
                }
                address.Id = addressEntity.AddressId;
                return(address);
            }
        }
Exemplo n.º 10
0
        private ShippingDetail UpdateShippingDetail(Control currentGridRow, long shippingDetailId, bool isBulkUpdate)
        {
            NullArgumentChecker.CheckIfNull(currentGridRow, "currentGridRow");

            if (shippingDetailId > 0 && currentGridRow is GridViewRow)
            {
                currentGridRow = currentGridRow as GridViewRow;

                var eventDate = currentGridRow.FindControl("EventDateItemLiteral") as Literal;

                if (eventDate != null)
                {
                    if (Convert.ToDateTime(eventDate.Text) > DateTime.Now)
                    {
                        MessageBox.ShowErrorMessage("You can not update shipping status of future event.");
                        return(null);
                    }
                }

                var shippingDetail = _shippingDetailRepository.GetById(shippingDetailId);

                var shippingStatus =
                    currentGridRow.FindControl("ShipmentStatusDropDown") as DropDownList;

                if (shippingStatus != null)
                {
                    shippingDetail.Status = (ShipmentStatus)Enum.Parse(typeof(ShipmentStatus), (isBulkUpdate ? ShipmentStatusUpdateDropDown.SelectedValue : shippingStatus.SelectedValue));
                }

                if (shippingDetail.Status == ShipmentStatus.Shipped)
                {
                    shippingDetail.ShippedByOrgRoleUserId = IoC.Resolve <SessionContext>().UserSession.CurrentOrganizationRole.OrganizationRoleUserId;
                }


                shippingDetail.DataRecorderMetaData.DataRecorderModifier = new OrganizationRoleUser(IoC.Resolve <SessionContext>().UserSession.CurrentOrganizationRole.OrganizationRoleUserId);
                shippingDetail.DataRecorderMetaData.DateModified         = DateTime.Now;
                return(shippingDetail);
            }
            return(null);
        }
Exemplo n.º 11
0
        protected override void MapDomainFields(OrderDetailEntity entity, OrderDetail domainObjectToMapTo)
        {
            NullArgumentChecker.CheckIfNull(entity.OrderItem, "entity.OrderItem",
                                            "The OrderItem associated with the given OrderDetail must be provided.");

            OrderItemStatus orderItemStatus = _orderItemStatusFactory.CreateOrderItemStatus
                                                  ((OrderItemType)entity.OrderItem.Type, entity.Status);
            DataRecorderMetaData dataRecorderMetaData = _dataRecorderMetaDataFactory.
                                                        CreateDataRecorderMetaData(entity.OrganizationRoleUserCreatorId, entity.DateCreated);

            domainObjectToMapTo.Id          = entity.OrderDetailId;
            domainObjectToMapTo.OrderId     = entity.OrderId;
            domainObjectToMapTo.OrderItemId = entity.OrderItemId;
            domainObjectToMapTo.ForOrganizationRoleUserId = entity.ForOrganizationRoleUserId;
            domainObjectToMapTo.Description          = entity.Description;
            domainObjectToMapTo.Quantity             = entity.Quantity;
            domainObjectToMapTo.Price                = entity.Price;
            domainObjectToMapTo.DataRecorderMetaData = dataRecorderMetaData;
            domainObjectToMapTo.OrderItemStatus      = orderItemStatus;
            domainObjectToMapTo.DetailType           = (OrderItemType)entity.OrderItem.Type;
            domainObjectToMapTo.SourceId             = entity.SourceId;
        }
Exemplo n.º 12
0
        protected override void MapEntityFields(OrderDetail domainObject, OrderDetailEntity entityToMapTo)
        {
            NullArgumentChecker.CheckIfNull(domainObject.DataRecorderMetaData,
                                            "domainObject.DataRecorderMetaData",
                                            "The given OrderDetail requires DataRecorderMetaData.");
            NullArgumentChecker.CheckIfNull(domainObject.DataRecorderMetaData.DataRecorderCreator,
                                            "domainObject.DataRecorderMetaData.DataRecorderCreator",
                                            "The given OrderDetail DataRecorderMetaData requires a Creator.");

            entityToMapTo.OrderDetailId             = domainObject.Id;
            entityToMapTo.OrderId                   = domainObject.OrderId;
            entityToMapTo.OrderItemId               = domainObject.OrderItemId;
            entityToMapTo.ForOrganizationRoleUserId = domainObject.ForOrganizationRoleUserId;
            entityToMapTo.Description               = domainObject.Description;
            entityToMapTo.Quantity                  = domainObject.Quantity;
            entityToMapTo.Price       = domainObject.Price;
            entityToMapTo.Status      = (short)domainObject.OrderItemStatus.StatusCode;
            entityToMapTo.DateCreated = domainObject.DataRecorderMetaData.DateCreated;
            entityToMapTo.OrganizationRoleUserCreatorId = domainObject.DataRecorderMetaData.
                                                          DataRecorderCreator.Id;
            entityToMapTo.IsNew    = domainObject.Id == 0;
            entityToMapTo.SourceId = domainObject.SourceId;
        }
Exemplo n.º 13
0
 public List <Territory> CreateTerritories(IEnumerable <TerritoryEntity> territoryEntities)
 {
     NullArgumentChecker.CheckIfNull(territoryEntities, "territoryEntities");
     return(territoryEntities.Select(entity => CreateTerritory(entity)).ToList());
 }
Exemplo n.º 14
0
 public void CheckIfNullThrowsExceptionWhenGivenObjectIsNull()
 {
     NullArgumentChecker.CheckIfNull(null, "Object");
 }
Exemplo n.º 15
0
        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);
        }
Exemplo n.º 16
0
 public void CheckIfNullTakesNoActionWhenGivenNonNullObject()
 {
     NullArgumentChecker.CheckIfNull(string.Empty, "String");
 }
Exemplo n.º 17
0
        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);
        }