public override bool Equals(object obj) { if (Object.ReferenceEquals(this, obj)) { return(true); } ShipmentItemIssuanceId other = obj as ShipmentItemIssuanceId; if (other == null) { return(false); } return(true && Object.Equals(this.ShipmentId, other.ShipmentId) && Object.Equals(this.ItemIssuanceSeqId, other.ItemIssuanceSeqId) ); }
public virtual IItemIssuanceState Get(string itemIssuanceSeqId, bool forCreation, bool nullAllowed) { ShipmentItemIssuanceId globalId = new ShipmentItemIssuanceId(_shipmentState.ShipmentId, itemIssuanceSeqId); if (_loadedItemIssuanceStates.ContainsKey(globalId)) { var state = _loadedItemIssuanceStates[globalId]; if (this._shipmentState != null && this._shipmentState.ReadOnly == false) { ((IItemIssuanceState)state).ReadOnly = false; } return(state); } if (forCreation || ForReapplying) { var state = new ItemIssuanceState(ForReapplying); state.ShipmentItemIssuanceId = globalId; _loadedItemIssuanceStates.Add(globalId, state); if (this._shipmentState != null && this._shipmentState.ReadOnly == false) { ((IItemIssuanceState)state).ReadOnly = false; } return(state); } else { var state = ItemIssuanceStateDao.Get(globalId, nullAllowed); if (state != null) { _loadedItemIssuanceStates.Add(globalId, state); } if (this._shipmentState != null && this._shipmentState.ReadOnly == false) { ((IItemIssuanceState)state).ReadOnly = false; } return(state); } }