| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 | 
							- using System;
 
- using System.Collections.Generic;
 
- using System.Linq.Expressions;
 
- using InABox.Core;
 
- namespace Comal.Classes
 
- {
 
-     public class ShipmentItemCount : CoreAggregate<Shipment, DeliveryItem, Guid>
 
-     {
 
-         public override Expression<Func<DeliveryItem, Guid>> Aggregate => x => x.ID;
 
-         public override AggregateCalculation Calculation => AggregateCalculation.Count;
 
-         public override Dictionary<Expression<Func<DeliveryItem, object>>, Expression<Func<Shipment, object>>> Links =>
 
-             new Dictionary<Expression<Func<DeliveryItem, object>>, Expression<Func<Shipment, object>>>()
 
-             {
 
-                 { DeliveryItem => DeliveryItem.ShipmentLink.ID, Shipment => Shipment.ID }
 
-             };
 
-     }
 
-     [UserTracking(typeof(Delivery))]
 
-     public class Shipment : Entity, IPersistent, IRemotable, ILicense<LogisticsLicense>
 
-     {
 
-         [UniqueCodeEditor(Visible = Visible.Default, Editable = Editable.Enabled)]
 
-         [EditorSequence(1)]
 
-         public string Code { get; set; }
 
-         [TextBoxEditor]
 
-         [EditorSequence(2)]
 
-         public string Description { get; set; }
 
-         [TextBoxEditor]
 
-         [EditorSequence(3)]
 
-         public string Type { get; set; }
 
-         [CodeEditor(Editable = Editable.Disabled)]
 
-         [EditorSequence(4)]
 
-         public string BarCode { get; set; }
 
-         [EditorSequence(5)]
 
-         [EntityRelationship(DeleteAction.SetNull)]
 
-         public GPSTrackerLink TrackerLink { get; set; }
 
-         [EditorSequence(6)]
 
-         [EntityRelationship(DeleteAction.SetNull)]
 
-         public DeliveryLink Delivery { get; set; }
 
-         [EditorSequence(7)]
 
-         [IntegerEditor(Editable = Editable.Hidden)]
 
-         [Aggregate(typeof(ShipmentItemCount))]
 
-         public int ItemCount { get; set; }
 
-         [Obsolete("Replaced with GPSTrackerLink")]
 
-         [NullEditor]
 
-         public Guid GPSTrackerID { get; set; }
 
-         protected override void Init()
 
-         {
 
-             base.Init();
 
-             BarCode = CoreUtils.RandomHexString(16);
 
-             TrackerLink = new GPSTrackerLink();
 
-             Delivery = new DeliveryLink();
 
-         }
 
-         public override string ToString()
 
-         {
 
-             return string.Format("{0}: {1}", Code, Description);
 
-         }
 
-     }
 
- }
 
 
  |