public virtual void RemoveShipmentStatus(ShipmentStatus __item)
 {
     if (__item != null)
     {
         InternalRemoveShipmentStatus(__item);
     }
 }
 public virtual void AddShipmentStatus(ShipmentStatus __item)
 {
     if (__item == null)
     {
         return;
     }
     InternalAddShipmentStatus(__item);
 }
 public virtual void AddAtIndexShipmentStatus(int index, ShipmentStatus __item)
 {
     if (__item == null)
     {
         return;
     }
     shipmentStatus?.Insert(index, __item);
 }
 public virtual void InternalRemoveShipmentStatus(ShipmentStatus __item)
 {
     if (__item == null)
     {
         return;
     }
     shipmentStatus?.Remove(__item);
 }
 public virtual void InternalAddShipmentStatus(ShipmentStatus __item)
 {
     if (__item == null || disableInternalAdditions)
     {
         return;
     }
     shipmentStatus?.Add(__item);
 }
 public virtual void SetShipmentStatusAt(ShipmentStatus __item, int __index)
 {
     if (__item == null)
     {
         shipmentStatus[__index] = null;
     }
     else
     {
         shipmentStatus[__index] = __item;
     }
 }
Beispiel #7
0
        public void Shipment_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _actionsbo_shippingorders_shipment = new DSS3_LogisticsPoolingForUrbanDistribution.BO.ShippingOrder
            {
                DepartureDate   = now,
                ArrivalDate     = now,
                Shipper         = "ShippingOrder_Shipper",
                Carrier         = "ShippingOrder_Carrier",
                ItemDescription = "ShippingOrder_ItemDescription",
                Conditions      = "ShippingOrder_Conditions",
                AggregateVolume = 222222.22M,
                Priority        = 1726,
            };
            var _actionsbo_shippingorders_shipment2 = new DSS3_LogisticsPoolingForUrbanDistribution.BO.ShippingOrder
            {
                DepartureDate   = now,
                ArrivalDate     = now,
                Shipper         = "ShippingOrder_Shipper",
                Carrier         = "ShippingOrder_Carrier",
                ItemDescription = "ShippingOrder_ItemDescription",
                Conditions      = "ShippingOrder_Conditions",
                AggregateVolume = 222222.22M,
                Priority        = 8201,
            };
            var _actionsbo_shipmentstatus_shipment = new DSS3_LogisticsPoolingForUrbanDistribution.BO.ShipmentStatus
            {
                TimeReported = now,
                Description  = "ShipmentStatus_Description",
                User         = "******",
            };
            var _actionsbo_shipmentstatus_shipment2 = new DSS3_LogisticsPoolingForUrbanDistribution.BO.ShipmentStatus
            {
                TimeReported = now,
                Description  = "ShipmentStatus_Description",
                User         = "******",
            };
            var _actionsbo_departurepoint_shipment = new DSS3_LogisticsPoolingForUrbanDistribution.BO.Location
            {
                Name     = "Location_Name",
                Street   = "Location_Street",
                City     = "Location_City",
                Country  = "Location_Country",
                Number   = "Location_Number",
                PostCode = "Location_PostCode",
                Label    = "Location_Label",
            };
            var _actionsbo_finaldestination_shipment_1 = new DSS3_LogisticsPoolingForUrbanDistribution.BO.Location
            {
                Name     = "Location_Name",
                Street   = "Location_Street",
                City     = "Location_City",
                Country  = "Location_Country",
                Number   = "Location_Number",
                PostCode = "Location_PostCode",
                Label    = "Location_Label",
            };
            var _actionsbo_driver_shipment = new DSS3_LogisticsPoolingForUrbanDistribution.BO.Driver
            {
                Id                   = 6688,
                UserName             = "******",
                PasswordHash         = "Driver_PasswordHash",
                SecurityStamp        = "Driver_SecurityStamp",
                EmailConfirmed       = true,
                LockoutEnabled       = true,
                PhoneNumberConfirmed = true,
                TwoFactorEnabled     = true,
                AccessFailedCount    = 6962,
                Name                 = "Driver_Name",
                Email                = "Driver_Email",
                PhoneNumber          = "Driver_PhoneNumber",
                LockoutEndDate       = now,
            };
            var _actionsbo_occupiedvolume_shipment_1 = new DSS3_LogisticsPoolingForUrbanDistribution.BO.CustomVolume
            {
                Weight = 222222.22M,
            };
            var _actionsbo_acceptedconditions_shipment = new DSS3_LogisticsPoolingForUrbanDistribution.BO.Condition
            {
                Description = "Condition_Description",
            };
            var _actionsbo_acceptedconditions_shipment2 = new DSS3_LogisticsPoolingForUrbanDistribution.BO.Condition
            {
                Description = "Condition_Description",
            };
            var _actionsbo_vehiculetype_shipment = new DSS3_LogisticsPoolingForUrbanDistribution.BO.Vehicule
            {
                OverHeadCost            = 222222.22M,
                CalculatedTimeCost      = 222222.22M,
                CalculatedDistanceCost  = 222222.22M,
                CalculatedOwnershipCost = 222222.22M,
                VehiculeType            = "Vehicule_VehiculeType",
                Volume           = "Vehicule_Volume",
                CO2perKm         = 222222.22M,
                AmortizationType = "Vehicule_AmortizationType",
                MaximumLoad      = 222222.22M,
            };
            var _actionsbo_path_shipment_2 = new DSS3_LogisticsPoolingForUrbanDistribution.BO.Point
            {
                LocId       = 833,
                Time        = 751,
                Distance    = 2145,
                CurrentLoad = 222222.22M,
            };
            var _actionsbo_path_shipment_22 = new DSS3_LogisticsPoolingForUrbanDistribution.BO.Point
            {
                LocId       = 7501,
                Time        = 1091,
                Distance    = 9420,
                CurrentLoad = 222222.22M,
            };

            new PersistenceSpecification <DSS3_LogisticsPoolingForUrbanDistribution.BO.Shipment>(Session)
            .CheckProperty(p => p.Owner, "Shipment_Owner")
            .CheckProperty(p => p.DepartureTime, now)
            .CheckProperty(p => p.Temperature, "Shipment_Temperature")
            .CheckProperty(p => p.LoadPercentage, 6077)
            .CheckProperty(p => p.TotalVolume, 222222.22M)
            .CheckProperty(p => p.AverageVolume, 222222.22M)
            .CheckProperty(p => p.MaxTravelTime, 7344)
            .CheckBag(p => p.ShippingOrders, (new List <DSS3_LogisticsPoolingForUrbanDistribution.BO.ShippingOrder>
            {
                _actionsbo_shippingorders_shipment,
                _actionsbo_shippingorders_shipment2
            }))
            .CheckBag(p => p.ShipmentStatus, (new List <DSS3_LogisticsPoolingForUrbanDistribution.BO.ShipmentStatus>
            {
                _actionsbo_shipmentstatus_shipment,
                _actionsbo_shipmentstatus_shipment2
            }))
            .CheckReference(p => p.DeparturePoint, _actionsbo_departurepoint_shipment)
            .CheckReference(p => p.FinalDestination, _actionsbo_finaldestination_shipment_1)
            .CheckReference(p => p.Driver, _actionsbo_driver_shipment)
            .CheckReference(p => p.OccupiedVolume, _actionsbo_occupiedvolume_shipment_1)
            .CheckBag(p => p.AcceptedConditions, (new List <DSS3_LogisticsPoolingForUrbanDistribution.BO.Condition>
            {
                _actionsbo_acceptedconditions_shipment,
                _actionsbo_acceptedconditions_shipment2
            }))
            .CheckReference(p => p.VehiculeType, _actionsbo_vehiculetype_shipment)
            .CheckBag(p => p.Path, (new List <DSS3_LogisticsPoolingForUrbanDistribution.BO.Point>
            {
                _actionsbo_path_shipment_2,
                _actionsbo_path_shipment_22
            }))
            .VerifyTheMappings();
        }
