/// <summary> /// Internal use /// </summary> public MemberNotificationType ShallowCopy(bool allData = false, bool preserveState = false, bool checkLoadState = false) { MemberNotificationType e = new MemberNotificationType(); e.StartAutoUpdating = false; e.ID = ID; e.TypeName = TypeName; if (preserveState) { e.IsTypeNameModified = IsTypeNameModified; } else { e.IsTypeNameModified = false; } e.DistinctString = GetDistinctString(true); e.IsPersisted = IsPersisted; if (preserveState) { e.IsEntityChanged = IsEntityChanged; } else { e.IsEntityChanged = false; } e.StartAutoUpdating = true; 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) intrinsic identifiers. /// </summary> /// <param name="other">The entity to be compared to.</param> /// <returns> /// The result of comparison. /// </returns> public bool IsEntityTheSame(MemberNotificationType other) { if (other == null) { return(false); } else { return(ID == other.ID); } }
/// <summary> /// <see cref="MemberNotification.MemberNotificationTypeRef" /> is not initialized when the entity is created. Clients could call this method to load it provided a proper delegate <see cref="MemberNotification.DelLoadMemberNotificationTypeRef" /> was setup /// before calling it. /// </summary> public void LoadMemberNotificationTypeRef() { if (_MemberNotificationTypeRef != null) { return; } if (DelLoadMemberNotificationTypeRef != null) { _MemberNotificationTypeRef = DelLoadMemberNotificationTypeRef(); } }
/// <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(MemberNotificationType newdata) { int cnt = 0; if (TypeName != newdata.TypeName) { TypeName = newdata.TypeName; IsTypeNameModified = true; cnt++; } IsEntityChanged = cnt > 0; }
/// <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(MemberNotificationType other) { if (other == null) { return(false); } if (ID != other.ID) { return(false); } return(true); }
public static string MapCategoryName(MemberNotificationType type, string acceptLangs = null) { switch (type.ID) { case 1: return ResourceUtils.GetString("d8987bcb34881d89920c06a08a5b26f2", "Admin Status Changed", acceptLangs); case 2: return ResourceUtils.GetString("a644e8cd597f2b92aa52861632c0363e", "New Messages", acceptLangs); case 3: return ResourceUtils.GetString("1ff98aa30fa8b84e5e2bfba04ee67438", "Chat Invitation", acceptLangs); } return type.TypeName; }
/// <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(MemberNotificationType from, MemberNotificationType to) { if (to.IsPersisted) { if (from.IsTypeNameModified && !to.IsTypeNameModified) { to.TypeName = from.TypeName; to.IsTypeNameModified = true; } } else { to.IsPersisted = from.IsPersisted; to.ID = from.ID; to.TypeName = from.TypeName; to.IsTypeNameModified = from.IsTypeNameModified; } }
/// <summary> /// Internal use /// </summary> public MemberNotificationType ShallowCopy(bool allData = false, bool preserveState = false) { MemberNotificationType e = new MemberNotificationType(); e.StartAutoUpdating = false; e.ID = ID; e.TypeName = TypeName; if (preserveState) e.IsTypeNameModified = IsTypeNameModified; else e.IsTypeNameModified = false; e.DistinctString = GetDistinctString(true); e.IsPersisted = IsPersisted; if (preserveState) e.IsEntityChanged = IsEntityChanged; else e.IsEntityChanged = false; e.StartAutoUpdating = true; 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) intrinsic identifiers. /// </summary> /// <param name="other">The entity to be compared to.</param> /// <returns> /// The result of comparison. /// </returns> public bool IsEntityTheSame(MemberNotificationType other) { if (other == null) return false; else return ID == other.ID; }
/// <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(MemberNotificationType other) { if (other == null) return false; if (ID != other.ID) return false; return true; }
/// <summary> /// <see cref="MemberNotification.MemberNotificationTypeRef" /> is not initialized when the entity is created. Clients could call this method to load it provided a proper delegate <see cref="MemberNotification.DelLoadMemberNotificationTypeRef" /> was setup /// before calling it. /// </summary> public void LoadMemberNotificationTypeRef() { if (_MemberNotificationTypeRef != null) return; if (DelLoadMemberNotificationTypeRef != null) _MemberNotificationTypeRef = DelLoadMemberNotificationTypeRef(); }