/// <summary>
 /// Merge changes inside entity <paramref name="from" /> to the entity <paramref name="to" />. Any changes in <paramref name="from" /> that is not changed in <paramref name="to" /> is updated inside <paramref name="to" />.
 /// </summary>
 /// <param name="from">The "old" entity acting as merging source.</param>
 /// <param name="to">The "new" entity which inherits changes made in <paramref name="from" />.</param>
 /// <returns>
 /// </returns>
 public static void MergeChanges(EventCalendarShareCircle from, EventCalendarShareCircle to)
 {
     if (to.IsPersisted)
     {
         if (from.IsShareDurationModified && !to.IsShareDurationModified)
         {
             to.ShareDuration           = from.ShareDuration;
             to.IsShareDurationModified = true;
         }
         if (from.IsStartDateModified && !to.IsStartDateModified)
         {
             to.StartDate           = from.StartDate;
             to.IsStartDateModified = true;
         }
     }
     else
     {
         to.IsPersisted             = from.IsPersisted;
         to.AssocTypeID             = from.AssocTypeID;
         to.EventID                 = from.EventID;
         to.ShareDuration           = from.ShareDuration;
         to.IsShareDurationModified = from.IsShareDurationModified;
         to.StartDate               = from.StartDate;
         to.IsStartDateModified     = from.IsStartDateModified;
     }
 }
 /// <summary>
 /// Whether or not the present entity is identitical to <paramref name="other" />, in the sense that they have the same (set of) intrinsic identifiers.
 /// </summary>
 /// <param name="other">The entity to be compared to.</param>
 /// <returns>
 ///   The result of comparison.
 /// </returns>
 public bool IsEntityTheSame(EventCalendarShareCircle other)
 {
     if (other == null)
     {
         return(false);
     }
     else
     {
         return(AssocTypeID == other.AssocTypeID && EventID == other.EventID);
     }
 }
