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>
/// 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 [tblZslTransportOrder] instance to use as the destination.</param>
/// <returns>A copy of the object</returns>
        public virtual tblZslTransportOrder Copy(bool deep = false, Hashtable copiedObjects = null, bool asNew = false, bool reuseNestedObjects = false, tblZslTransportOrder copy = null)
        {
            if (copiedObjects == null)
            {
                copiedObjects = new Hashtable();
            }
            if (copy == null && copiedObjects.Contains(this))
            {
                return((tblZslTransportOrder)copiedObjects[this]);
            }
            copy = copy ?? new tblZslTransportOrder();
            if (!asNew)
            {
                copy.TransientId = this.TransientId;
                copy.Id          = this.Id;
            }
            copy.TransportOrderNo      = this.TransportOrderNo;
            copy.OrderYear             = this.OrderYear;
            copy.DocumentTransportNo   = this.DocumentTransportNo;
            copy.OrderDate             = this.OrderDate;
            copy.DepartureCustomerName = this.DepartureCustomerName;
            copy.DepartureAddress      = this.DepartureAddress;
            copy.DepartureCity         = this.DepartureCity;
            copy.DepartureState        = this.DepartureState;
            copy.DestinationName       = this.DestinationName;
            copy.DestinationAddress    = this.DestinationAddress;
            copy.DestinationCity       = this.DestinationCity;
            copy.DestinationState      = this.DestinationState;
            copy.Qty                = this.Qty;
            copy.OrderWeight        = this.OrderWeight;
            copy.Volume             = this.Volume;
            copy.Pallet             = this.Pallet;
            copy.RetiredDate        = this.RetiredDate;
            copy.DeliveryDate       = this.DeliveryDate;
            copy.Note               = this.Note;
            copy.CallCustomerBefore = this.CallCustomerBefore;
            copy.Telephone          = this.Telephone;
            copy.DayClosed          = this.DayClosed;
            copy.Urgent             = this.Urgent;
            if (!copiedObjects.Contains(this))
            {
                copiedObjects.Add(this, copy);
            }
            if (deep && this.transportOrder != null)
            {
                if (!copiedObjects.Contains(this.transportOrder))
                {
                    if (asNew && reuseNestedObjects)
                    {
                        copy.TransportOrder = this.TransportOrder;
                    }
                    else if (asNew)
                    {
                        copy.TransportOrder = this.TransportOrder.Copy(deep, copiedObjects, true);
                    }
                    else
                    {
                        copy.transportOrder = this.transportOrder.Copy(deep, copiedObjects, false);
                    }
                }
                else
                {
                    if (asNew)
                    {
                        copy.TransportOrder = (tblZslTransportOrder)copiedObjects[this.TransportOrder];
                    }
                    else
                    {
                        copy.transportOrder = (tblZslTransportOrder)copiedObjects[this.TransportOrder];
                    }
                }
            }
            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];
                    }
                }
            }
            return(copy);
        }
/// <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(tblZslTransportOrder compareTo)
        {
            return(!this.IsTransient() && !compareTo.IsTransient() && this.Id.Equals(compareTo.Id));
        }
示例#4
0
        public void tblZslTransportOrder_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _zanardobo_transportorder_tblzsltransportorder = new DSS3_LogisticsPoolingForUrbanDistribution.BO.tblZslTransportOrder
            {
                TransportOrderNo      = "tblZslTransportOrder_TransportOrderNo",
                OrderYear             = 619,
                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                = 3600,
                OrderWeight        = 222222.22M,
                Volume             = 222222.22M,
                Pallet             = 8478,
                RetiredDate        = now,
                DeliveryDate       = now,
                Note               = "tblZslTransportOrder_Note",
                CallCustomerBefore = "tblZslTransportOrder_CallCustomerBefore",
                Telephone          = "tblZslTransportOrder_Telephone",
                DayClosed          = "tblZslTransportOrder_DayClosed",
                Urgent             = "tblZslTransportOrder_Urgent",
            };
            var _zanardobo_tblzslcustomer_tblzsltransportorder = new DSS3_LogisticsPoolingForUrbanDistribution.BO.tblZslCustomer
            {
                CustomerFullName = "tblZslCustomer_CustomerFullName",
            };

            new PersistenceSpecification <DSS3_LogisticsPoolingForUrbanDistribution.BO.tblZslTransportOrder>(Session)
            .CheckProperty(p => p.TransportOrderNo, "tblZslTransportOrder_TransportOrderNo")
            .CheckProperty(p => p.OrderYear, 2863)
            .CheckProperty(p => p.DocumentTransportNo, "tblZslTransportOrder_DocumentTransportNo")
            .CheckProperty(p => p.OrderDate, now)
            .CheckProperty(p => p.DepartureCustomerName, "tblZslTransportOrder_DepartureCustomerName")
            .CheckProperty(p => p.DepartureAddress, "tblZslTransportOrder_DepartureAddress")
            .CheckProperty(p => p.DepartureCity, "tblZslTransportOrder_DepartureCity")
            .CheckProperty(p => p.DepartureState, "tblZslTransportOrder_DepartureState")
            .CheckProperty(p => p.DestinationName, "tblZslTransportOrder_DestinationName")
            .CheckProperty(p => p.DestinationAddress, "tblZslTransportOrder_DestinationAddress")
            .CheckProperty(p => p.DestinationCity, "tblZslTransportOrder_DestinationCity")
            .CheckProperty(p => p.DestinationState, "tblZslTransportOrder_DestinationState")
            .CheckProperty(p => p.Qty, 8271)
            .CheckProperty(p => p.OrderWeight, 222222.22M)
            .CheckProperty(p => p.Volume, 222222.22M)
            .CheckProperty(p => p.Pallet, 6015)
            .CheckProperty(p => p.RetiredDate, now)
            .CheckProperty(p => p.DeliveryDate, now)
            .CheckProperty(p => p.Note, "tblZslTransportOrder_Note")
            .CheckProperty(p => p.CallCustomerBefore, "tblZslTransportOrder_CallCustomerBefore")
            .CheckProperty(p => p.Telephone, "tblZslTransportOrder_Telephone")
            .CheckProperty(p => p.DayClosed, "tblZslTransportOrder_DayClosed")
            .CheckProperty(p => p.Urgent, "tblZslTransportOrder_Urgent")
            .CheckReference(p => p.TransportOrder, _zanardobo_transportorder_tblzsltransportorder)
            .CheckReference(p => p.tblZslCustomer, _zanardobo_tblzslcustomer_tblzsltransportorder)
            .VerifyTheMappings();
        }