예제 #1
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(UserAssocInvitation from, UserAssocInvitation to)
 {
     if (to.IsPersisted)
     {
         if (from.IsCurrentStatusModified && !to.IsCurrentStatusModified)
         {
             to.CurrentStatus           = from.CurrentStatus;
             to.IsCurrentStatusModified = true;
         }
         if (from.IsInvitationMessageModified && !to.IsInvitationMessageModified)
         {
             to.InvitationMessage           = from.InvitationMessage;
             to.IsInvitationMessageModified = true;
         }
         if (from.IsLastStatusChangeModified && !to.IsLastStatusChangeModified)
         {
             to.LastStatusChange           = from.LastStatusChange;
             to.IsLastStatusChangeModified = true;
         }
     }
     else
     {
         to.IsPersisted                 = from.IsPersisted;
         to.FromUserID                  = from.FromUserID;
         to.ToUserID                    = from.ToUserID;
         to.CreateDate                  = from.CreateDate;
         to.CurrentStatus               = from.CurrentStatus;
         to.IsCurrentStatusModified     = from.IsCurrentStatusModified;
         to.InvitationMessage           = from.InvitationMessage;
         to.IsInvitationMessageModified = from.IsInvitationMessageModified;
         to.LastStatusChange            = from.LastStatusChange;
         to.IsLastStatusChangeModified  = from.IsLastStatusChangeModified;
     }
 }
예제 #2
0
        /// <summary>
        /// Internal use
        /// </summary>
        public UserAssocInvitation ShallowCopy(bool allData = false, bool preserveState = false, bool checkLoadState = false)
        {
            UserAssocInvitation e = new UserAssocInvitation();

            e.StartAutoUpdating = false;
            e.FromUserID        = FromUserID;
            e.ToUserID          = ToUserID;
            e.CreateDate        = CreateDate;
            e.CurrentStatus     = CurrentStatus;
            if (preserveState)
            {
                e.IsCurrentStatusModified = IsCurrentStatusModified;
            }
            else
            {
                e.IsCurrentStatusModified = false;
            }
            e.LastStatusChange = LastStatusChange;
            if (preserveState)
            {
                e.IsLastStatusChangeModified = IsLastStatusChangeModified;
            }
            else
            {
                e.IsLastStatusChangeModified = false;
            }
            if (allData)
            {
                if (!checkLoadState || IsInvitationMessageLoaded)
                {
                    e.InvitationMessage = InvitationMessage;
                }
                if (preserveState)
                {
                    e.IsInvitationMessageModified = IsInvitationMessageModified;
                }
                else
                {
                    e.IsInvitationMessageModified = false;
                }
                e.IsInvitationMessageLoaded = IsInvitationMessageLoaded;
            }
            e.DistinctString = GetDistinctString(true);
            e.IsPersisted    = IsPersisted;
            if (preserveState)
            {
                e.IsEntityChanged = IsEntityChanged;
            }
            else
            {
                e.IsEntityChanged = false;
            }
            e.StartAutoUpdating = true;
            return(e);
        }
예제 #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) intrinsic identifiers.
 /// </summary>
 /// <param name="other">The entity to be compared to.</param>
 /// <returns>
 ///   The result of comparison.
 /// </returns>
 public bool IsEntityTheSame(UserAssocInvitation other)
 {
     if (other == null)
     {
         return(false);
     }
     else
     {
         return(FromUserID == other.FromUserID && ToUserID == other.ToUserID);
     }
 }
예제 #4
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(UserAssocInvitation other)
 {
     if (other == null)
     {
         return(false);
     }
     if (FromUserID != other.FromUserID)
     {
         return(false);
     }
     if (ToUserID != other.ToUserID)
     {
         return(false);
     }
     return(true);
 }
예제 #5
0
        /// <summary>
        /// Internal use
        /// </summary>
        public UserAssocInvitation ShallowCopy(bool allData = false)
        {
            UserAssocInvitation e = new UserAssocInvitation();

            e.IsInitializing   = true;
            e.FromUserID       = FromUserID;
            e.ToUserID         = ToUserID;
            e.CreateDate       = CreateDate;
            e.CurrentStatus    = CurrentStatus;
            e.LastStatusChange = LastStatusChange;
            if (allData)
            {
                e.InvitationMessage = InvitationMessage;
            }
            e.DistinctString  = GetDistinctString(true);
            e.IsPersisted     = true;
            e.IsEntityChanged = false;
            e.IsInitializing  = false;
            return(e);
        }
