/// <summary> /// Internal use /// </summary> public UsersRoleHistory ShallowCopy(bool allData = false, bool preserveState = false, bool checkLoadState = false) { UsersRoleHistory e = new UsersRoleHistory(); e.StartAutoUpdating = false; e.ID = ID; e.ChangeDate = ChangeDate; e.Operation = Operation; e.SubPriority = SubPriority; e.OperatorID = OperatorID; e.RoleID = RoleID; e.UserID = UserID; 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(UsersRoleHistory other) { if (other == null) { return(false); } else { return(ChangeDate == other.ChangeDate && RoleID == other.RoleID && UserID == other.UserID); } }
/// <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(UsersRoleHistory other) { if (other == null) { return(false); } if (ID != other.ID) { return(false); } return(true); }
/// <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(UsersRoleHistory from, UsersRoleHistory to) { if (to.IsPersisted) { } else { to.IsPersisted = from.IsPersisted; to.ID = from.ID; to.ChangeDate = from.ChangeDate; to.Operation = from.Operation; to.SubPriority = from.SubPriority; to.OperatorID = from.OperatorID; to.RoleID = from.RoleID; to.UserID = from.UserID; } }
/// <summary> /// Internal use /// </summary> public UsersRoleHistory ShallowCopy(bool allData = false) { UsersRoleHistory e = new UsersRoleHistory(); e.IsInitializing = true; e.ID = ID; e.ChangeDate = ChangeDate; e.Operation = Operation; e.SubPriority = SubPriority; e.OperatorID = OperatorID; e.RoleID = RoleID; e.UserID = UserID; 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(UsersRoleHistory newdata) { int cnt = 0; IsEntityChanged = cnt > 0; }
/// <summary> /// Internal use /// </summary> public UsersRoleHistory ShallowCopy(bool allData = false, bool preserveState = false, bool checkLoadState = false) { UsersRoleHistory e = new UsersRoleHistory(); e.StartAutoUpdating = false; e.ID = ID; e.ChangeDate = ChangeDate; e.Operation = Operation; e.SubPriority = SubPriority; e.OperatorID = OperatorID; e.RoleID = RoleID; e.UserID = UserID; 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(UsersRoleHistory other) { if (other == null) return false; else return ChangeDate == other.ChangeDate && RoleID == other.RoleID && UserID == other.UserID; }
/// <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(UsersRoleHistory other) { if (other == null) return false; if (ID != other.ID) return false; return true; }
private static async Task AddUserRoleHistory(UsersInRole current, UserRoleOperations op) { UsersRoleHistoryServiceProxy hrhsvc = new UsersRoleHistoryServiceProxy(); UsersRoleHistorySet urhs = new UsersRoleHistorySet(); UsersRoleHistory urh = new UsersRoleHistory(); urh.UserID = current.UserID; urh.RoleID = current.RoleID; urh.SubPriority = current.SubPriority; urh.OperatorID = current.AdminID; urh.ChangeDate = DateTime.UtcNow; switch (op) { case UserRoleOperations.Added: urh.Operation = urhs.OperationValues[0]; break; case UserRoleOperations.Modified: urh.Operation = urhs.OperationValues[1]; break; case UserRoleOperations.Deleted: urh.Operation = urhs.OperationValues[2]; break; } await hrhsvc.AddOrUpdateEntitiesAsync(Cntx, urhs, new UsersRoleHistory[] { urh }); }
/// <summary> /// Internal use /// </summary> public UsersRoleHistory ShallowCopy(bool allData = false) { UsersRoleHistory e = new UsersRoleHistory(); e.IsInitializing = true; e.ID = ID; e.ChangeDate = ChangeDate; e.Operation = Operation; e.SubPriority = SubPriority; e.OperatorID = OperatorID; e.RoleID = RoleID; e.UserID = UserID; e.DistinctString = GetDistinctString(true); e.IsPersisted = true; e.IsEntityChanged = false; e.IsInitializing = false; return e; }