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

                IRelationPredicateBucket bucket = new RelationPredicateBucket(ContactCallFields.ContactCallId == callId);
                var contactCallEntity           = new ContactCallEntity(callId)
                {
                    DateModified = DateTime.Now, ContactCallStatusId = callStatusId
                };

                if (myAdapter.UpdateEntitiesDirectly(contactCallEntity, bucket) == 0)
                {
                    throw new PersistenceFailureException();
                }
            }
            return(true);
        }
Ejemplo n.º 2
0
 /// <summary> setups the sync logic for member _contactCall</summary>
 /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
 private void SetupSyncContactCall(IEntity2 relatedEntity)
 {
     if (_contactCall != relatedEntity)
     {
         DesetupSyncContactCall(true, true);
         _contactCall = (ContactCallEntity)relatedEntity;
         base.PerformSetupSyncRelatedEntity(_contactCall, new PropertyChangedEventHandler(OnContactCallPropertyChanged), "ContactCall", EventCallDetailsEntity.Relations.ContactCallEntityUsingCallId, true, new string[] {  });
     }
 }
Ejemplo n.º 3
0
        /// <summary> Initializes the class members</summary>
        protected virtual void InitClassMembers()
        {
            _contactCall = null;
            _events      = null;

            PerformDependencyInjection();

            // __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
            // __LLBLGENPRO_USER_CODE_REGION_END
            OnInitClassMembersComplete();
        }
Ejemplo n.º 4
0
        private bool DeleteContactCall(long contactCallId)
        {
            using (IDataAccessAdapter myAdapter = PersistenceLayer.GetDataAccessAdapter())
            {
                IRelationPredicateBucket bucket = new RelationPredicateBucket(ContactCallFields.ContactCallId == contactCallId);
                var contactCallEntity           = new ContactCallEntity(contactCallId)
                {
                    IsActive = false
                };

                if (myAdapter.UpdateEntitiesDirectly(contactCallEntity, bucket) == 0)
                {
                    throw new PersistenceFailureException();
                }
            }
            return(true);
        }
Ejemplo n.º 5
0
        protected EventCallDetailsEntity(SerializationInfo info, StreamingContext context) : base(info, context)
        {
            if (SerializationHelper.Optimization != SerializationOptimization.Fast)
            {
                _contactCall = (ContactCallEntity)info.GetValue("_contactCall", typeof(ContactCallEntity));
                if (_contactCall != null)
                {
                    _contactCall.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
        }
Ejemplo n.º 6
0
 /// <summary> Removes the sync logic for member _contactCall</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 DesetupSyncContactCall(bool signalRelatedEntity, bool resetFKFields)
 {
     base.PerformDesetupSyncRelatedEntity(_contactCall, new PropertyChangedEventHandler(OnContactCallPropertyChanged), "ContactCall", EventCallDetailsEntity.Relations.ContactCallEntityUsingCallId, true, signalRelatedEntity, "EventCallDetails", resetFKFields, new int[] { (int)EventCallDetailsFieldIndex.CallId });
     _contactCall = null;
 }