public void tblZslTransportDetail_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _zanardobo_tblzslplatformbookingorder_tblzsltransportdetail = new DSS3_LogisticsPoolingForUrbanDistribution.BO.tblZslPlatformBookingOrder
            {
                BookingDate      = now,
                OrderNo          = "tblZslPlatformBookingOrder_OrderNo",
                NoIdentity       = "tblZslPlatformBookingOrder_NoIdentity",
                FromExtTime      = now,
                ToExtTime        = now,
                BookStatus       = "tblZslPlatformBookingOrder_BookStatus",
                NoPlatform       = "tblZslPlatformBookingOrder_NoPlatform",
                NoCourier        = "tblZslPlatformBookingOrder_NoCourier",
                Warehouse        = "tblZslPlatformBookingOrder_Warehouse",
                Driver           = "tblZslPlatformBookingOrder_Driver",
                DriverTelephone  = "tblZslPlatformBookingOrder_DriverTelephone",
                Plate            = "tblZslPlatformBookingOrder_Plate",
                Trailerplate     = "tblZslPlatformBookingOrder_Trailerplate",
                PalletIN         = 2791,
                TotalPallet      = 4568,
                DateArrived      = now,
                TimeArrived      = now,
                DateExit         = now,
                TImeExit         = now,
                RouteTracking_ID = 1454,
            };
            var _zanardobo_tblzslcustomer_tblzsltransportdetail = new DSS3_LogisticsPoolingForUrbanDistribution.BO.tblZslCustomer
            {
                CustomerFullName = "tblZslCustomer_CustomerFullName",
            };
            var _zanardobo_tblzslworker_tblzsltransportdetail = new DSS3_LogisticsPoolingForUrbanDistribution.BO.tblZslWorker
            {
                WorkerFullName = "tblZslWorker_WorkerFullName",
            };

            new PersistenceSpecification <DSS3_LogisticsPoolingForUrbanDistribution.BO.tblZslTransportDetail>(Session)
            .CheckProperty(p => p.EventID, 1352)
            .CheckProperty(p => p.Qty, 222222.22M)
            .CheckProperty(p => p.ExtDateStart, now)
            .CheckProperty(p => p.ExtTimeStart, now)
            .CheckProperty(p => p.ExtTimeAction, now)
            .CheckProperty(p => p.RealDateStart, now)
            .CheckProperty(p => p.RealTimeStart, now)
            .CheckProperty(p => p.RealTimeAction, now)
            .CheckReference(p => p.tblZslPlatformBookingOrder, _zanardobo_tblzslplatformbookingorder_tblzsltransportdetail)
            .CheckReference(p => p.tblZslCustomer, _zanardobo_tblzslcustomer_tblzsltransportdetail)
            .CheckReference(p => p.tblZslWorker, _zanardobo_tblzslworker_tblzsltransportdetail)
            .VerifyTheMappings();
        }
        public void tblZslTransportExecutionPlan_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _zanardobo_tblzslcarrier_tblzsltransportexecutionplan = new DSS3_LogisticsPoolingForUrbanDistribution.BO.tblZslCarrier
            {
                CarrierName = "tblZslCarrier_CarrierName",
            };
            var _zanardobo_tblzslplatformbookingorder_tblzsltransportexecutionplan = new DSS3_LogisticsPoolingForUrbanDistribution.BO.tblZslPlatformBookingOrder
            {
                BookingDate      = now,
                OrderNo          = "tblZslPlatformBookingOrder_OrderNo",
                NoIdentity       = "tblZslPlatformBookingOrder_NoIdentity",
                FromExtTime      = now,
                ToExtTime        = now,
                BookStatus       = "tblZslPlatformBookingOrder_BookStatus",
                NoPlatform       = "tblZslPlatformBookingOrder_NoPlatform",
                NoCourier        = "tblZslPlatformBookingOrder_NoCourier",
                Warehouse        = "tblZslPlatformBookingOrder_Warehouse",
                Driver           = "tblZslPlatformBookingOrder_Driver",
                DriverTelephone  = "tblZslPlatformBookingOrder_DriverTelephone",
                Plate            = "tblZslPlatformBookingOrder_Plate",
                Trailerplate     = "tblZslPlatformBookingOrder_Trailerplate",
                PalletIN         = 780,
                TotalPallet      = 7780,
                DateArrived      = now,
                TimeArrived      = now,
                DateExit         = now,
                TImeExit         = now,
                RouteTracking_ID = 7596,
            };
            var _zanardobo_tblzsldeliverystatus_tblzsltransportexecutionplan = new DSS3_LogisticsPoolingForUrbanDistribution.BO.tblZslDeliveryStatus
            {
                DeliveryStatusName = "tblZslDeliveryStatus_DeliveryStatusName",
            };

            new PersistenceSpecification <DSS3_LogisticsPoolingForUrbanDistribution.BO.tblZslTransportExecutionPlan>(Session)
            .CheckProperty(p => p.Notes, "tblZslTransportExecutionPlan_Notes")
            .CheckProperty(p => p.ETA, now)
            .CheckProperty(p => p.ActualArrivalTime, now)
            .CheckReference(p => p.tblZslCarrier, _zanardobo_tblzslcarrier_tblzsltransportexecutionplan)
            .CheckReference(p => p.tblZslPlatformBookingOrder, _zanardobo_tblzslplatformbookingorder_tblzsltransportexecutionplan)
            .CheckReference(p => p.tblZslDeliveryStatus, _zanardobo_tblzsldeliverystatus_tblzsltransportexecutionplan)
            .VerifyTheMappings();
        }
        public void tblZslPlatformBookingOrder_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _zanardobo_platformbookingorder_tblzslplatformbookingorder = new DSS3_LogisticsPoolingForUrbanDistribution.BO.tblZslPlatformBookingOrder
            {
                BookingDate      = now,
                OrderNo          = "tblZslPlatformBookingOrder_OrderNo",
                NoIdentity       = "tblZslPlatformBookingOrder_NoIdentity",
                FromExtTime      = now,
                ToExtTime        = now,
                BookStatus       = "tblZslPlatformBookingOrder_BookStatus",
                NoPlatform       = "tblZslPlatformBookingOrder_NoPlatform",
                NoCourier        = "tblZslPlatformBookingOrder_NoCourier",
                Warehouse        = "tblZslPlatformBookingOrder_Warehouse",
                Driver           = "tblZslPlatformBookingOrder_Driver",
                DriverTelephone  = "tblZslPlatformBookingOrder_DriverTelephone",
                Plate            = "tblZslPlatformBookingOrder_Plate",
                Trailerplate     = "tblZslPlatformBookingOrder_Trailerplate",
                PalletIN         = 162,
                TotalPallet      = 4371,
                DateArrived      = now,
                TimeArrived      = now,
                DateExit         = now,
                TImeExit         = now,
                RouteTracking_ID = 2948,
            };
            var _zanardobo_tblzslcustomer_tblzslplatformbookingorder = new DSS3_LogisticsPoolingForUrbanDistribution.BO.tblZslCustomer
            {
                CustomerFullName = "tblZslCustomer_CustomerFullName",
            };
            var _zanardobo_tblzslbookingtype_tblzslplatformbookingorder = new DSS3_LogisticsPoolingForUrbanDistribution.BO.tblZslBookingType
            {
                BookingTypeName = "tblZslBookingType_BookingTypeName",
            };
            var _zanardobo_tblzsltransportorder_tblzslplatformbookingorder = new DSS3_LogisticsPoolingForUrbanDistribution.BO.tblZslTransportOrder
            {
                TransportOrderNo      = "tblZslTransportOrder_TransportOrderNo",
                OrderYear             = 5864,
                DocumentTransportNo   = "tblZslTransportOrder_DocumentTransportNo",
                OrderDate             = now,
                DepartureCustomerName = "tblZslTransportOrder_DepartureCustomerName",
                DepartureAddress      = "tblZslTransportOrder_DepartureAddress",
                DepartureCity         = "tblZslTransportOrder_DepartureCity",
                DepartureState        = "tblZslTransportOrder_DepartureState",
                DestinationName       = "tblZslTransportOrder_DestinationName",
                DestinationAddress    = "tblZslTransportOrder_DestinationAddress",
                DestinationCity       = "tblZslTransportOrder_DestinationCity",
                DestinationState      = "tblZslTransportOrder_DestinationState",
                Qty                = 2953,
                OrderWeight        = 222222.22M,
                Volume             = 222222.22M,
                Pallet             = 2613,
                RetiredDate        = now,
                DeliveryDate       = now,
                Note               = "tblZslTransportOrder_Note",
                CallCustomerBefore = "tblZslTransportOrder_CallCustomerBefore",
                Telephone          = "tblZslTransportOrder_Telephone",
                DayClosed          = "tblZslTransportOrder_DayClosed",
                Urgent             = "tblZslTransportOrder_Urgent",
            };

            new PersistenceSpecification <DSS3_LogisticsPoolingForUrbanDistribution.BO.tblZslPlatformBookingOrder>(Session)
            .CheckProperty(p => p.BookingDate, now)
            .CheckProperty(p => p.OrderNo, "tblZslPlatformBookingOrder_OrderNo")
            .CheckProperty(p => p.NoIdentity, "tblZslPlatformBookingOrder_NoIdentity")
            .CheckProperty(p => p.FromExtTime, now)
            .CheckProperty(p => p.ToExtTime, now)
            .CheckProperty(p => p.BookStatus, "tblZslPlatformBookingOrder_BookStatus")
            .CheckProperty(p => p.NoPlatform, "tblZslPlatformBookingOrder_NoPlatform")
            .CheckProperty(p => p.NoCourier, "tblZslPlatformBookingOrder_NoCourier")
            .CheckProperty(p => p.Warehouse, "tblZslPlatformBookingOrder_Warehouse")
            .CheckProperty(p => p.Driver, "tblZslPlatformBookingOrder_Driver")
            .CheckProperty(p => p.DriverTelephone, "tblZslPlatformBookingOrder_DriverTelephone")
            .CheckProperty(p => p.Plate, "tblZslPlatformBookingOrder_Plate")
            .CheckProperty(p => p.Trailerplate, "tblZslPlatformBookingOrder_Trailerplate")
            .CheckProperty(p => p.PalletIN, 5763)
            .CheckProperty(p => p.TotalPallet, 981)
            .CheckProperty(p => p.DateArrived, now)
            .CheckProperty(p => p.TimeArrived, now)
            .CheckProperty(p => p.DateExit, now)
            .CheckProperty(p => p.TImeExit, now)
            .CheckProperty(p => p.RouteTracking_ID, 9347)
            .CheckReference(p => p.PlatformBookingOrder, _zanardobo_platformbookingorder_tblzslplatformbookingorder)
            .CheckReference(p => p.tblZslCustomer, _zanardobo_tblzslcustomer_tblzslplatformbookingorder)
            .CheckReference(p => p.tblZslBookingType, _zanardobo_tblzslbookingtype_tblzslplatformbookingorder)
            .CheckReference(p => p.tblZslTransportOrder, _zanardobo_tblzsltransportorder_tblzslplatformbookingorder)
            .VerifyTheMappings();
        }
