Ejemplo n.º 1
0
 public Host CreateHost(ProspectsEntity prospectsEntity, Address address, Address mailingAddress)
 {
     return(new Host(prospectsEntity.ProspectId)
     {
         Address = address,
         MailingAddress = mailingAddress,
         OrganizationName = prospectsEntity.OrganizationName ?? string.Empty,
         TaxIdNumber = prospectsEntity.TaxIdNumber ?? string.Empty,
         Notes = prospectsEntity.Notes,
         Email = _emailFactory.CreateEmail(prospectsEntity.EmailId),
         OfficePhoneNumber =
             _phoneNumberFactory.CreatePhoneNumber(prospectsEntity.PhoneOffice, PhoneNumberType.Office),
         MobilePhoneNumber =
             _phoneNumberFactory.CreatePhoneNumber(prospectsEntity.PhoneCell, PhoneNumberType.Mobile),
         OtherPhoneNumber =
             _phoneNumberFactory.CreatePhoneNumber(prospectsEntity.PhoneOther, PhoneNumberType.Unknown),
         Status =
             HostStatus.HostStatuses.Find(
                 hostStatus => hostStatus.PersistenceLayerId.ToString() == prospectsEntity.Status),
         Type = prospectsEntity.ProspectTypeId.HasValue ? ((HostProspectType)prospectsEntity.ProspectTypeId.Value) : HostProspectType.Other,
         FaxNumber = _phoneNumberFactory.CreatePhoneNumber(prospectsEntity.Fax, PhoneNumberType.Unknown),
         DataRecorderMetaData = new DataRecorderMetaData
         {
             DateCreated = prospectsEntity.DateCreated,
             DateModified = prospectsEntity.DateModified,
             DataRecorderCreator = prospectsEntity.OrgRoleUserId.HasValue ? new OrganizationRoleUser(prospectsEntity.OrgRoleUserId.Value) : null
         },
         IsHost = prospectsEntity.IsHost.HasValue && prospectsEntity.IsHost.Value
     });
 }
Ejemplo n.º 2
0
        protected HostImageEntity(SerializationInfo info, StreamingContext context) : base(info, context)
        {
            if (SerializationHelper.Optimization != SerializationOptimization.Fast)
            {
                _file = (FileEntity)info.GetValue("_file", typeof(FileEntity));
                if (_file != null)
                {
                    _file.AfterSave += new EventHandler(OnEntityAfterSave);
                }
                _lookup = (LookupEntity)info.GetValue("_lookup", typeof(LookupEntity));
                if (_lookup != null)
                {
                    _lookup.AfterSave += new EventHandler(OnEntityAfterSave);
                }
                _prospects = (ProspectsEntity)info.GetValue("_prospects", typeof(ProspectsEntity));
                if (_prospects != null)
                {
                    _prospects.AfterSave += new EventHandler(OnEntityAfterSave);
                }

                base.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
            }

            // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
            // __LLBLGENPRO_USER_CODE_REGION_END
        }
Ejemplo n.º 3
0
 /// <summary> setups the sync logic for member _prospects</summary>
 /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
 private void SetupSyncProspects(IEntity2 relatedEntity)
 {
     if (_prospects != relatedEntity)
     {
         DesetupSyncProspects(true, true);
         _prospects = (ProspectsEntity)relatedEntity;
         base.PerformSetupSyncRelatedEntity(_prospects, new PropertyChangedEventHandler(OnProspectsPropertyChanged), "Prospects", SalesCycleEntity.Relations.ProspectsEntityUsingProspectsId, true, new string[] {  });
     }
 }
Ejemplo n.º 4
0
        /// <summary> Initializes the class members</summary>
        protected virtual void InitClassMembers()
        {
            _prospects = null;
            PerformDependencyInjection();

            // __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
            // __LLBLGENPRO_USER_CODE_REGION_END
            OnInitClassMembersComplete();
        }
Ejemplo n.º 5
0
        public bool UpdateHostTaxIdNumber(long hostId, string taxIdNumber)
        {
            var host = new ProspectsEntity(hostId)
            {
                TaxIdNumber = taxIdNumber
            };
            IRelationPredicateBucket relationPredicateBucket =
                new RelationPredicateBucket(ProspectsFields.ProspectId == hostId);

            using (IDataAccessAdapter myAdapter = PersistenceLayer.GetDataAccessAdapter())
            {
                return(myAdapter.UpdateEntitiesDirectly(host, relationPredicateBucket) > 0);
            }
        }
Ejemplo n.º 6
0
        protected ProspectContactEntity(SerializationInfo info, StreamingContext context) : base(info, context)
        {
            if (SerializationHelper.Optimization != SerializationOptimization.Fast)
            {
                _prospectContactRoleMapping = (EntityCollection <ProspectContactRoleMappingEntity>)info.GetValue("_prospectContactRoleMapping", typeof(EntityCollection <ProspectContactRoleMappingEntity>));
                _prospectContactRoleCollectionViaProspectContactRoleMapping = (EntityCollection <ProspectContactRoleEntity>)info.GetValue("_prospectContactRoleCollectionViaProspectContactRoleMapping", typeof(EntityCollection <ProspectContactRoleEntity>));
                _prospects = (ProspectsEntity)info.GetValue("_prospects", typeof(ProspectsEntity));
                if (_prospects != null)
                {
                    _prospects.AfterSave += new EventHandler(OnEntityAfterSave);
                }

                base.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
            }

            // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
            // __LLBLGENPRO_USER_CODE_REGION_END
        }
Ejemplo n.º 7
0
 /// <summary> Removes the sync logic for member _prospects</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 DesetupSyncProspects(bool signalRelatedEntity, bool resetFKFields)
 {
     base.PerformDesetupSyncRelatedEntity(_prospects, new PropertyChangedEventHandler(OnProspectsPropertyChanged), "Prospects", SalesCycleEntity.Relations.ProspectsEntityUsingProspectsId, true, signalRelatedEntity, "SalesCycle", resetFKFields, new int[] { (int)SalesCycleFieldIndex.ProspectsId });
     _prospects = null;
 }
Ejemplo n.º 8
0
 /// <summary> Removes the sync logic for member _prospects</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 DesetupSyncProspects(bool signalRelatedEntity, bool resetFKFields)
 {
     base.PerformDesetupSyncRelatedEntity(_prospects, new PropertyChangedEventHandler(OnProspectsPropertyChanged), "Prospects", HostEventDetailsEntity.Relations.ProspectsEntityUsingHostId, true, signalRelatedEntity, "HostEventDetails", resetFKFields, new int[] { (int)HostEventDetailsFieldIndex.HostId });
     _prospects = null;
 }