| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- using InABox.Core;
- using System;
- namespace Comal.Classes
- {
- [UserTracking(typeof(ManufacturingPacket))]
- [Caption("Components")]
- public class ManufacturingPacketComponent : DimensionedEntity<ProductDimensions>, IRemotable, IPersistent, IOneToMany<ManufacturingPacket>, ILicense<ManufacturingLicense>, ISequenceable
- {
- // Used to be Cascade, but now must be delete, because you might delete a packet when on the staging screen, and not want to get rid of the components, obviously.
- [EntityRelationship(DeleteAction.SetNull)]
- public ManufacturingPacketLink Packet { get; set; }
- [NullEditor]
- [EntityRelationship(DeleteAction.Cascade)]
- public SetoutLink Setout { get; set; }
- [EntityRelationship(DeleteAction.SetNull)]
- [EditorSequence(1)]
- public ProductLink Product { get; set; }
- [TextBoxEditor]
- [EditorSequence(2)]
- public string Description { get; set; }
- [DimensionsEditor(typeof(ProductDimensions))]
- [EditorSequence(4)]
- public override ProductDimensions Dimensions { get; set; }
-
- [EditorSequence(5)]
- public int Quantity { get; set; }
-
- [NullEditor]
- public int Consumed { get; set; }
- /// <summary>
- /// When a picking list is creating for a <see cref="ManufacturingPacketComponent"/>, we save a link to the requisition,
- /// so that we don't require the same component twice.
- /// </summary>
- [NullEditor]
- public RequisitionLink Requisition { get; set; }
- [NullEditor]
- public long Sequence { get; set; }
- static ManufacturingPacketComponent()
- {
- LinkedProperties.Register<ManufacturingPacketComponent, ProductLink, string>(x => x.Product, x => x.Name, x => x.Description);
- LinkedProperties.Register<ManufacturingPacketComponent, ProductDimensionUnitLink, Guid>(x => x.Product.UnitOfMeasure, x => x.ID, x => x.Dimensions.Unit.ID);
- LinkedProperties.Register<ManufacturingPacketComponent, ProductDimensionUnitLink, string>(x => x.Product.UnitOfMeasure, x => x.Code, x => x.Dimensions.Unit.Code);
- LinkedProperties.Register<ManufacturingPacketComponent, ProductDimensionUnitLink, string>(x => x.Product.UnitOfMeasure, x => x.Description, x => x.Dimensions.Unit.Description);
- LinkedProperties.Register<ManufacturingPacketComponent, ProductDimensionUnitLink, bool>(x => x.Product.UnitOfMeasure, x => x.HasLength, x => x.Dimensions.Unit.HasLength);
- LinkedProperties.Register<ManufacturingPacketComponent, ProductDimensionUnitLink, bool>(x => x.Product.UnitOfMeasure, x => x.HasHeight, x => x.Dimensions.Unit.HasHeight);
- LinkedProperties.Register<ManufacturingPacketComponent, ProductDimensionUnitLink, bool>(x => x.Product.UnitOfMeasure, x => x.HasQuantity, x => x.Dimensions.Unit.HasQuantity);
- LinkedProperties.Register<ManufacturingPacketComponent, ProductDimensionUnitLink, bool>(x => x.Product.UnitOfMeasure, x => x.HasWeight, x => x.Dimensions.Unit.HasWeight);
- LinkedProperties.Register<ManufacturingPacketComponent, ProductDimensionUnitLink, bool>(x => x.Product.UnitOfMeasure, x => x.HasWidth, x => x.Dimensions.Unit.HasWidth);
- LinkedProperties.Register<ManufacturingPacketComponent, ProductDimensionUnitLink, string>(x => x.Product.UnitOfMeasure, x => x.Formula, x => x.Dimensions.Unit.Formula);
- LinkedProperties.Register<ManufacturingPacketComponent, ProductDimensionUnitLink, string>(x => x.Product.UnitOfMeasure, x => x.Format, x => x.Dimensions.Unit.Format);
-
- LinkedProperties.Register<ManufacturingPacketComponent, StockDimensions, double>(x => x.Product.DefaultInstance.Dimensions, x => x.Height, x => x.Dimensions.Height);
- LinkedProperties.Register<ManufacturingPacketComponent, StockDimensions, double>(x => x.Product.DefaultInstance.Dimensions, x => x.Length, x => x.Dimensions.Length);
- LinkedProperties.Register<ManufacturingPacketComponent, StockDimensions, double>(x => x.Product.DefaultInstance.Dimensions, x => x.Quantity, x => x.Dimensions.Quantity);
- LinkedProperties.Register<ManufacturingPacketComponent, StockDimensions, double>(x => x.Product.DefaultInstance.Dimensions, x => x.Weight, x => x.Dimensions.Weight);
- LinkedProperties.Register<ManufacturingPacketComponent, StockDimensions, double>(x => x.Product.DefaultInstance.Dimensions, x => x.Width, x => x.Dimensions.Width);
- LinkedProperties.Register<ManufacturingPacketComponent, StockDimensions, double>(x => x.Product.DefaultInstance.Dimensions, x => x.Value, x => x.Dimensions.Value);
- LinkedProperties.Register<ManufacturingPacketComponent, StockDimensions, string>(x => x.Product.DefaultInstance.Dimensions, x => x.UnitSize, x => x.Dimensions.UnitSize);
- }
- }
- }
|