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 tblZslWorker_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _zanardobo_worker_tblzslworker = new DSS3_LogisticsPoolingForUrbanDistribution.BO.tblZslWorker
            {
                WorkerFullName = "tblZslWorker_WorkerFullName",
            };

            new PersistenceSpecification <DSS3_LogisticsPoolingForUrbanDistribution.BO.tblZslWorker>(Session)
            .CheckProperty(p => p.WorkerFullName, "tblZslWorker_WorkerFullName")
            .CheckReference(p => p.Worker, _zanardobo_worker_tblzslworker)
            .VerifyTheMappings();
        }
Esempio n. 3
0
        public void tblZslTransportEvent_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _zanardobo_tblzslcustomer_tblzsltransportevent = new DSS3_LogisticsPoolingForUrbanDistribution.BO.tblZslCustomer
            {
                CustomerFullName = "tblZslCustomer_CustomerFullName",
            };
            var _zanardobo_tblzslworker_tblzsltransportevent = new DSS3_LogisticsPoolingForUrbanDistribution.BO.tblZslWorker
            {
                WorkerFullName = "tblZslWorker_WorkerFullName",
            };

            new PersistenceSpecification <DSS3_LogisticsPoolingForUrbanDistribution.BO.tblZslTransportEvent>(Session)
            .CheckProperty(p => p.EventDesc, "tblZslTransportEvent_EventDesc")
            .CheckProperty(p => p.EventTime, now)
            .CheckReference(p => p.tblZslCustomer, _zanardobo_tblzslcustomer_tblzsltransportevent)
            .CheckReference(p => p.tblZslWorker, _zanardobo_tblzslworker_tblzsltransportevent)
            .VerifyTheMappings();
        }
Esempio n. 4
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(tblZslWorker compareTo)
        {
            return(!this.IsTransient() && !compareTo.IsTransient() && this.Id.Equals(compareTo.Id));
        }
Esempio n. 5
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 [tblZslWorker] instance to use as the destination.</param>
/// <returns>A copy of the object</returns>
        public virtual tblZslWorker Copy(bool deep = false, Hashtable copiedObjects = null, bool asNew = false, bool reuseNestedObjects = false, tblZslWorker copy = null)
        {
            if (copiedObjects == null)
            {
                copiedObjects = new Hashtable();
            }
            if (copy == null && copiedObjects.Contains(this))
            {
                return((tblZslWorker)copiedObjects[this]);
            }
            copy = copy ?? new tblZslWorker();
            if (!asNew)
            {
                copy.TransientId = this.TransientId;
                copy.Id          = this.Id;
            }
            copy.WorkerFullName = this.WorkerFullName;
            if (!copiedObjects.Contains(this))
            {
                copiedObjects.Add(this, copy);
            }
            if (deep && this.worker != null)
            {
                if (!copiedObjects.Contains(this.worker))
                {
                    if (asNew && reuseNestedObjects)
                    {
                        copy.Worker = this.Worker;
                    }
                    else if (asNew)
                    {
                        copy.Worker = this.Worker.Copy(deep, copiedObjects, true);
                    }
                    else
                    {
                        copy.worker = this.worker.Copy(deep, copiedObjects, false);
                    }
                }
                else
                {
                    if (asNew)
                    {
                        copy.Worker = (tblZslWorker)copiedObjects[this.Worker];
                    }
                    else
                    {
                        copy.worker = (tblZslWorker)copiedObjects[this.Worker];
                    }
                }
            }
            return(copy);
        }