public virtual void RemoveOrderForecastStatistics(OrderForecastStatistic __item)
 {
     if (__item != null)
     {
         InternalRemoveOrderForecastStatistics(__item);
     }
 }
        public void OrderFDashboard_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _orderforecastdashboard_orderforecaststatistics_dashboard = new DSS1_RetailerDriverStockOptimisation.BO.OrderForecastStatistic
            {
                Quantity           = 222222.22M,
                RoundQuantity      = 548,
                OrderDate          = now,
                OrderDateFormatted = "OrderForecastStatistic_OrderDateFormatted",
            };
            var _orderforecastdashboard_orderforecaststatistics_dashboard2 = new DSS1_RetailerDriverStockOptimisation.BO.OrderForecastStatistic
            {
                Quantity           = 222222.22M,
                RoundQuantity      = 4764,
                OrderDate          = now,
                OrderDateFormatted = "OrderForecastStatistic_OrderDateFormatted",
            };

            new PersistenceSpecification <DSS1_RetailerDriverStockOptimisation.BO.OrderFDashboard>(Session)
            .CheckBag(p => p.OrderForecastStatistics, (new List <DSS1_RetailerDriverStockOptimisation.BO.OrderForecastStatistic>
            {
                _orderforecastdashboard_orderforecaststatistics_dashboard,
                _orderforecastdashboard_orderforecaststatistics_dashboard2
            }))
            .VerifyTheMappings();
        }
 public virtual void AddAtIndexOrderForecastStatistics(int index, OrderForecastStatistic __item)
 {
     if (__item == null)
     {
         return;
     }
     orderForecastStatistics?.Insert(index, __item);
 }
 public virtual void AddOrderForecastStatistics(OrderForecastStatistic __item)
 {
     if (__item == null)
     {
         return;
     }
     InternalAddOrderForecastStatistics(__item);
 }
 public virtual void InternalRemoveOrderForecastStatistics(OrderForecastStatistic __item)
 {
     if (__item == null)
     {
         return;
     }
     orderForecastStatistics?.Remove(__item);
 }
 public virtual void InternalAddOrderForecastStatistics(OrderForecastStatistic __item)
 {
     if (__item == null || disableInternalAdditions)
     {
         return;
     }
     orderForecastStatistics?.Add(__item);
 }
 public virtual void SetOrderForecastStatisticsAt(OrderForecastStatistic __item, int __index)
 {
     if (__item == null)
     {
         orderForecastStatistics[__index] = null;
     }
     else
     {
         orderForecastStatistics[__index] = __item;
     }
 }
Exemple #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(OrderForecastStatistic compareTo)
        {
            return(!this.IsTransient() && !compareTo.IsTransient() && this.Id.Equals(compareTo.Id));
        }
Exemple #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 [OrderForecastStatistic] instance to use as the destination.</param>
/// <returns>A copy of the object</returns>
        public virtual OrderForecastStatistic Copy(bool deep = false, Hashtable copiedObjects = null, bool asNew = false, bool reuseNestedObjects = false, OrderForecastStatistic copy = null)
        {
            if (copiedObjects == null)
            {
                copiedObjects = new Hashtable();
            }
            if (copy == null && copiedObjects.Contains(this))
            {
                return((OrderForecastStatistic)copiedObjects[this]);
            }
            copy = copy ?? new OrderForecastStatistic();
            if (!asNew)
            {
                copy.TransientId = this.TransientId;
                copy.Id          = this.Id;
            }
            copy.Quantity           = this.Quantity;
            copy.RoundQuantity      = this.RoundQuantity;
            copy.OrderDate          = this.OrderDate;
            copy.OrderDateFormatted = this.OrderDateFormatted;
            if (!copiedObjects.Contains(this))
            {
                copiedObjects.Add(this, copy);
            }
            if (deep && this.item != null)
            {
                if (!copiedObjects.Contains(this.item))
                {
                    if (asNew && reuseNestedObjects)
                    {
                        copy.Item = this.Item;
                    }
                    else if (asNew)
                    {
                        copy.Item = this.Item.Copy(deep, copiedObjects, true);
                    }
                    else
                    {
                        copy.item = this.item.Copy(deep, copiedObjects, false);
                    }
                }
                else
                {
                    if (asNew)
                    {
                        copy.Item = (Item)copiedObjects[this.Item];
                    }
                    else
                    {
                        copy.item = (Item)copiedObjects[this.Item];
                    }
                }
            }
            if (deep && this.warehouse != null)
            {
                if (!copiedObjects.Contains(this.warehouse))
                {
                    if (asNew && reuseNestedObjects)
                    {
                        copy.Warehouse = this.Warehouse;
                    }
                    else if (asNew)
                    {
                        copy.Warehouse = this.Warehouse.Copy(deep, copiedObjects, true);
                    }
                    else
                    {
                        copy.warehouse = this.warehouse.Copy(deep, copiedObjects, false);
                    }
                }
                else
                {
                    if (asNew)
                    {
                        copy.Warehouse = (Warehouse)copiedObjects[this.Warehouse];
                    }
                    else
                    {
                        copy.warehouse = (Warehouse)copiedObjects[this.Warehouse];
                    }
                }
            }
            return(copy);
        }