public virtual IPicklistRoleState ToPicklistRoleState() { var state = new PicklistRoleState(true); state.PartyRoleId = this.PartyRoleId; if (this.Active != null && this.Active.HasValue) { state.Active = this.Active.Value; } if (this.Version != null && this.Version.HasValue) { state.Version = this.Version.Value; } state.PicklistId = this.PicklistId; state.CreatedByUserLogin = this.CreatedByUserLogin; if (this.CreatedAt != null && this.CreatedAt.HasValue) { state.CreatedAt = this.CreatedAt.Value; } state.LastModifiedByUserLogin = this.LastModifiedByUserLogin; if (this.UpdatedAt != null && this.UpdatedAt.HasValue) { state.UpdatedAt = this.UpdatedAt.Value; } return(state); }
public virtual IPicklistRoleState Get(PartyRoleId partyRoleId, bool forCreation, bool nullAllowed) { PicklistRoleId globalId = new PicklistRoleId(_picklistState.PicklistId, partyRoleId); if (_loadedPicklistRoleStates.ContainsKey(globalId)) { var state = _loadedPicklistRoleStates[globalId]; if (this._picklistState != null && this._picklistState.ReadOnly == false) { ((IPicklistRoleState)state).ReadOnly = false; } return(state); } if (forCreation || ForReapplying) { var state = new PicklistRoleState(ForReapplying); state.PicklistRoleId = globalId; _loadedPicklistRoleStates.Add(globalId, state); if (this._picklistState != null && this._picklistState.ReadOnly == false) { ((IPicklistRoleState)state).ReadOnly = false; } return(state); } else { var state = PicklistRoleStateDao.Get(globalId, nullAllowed); if (state != null) { _loadedPicklistRoleStates.Add(globalId, state); } if (this._picklistState != null && this._picklistState.ReadOnly == false) { ((IPicklistRoleState)state).ReadOnly = false; } return(state); } }
public static CreatePicklistRole ToCreatePicklistRole(this PicklistRoleState state) { return(state.ToCreatePicklistRole <CreatePicklistRole>()); }
public static MergePatchPicklistRole ToMergePatchPicklistRole(this PicklistRoleState state) { return(state.ToMergePatchPicklistRole <MergePatchPicklistRole>()); }
public static RemovePicklistRole ToRemovePicklistRole(this PicklistRoleState state) { return(state.ToRemovePicklistRole <RemovePicklistRole>()); }
public static IPicklistRoleCommand ToCreateOrMergePatchPicklistRole(this PicklistRoleState state) { return(state.ToCreateOrMergePatchPicklistRole <CreatePicklistRole, MergePatchPicklistRole>()); }