예제 #6
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(UserAssocInvitation newdata)
        {
            int cnt = 0;

            if (CurrentStatus != newdata.CurrentStatus)
            {
                CurrentStatus           = newdata.CurrentStatus;
                IsCurrentStatusModified = true;
                cnt++;
            }
            if (InvitationMessage != newdata.InvitationMessage)
            {
                InvitationMessage           = newdata.InvitationMessage;
                IsInvitationMessageModified = true;
                cnt++;
            }
            if (LastStatusChange != newdata.LastStatusChange)
            {
                LastStatusChange           = newdata.LastStatusChange;
                IsLastStatusChangeModified = true;
                cnt++;
            }
            IsEntityChanged = cnt > 0;
        }
 /// <summary>
 /// Internal use
 /// </summary>
 public UserAssocInvitation ShallowCopy(bool allData = false, bool preserveState = false, bool checkLoadState = false)
 {
     UserAssocInvitation e = new UserAssocInvitation();
     e.StartAutoUpdating = false;
     e.FromUserID = FromUserID;
     e.ToUserID = ToUserID;
     e.CreateDate = CreateDate;
     e.CurrentStatus = CurrentStatus;
     if (preserveState)
         e.IsCurrentStatusModified = IsCurrentStatusModified;
     else
         e.IsCurrentStatusModified = false;
     e.LastStatusChange = LastStatusChange;
     if (preserveState)
         e.IsLastStatusChangeModified = IsLastStatusChangeModified;
     else
         e.IsLastStatusChangeModified = false;
     if (allData)
     {
         if (!checkLoadState || IsInvitationMessageLoaded)
             e.InvitationMessage = InvitationMessage;
         if (preserveState)
             e.IsInvitationMessageModified = IsInvitationMessageModified;
         else
             e.IsInvitationMessageModified = false;
         e.IsInvitationMessageLoaded = IsInvitationMessageLoaded;
     }
     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(UserAssocInvitation newdata)
 {
     int cnt = 0;
     if (CurrentStatus != newdata.CurrentStatus)
     {
         CurrentStatus = newdata.CurrentStatus;
         IsCurrentStatusModified = true;
         cnt++;
     }
     if (InvitationMessage != newdata.InvitationMessage)
     {
         InvitationMessage = newdata.InvitationMessage;
         IsInvitationMessageModified = true;
         cnt++;
     }
     if (LastStatusChange != newdata.LastStatusChange)
     {
         LastStatusChange = newdata.LastStatusChange;
         IsLastStatusChangeModified = 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(UserAssocInvitation from, UserAssocInvitation to)
 {
     if (to.IsPersisted)
     {
         if (from.IsCurrentStatusModified && !to.IsCurrentStatusModified)
         {
             to.CurrentStatus = from.CurrentStatus;
             to.IsCurrentStatusModified = true;
         }
         if (from.IsInvitationMessageModified && !to.IsInvitationMessageModified)
         {
             to.InvitationMessage = from.InvitationMessage;
             to.IsInvitationMessageModified = true;
         }
         if (from.IsLastStatusChangeModified && !to.IsLastStatusChangeModified)
         {
             to.LastStatusChange = from.LastStatusChange;
             to.IsLastStatusChangeModified = true;
         }
     }
     else
     {
         to.IsPersisted = from.IsPersisted;
         to.FromUserID = from.FromUserID;
         to.ToUserID = from.ToUserID;
         to.CreateDate = from.CreateDate;
         to.CurrentStatus = from.CurrentStatus;
         to.IsCurrentStatusModified = from.IsCurrentStatusModified;
         to.InvitationMessage = from.InvitationMessage;
         to.IsInvitationMessageModified = from.IsInvitationMessageModified;
         to.LastStatusChange = from.LastStatusChange;
         to.IsLastStatusChangeModified = from.IsLastStatusChangeModified;
     }
 }
 /// <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(UserAssocInvitation other)
 {
     if (other == null)
         return false;
     else
         return FromUserID == other.FromUserID &&  ToUserID == other.ToUserID;
 }              
 /// <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(UserAssocInvitation other)
 {
     if (other == null)
         return false;
     if (FromUserID != other.FromUserID)
         return false;
     if (ToUserID != other.ToUserID)
         return false;
     return true;
 }              
 /// <summary>
 /// Internal use
 /// </summary>
 public UserAssocInvitation ShallowCopy(bool allData = false)
 {
     UserAssocInvitation e = new UserAssocInvitation();
     e.IsInitializing = true;
     e.FromUserID = FromUserID;
     e.ToUserID = ToUserID;
     e.CreateDate = CreateDate;
     e.CurrentStatus = CurrentStatus;
     e.LastStatusChange = LastStatusChange;
     if (allData)
     {
         e.InvitationMessage = InvitationMessage;
     }
     e.DistinctString = GetDistinctString(true);
     e.IsPersisted = true;
     e.IsEntityChanged = false;
     e.IsInitializing = false;
     return e;
 }