/// <summary> /// Internal use /// </summary> public EventCalendar ShallowCopy(bool allData = false) { EventCalendar e = new EventCalendar(); e.IsInitializing = true; e.ID = ID; e.CreateDate = CreateDate; e.EventDuration = EventDuration; e.StartDate = StartDate; e.Title = Title; e.EventStatus = EventStatus; e.SubTitle = SubTitle; e.ApplicationID = ApplicationID; e.CreatedUserID = CreatedUserID; e.EventTypeID = EventTypeID; e.GroupID = GroupID; e.UserID = UserID; if (allData) { e.Description = Description; } e.DistinctString = GetDistinctString(true); e.IsPersisted = true; e.IsEntityChanged = false; e.IsInitializing = false; return(e); }
/// <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(EventCalendar from, EventCalendar to) { if (to.IsPersisted) { if (from.IsEventDurationModified && !to.IsEventDurationModified) { to.EventDuration = from.EventDuration; to.IsEventDurationModified = true; } if (from.IsStartDateModified && !to.IsStartDateModified) { to.StartDate = from.StartDate; to.IsStartDateModified = true; } if (from.IsTitleModified && !to.IsTitleModified) { to.Title = from.Title; to.IsTitleModified = true; } if (from.IsDescriptionModified && !to.IsDescriptionModified) { to.Description = from.Description; to.IsDescriptionModified = true; } if (from.IsEventStatusModified && !to.IsEventStatusModified) { to.EventStatus = from.EventStatus; to.IsEventStatusModified = true; } if (from.IsSubTitleModified && !to.IsSubTitleModified) { to.SubTitle = from.SubTitle; to.IsSubTitleModified = true; } } else { to.IsPersisted = from.IsPersisted; to.ID = from.ID; to.CreateDate = from.CreateDate; to.EventDuration = from.EventDuration; to.IsEventDurationModified = from.IsEventDurationModified; to.StartDate = from.StartDate; to.IsStartDateModified = from.IsStartDateModified; to.Title = from.Title; to.IsTitleModified = from.IsTitleModified; to.Description = from.Description; to.IsDescriptionModified = from.IsDescriptionModified; to.EventStatus = from.EventStatus; to.IsEventStatusModified = from.IsEventStatusModified; to.SubTitle = from.SubTitle; to.IsSubTitleModified = from.IsSubTitleModified; to.ApplicationID = from.ApplicationID; to.CreatedUserID = from.CreatedUserID; to.EventTypeID = from.EventTypeID; to.GroupID = from.GroupID; to.UserID = from.UserID; } }
/// <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(EventCalendar other) { if (other == null) { return(false); } else { return(ID == other.ID && EventTypeID == other.EventTypeID); } }
/// <summary> /// <see cref="NotificationTaskSchedule.EventCalendarRef" /> is not initialized when the entity is created. Clients could call this method to load it provided a proper delegate <see cref="NotificationTaskSchedule.DelLoadEventCalendarRef" /> was setup /// before calling it. /// </summary> public void LoadEventCalendarRef() { if (_EventCalendarRef != null) { return; } if (DelLoadEventCalendarRef != null) { _EventCalendarRef = DelLoadEventCalendarRef(); } }
/// <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(EventCalendar other) { if (other == null) { return(false); } if (ID != other.ID) { 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(EventCalendar newdata) { int cnt = 0; if (EventDuration != newdata.EventDuration) { EventDuration = newdata.EventDuration; IsEventDurationModified = true; cnt++; } if (StartDate != newdata.StartDate) { StartDate = newdata.StartDate; IsStartDateModified = true; cnt++; } if (Title != newdata.Title) { Title = newdata.Title; IsTitleModified = true; cnt++; } if (Description != newdata.Description) { Description = newdata.Description; IsDescriptionModified = true; cnt++; } if (EventStatus != newdata.EventStatus) { EventStatus = newdata.EventStatus; IsEventStatusModified = true; cnt++; } if (SubTitle != newdata.SubTitle) { SubTitle = newdata.SubTitle; IsSubTitleModified = true; cnt++; } IsEntityChanged = cnt > 0; }
/// <summary> /// <see cref="EventCalendarShareCircle.EventCalendarRef" /> is not initialized when the entity is created. Clients could call this method to load it provided a proper delegate <see cref="EventCalendarShareCircle.DelLoadEventCalendarRef" /> was setup /// before calling it. /// </summary> public void LoadEventCalendarRef() { if (_EventCalendarRef != null) return; if (DelLoadEventCalendarRef != null) _EventCalendarRef = DelLoadEventCalendarRef(); }
/// <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(EventCalendar from, EventCalendar to) { if (to.IsPersisted) { if (from.IsEventDurationModified && !to.IsEventDurationModified) { to.EventDuration = from.EventDuration; to.IsEventDurationModified = true; } if (from.IsStartDateModified && !to.IsStartDateModified) { to.StartDate = from.StartDate; to.IsStartDateModified = true; } if (from.IsTitleModified && !to.IsTitleModified) { to.Title = from.Title; to.IsTitleModified = true; } if (from.IsDescriptionModified && !to.IsDescriptionModified) { to.Description = from.Description; to.IsDescriptionModified = true; } if (from.IsEventStatusModified && !to.IsEventStatusModified) { to.EventStatus = from.EventStatus; to.IsEventStatusModified = true; } if (from.IsSubTitleModified && !to.IsSubTitleModified) { to.SubTitle = from.SubTitle; to.IsSubTitleModified = true; } } else { to.IsPersisted = from.IsPersisted; to.ID = from.ID; to.CreateDate = from.CreateDate; to.EventDuration = from.EventDuration; to.IsEventDurationModified = from.IsEventDurationModified; to.StartDate = from.StartDate; to.IsStartDateModified = from.IsStartDateModified; to.Title = from.Title; to.IsTitleModified = from.IsTitleModified; to.Description = from.Description; to.IsDescriptionModified = from.IsDescriptionModified; to.EventStatus = from.EventStatus; to.IsEventStatusModified = from.IsEventStatusModified; to.SubTitle = from.SubTitle; to.IsSubTitleModified = from.IsSubTitleModified; to.ApplicationID = from.ApplicationID; to.CreatedUserID = from.CreatedUserID; to.EventTypeID = from.EventTypeID; to.GroupID = from.GroupID; to.UserID = from.UserID; } }
/// <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(EventCalendar other) { if (other == null) return false; else return ID == other.ID && EventTypeID == other.EventTypeID; }
/// <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(EventCalendar other) { if (other == null) return false; if (ID != other.ID) return false; return true; }
/// <summary> /// Internal use /// </summary> public EventCalendar ShallowCopy(bool allData = false) { EventCalendar e = new EventCalendar(); e.IsInitializing = true; e.ID = ID; e.CreateDate = CreateDate; e.EventDuration = EventDuration; e.StartDate = StartDate; e.Title = Title; e.EventStatus = EventStatus; e.SubTitle = SubTitle; e.ApplicationID = ApplicationID; e.CreatedUserID = CreatedUserID; e.EventTypeID = EventTypeID; e.GroupID = GroupID; e.UserID = UserID; if (allData) { e.Description = Description; } 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(EventCalendar newdata) { int cnt = 0; if (EventDuration != newdata.EventDuration) { EventDuration = newdata.EventDuration; IsEventDurationModified = true; cnt++; } if (StartDate != newdata.StartDate) { StartDate = newdata.StartDate; IsStartDateModified = true; cnt++; } if (Title != newdata.Title) { Title = newdata.Title; IsTitleModified = true; cnt++; } if (Description != newdata.Description) { Description = newdata.Description; IsDescriptionModified = true; cnt++; } if (EventStatus != newdata.EventStatus) { EventStatus = newdata.EventStatus; IsEventStatusModified = true; cnt++; } if (SubTitle != newdata.SubTitle) { SubTitle = newdata.SubTitle; IsSubTitleModified = true; cnt++; } IsEntityChanged = cnt > 0; }
/// <summary> /// Internal use /// </summary> public EventCalendar ShallowCopy(bool allData = false, bool preserveState = false) { EventCalendar e = new EventCalendar(); e.StartAutoUpdating = false; e.ID = ID; e.CreateDate = CreateDate; e.EventDuration = EventDuration; if (preserveState) e.IsEventDurationModified = IsEventDurationModified; else e.IsEventDurationModified = false; e.StartDate = StartDate; if (preserveState) e.IsStartDateModified = IsStartDateModified; else e.IsStartDateModified = false; e.Title = Title; if (preserveState) e.IsTitleModified = IsTitleModified; else e.IsTitleModified = false; e.EventStatus = EventStatus; if (preserveState) e.IsEventStatusModified = IsEventStatusModified; else e.IsEventStatusModified = false; e.SubTitle = SubTitle; if (preserveState) e.IsSubTitleModified = IsSubTitleModified; else e.IsSubTitleModified = false; e.ApplicationID = ApplicationID; e.CreatedUserID = CreatedUserID; e.EventTypeID = EventTypeID; e.GroupID = GroupID; e.UserID = UserID; if (allData) { e.Description = Description; if (preserveState) e.IsDescriptionModified = IsDescriptionModified; else e.IsDescriptionModified = false; } e.DistinctString = GetDistinctString(true); e.IsPersisted = IsPersisted; if (preserveState) e.IsEntityChanged = IsEntityChanged; else e.IsEntityChanged = false; e.StartAutoUpdating = true; return e; }