public void SetValue(EntityMemberInfo member, object value) { // if we are loading the record, just set the value and that's it. if (_status == EntityStatus.Loading || Session == null) { member.SetValueRef(this, member, value); return; } if (_status == EntityStatus.Stub) { this.Reload(); } var oldStatus = _status; member.SetValueRef(this, member, value); //Fire modified event if necessary if (_status != oldStatus && _status == EntityStatus.Modified) { EntityInfo.Events.OnModified(this); } if (PropertyChanged != null) { OnPropertyChanged(member.MemberName); if (member.DependentMembers != null) { for (int i = 0; i < member.DependentMembers.Length; i++) //for loop is more efficient { OnPropertyChanged(member.DependentMembers[i].MemberName); } } } }
public void SetValue(EntityMemberInfo member, object value) { // if we are loading the record, just set the value and that's it. if (_status == EntityStatus.Loading || Session == null) { member.SetValueRef(this, member, value); return; } if (_status == EntityStatus.Stub) this.Reload(); var oldStatus = _status; // Go thru session. Authorization-enabled session will use this method to check permissions Session.RecordSetMemberValue(this, member, value); //Fire modified event if necessary if (_status != oldStatus && _status == EntityStatus.Modified) { EntityInfo.Events.OnModified(this); Session.Context.App.EntityEvents.OnModified(this); } if (PropertyChanged != null) { OnPropertyChanged(member.MemberName); if (member.DependentMembers != null) for (int i=0; i< member.DependentMembers.Length; i++) //for loop is more efficient OnPropertyChanged(member.DependentMembers[i].MemberName); } }
public virtual void RecordSetMemberValue(EntityRecord record, EntityMemberInfo member, object value) { member.SetValueRef(record, member, value); }