public virtual void RemoveAgreementStatuses(AgreementStatus __item)
 {
     if (__item != null)
     {
         InternalRemoveAgreementStatuses(__item);
     }
 }
 public virtual void AddAgreementStatuses(AgreementStatus __item)
 {
     if (__item == null)
     {
         return;
     }
     InternalAddAgreementStatuses(__item);
 }
 public virtual void AddAtIndexAgreementStatuses(int index, AgreementStatus __item)
 {
     if (__item == null)
     {
         return;
     }
     agreementStatuses?.Insert(index, __item);
 }
 public virtual void InternalRemoveAgreementStatuses(AgreementStatus __item)
 {
     if (__item == null)
     {
         return;
     }
     agreementStatuses?.Remove(__item);
 }
 public virtual void InternalAddAgreementStatuses(AgreementStatus __item)
 {
     if (__item == null || disableInternalAdditions)
     {
         return;
     }
     agreementStatuses?.Add(__item);
 }
 public virtual void SetAgreementStatusesAt(AgreementStatus __item, int __index)
 {
     if (__item == null)
     {
         agreementStatuses[__index] = null;
     }
     else
     {
         agreementStatuses[__index] = __item;
     }
 }
        public void Agreement_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _agreement_agreementstatuses_agreement = new DSS1_RetailerDriverStockOptimisation.BO.AgreementStatus
            {
                IssuedBy           = "AgreementStatus_IssuedBy",
                Status             = "AgreementStatus_Status",
                DateIssued         = now,
                ApprovedBySonae    = true,
                ApprovedBySupplier = true,
                InProgress         = true,
                Active             = true,
                UnderRevision      = true,
            };
            var _agreement_agreementstatuses_agreement2 = new DSS1_RetailerDriverStockOptimisation.BO.AgreementStatus
            {
                IssuedBy           = "AgreementStatus_IssuedBy",
                Status             = "AgreementStatus_Status",
                DateIssued         = now,
                ApprovedBySonae    = true,
                ApprovedBySupplier = true,
                InProgress         = true,
                Active             = true,
                UnderRevision      = true,
            };
            var _agreement_items_agreements = new DSS1_RetailerDriverStockOptimisation.BO.Item
            {
                SKU              = "85c41988-a9ba-4eda-9414-d5e910f388a2Item_SKU",
                Description      = "Item_Description",
                UPC              = "Item_UPC",
                AvgDailyDemand   = 222222.22M,
                PalletSize       = 5412,
                SupplierPackSize = 2461,
                InnerPackSize    = 5128,
                PalletType       = "Item_PalletType",
                PalTI            = 965,
                PalHI            = 4274,
                UOM              = "Item_UOM",
            };
            var _agreement_items_agreements2 = new DSS1_RetailerDriverStockOptimisation.BO.Item
            {
                SKU              = "1111",
                Description      = "Item_Description",
                UPC              = "Item_UPC",
                AvgDailyDemand   = 222222.22M,
                PalletSize       = 2720,
                SupplierPackSize = 6994,
                InnerPackSize    = 6127,
                PalletType       = "Item_PalletType",
                PalTI            = 161,
                PalHI            = 6362,
                UOM              = "Item_UOM",
            };
            var _agreement_supplier_agreements = new DSS1_RetailerDriverStockOptimisation.BO.Supplier
            {
                Code = "Supplier_Code",
                Name = "Supplier_Name",
            };
            var _agreement_warehouses_agreements = new DSS1_RetailerDriverStockOptimisation.BO.Warehouse
            {
                Code        = "Warehouse_Code",
                Description = "Warehouse_Description",
                FlowType    = "Warehouse_FlowType",
            };
            var _agreement_warehouses_agreements2 = new DSS1_RetailerDriverStockOptimisation.BO.Warehouse
            {
                Code        = "Warehouse_Code",
                Description = "Warehouse_Description",
                FlowType    = "Warehouse_FlowType",
            };
            var _agreement_stockonhands_agreement = new DSS1_RetailerDriverStockOptimisation.BO.StockOnHand
            {
                Units = 3710,
                CurrentInventoryDays = 222222.22M,
                StockOnHandDate      = now,
                LeadTime             = "StockOnHand_LeadTime",
                TargetInventoryDays  = 222222.22M,
                FullTrackLoad        = true,
                WDDays = true,
            };
            var _agreement_stockonhands_agreement2 = new DSS1_RetailerDriverStockOptimisation.BO.StockOnHand
            {
                Units = 1751,
                CurrentInventoryDays = 222222.22M,
                StockOnHandDate      = now,
                LeadTime             = "StockOnHand_LeadTime",
                TargetInventoryDays  = 222222.22M,
                FullTrackLoad        = true,
                WDDays = true,
            };
            var _agreement_transportuncaps_agreement = new DSS1_RetailerDriverStockOptimisation.BO.TransportUnCap
            {
                UOP        = "TransportUnCap_UOP",
                PercRound  = 2222222222.22222M,
                Tuc1       = 2222222222.22222M,
                SplitOcInd = "TransportUnCap_SplitOcInd",
                Status     = "TransportUnCap_Status",
            };
            var _agreement_transportuncaps_agreement2 = new DSS1_RetailerDriverStockOptimisation.BO.TransportUnCap
            {
                UOP        = "TransportUnCap_UOP",
                PercRound  = 2222222222.22222M,
                Tuc1       = 2222222222.22222M,
                SplitOcInd = "TransportUnCap_SplitOcInd",
                Status     = "TransportUnCap_Status",
            };

            new PersistenceSpecification <DSS1_RetailerDriverStockOptimisation.BO.Agreement>(Session)
            .CheckProperty(p => p.FullTruckLoad, true)
            .CheckProperty(p => p.AgreementDocument, "Agreement_AgreementDocument")
            .CheckProperty(p => p.LeadTime, "Agreement_LeadTime")
            .CheckProperty(p => p.DateCreated, now)
            .CheckProperty(p => p.WDDeliveries, true)
            .CheckProperty(p => p.TargetInventoryDays, 6622)
            .CheckProperty(p => p.Profile, "Agreement_Profile")
            .CheckBag(p => p.AgreementStatuses, (new List <DSS1_RetailerDriverStockOptimisation.BO.AgreementStatus>
            {
                _agreement_agreementstatuses_agreement,
                _agreement_agreementstatuses_agreement2
            }))
            .CheckBag(p => p.Items, (new List <DSS1_RetailerDriverStockOptimisation.BO.Item>
            {
                _agreement_items_agreements,
                _agreement_items_agreements2
            }))
            .CheckReference(p => p.Supplier, _agreement_supplier_agreements)
            .CheckBag(p => p.Warehouses, (new List <DSS1_RetailerDriverStockOptimisation.BO.Warehouse>
            {
                _agreement_warehouses_agreements,
                _agreement_warehouses_agreements2
            }))
            .CheckBag(p => p.StockOnHands, (new List <DSS1_RetailerDriverStockOptimisation.BO.StockOnHand>
            {
                _agreement_stockonhands_agreement,
                _agreement_stockonhands_agreement2
            }))
            .CheckBag(p => p.TransportUnCaps, (new List <DSS1_RetailerDriverStockOptimisation.BO.TransportUnCap>
            {
                _agreement_transportuncaps_agreement,
                _agreement_transportuncaps_agreement2
            }))
            .VerifyTheMappings();
        }
