コード例 #1
0
 public virtual void RemoveBuyerStatistics(BuyerStatistic __item)
 {
     if (__item != null)
     {
         InternalRemoveBuyerStatistics(__item);
     }
 }
コード例 #2
0
 public virtual void AddAtIndexBuyerStatistics(int index, BuyerStatistic __item)
 {
     if (__item == null)
     {
         return;
     }
     buyerStatistics?.Insert(index, __item);
 }
コード例 #3
0
 public virtual void AddBuyerStatistics(BuyerStatistic __item)
 {
     if (__item == null)
     {
         return;
     }
     InternalAddBuyerStatistics(__item);
 }
コード例 #4
0
 public virtual void InternalRemoveBuyerStatistics(BuyerStatistic __item)
 {
     if (__item == null)
     {
         return;
     }
     buyerStatistics?.Remove(__item);
 }
コード例 #5
0
 public virtual void InternalAddBuyerStatistics(BuyerStatistic __item)
 {
     if (__item == null || disableInternalAdditions)
     {
         return;
     }
     buyerStatistics?.Add(__item);
 }
        public void Dashboard_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _dashboard_supplierstatistics_dashboard = new DSS5_SupplyChainFinancialsOptimisation.BO.SupplierStatistic
            {
                TotalCommercialAgreements = 1260,
                DataQuality         = 222222.22M,
                DataAvailability    = 5645,
                OnTimeDeliveries    = 6781,
                AsOrderedDeliveries = 4605,
                InFullDeliveries    = 8493,
                TotalImpeachments   = 987,
                CurrentTurnover     = 222222.22M,
                NextTurnover        = 222222.22M,
                PreviousTurnover    = 222222.22M,
                TotalTransactions   = 7577,
            };
            var _dashboard_supplierstatistics_dashboard2 = new DSS5_SupplyChainFinancialsOptimisation.BO.SupplierStatistic
            {
                TotalCommercialAgreements = 7297,
                DataQuality         = 222222.22M,
                DataAvailability    = 5038,
                OnTimeDeliveries    = 5309,
                AsOrderedDeliveries = 2321,
                InFullDeliveries    = 7733,
                TotalImpeachments   = 8072,
                CurrentTurnover     = 222222.22M,
                NextTurnover        = 222222.22M,
                PreviousTurnover    = 222222.22M,
                TotalTransactions   = 201,
            };
            var _dashboard_buyerstatistics_dashboard = new DSS5_SupplyChainFinancialsOptimisation.BO.BuyerStatistic
            {
            };
            var _dashboard_buyerstatistics_dashboard2 = new DSS5_SupplyChainFinancialsOptimisation.BO.BuyerStatistic
            {
            };

            new PersistenceSpecification <DSS5_SupplyChainFinancialsOptimisation.BO.Dashboard>(Session)
            .CheckBag(p => p.SupplierStatistics, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.SupplierStatistic>
            {
                _dashboard_supplierstatistics_dashboard,
                _dashboard_supplierstatistics_dashboard2
            }))
            .CheckBag(p => p.BuyerStatistics, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.BuyerStatistic>
            {
                _dashboard_buyerstatistics_dashboard,
                _dashboard_buyerstatistics_dashboard2
            }))
            .VerifyTheMappings();
        }
コード例 #7
0
 public virtual void SetBuyerStatisticsAt(BuyerStatistic __item, int __index)
 {
     if (__item == null)
     {
         buyerStatistics[__index] = null;
     }
     else
     {
         buyerStatistics[__index] = __item;
     }
 }
コード例 #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(BuyerStatistic compareTo)
        {
            return(!this.IsTransient() && !compareTo.IsTransient() && this.Id.Equals(compareTo.Id));
        }
コード例 #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 [BuyerStatistic] instance to use as the destination.</param>
/// <returns>A copy of the object</returns>
        public virtual BuyerStatistic Copy(bool deep = false, Hashtable copiedObjects = null, bool asNew = false, bool reuseNestedObjects = false, BuyerStatistic copy = null)
        {
            if (copiedObjects == null)
            {
                copiedObjects = new Hashtable();
            }
            if (copy == null && copiedObjects.Contains(this))
            {
                return((BuyerStatistic)copiedObjects[this]);
            }
            copy = copy ?? new BuyerStatistic();
            if (!asNew)
            {
                copy.TransientId = this.TransientId;
                copy.Id          = this.Id;
            }
            if (!copiedObjects.Contains(this))
            {
                copiedObjects.Add(this, copy);
            }
            if (deep && this.buyer != null)
            {
                if (!copiedObjects.Contains(this.buyer))
                {
                    if (asNew && reuseNestedObjects)
                    {
                        copy.Buyer = this.Buyer;
                    }
                    else if (asNew)
                    {
                        copy.Buyer = this.Buyer.Copy(deep, copiedObjects, true);
                    }
                    else
                    {
                        copy.buyer = this.buyer.Copy(deep, copiedObjects, false);
                    }
                }
                else
                {
                    if (asNew)
                    {
                        copy.Buyer = (Buyer)copiedObjects[this.Buyer];
                    }
                    else
                    {
                        copy.buyer = (Buyer)copiedObjects[this.Buyer];
                    }
                }
            }
            return(copy);
        }