ManufacturingPacketComponent.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using InABox.Core;
  2. namespace Comal.Classes
  3. {
  4. [UserTracking(typeof(ManufacturingPacket))]
  5. [Caption("Components")]
  6. public class ManufacturingPacketComponent : DimensionedEntity<ProductDimensions>, IRemotable, IPersistent, IOneToMany<ManufacturingPacket>, ILicense<ManufacturingLicense>
  7. {
  8. [EntityRelationship(DeleteAction.Cascade)]
  9. public ManufacturingPacketLink Packet { get; set; }
  10. [EntityRelationship(DeleteAction.SetNull)]
  11. public ProductLink Product { get; set; }
  12. [TextBoxEditor]
  13. [EditorSequence(1)]
  14. public string Description { get; set; }
  15. public int Quantity { get; set; }
  16. public override ProductDimensions Dimensions { get; set; }
  17. /// <summary>
  18. /// When a picking list is creating for a <see cref="ManufacturingPacketComponent"/>, we save a link to the requisition,
  19. /// so that we don't require the same component twice.
  20. /// </summary>
  21. [NullEditor]
  22. public RequisitionLink Requisition { get; set; }
  23. protected override void Init()
  24. {
  25. base.Init();
  26. Packet = new ManufacturingPacketLink();
  27. Product = new ProductLink(() => this);
  28. Dimensions = new ProductDimensions(() => this);
  29. Requisition = new RequisitionLink();
  30. }
  31. static ManufacturingPacketComponent()
  32. {
  33. LinkedProperties.Register<ManufacturingPacketComponent, ProductLink, string>(x => x.Product, x => x.Name, x => x.Description);
  34. }
  35. }
  36. }