Beispiel #8
0
/// <summary>
///     Returns true if self and the provided entity have the same Id values
///     and the Ids are not of the default Id value
/// </summary>
        protected bool HasSameNonDefaultIdAs(ShipmentStatus compareTo)
        {
            return(!this.IsTransient() && !compareTo.IsTransient() && this.Id.Equals(compareTo.Id));
        }
Beispiel #9
0
/// <summary>
/// Copies the current object to a new instance
/// </summary>
/// <param name="deep">Copy members that refer to objects external to this class (not dependent)</param>
/// <param name="copiedObjects">Objects that should be reused</param>
/// <param name="asNew">Copy the current object as a new one, ready to be persisted, along all its members.</param>
/// <param name="reuseNestedObjects">If asNew is true, this flag if set, forces the reuse of all external objects.</param>
/// <param name="copy">Optional - An existing [ShipmentStatus] instance to use as the destination.</param>
/// <returns>A copy of the object</returns>
        public virtual ShipmentStatus Copy(bool deep = false, Hashtable copiedObjects = null, bool asNew = false, bool reuseNestedObjects = false, ShipmentStatus copy = null)
        {
            if (copiedObjects == null)
            {
                copiedObjects = new Hashtable();
            }
            if (copy == null && copiedObjects.Contains(this))
            {
                return((ShipmentStatus)copiedObjects[this]);
            }
            copy = copy ?? new ShipmentStatus();
            if (!asNew)
            {
                copy.TransientId = this.TransientId;
                copy.Id          = this.Id;
            }
            copy.TimeReported = this.TimeReported;
            copy.Description  = this.Description;
            copy.User         = this.User;
            if (!copiedObjects.Contains(this))
            {
                copiedObjects.Add(this, copy);
            }
            if (deep && this.status != null)
            {
                if (!copiedObjects.Contains(this.status))
                {
                    if (asNew && reuseNestedObjects)
                    {
                        copy.Status = this.Status;
                    }
                    else if (asNew)
                    {
                        copy.Status = this.Status.Copy(deep, copiedObjects, true);
                    }
                    else
                    {
                        copy.status = this.status.Copy(deep, copiedObjects, false);
                    }
                }
                else
                {
                    if (asNew)
                    {
                        copy.Status = (Status)copiedObjects[this.Status];
                    }
                    else
                    {
                        copy.status = (Status)copiedObjects[this.Status];
                    }
                }
            }
            return(copy);
        }