2using System.Xml.Serialization;
20[XmlType(TypeName =
"distributionCenterSourcing")]
23 private int _distributionCenterId;
50 int distributionCenterId,
64 [XmlAttribute(
"distributionCenterId")]
67 get => _distributionCenterId;
73 throw new ArgumentOutOfRangeException(
76 "The distribution-center identifier cannot be negative.");
81 ref _distributionCenterId,
90 [XmlAttribute(
"itemId")]
99 throw new ArgumentOutOfRangeException(
102 "The item identifier cannot be negative.");
106 SetProperty(ref _itemId, value);
114 [XmlElement(
"warehouse")]
121 ArgumentNullException.ThrowIfNull(value);
124 if (SetProperty(ref _warehouse, value))
158 int distributionCenterId,
160 int standaloneWarehouseId)
164 distributionCenterId,
167 standaloneWarehouseId));
176 int distributionCenterId,
182 distributionCenterId,
196 return other is not
null
198 other.DistributionCenterId
200 && Warehouse.Kind == other.Warehouse.Kind
201 && Warehouse.ReferenceId ==
210 int distributionCenterId)
214 distributionCenterId;
236 ArgumentNullException.ThrowIfNull(warehouse);
240 && Warehouse.Kind == warehouse.Kind
241 && Warehouse.ReferenceId ==
Base class for model objects that notify listeners when one of their properties changes.
virtual void OnPropertyChanged([CallerMemberName] string? propertyName=null)
Raises the PropertyChanged event.
Represents a serializable reference to a warehouse.
int ReferenceId
Gets or sets the referenced identifier.
static WarehouseReference ForPlantWarehouse(int plantId)
Creates a reference to the warehouse attached to a plant.
static WarehouseReference ForStandaloneWarehouse(int warehouseId)
Creates a reference to a standalone warehouse.
Represents the ability of a distribution center to source a given item from a given warehouse invento...
bool ConcernsItem(int itemId)
Determines whether this relationship concerns the specified item.
static DistributionCenterSourcing FromPlantWarehouse(int distributionCenterId, int itemId, int plantId)
Creates a sourcing relationship involving a warehouse attached to a plant.
bool ConcernsInventory(int itemId, WarehouseReference warehouse)
Determines whether this relationship concerns the specified warehouse inventory.
int DistributionCenterId
Gets or sets the identifier of the distribution center that can obtain the item from the referenced i...
bool RefersToSameSourcing(DistributionCenterSourcing? other)
Determines whether this object represents the same distribution-center/inventory relationship as anot...
static DistributionCenterSourcing FromStandaloneWarehouse(int distributionCenterId, int itemId, int standaloneWarehouseId)
Creates a sourcing relationship involving a standalone warehouse.
DistributionCenterSourcing()
Initializes an empty distribution-center sourcing relationship.
DistributionCenterSourcing(int distributionCenterId, int itemId, WarehouseReference warehouse)
Initializes a distribution-center sourcing relationship.
WarehouseReference Warehouse
Gets or sets the warehouse holding the inventory from which the distribution center can obtain the it...
int WarehouseReferenceId
Gets the identifier used to reference the warehouse.
int ItemId
Gets or sets the identifier of the item contained in the referenced inventory.
WarehouseReferenceKind WarehouseKind
Gets the kind of referenced warehouse.
bool ConcernsDistributionCenter(int distributionCenterId)
Determines whether this relationship concerns the specified distribution center.
WarehouseReferenceKind
Identifies the type of warehouse referenced by a relationship.