示例#1
0
        public void tblZslBookingType_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _zanardobo_bookingtype_tblzslbookingtype = new DSS3_LogisticsPoolingForUrbanDistribution.BO.tblZslBookingType
            {
                BookingTypeName = "tblZslBookingType_BookingTypeName",
            };

            new PersistenceSpecification <DSS3_LogisticsPoolingForUrbanDistribution.BO.tblZslBookingType>(Session)
            .CheckProperty(p => p.BookingTypeName, "tblZslBookingType_BookingTypeName")
            .CheckReference(p => p.BookingType, _zanardobo_bookingtype_tblzslbookingtype)
            .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(tblZslBookingType 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 [tblZslBookingType] instance to use as the destination.</param>
/// <returns>A copy of the object</returns>
        public virtual tblZslBookingType Copy(bool deep = false, Hashtable copiedObjects = null, bool asNew = false, bool reuseNestedObjects = false, tblZslBookingType copy = null)
        {
            if (copiedObjects == null)
            {
                copiedObjects = new Hashtable();
            }
            if (copy == null && copiedObjects.Contains(this))
            {
                return((tblZslBookingType)copiedObjects[this]);
            }
            copy = copy ?? new tblZslBookingType();
            if (!asNew)
            {
                copy.TransientId = this.TransientId;
                copy.Id          = this.Id;
            }
            copy.BookingTypeName = this.BookingTypeName;
            if (!copiedObjects.Contains(this))
            {
                copiedObjects.Add(this, copy);
            }
            if (deep && this.bookingType != null)
            {
                if (!copiedObjects.Contains(this.bookingType))
                {
                    if (asNew && reuseNestedObjects)
                    {
                        copy.BookingType = this.BookingType;
                    }
                    else if (asNew)
                    {
                        copy.BookingType = this.BookingType.Copy(deep, copiedObjects, true);
                    }
                    else
                    {
                        copy.bookingType = this.bookingType.Copy(deep, copiedObjects, false);
                    }
                }
                else
                {
                    if (asNew)
                    {
                        copy.BookingType = (tblZslBookingType)copiedObjects[this.BookingType];
                    }
                    else
                    {
                        copy.bookingType = (tblZslBookingType)copiedObjects[this.BookingType];
                    }
                }
            }
            return(copy);
        }
        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();
        }