コード例 #1
0
        /// <summary>
        /// Internal use
        /// </summary>
        public UserGroupAdminRole ShallowCopy(bool allData = false, bool preserveState = false, bool checkLoadState = false)
        {
            UserGroupAdminRole e = new UserGroupAdminRole();

            e.StartAutoUpdating = false;
            e.GroupID           = GroupID;
            e.RoleID            = RoleID;
            e.CreateDate        = CreateDate;
            e.Permission        = Permission;
            if (preserveState)
            {
                e.IsPermissionModified = IsPermissionModified;
            }
            else
            {
                e.IsPermissionModified = false;
            }
            e.DistinctString = GetDistinctString(true);
            e.IsPersisted    = IsPersisted;
            if (preserveState)
            {
                e.IsEntityChanged = IsEntityChanged;
            }
            else
            {
                e.IsEntityChanged = false;
            }
            e.StartAutoUpdating = true;
            return(e);
        }
コード例 #2
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(UserGroupAdminRole other)
 {
     if (other == null)
     {
         return(false);
     }
     else
     {
         return(GroupID == other.GroupID && RoleID == other.RoleID);
     }
 }
コード例 #3
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(UserGroupAdminRole newdata)
        {
            int cnt = 0;

            if (Permission != newdata.Permission)
            {
                Permission           = newdata.Permission;
                IsPermissionModified = true;
                cnt++;
            }
            IsEntityChanged = cnt > 0;
        }
コード例 #4
0
        /// <summary>
        /// Internal use
        /// </summary>
        public UserGroupAdminRole ShallowCopy(bool allData = false)
        {
            UserGroupAdminRole e = new UserGroupAdminRole();

            e.IsInitializing  = true;
            e.GroupID         = GroupID;
            e.RoleID          = RoleID;
            e.CreateDate      = CreateDate;
            e.Permission      = Permission;
            e.DistinctString  = GetDistinctString(true);
            e.IsPersisted     = true;
            e.IsEntityChanged = false;
            e.IsInitializing  = false;
            return(e);
        }
コード例 #5
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(UserGroupAdminRole other)
 {
     if (other == null)
     {
         return(false);
     }
     if (GroupID != other.GroupID)
     {
         return(false);
     }
     if (RoleID != other.RoleID)
     {
         return(false);
     }
     return(true);
 }
コード例 #6
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(UserGroupAdminRole from, UserGroupAdminRole to)
 {
     if (to.IsPersisted)
     {
         if (from.IsPermissionModified && !to.IsPermissionModified)
         {
             to.Permission           = from.Permission;
             to.IsPermissionModified = true;
         }
     }
     else
     {
         to.IsPersisted          = from.IsPersisted;
         to.GroupID              = from.GroupID;
         to.RoleID               = from.RoleID;
         to.CreateDate           = from.CreateDate;
         to.Permission           = from.Permission;
         to.IsPermissionModified = from.IsPermissionModified;
     }
 }
コード例 #7
0
 /// <summary>
 /// Internal use
 /// </summary>
 public UserGroupAdminRole ShallowCopy(bool allData = false, bool preserveState = false)
 {
     UserGroupAdminRole e = new UserGroupAdminRole();
     e.StartAutoUpdating = false;
     e.GroupID = GroupID;
     e.RoleID = RoleID;
     e.CreateDate = CreateDate;
     e.Permission = Permission;
     if (preserveState)
         e.IsPermissionModified = IsPermissionModified;
     else
         e.IsPermissionModified = false;
     e.DistinctString = GetDistinctString(true);
     e.IsPersisted = IsPersisted;
     if (preserveState)
         e.IsEntityChanged = IsEntityChanged;
     else
         e.IsEntityChanged = false;
     e.StartAutoUpdating = true;
     return e;
 }
コード例 #8
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(UserGroupAdminRole newdata)
 {
     int cnt = 0;
     if (Permission != newdata.Permission)
     {
         Permission = newdata.Permission;
         IsPermissionModified = true;
         cnt++;
     }
     IsEntityChanged = cnt > 0;
 }
コード例 #9
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(UserGroupAdminRole from, UserGroupAdminRole to)
 {
     if (to.IsPersisted)
     {
         if (from.IsPermissionModified && !to.IsPermissionModified)
         {
             to.Permission = from.Permission;
             to.IsPermissionModified = true;
         }
     }
     else
     {
         to.IsPersisted = from.IsPersisted;
         to.GroupID = from.GroupID;
         to.RoleID = from.RoleID;
         to.CreateDate = from.CreateDate;
         to.Permission = from.Permission;
         to.IsPermissionModified = from.IsPermissionModified;
     }
 }
コード例 #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) intrinsic identifiers.
 /// </summary>
 /// <param name="other">The entity to be compared to.</param>
 /// <returns>
 ///   The result of comparison.
 /// </returns>
 public bool IsEntityTheSame(UserGroupAdminRole other)
 {
     if (other == null)
         return false;
     else
         return GroupID == other.GroupID &&  RoleID == other.RoleID;
 }              
コード例 #11
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(UserGroupAdminRole other)
 {
     if (other == null)
         return false;
     if (GroupID != other.GroupID)
         return false;
     if (RoleID != other.RoleID)
         return false;
     return true;
 }              
コード例 #12
0
 /// <summary>
 /// Internal use
 /// </summary>
 public UserGroupAdminRole ShallowCopy(bool allData = false)
 {
     UserGroupAdminRole e = new UserGroupAdminRole();
     e.IsInitializing = true;
     e.GroupID = GroupID;
     e.RoleID = RoleID;
     e.CreateDate = CreateDate;
     e.Permission = Permission;
     e.DistinctString = GetDistinctString(true);
     e.IsPersisted = true;
     e.IsEntityChanged = false;
     e.IsInitializing = false;
     return e;
 }