/// <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(tblZslPlatformBookingOrder compareTo)
        {
            return(!this.IsTransient() && !compareTo.IsTransient() && this.Id.Equals(compareTo.Id));
        }
/// <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 [tblZslPlatformBookingOrder] instance to use as the destination.</param>
/// <returns>A copy of the object</returns>
        public virtual tblZslPlatformBookingOrder Copy(bool deep = false, Hashtable copiedObjects = null, bool asNew = false, bool reuseNestedObjects = false, tblZslPlatformBookingOrder copy = null)
        {
            if (copiedObjects == null)
            {
                copiedObjects = new Hashtable();
            }
            if (copy == null && copiedObjects.Contains(this))
            {
                return((tblZslPlatformBookingOrder)copiedObjects[this]);
            }
            copy = copy ?? new tblZslPlatformBookingOrder();
            if (!asNew)
            {
                copy.TransientId = this.TransientId;
                copy.Id          = this.Id;
            }
            copy.BookingDate      = this.BookingDate;
            copy.OrderNo          = this.OrderNo;
            copy.NoIdentity       = this.NoIdentity;
            copy.FromExtTime      = this.FromExtTime;
            copy.ToExtTime        = this.ToExtTime;
            copy.BookStatus       = this.BookStatus;
            copy.NoPlatform       = this.NoPlatform;
            copy.NoCourier        = this.NoCourier;
            copy.Warehouse        = this.Warehouse;
            copy.Driver           = this.Driver;
            copy.DriverTelephone  = this.DriverTelephone;
            copy.Plate            = this.Plate;
            copy.Trailerplate     = this.Trailerplate;
            copy.PalletIN         = this.PalletIN;
            copy.TotalPallet      = this.TotalPallet;
            copy.DateArrived      = this.DateArrived;
            copy.TimeArrived      = this.TimeArrived;
            copy.DateExit         = this.DateExit;
            copy.TImeExit         = this.TImeExit;
            copy.RouteTracking_ID = this.RouteTracking_ID;
            if (!copiedObjects.Contains(this))
            {
                copiedObjects.Add(this, copy);
            }
            if (deep && this.platformBookingOrder != null)
            {
                if (!copiedObjects.Contains(this.platformBookingOrder))
                {
                    if (asNew && reuseNestedObjects)
                    {
                        copy.PlatformBookingOrder = this.PlatformBookingOrder;
                    }
                    else if (asNew)
                    {
                        copy.PlatformBookingOrder = this.PlatformBookingOrder.Copy(deep, copiedObjects, true);
                    }
                    else
                    {
                        copy.platformBookingOrder = this.platformBookingOrder.Copy(deep, copiedObjects, false);
                    }
                }
                else
                {
                    if (asNew)
                    {
                        copy.PlatformBookingOrder = (tblZslPlatformBookingOrder)copiedObjects[this.PlatformBookingOrder];
                    }
                    else
                    {
                        copy.platformBookingOrder = (tblZslPlatformBookingOrder)copiedObjects[this.PlatformBookingOrder];
                    }
                }
            }
            if (deep && this._tblZslCustomer != null)
            {
                if (!copiedObjects.Contains(this._tblZslCustomer))
                {
                    if (asNew && reuseNestedObjects)
                    {
                        copy.tblZslCustomer = this.tblZslCustomer;
                    }
                    else if (asNew)
                    {
                        copy.tblZslCustomer = this.tblZslCustomer.Copy(deep, copiedObjects, true);
                    }
                    else
                    {
                        copy._tblZslCustomer = this._tblZslCustomer.Copy(deep, copiedObjects, false);
                    }
                }
                else
                {
                    if (asNew)
                    {
                        copy.tblZslCustomer = (tblZslCustomer)copiedObjects[this.tblZslCustomer];
                    }
                    else
                    {
                        copy._tblZslCustomer = (tblZslCustomer)copiedObjects[this.tblZslCustomer];
                    }
                }
            }
            if (deep && this._tblZslBookingType != null)
            {
                if (!copiedObjects.Contains(this._tblZslBookingType))
                {
                    if (asNew && reuseNestedObjects)
                    {
                        copy.tblZslBookingType = this.tblZslBookingType;
                    }
                    else if (asNew)
                    {
                        copy.tblZslBookingType = this.tblZslBookingType.Copy(deep, copiedObjects, true);
                    }
                    else
                    {
                        copy._tblZslBookingType = this._tblZslBookingType.Copy(deep, copiedObjects, false);
                    }
                }
                else
                {
                    if (asNew)
                    {
                        copy.tblZslBookingType = (tblZslBookingType)copiedObjects[this.tblZslBookingType];
                    }
                    else
                    {
                        copy._tblZslBookingType = (tblZslBookingType)copiedObjects[this.tblZslBookingType];
                    }
                }
            }
            if (deep && this._tblZslTransportOrder != null)
            {
                if (!copiedObjects.Contains(this._tblZslTransportOrder))
                {
                    if (asNew && reuseNestedObjects)
                    {
                        copy.tblZslTransportOrder = this.tblZslTransportOrder;
                    }
                    else if (asNew)
                    {
                        copy.tblZslTransportOrder = this.tblZslTransportOrder.Copy(deep, copiedObjects, true);
                    }
                    else
                    {
                        copy._tblZslTransportOrder = this._tblZslTransportOrder.Copy(deep, copiedObjects, false);
                    }
                }
                else
                {
                    if (asNew)
                    {
                        copy.tblZslTransportOrder = (tblZslTransportOrder)copiedObjects[this.tblZslTransportOrder];
                    }
                    else
                    {
                        copy._tblZslTransportOrder = (tblZslTransportOrder)copiedObjects[this.tblZslTransportOrder];
                    }
                }
            }
            return(copy);
        }