Example #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(AgreementStatus compareTo)
        {
            return(!this.IsTransient() && !compareTo.IsTransient() && this.Id.Equals(compareTo.Id));
        }
Example #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 [AgreementStatus] instance to use as the destination.</param>
/// <returns>A copy of the object</returns>
        public virtual AgreementStatus Copy(bool deep = false, Hashtable copiedObjects = null, bool asNew = false, bool reuseNestedObjects = false, AgreementStatus copy = null)
        {
            if (copiedObjects == null)
            {
                copiedObjects = new Hashtable();
            }
            if (copy == null && copiedObjects.Contains(this))
            {
                return((AgreementStatus)copiedObjects[this]);
            }
            copy = copy ?? new AgreementStatus();
            if (!asNew)
            {
                copy.TransientId = this.TransientId;
                copy.Id          = this.Id;
            }
            copy.IssuedBy           = this.IssuedBy;
            copy.Status             = this.Status;
            copy.DateIssued         = this.DateIssued;
            copy.ApprovedBySonae    = this.ApprovedBySonae;
            copy.ApprovedBySupplier = this.ApprovedBySupplier;
            copy.InProgress         = this.InProgress;
            copy.Active             = this.Active;
            copy.UnderRevision      = this.UnderRevision;
            if (!copiedObjects.Contains(this))
            {
                copiedObjects.Add(this, copy);
            }
            return(copy);
        }