Exemplo n.º 1
0
        private void AddEmployeePlanningWeeks(StoreWorldWeekPlanningState worldweekstate, DateTime date)
        {
            ClearAll();
            _WorldWeekState = worldweekstate;
            _date           = date;
            if (WorldWeekState != null)
            {
                _DayWeeklyList = PlanningWeekProcessor.GetEmployeesByWorldAndDate(WorldWeekState.StoreWorldId, date, WorldWeekState.List);
                if (_DayWeeklyList != null)
                {
                    EmployeeDayView     dayView     = null;
                    EmployeePlanningDay dayPlanning = null;
                    foreach (EmployeePlanningWeek emplWeek in _DayWeeklyList)
                    {
                        if (emplWeek.Days.TryGetValue(date, out dayPlanning))
                        {
                            if (!dayPlanning.HasContract || dayPlanning.HasLongAbsence ||
                                !dayPlanning.HasRelation)
                            {
                                continue;
                            }


                            dayView = new EmployeeDayView(emplWeek.EmployeeId, date);
                            this[emplWeek.EmployeeId] = dayView;

                            dayView.SetEmployeePlanningDay(dayPlanning);
                            TotalWorkingHoursPerWeek += dayView.ContractHoursPerWeek;
                        }
                    }
                }
            }
            else
            {
                ClearAll();
            }
        }
Exemplo n.º 2
0
 public EmployeeDayViewList(StoreWorldWeekPlanningState state, DateTime date)
 {
     AddEmployeePlanningWeeks(state, date);
 }
Exemplo n.º 3
0
        public StoreWorldWeekPlanningState GetWorldPlanningState(long worldID)
        {
            StoreWorldWeekPlanningState result = new StoreWorldWeekPlanningState(worldID, StartDate, EndDate);
            result.IContext = this;

            List<EmployeePlanningWeek> worldEmployees = PlanningWeekProcessor.GetEmployeesByWorld(worldID, _storeEmployees);

            if (worldEmployees != null)
            {
                result.List.AddRange(worldEmployees);
            }

            return result;
        }