Exemplo n.º 1
0
        private BindingList <Activity> GenerateActivites()
        {
            BindingList <Activity> activities = new BindingList <Activity>();

            Source[] sources = (Source[])Enum.GetValues(typeof(Source));
            foreach (Source source in sources)
            {
                decimal actualInflow  = RandomDataGenerator.RandomDecimal(1500000, 6000000);
                decimal actualOutflow = RandomDataGenerator.RandomDecimal(1500000, 5500000);

                decimal projectedInflow  = RandomDataGenerator.RandomProjection(actualInflow);
                decimal projectedOutflow = RandomDataGenerator.RandomProjection(actualOutflow);

                Activity activity = new Activity(
                    source,
                    actualInflow,
                    actualOutflow,
                    projectedInflow,
                    projectedOutflow
                    );

                activities.Add(activity);
            }

            return(activities);
        }
Exemplo n.º 2
0
        public static decimal RandomDecimal(int minValue, int maxValue)
        {
            decimal dollars = RandomDataGenerator.RandomInt(minValue, maxValue);
            decimal cents   = RandomDataGenerator.RandomInt(0, 99);

            cents = cents / 100;

            return(dollars + cents);
        }