Beispiel #3
0
        /// <summary>
        /// Internal use
        /// </summary>
        public EventCalendarShareCircle ShallowCopy(bool allData = false)
        {
            EventCalendarShareCircle e = new EventCalendarShareCircle();

            e.IsInitializing  = true;
            e.AssocTypeID     = AssocTypeID;
            e.EventID         = EventID;
            e.ShareDuration   = ShareDuration;
            e.StartDate       = StartDate;
            e.DistinctString  = GetDistinctString(true);
            e.IsPersisted     = true;
            e.IsEntityChanged = false;
            e.IsInitializing  = false;
            return(e);
        }
 /// <summary>
 /// Whether or not the present entity is identitical to <paramref name="other" />, in the sense that they have the same (set of) primary key(s).
 /// </summary>
 /// <param name="other">The entity to be compared to.</param>
 /// <returns>
 ///   The result of comparison.
 /// </returns>
 public bool IsEntityIdentical(EventCalendarShareCircle other)
 {
     if (other == null)
     {
         return(false);
     }
     if (AssocTypeID != other.AssocTypeID)
     {
         return(false);
     }
     if (EventID != other.EventID)
     {
         return(false);
     }
     return(true);
 }
        /// <summary>
        /// Update changes to the current entity compared to an input <paramref name="newdata" /> and set the entity to a proper state for updating.
        /// </summary>
        /// <param name="newdata">The "new" entity acting as the source of the changes, if any.</param>
        /// <returns>
        /// </returns>
        public void UpdateChanges(EventCalendarShareCircle newdata)
        {
            int cnt = 0;

            if (ShareDuration != newdata.ShareDuration)
            {
                ShareDuration           = newdata.ShareDuration;
                IsShareDurationModified = true;
                cnt++;
            }
            if (StartDate != newdata.StartDate)
            {
                StartDate           = newdata.StartDate;
                IsStartDateModified = true;
                cnt++;
            }
            IsEntityChanged = cnt > 0;
        }
        /// <summary>
        /// Internal use
        /// </summary>
        public EventCalendarShareCircle ShallowCopy(bool allData = false, bool preserveState = false, bool checkLoadState = false)
        {
            EventCalendarShareCircle e = new EventCalendarShareCircle();

            e.StartAutoUpdating = false;
            e.AssocTypeID       = AssocTypeID;
            e.EventID           = EventID;
            e.ShareDuration     = ShareDuration;
            if (preserveState)
            {
                e.IsShareDurationModified = IsShareDurationModified;
            }
            else
            {
                e.IsShareDurationModified = false;
            }
            e.StartDate = StartDate;
            if (preserveState)
            {
                e.IsStartDateModified = IsStartDateModified;
            }
            else
            {
                e.IsStartDateModified = false;
            }
            e.DistinctString = GetDistinctString(true);
            e.IsPersisted    = IsPersisted;
            if (preserveState)
            {
                e.IsEntityChanged = IsEntityChanged;
            }
            else
            {
                e.IsEntityChanged = false;
            }
            e.StartAutoUpdating = true;
            return(e);
        }
 /// <summary>
 /// Internal use
 /// </summary>
 public EventCalendarShareCircle ShallowCopy(bool allData = false)
 {
     EventCalendarShareCircle e = new EventCalendarShareCircle();
     e.IsInitializing = true;
     e.AssocTypeID = AssocTypeID;
     e.EventID = EventID;
     e.ShareDuration = ShareDuration;
     e.StartDate = StartDate;
     e.DistinctString = GetDistinctString(true);
     e.IsPersisted = true;
     e.IsEntityChanged = false;
     e.IsInitializing = false;
     return e;
 }
 /// <summary>
 /// Update changes to the current entity compared to an input <paramref name="newdata" /> and set the entity to a proper state for updating.
 /// </summary>
 /// <param name="newdata">The "new" entity acting as the source of the changes, if any.</param>
 /// <returns>
 /// </returns>
 public void UpdateChanges(EventCalendarShareCircle newdata)
 {
     int cnt = 0;
     if (ShareDuration != newdata.ShareDuration)
     {
         ShareDuration = newdata.ShareDuration;
         IsShareDurationModified = true;
         cnt++;
     }
     if (StartDate != newdata.StartDate)
     {
         StartDate = newdata.StartDate;
         IsStartDateModified = true;
         cnt++;
     }
     IsEntityChanged = cnt > 0;
 }
 /// <summary>
 /// Merge changes inside entity <paramref name="from" /> to the entity <paramref name="to" />. Any changes in <paramref name="from" /> that is not changed in <paramref name="to" /> is updated inside <paramref name="to" />.
 /// </summary>
 /// <param name="from">The "old" entity acting as merging source.</param>
 /// <param name="to">The "new" entity which inherits changes made in <paramref name="from" />.</param>
 /// <returns>
 /// </returns>
 public static void MergeChanges(EventCalendarShareCircle from, EventCalendarShareCircle to)
 {
     if (to.IsPersisted)
     {
         if (from.IsShareDurationModified && !to.IsShareDurationModified)
         {
             to.ShareDuration = from.ShareDuration;
             to.IsShareDurationModified = true;
         }
         if (from.IsStartDateModified && !to.IsStartDateModified)
         {
             to.StartDate = from.StartDate;
             to.IsStartDateModified = true;
         }
     }
     else
     {
         to.IsPersisted = from.IsPersisted;
         to.AssocTypeID = from.AssocTypeID;
         to.EventID = from.EventID;
         to.ShareDuration = from.ShareDuration;
         to.IsShareDurationModified = from.IsShareDurationModified;
         to.StartDate = from.StartDate;
         to.IsStartDateModified = from.IsStartDateModified;
     }
 }
 /// <summary>
 /// Whether or not the present entity is identitical to <paramref name="other" />, in the sense that they have the same (set of) intrinsic identifiers.
 /// </summary>
 /// <param name="other">The entity to be compared to.</param>
 /// <returns>
 ///   The result of comparison.
 /// </returns>
 public bool IsEntityTheSame(EventCalendarShareCircle other)
 {
     if (other == null)
         return false;
     else
         return AssocTypeID == other.AssocTypeID &&  EventID == other.EventID;
 }              
 /// <summary>
 /// Whether or not the present entity is identitical to <paramref name="other" />, in the sense that they have the same (set of) primary key(s).
 /// </summary>
 /// <param name="other">The entity to be compared to.</param>
 /// <returns>
 ///   The result of comparison.
 /// </returns>
 public bool IsEntityIdentical(EventCalendarShareCircle other)
 {
     if (other == null)
         return false;
     if (AssocTypeID != other.AssocTypeID)
         return false;
     if (EventID != other.EventID)
         return false;
     return true;
 }              
 /// <summary>
 /// Internal use
 /// </summary>
 public EventCalendarShareCircle ShallowCopy(bool allData = false, bool preserveState = false, bool checkLoadState = false)
 {
     EventCalendarShareCircle e = new EventCalendarShareCircle();
     e.StartAutoUpdating = false;
     e.AssocTypeID = AssocTypeID;
     e.EventID = EventID;
     e.ShareDuration = ShareDuration;
     if (preserveState)
         e.IsShareDurationModified = IsShareDurationModified;
     else
         e.IsShareDurationModified = false;
     e.StartDate = StartDate;
     if (preserveState)
         e.IsStartDateModified = IsStartDateModified;
     else
         e.IsStartDateModified = false;
     e.DistinctString = GetDistinctString(true);
     e.IsPersisted = IsPersisted;
     if (preserveState)
         e.IsEntityChanged = IsEntityChanged;
     else
         e.IsEntityChanged = false;
     e.StartAutoUpdating = true;
     return e;
 }