Example #1
0
        public void Calculate(IWorkingModelManager wmmanager)
        {
            if (wmmanager != null)
            {
                foreach (EmployeeWeek epw in _listemployeesweek)
                {
                    wmmanager.CalculateNew(epw, PlannedWorld);
                }
            }
            CalculateDaysSum();

            if (StoreWorldInfo != null && (StoreWorldInfo is StoreWorldPlanningInfo))
            {
                (StoreWorldInfo as StoreWorldPlanningInfo).Calculate(GetSums());
            }
        }
        public TimePlanningReportContext(long countryID, long storeID, DateTime startDate, DateTime endDate)
        {
            _countryID = countryID;
            _storeID   = storeID;
            _startDate = startDate;
            _endDate   = endDate;

            _absences           = new AbsenceManager(ClientEnvironment.AbsenceService);
            _absences.CountryId = _countryID;

            _longAbsences           = new LongTimeAbsenceManager(ClientEnvironment.LongTimeAbsenceService);
            _longAbsences.CountryId = _countryID;

            _workingModels           = new WorkingModelManager(ClientEnvironment.WorkingModelService);
            _workingModels.CountryId = _countryID;

            _countryColors           = new CountryColorManager(ClientEnvironment.ColouringService);
            _countryColors.CountryId = _countryID;

            _storeDays = ClientEnvironment.StoreService.GetStoreDays(_storeID, StartDate, EndDate);

            _storeEmployees = ClientEnvironment.EmployeeService.GetTimePlannignEmployee2(_storeID, StartDate, EndDate);

            if (_storeEmployees != null)
            {
                foreach (EmployeePlanningWeek week in _storeEmployees)
                {
                    if (_storeDays.AvgDayInWeek == 0)
                    {
                        week.AvgDaysWeek = 5;
                    }
                    else
                    {
                        week.AvgDaysWeek = _storeDays.AvgDayInWeek;
                    }
                    week.InitWeekState();
                }
            }
            LoadWorkingAndAbsencesHours();
            ApplyStoreDays();
        }
        public TimePlanningReportContext(long countryID, long storeID, DateTime startDate, DateTime endDate)
        {
            _countryID = countryID;
            _storeID = storeID;
            _startDate = startDate;
            _endDate = endDate;

            _absences = new AbsenceManager(ClientEnvironment.AbsenceService);
            _absences.CountryId = _countryID;

            _longAbsences = new LongTimeAbsenceManager(ClientEnvironment.LongTimeAbsenceService);
            _longAbsences.CountryId = _countryID;

            _workingModels = new WorkingModelManager(ClientEnvironment.WorkingModelService);
            _workingModels.CountryId = _countryID;

            _countryColors = new CountryColorManager(ClientEnvironment.ColouringService);
            _countryColors.CountryId = _countryID;

            _storeDays = ClientEnvironment.StoreService.GetStoreDays(_storeID, StartDate, EndDate);

            _storeEmployees = ClientEnvironment.EmployeeService.GetTimePlannignEmployee2(_storeID, StartDate, EndDate);

            if (_storeEmployees != null)
            {
                foreach (EmployeePlanningWeek week in _storeEmployees)
                {
                    if (_storeDays.AvgDayInWeek == 0)
                        week.AvgDaysWeek = 5;
                    else
                        week.AvgDaysWeek = _storeDays.AvgDayInWeek;
                    week.InitWeekState();
                }
            }
            LoadWorkingAndAbsencesHours();
            ApplyStoreDays();
        }
Example #4
0
        public void Calculate(IWorkingModelManager wmmanager)
        {
            if (wmmanager != null)
            {
                foreach (EmployeeWeek epw in _listemployeesweek)
                {
                    wmmanager.CalculateNew(epw, PlannedWorld);
                }
            }
            CalculateDaysSum();

            if (StoreWorldInfo != null && (StoreWorldInfo is StoreWorldPlanningInfo))
            {
                (StoreWorldInfo as StoreWorldPlanningInfo).Calculate(GetSums());
            }
        }