Exemplo n.º 1
0
        private bool MarkMeeting(long meetingId, bool markActivity)
        {
            using (IDataAccessAdapter myAdapter = PersistenceLayer.GetDataAccessAdapter())
            {
                var  linqMetaData = new LinqMetaData(myAdapter);
                long meetingStatusId;
                if (markActivity)
                {
                    meetingStatusId = linqMetaData.ContactCallStatus.Where(callStatus => callStatus.Status == "Held").Select(p => p.ContactCallStatusId).FirstOrDefault();
                }
                else
                {
                    meetingStatusId = linqMetaData.ContactCallStatus.Where(callStatus => callStatus.Status == "Planned").Select(p => p.ContactCallStatusId).FirstOrDefault();
                }

                IRelationPredicateBucket bucket = new RelationPredicateBucket(ContactMeetingFields.ContactMeetingId == meetingId);
                var contactMeetingEntity        = new ContactMeetingEntity(meetingId)
                {
                    DateModified = DateTime.Now, ContactMeetingStatusId = meetingStatusId
                };

                if (myAdapter.UpdateEntitiesDirectly(contactMeetingEntity, bucket) == 0)
                {
                    throw new PersistenceFailureException();
                }
            }
            return(true);
        }
Exemplo n.º 2
0
 /// <summary> setups the sync logic for member _contactMeeting</summary>
 /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
 private void SetupSyncContactMeeting(IEntity2 relatedEntity)
 {
     if (_contactMeeting != relatedEntity)
     {
         DesetupSyncContactMeeting(true, true);
         _contactMeeting = (ContactMeetingEntity)relatedEntity;
         base.PerformSetupSyncRelatedEntity(_contactMeeting, new PropertyChangedEventHandler(OnContactMeetingPropertyChanged), "ContactMeeting", EventMeetingDetailsEntity.Relations.ContactMeetingEntityUsingMeetingId, true, new string[] {  });
     }
 }
Exemplo n.º 3
0
        /// <summary> Initializes the class members</summary>
        protected virtual void InitClassMembers()
        {
            _contactMeeting = null;
            _events         = null;

            PerformDependencyInjection();

            // __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
            // __LLBLGENPRO_USER_CODE_REGION_END
            OnInitClassMembersComplete();
        }
Exemplo n.º 4
0
        private bool DeleteContactMeeting(long contactMeetingId)
        {
            using (IDataAccessAdapter myAdapter = PersistenceLayer.GetDataAccessAdapter())
            {
                IRelationPredicateBucket bucket = new RelationPredicateBucket(ContactMeetingFields.ContactMeetingId == contactMeetingId);
                var contactMeetingEntity        = new ContactMeetingEntity(contactMeetingId)
                {
                    IsActive = false
                };

                if (myAdapter.UpdateEntitiesDirectly(contactMeetingEntity, bucket) == 0)
                {
                    throw new PersistenceFailureException();
                }
            }
            return(true);
        }
Exemplo n.º 5
0
        protected EventMeetingDetailsEntity(SerializationInfo info, StreamingContext context) : base(info, context)
        {
            if (SerializationHelper.Optimization != SerializationOptimization.Fast)
            {
                _contactMeeting = (ContactMeetingEntity)info.GetValue("_contactMeeting", typeof(ContactMeetingEntity));
                if (_contactMeeting != null)
                {
                    _contactMeeting.AfterSave += new EventHandler(OnEntityAfterSave);
                }
                _events = (EventsEntity)info.GetValue("_events", typeof(EventsEntity));
                if (_events != null)
                {
                    _events.AfterSave += new EventHandler(OnEntityAfterSave);
                }

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

            // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
            // __LLBLGENPRO_USER_CODE_REGION_END
        }
Exemplo n.º 6
0
 /// <summary> Removes the sync logic for member _contactMeeting</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 DesetupSyncContactMeeting(bool signalRelatedEntity, bool resetFKFields)
 {
     base.PerformDesetupSyncRelatedEntity(_contactMeeting, new PropertyChangedEventHandler(OnContactMeetingPropertyChanged), "ContactMeeting", EventMeetingDetailsEntity.Relations.ContactMeetingEntityUsingMeetingId, true, signalRelatedEntity, "EventMeetingDetails", resetFKFields, new int[] { (int)EventMeetingDetailsFieldIndex.MeetingId });
     _contactMeeting = null;
 }