public override bool Equals(object obj) { if (Object.ReferenceEquals(this, obj)) { return(true); } MovementConfirmationLineId other = obj as MovementConfirmationLineId; if (other == null) { return(false); } return(true && Object.Equals(this.MovementConfirmationDocumentNumber, other.MovementConfirmationDocumentNumber) && Object.Equals(this.LineNumber, other.LineNumber) ); }
public virtual IMovementConfirmationLineState Get(string lineNumber, bool forCreation, bool nullAllowed) { MovementConfirmationLineId globalId = new MovementConfirmationLineId(_movementConfirmationState.DocumentNumber, lineNumber); if (_loadedMovementConfirmationLineStates.ContainsKey(globalId)) { var state = _loadedMovementConfirmationLineStates[globalId]; if (this._movementConfirmationState != null && this._movementConfirmationState.ReadOnly == false) { ((IMovementConfirmationLineState)state).ReadOnly = false; } return(state); } if (forCreation || ForReapplying) { var state = new MovementConfirmationLineState(ForReapplying); state.MovementConfirmationLineId = globalId; _loadedMovementConfirmationLineStates.Add(globalId, state); if (this._movementConfirmationState != null && this._movementConfirmationState.ReadOnly == false) { ((IMovementConfirmationLineState)state).ReadOnly = false; } return(state); } else { var state = MovementConfirmationLineStateDao.Get(globalId, nullAllowed); if (state != null) { _loadedMovementConfirmationLineStates.Add(globalId, state); } if (this._movementConfirmationState != null && this._movementConfirmationState.ReadOnly == false) { ((IMovementConfirmationLineState)state).ReadOnly = false; } return(state); } }