Exemplo n.º 1
0
        private ABOResult Getter(int count, bool getFull, int childPercent, int siblingPercent)
        {
            // limit the number of results
            if (count > 20000) count = 20000;
            count = count - 1;

            var results = new List<ABOResult>();
            NamesList names = new NamesList();

            ABOResult result = (getFull) ? new ABOFullResult() : new ABOResult();
            result.SetSampleData(names, 0);
            int index = 0;
            while (index < count) {
                this.Populate(result, count, ref index, getFull, names, childPercent, siblingPercent);
            }

            return result;
        }
Exemplo n.º 2
0
            public override void SetSampleData(NamesList names, int count)
            {
                base.SetSampleData(names, count);

                this.Volume = new VolumeContainer() {
                    BonusPeriod = 201410,
                    Results = new List<VolumeResult>() {
                        new VolumeResult() {
                            BV = 131.13,
                            PV = 140.11
                        }
                    }
                };
            }
Exemplo n.º 3
0
 public virtual void SetSampleData(NamesList names, int count)
 {
     this.Name = names.GetName();
     this.ID = "10000" + count.ToString();
     this.Aff = "US";
     this.IsActive = GetPercentage(90);
     this.IsConfidential = GetPercentage(10);
     this.IsInternational = GetPercentage(10);
     this.Entry = new DateTime(_random.Next(1950, 2010), _random.Next(1, 13), _random.Next(1, 28));
     this.GroupSize = 0;
 }
Exemplo n.º 4
0
        private void Populate(ABOResult parent, int count, ref int index, bool getFull, NamesList names, int childPercent, int siblingPercent)
        {
            if (index >= count) return;

            index++;

            ABOResult result = (getFull) ? new ABOFullResult() : new ABOResult();
            result.SetSampleData(names, index);
            if (parent.Children == null) parent.Children = new List<ABOResult>();
            parent.Children.Add(result);

            result.GroupSize = _random.Next(1, 25);

            bool makeChild = (((double)_random.Next(10000) / 10000) * 100) <= childPercent;
            bool makeSibling = (((double)_random.Next(10000) / 10000) * 100) <= siblingPercent;
            if (makeChild) {
                this.Populate(result, count, ref index, getFull, names, childPercent, siblingPercent);
            } else if (makeSibling) {
                this.Populate(parent, count, ref index, getFull, names, childPercent, siblingPercent);
            }
        }