Пример #1
0
 /// <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(UserAppMember other)
 {
     if (other == null)
     {
         return(false);
     }
     else
     {
         return(ApplicationID == other.ApplicationID && UserID == other.UserID);
     }
 }
Пример #2
0
 /// <summary>
 /// <see cref="MemberCallback.UserAppMemberRef" /> is not initialized when the entity is created. Clients could call this method to load it provided a proper delegate <see cref="MemberCallback.DelLoadUserAppMemberRef" /> was setup
 /// before calling it.
 /// </summary>
 public void LoadUserAppMemberRef()
 {
     if (_UserAppMemberRef != null)
     {
         return;
     }
     if (DelLoadUserAppMemberRef != null)
     {
         _UserAppMemberRef = DelLoadUserAppMemberRef();
     }
 }
Пример #3
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(UserAppMember other)
 {
     if (other == null)
     {
         return(false);
     }
     if (ApplicationID != other.ApplicationID)
     {
         return(false);
     }
     if (UserID != other.UserID)
     {
         return(false);
     }
     return(true);
 }
Пример #4
0
        /// <summary>
        /// Internal use
        /// </summary>
        public UserAppMember ShallowCopy(bool allData = false)
        {
            UserAppMember e = new UserAppMember();

            e.IsInitializing   = true;
            e.ApplicationID    = ApplicationID;
            e.UserID           = UserID;
            e.Email            = Email;
            e.IconLastModified = IconLastModified;
            e.IconMime         = IconMime;
            e.LastActivityDate = LastActivityDate;
            e.LastStatusChange = LastStatusChange;
            e.MemberStatus     = MemberStatus;
            if (allData)
            {
                e.Comment = Comment;
                e.IconImg = IconImg;
            }
            e.DistinctString  = GetDistinctString(true);
            e.IsPersisted     = true;
            e.IsEntityChanged = false;
            e.IsInitializing  = false;
            return(e);
        }
 /// <summary>
 /// <see cref="MemberCallback.UserAppMemberRef" /> is not initialized when the entity is created. Clients could call this method to load it provided a proper delegate <see cref="MemberCallback.DelLoadUserAppMemberRef" /> was setup
 /// before calling it.
 /// </summary>
 public void LoadUserAppMemberRef()
 {
     if (_UserAppMemberRef != null)
         return;
     if (DelLoadUserAppMemberRef != null)
         _UserAppMemberRef = DelLoadUserAppMemberRef();
 }
 /// <summary>
 /// Internal use
 /// </summary>
 public UserAppMember ShallowCopy(bool allData = false, bool preserveState = false)
 {
     UserAppMember e = new UserAppMember();
     e.StartAutoUpdating = false;
     e.ApplicationID = ApplicationID;
     e.UserID = UserID;
     e.Email = Email;
     if (preserveState)
         e.IsEmailModified = IsEmailModified;
     else
         e.IsEmailModified = false;
     e.AcceptChatInvitation = AcceptChatInvitation;
     if (preserveState)
         e.IsAcceptChatInvitationModified = IsAcceptChatInvitationModified;
     else
         e.IsAcceptChatInvitationModified = false;
     e.AcceptLanguages = AcceptLanguages;
     if (preserveState)
         e.IsAcceptLanguagesModified = IsAcceptLanguagesModified;
     else
         e.IsAcceptLanguagesModified = false;
     e.IconLastModified = IconLastModified;
     if (preserveState)
         e.IsIconLastModifiedModified = IsIconLastModifiedModified;
     else
         e.IsIconLastModifiedModified = false;
     e.IconMime = IconMime;
     if (preserveState)
         e.IsIconMimeModified = IsIconMimeModified;
     else
         e.IsIconMimeModified = false;
     e.LastActivityDate = LastActivityDate;
     if (preserveState)
         e.IsLastActivityDateModified = IsLastActivityDateModified;
     else
         e.IsLastActivityDateModified = false;
     e.LastStatusChange = LastStatusChange;
     if (preserveState)
         e.IsLastStatusChangeModified = IsLastStatusChangeModified;
     else
         e.IsLastStatusChangeModified = false;
     e.MemberStatus = MemberStatus;
     if (preserveState)
         e.IsMemberStatusModified = IsMemberStatusModified;
     else
         e.IsMemberStatusModified = false;
     e.SearchListing = SearchListing;
     if (preserveState)
         e.IsSearchListingModified = IsSearchListingModified;
     else
         e.IsSearchListingModified = false;
     if (allData)
     {
         e.Comment = Comment;
         if (preserveState)
             e.IsCommentModified = IsCommentModified;
         else
             e.IsCommentModified = false;
         e.IconImg = IconImg;
         if (preserveState)
             e.IsIconImgModified = IsIconImgModified;
         else
             e.IsIconImgModified = false;
     }
     e.DistinctString = GetDistinctString(true);
     e.IsPersisted = IsPersisted;
     if (preserveState)
         e.IsEntityChanged = IsEntityChanged;
     else
         e.IsEntityChanged = false;
     e.StartAutoUpdating = true;
     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(UserAppMember newdata)
 {
     int cnt = 0;
     if (Email != newdata.Email)
     {
         Email = newdata.Email;
         IsEmailModified = true;
         cnt++;
     }
     if (AcceptChatInvitation != newdata.AcceptChatInvitation)
     {
         AcceptChatInvitation = newdata.AcceptChatInvitation;
         IsAcceptChatInvitationModified = true;
         cnt++;
     }
     if (AcceptLanguages != newdata.AcceptLanguages)
     {
         AcceptLanguages = newdata.AcceptLanguages;
         IsAcceptLanguagesModified = true;
         cnt++;
     }
     if (Comment != newdata.Comment)
     {
         Comment = newdata.Comment;
         IsCommentModified = true;
         cnt++;
     }
     bool bIconImg = IconImg == null && newdata.IconImg != null ||
                                                  IconImg != null && newdata.IconImg == null ||
                                                  IconImg != null && newdata.IconImg != null && IconImg.Length != newdata.IconImg.Length;
     if (!bIconImg && IconImg != null)
     {
         for (int i = 0; i < IconImg.Length; i++)
         {
             bIconImg = IconImg[i] != newdata.IconImg[i];
             if (bIconImg)
                 break;
         }
     }
     if (bIconImg)
     {
         IconImg = newdata.IconImg;
         IsIconImgModified = true;
         cnt++;
     }
     if (IconLastModified != newdata.IconLastModified)
     {
         IconLastModified = newdata.IconLastModified;
         IsIconLastModifiedModified = true;
         cnt++;
     }
     if (IconMime != newdata.IconMime)
     {
         IconMime = newdata.IconMime;
         IsIconMimeModified = true;
         cnt++;
     }
     if (LastActivityDate != newdata.LastActivityDate)
     {
         LastActivityDate = newdata.LastActivityDate;
         IsLastActivityDateModified = true;
         cnt++;
     }
     if (LastStatusChange != newdata.LastStatusChange)
     {
         LastStatusChange = newdata.LastStatusChange;
         IsLastStatusChangeModified = true;
         cnt++;
     }
     if (MemberStatus != newdata.MemberStatus)
     {
         MemberStatus = newdata.MemberStatus;
         IsMemberStatusModified = true;
         cnt++;
     }
     if (SearchListing != newdata.SearchListing)
     {
         SearchListing = newdata.SearchListing;
         IsSearchListingModified = 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(UserAppMember from, UserAppMember to)
 {
     if (to.IsPersisted)
     {
         if (from.IsEmailModified && !to.IsEmailModified)
         {
             to.Email = from.Email;
             to.IsEmailModified = true;
         }
         if (from.IsAcceptChatInvitationModified && !to.IsAcceptChatInvitationModified)
         {
             to.AcceptChatInvitation = from.AcceptChatInvitation;
             to.IsAcceptChatInvitationModified = true;
         }
         if (from.IsAcceptLanguagesModified && !to.IsAcceptLanguagesModified)
         {
             to.AcceptLanguages = from.AcceptLanguages;
             to.IsAcceptLanguagesModified = true;
         }
         if (from.IsCommentModified && !to.IsCommentModified)
         {
             to.Comment = from.Comment;
             to.IsCommentModified = true;
         }
         if (from.IsIconImgModified && !to.IsIconImgModified)
         {
             to.IconImg = from.IconImg;
             to.IsIconImgModified = true;
         }
         if (from.IsIconLastModifiedModified && !to.IsIconLastModifiedModified)
         {
             to.IconLastModified = from.IconLastModified;
             to.IsIconLastModifiedModified = true;
         }
         if (from.IsIconMimeModified && !to.IsIconMimeModified)
         {
             to.IconMime = from.IconMime;
             to.IsIconMimeModified = true;
         }
         if (from.IsLastActivityDateModified && !to.IsLastActivityDateModified)
         {
             to.LastActivityDate = from.LastActivityDate;
             to.IsLastActivityDateModified = true;
         }
         if (from.IsLastStatusChangeModified && !to.IsLastStatusChangeModified)
         {
             to.LastStatusChange = from.LastStatusChange;
             to.IsLastStatusChangeModified = true;
         }
         if (from.IsMemberStatusModified && !to.IsMemberStatusModified)
         {
             to.MemberStatus = from.MemberStatus;
             to.IsMemberStatusModified = true;
         }
         if (from.IsSearchListingModified && !to.IsSearchListingModified)
         {
             to.SearchListing = from.SearchListing;
             to.IsSearchListingModified = true;
         }
     }
     else
     {
         to.IsPersisted = from.IsPersisted;
         to.ApplicationID = from.ApplicationID;
         to.UserID = from.UserID;
         to.Email = from.Email;
         to.IsEmailModified = from.IsEmailModified;
         to.AcceptChatInvitation = from.AcceptChatInvitation;
         to.IsAcceptChatInvitationModified = from.IsAcceptChatInvitationModified;
         to.AcceptLanguages = from.AcceptLanguages;
         to.IsAcceptLanguagesModified = from.IsAcceptLanguagesModified;
         to.Comment = from.Comment;
         to.IsCommentModified = from.IsCommentModified;
         to.IconImg = from.IconImg;
         to.IsIconImgModified = from.IsIconImgModified;
         to.IconLastModified = from.IconLastModified;
         to.IsIconLastModifiedModified = from.IsIconLastModifiedModified;
         to.IconMime = from.IconMime;
         to.IsIconMimeModified = from.IsIconMimeModified;
         to.LastActivityDate = from.LastActivityDate;
         to.IsLastActivityDateModified = from.IsLastActivityDateModified;
         to.LastStatusChange = from.LastStatusChange;
         to.IsLastStatusChangeModified = from.IsLastStatusChangeModified;
         to.MemberStatus = from.MemberStatus;
         to.IsMemberStatusModified = from.IsMemberStatusModified;
         to.SearchListing = from.SearchListing;
         to.IsSearchListingModified = from.IsSearchListingModified;
     }
 }
 /// <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(UserAppMember other)
 {
     if (other == null)
         return false;
     else
         return ApplicationID == other.ApplicationID &&  UserID == other.UserID;
 }              
Пример #10
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(UserAppMember other)
 {
     if (other == null)
         return false;
     if (ApplicationID != other.ApplicationID)
         return false;
     if (UserID != other.UserID)
         return false;
     return true;
 }              
Пример #11
0
 /// <summary>
 /// Internal use
 /// </summary>
 public UserAppMember ShallowCopy(bool allData = false)
 {
     UserAppMember e = new UserAppMember();
     e.IsInitializing = true;
     e.ApplicationID = ApplicationID;
     e.UserID = UserID;
     e.Email = Email;
     e.IconLastModified = IconLastModified;
     e.IconMime = IconMime;
     e.LastActivityDate = LastActivityDate;
     e.LastStatusChange = LastStatusChange;
     e.MemberStatus = MemberStatus;
     if (allData)
     {
         e.Comment = Comment;
         e.IconImg = IconImg;
     }
     e.DistinctString = GetDistinctString(true);
     e.IsPersisted = true;
     e.IsEntityChanged = false;
     e.IsInitializing = false;
     return e;
 }
Пример #12
0
        /// <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(UserAppMember newdata)
        {
            int cnt = 0;

            if (Email != newdata.Email)
            {
                Email           = newdata.Email;
                IsEmailModified = true;
                cnt++;
            }
            if (Comment != newdata.Comment)
            {
                Comment           = newdata.Comment;
                IsCommentModified = true;
                cnt++;
            }
            bool bIconImg = IconImg == null && newdata.IconImg != null ||
                            IconImg != null && newdata.IconImg == null ||
                            IconImg != null && newdata.IconImg != null && IconImg.Length != newdata.IconImg.Length;

            if (!bIconImg && IconImg != null)
            {
                for (int i = 0; i < IconImg.Length; i++)
                {
                    bIconImg = IconImg[i] != newdata.IconImg[i];
                    if (bIconImg)
                    {
                        break;
                    }
                }
            }
            if (bIconImg)
            {
                IconImg           = newdata.IconImg;
                IsIconImgModified = true;
                cnt++;
            }
            if (IconLastModified != newdata.IconLastModified)
            {
                IconLastModified           = newdata.IconLastModified;
                IsIconLastModifiedModified = true;
                cnt++;
            }
            if (IconMime != newdata.IconMime)
            {
                IconMime           = newdata.IconMime;
                IsIconMimeModified = true;
                cnt++;
            }
            if (LastActivityDate != newdata.LastActivityDate)
            {
                LastActivityDate           = newdata.LastActivityDate;
                IsLastActivityDateModified = true;
                cnt++;
            }
            if (LastStatusChange != newdata.LastStatusChange)
            {
                LastStatusChange           = newdata.LastStatusChange;
                IsLastStatusChangeModified = true;
                cnt++;
            }
            if (MemberStatus != newdata.MemberStatus)
            {
                MemberStatus           = newdata.MemberStatus;
                IsMemberStatusModified = true;
                cnt++;
            }
            IsEntityChanged = cnt > 0;
        }
Пример #13
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(UserAppMember from, UserAppMember to)
 {
     if (to.IsPersisted)
     {
         if (from.IsEmailModified && !to.IsEmailModified)
         {
             to.Email           = from.Email;
             to.IsEmailModified = true;
         }
         if (from.IsCommentModified && !to.IsCommentModified)
         {
             to.Comment           = from.Comment;
             to.IsCommentModified = true;
         }
         if (from.IsIconImgModified && !to.IsIconImgModified)
         {
             to.IconImg           = from.IconImg;
             to.IsIconImgModified = true;
         }
         if (from.IsIconLastModifiedModified && !to.IsIconLastModifiedModified)
         {
             to.IconLastModified           = from.IconLastModified;
             to.IsIconLastModifiedModified = true;
         }
         if (from.IsIconMimeModified && !to.IsIconMimeModified)
         {
             to.IconMime           = from.IconMime;
             to.IsIconMimeModified = true;
         }
         if (from.IsLastActivityDateModified && !to.IsLastActivityDateModified)
         {
             to.LastActivityDate           = from.LastActivityDate;
             to.IsLastActivityDateModified = true;
         }
         if (from.IsLastStatusChangeModified && !to.IsLastStatusChangeModified)
         {
             to.LastStatusChange           = from.LastStatusChange;
             to.IsLastStatusChangeModified = true;
         }
         if (from.IsMemberStatusModified && !to.IsMemberStatusModified)
         {
             to.MemberStatus           = from.MemberStatus;
             to.IsMemberStatusModified = true;
         }
     }
     else
     {
         to.IsPersisted                = from.IsPersisted;
         to.ApplicationID              = from.ApplicationID;
         to.UserID                     = from.UserID;
         to.Email                      = from.Email;
         to.IsEmailModified            = from.IsEmailModified;
         to.Comment                    = from.Comment;
         to.IsCommentModified          = from.IsCommentModified;
         to.IconImg                    = from.IconImg;
         to.IsIconImgModified          = from.IsIconImgModified;
         to.IconLastModified           = from.IconLastModified;
         to.IsIconLastModifiedModified = from.IsIconLastModifiedModified;
         to.IconMime                   = from.IconMime;
         to.IsIconMimeModified         = from.IsIconMimeModified;
         to.LastActivityDate           = from.LastActivityDate;
         to.IsLastActivityDateModified = from.IsLastActivityDateModified;
         to.LastStatusChange           = from.LastStatusChange;
         to.IsLastStatusChangeModified = from.IsLastStatusChangeModified;
         to.MemberStatus               = from.MemberStatus;
         to.IsMemberStatusModified     = from.IsMemberStatusModified;
     }
 }