public void AssignCashDeskInfo(CashDeskPlanningInfo cashdeskinfo, DateTime weekMondayDate)
        {
            CashDeskPlanningInfo CashDeskInfo = cashdeskinfo;

            if (CashDeskInfo != null)
            {
                DateTime sunday     = DateTimeHelper.GetSunday(weekMondayDate);
                DateTime index_date = DateTimeHelper.GetMonday(weekMondayDate);
                int      index      = 0;
                while (index_date <= sunday)
                {
                    index = (int)index_date.DayOfWeek;
                    DateCashDeskPeoplePerHour datecashdesk = cashdeskinfo.GetDayCashDeskData(index_date);
                    days_calculators[index] = new CashDeskDailyPlanningCalculator2();
                    days_calculators[index].AssignCashDeskInfo(cashdeskinfo, index_date);

                    if (datecashdesk != null)
                    {
                        TargetUnits[index] = datecashdesk.Calculate2(CashDeskInfo.CashDeskAmount, CashDeskInfo.MinimumPresence, CashDeskInfo.MaximumPresence);
                    }
                    else
                    {
                        TargetUnits[index] = 0;
                    }

                    index_date = index_date.AddDays(1);
                }
                TargetUnits.Calculate();
            }
            else
            {
                Clear();
            }
        }
        public void Calculate()
        {
            PlannedUnits.Calculate();
            TargetUnits.Calculate();

            DiffTargetPlannedPercent.DiffInPercent(TargetUnits, PlannedUnits);
        }
        public void Calculate()
        {
            PlannedUnits.Calculate();
            TargetUnits.Calculate();

            for (int i = 0; i < COUNTITEM; i++)
            {
                days_calculators[i].Calculate();
                DiffTargetPlannedPercent[i] = days_calculators[i].DifferenceTargetedPlannedPercent.AbsAverage;
            }
            DiffTargetPlannedPercent.Calculate();// DiffInPercent(TargetUnits, PlannedUnits);
        }
        public void AssignTargetedInfo(int[] unitsPerHour)
        {
            TargetedCashDeskUnits.Clear();
            double m = 60;

            if (unitsPerHour != null && unitsPerHour.Length == 24)
            {
                for (int i = 0; i < 24; i++)
                {
                    TargetedCashDeskUnits.Elements[i] = Math.Round(unitsPerHour[i] / m, 2);
                }
            }
            TargetedCashDeskUnits.Calculate();
            Calculate();
        }
        public void AssignCashDeskInfo(CashDeskPlanningInfo cashdeskinfo, DateTime date)
        {
            _CashDeskInfo = cashdeskinfo;

            TargetedCashDeskUnits.Clear();

            if (CashDeskInfo != null)
            {
                AvgCashDeskAmount = CashDeskInfo.CashDeskAmount;
                MinPercent        = CashDeskInfo.MinimumPresence;
                MaxPercent        = CashDeskInfo.MaximumPresence;

                DateCashDeskPeoplePerHour datecashdesk = CashDeskInfo.GetDayCashDeskData(date);
                TargetedCashDeskUnits = new DblArray50MinMax(24, MinPercent, MaxPercent);
                if (datecashdesk != null)
                {
                    //Random n = new Random(5000);

                    for (int i = 0; i < 24; i++)
                    {
                        if (AvgCashDeskAmount != 0)
                        {
                            //TargetedCashDeskUnits.Elements[i] = n.NextDouble () / AvgCashDeskAmount;
                            TargetedCashDeskUnits.Elements[i] = datecashdesk.GetReceipt(i) / AvgCashDeskAmount;

                            // _GetPeoplePerHour(datecashdesk.GetReceipt(i), AvgCashDeskAmount);
                        }
                        else
                        {
                            TargetedCashDeskUnits.Elements[i] = 0;
                        }
                    }
                }

                TargetedCashDeskUnits.Calculate();
            }
        }