public EmployeeMonthWorkingTime(EmployeeTimeService timeservice)
        {
            if (timeservice == null)
                throw new ArgumentNullException();

            _timeservice = timeservice;
        }
        public List <EmployeeWeek> FillPlanningEmployeeWeeks(long storeid, long worldid, DateTime aBegin, DateTime aEnd)
        {
            if (_listweeks != null && _listweeks.Count > 0)
            {
                FillEmployeeWeeks(aBegin, aEnd, true);
//                EmployeeTimeService timeService = EmployeeService.EmployeeTimeService as EmployeeTimeService;

//                timeService.FillEmployeeWeeks(_listweeks, _employeeids, _dictionWeek, aBegin, aEnd, true);

                if (LoadWeeks)
                {
                    EmployeeTimeService timeService = EmployeeService.EmployeeTimeService as EmployeeTimeService;

                    EmployeeWeekTimePlanningService weekService = timeService.EmployeeWeekTimePlanningService as EmployeeWeekTimePlanningService;

                    List <EmployeeWeekTimePlanning> planningweeks = weekService.GetEmployeesWeekState(_employeeids, aBegin, aEnd);

                    if (planningweeks != null && planningweeks.Count > 0)
                    {
                        EmployeeWeek emplweek = null;
                        foreach (EmployeeWeekTimePlanning week in planningweeks)
                        {
                            if (_dictionWeek.TryGetValue(week.EmployeeID, out emplweek))
                            {
                                emplweek.NewWeek = false;

                                EmployeeWeekProcessor.Assign(week, emplweek);
                            }
                        }
                    }
                }
            }
            return(_listweeks);
        }
        public EmployeeMonthWorkingTime(EmployeeTimeService timeservice)
        {
            if (timeservice == null)
            {
                throw new ArgumentNullException();
            }

            _timeservice = timeservice;
        }
Exemple #4
0
        public int GetLastSaldoForPlanning(DateTime date)
        {
            EmployeeTimeService service = ServerEnvironment.EmployeeTimeService as EmployeeTimeService;
            int?saldo = service.GetEmployeeLastVerifiedSaldo(Employee.ID, date);

            if (!saldo.HasValue)
            {
                return(Convert.ToInt32(Employee.BalanceHours));
            }
            else
            {
                return(saldo.Value);
            }
        }
Exemple #5
0
        private static void TestServices()
        {
            RoleService.Init();
            UserService.Init();
            CountryService.Init();
            LanguageService.Init();
            AvgAmountService.Init();
            CountryAdditionalHourService.Init();
            ColouringService.Init();
            FeastService.Init();
            AbsenceService.Init();
            WorkingModelService.Init();
            YearlyWorkingDayService.Init();
            EmployeeService.Init();
            EmployeeRelationService.Init();
            EmployeeContractService.Init();
            LongTimeAbsenceService.Init();
            EmployeeLongTimeAbsenceService.Init();
            StoreService.Init();
            WGRService.Init();
            HWGRService.Init();
            WorldService.Init();
            StoreToWorldService.Init();
            WorldToHWGRService.Init();
            HwgrToWgrService.Init();
            StoreWorkingTimeService.Init();
            StoreAdditionalHourService.Init();
            BufferHoursService.Init();
            BenchmarkService.Init();
            TrendCorrectionService.Init();
            PersonMinMaxService.Init();
            RegionService.Init();

            AbsenceTimePlanningService.Init();
            AbsenceTimeRecordingService.Init();
            WorkingTimePlanningService.Init();
            WorkingTimeRecordingService.Init();
            EmployeeTimeService.Init();
            AvgWorkingDaysInWeekService.Init();
            EmployeeDayStatePlanningService.Init();
            EmployeeDayStateRecordingService.Init();
            EmployeeWeekTimePlanningService.Init();
            EmployeeWeekTimeRecordingService.Init();
            EmployeePlanningWorkingModelService.Init();
            EmployeeRecordingWorkingModelService.Init();
        }
        public StoreWeekCalculater(long storeid, DateTime abegin, DateTime aend, EmployeeTimeService timeservice)
        {
            _storeid   = storeid;
            _begindate = abegin;
            _enddate   = aend;

            _timeservice     = timeservice;
            _employeeservice = _timeservice.EmployeeService as EmployeeService;
            _storeservice    = _employeeservice.StoreService as StoreService;



            CountryId = _storeservice.GetCountryByStoreId(_storeid);

            _absencemanager           = new AbsenceManager(_storeservice.CountryService.AbsenceService);
            _absencemanager.CountryId = CountryId;

            _wmodelmanager           = new WorkingModelManagerNew(_storeservice.CountryService.WorkingModelService);
            _wmodelmanager.CountryId = CountryId;

            Init();
        }
        public List <EmployeeWeek> FillActualEmployeeWeeks(long storeid, long worldid, DateTime aBegin, DateTime aEnd)
        {
            if (_listweeks != null && _listweeks.Count > 0)
            {
                //EmployeeTimeService timeService = EmployeeService.EmployeeTimeService as EmployeeTimeService;
                //timeService.FillEmployeeWeeks(_listweeks, aBegin, aEnd, false);

                FillEmployeeWeeks(aBegin, aEnd, false);

                if (LoadWeeks)
                {
                    EmployeeTimeService timeService = EmployeeService.EmployeeTimeService as EmployeeTimeService;

                    EmployeeWeekTimeRecordingService weekService = timeService.EmployeeWeekTimeRecordingService as EmployeeWeekTimeRecordingService;

                    List <EmployeeWeekTimeRecording> weeks = weekService.GetEmployeesWeekState(_employeeids, aBegin, aEnd);

                    if (weeks != null && weeks.Count > 0)
                    {
                        EmployeeWeek emplweek = null;
                        foreach (EmployeeWeekTimeRecording week in weeks)
                        {
                            if (_dictionWeek.TryGetValue(week.EmployeeID, out emplweek))
                            {
                                emplweek.NewWeek = false;
                                //emplweek.CustomEdit = week.CustomEdit;
                                //if (week.CustomEdit)
                                //    emplweek.Saldo = week.Saldo;

                                EmployeeWeekProcessor.Assign(week, emplweek);
                            }
                        }
                    }
                }
            }
            return(_listweeks);
        }
        public StoreWeekCalculater(long storeid, DateTime abegin, DateTime aend, EmployeeTimeService timeservice)
        {
            _storeid = storeid;
            _begindate = abegin;
            _enddate = aend;

            _timeservice = timeservice;
            _employeeservice = _timeservice.EmployeeService as EmployeeService;
            _storeservice = _employeeservice.StoreService as StoreService;

            CountryId = _storeservice.GetCountryByStoreId(_storeid);

            _absencemanager = new AbsenceManager(_storeservice.CountryService.AbsenceService);
            _absencemanager.CountryId = CountryId;

            _wmodelmanager = new WorkingModelManagerNew(_storeservice.CountryService.WorkingModelService);
            _wmodelmanager.CountryId = CountryId;

            Init();
        }
 public SrvRecordingStoreWeekCalculator(long storeid, DateTime abegin, DateTime aend, EmployeeTimeService timeservice)
     : base(storeid, abegin, aend, timeservice)
 {
 }
Exemple #10
0
        public static void InitServices()
        {
            // when connection is lost, it seems old references are no longer valid
            _ImportParam.CountryService  = null;
            _ImportParam.EmployeeService = null;
            _ImportParam.RegionService   = null;
            _ImportParam.StoreService    = null;
            _UserService     = null;
            _CountryService  = null;
            _LanguageService = null;
            _EmployeeService = null;
            _StoreService    = null;
            _RegionService   = null;
            _AuthService     = null;
            _RoleService     = null;

            RoleService.Init();
            UserService.Init();
            CountryService.Init();
            LanguageService.Init();
            AvgAmountService.Init();
            CountryAdditionalHourService.Init();
            ColouringService.Init();
            FeastService.Init();
            AbsenceService.Init();
            WorkingModelService.Init();
            YearlyWorkingDayService.Init();
            EmployeeService.Init();
            EmployeeRelationService.Init();
            EmployeeAllInService.Init();
            EmployeeContractService.Init();
            LongTimeAbsenceService.Init();
            EmployeeLongTimeAbsenceService.Init();
            StoreService.Init();
            WGRService.Init();
            HWGRService.Init();
            WorldService.Init();
            StoreToWorldService.Init();
            WorldToHWGRService.Init();
            HwgrToWgrService.Init();
            StoreWorkingTimeService.Init();
            StoreAdditionalHourService.Init();
            BufferHoursService.Init();
            BufferHourAvailableService.Init();
            BenchmarkService.Init();
            TrendCorrectionService.Init();
            PersonMinMaxService.Init();
            RegionService.Init();

            AbsenceTimePlanningService.Init();
            AbsenceTimeRecordingService.Init();
            WorkingTimePlanningService.Init();
            WorkingTimeRecordingService.Init();
            EmployeeTimeService.Init();
            AvgWorkingDaysInWeekService.Init();
            EmployeeDayStatePlanningService.Init();
            EmployeeDayStateRecordingService.Init();
            EmployeeWeekTimePlanningService.Init();
            EmployeeWeekTimeRecordingService.Init();
            EmployeePlanningWorkingModelService.Init();
            EmployeeRecordingWorkingModelService.Init();
            EmployeeHolidaysInfoService.Init();

            _ImportParam.CountryService  = CountryService;
            _ImportParam.EmployeeService = EmployeeService;
            _ImportParam.RegionService   = RegionService;
            _ImportParam.StoreService    = StoreService;
        }
 public SrvRecordingStoreWeekCalculator(long storeid, DateTime abegin, DateTime aend, EmployeeTimeService timeservice)
     : base(storeid, abegin, aend, timeservice)
 {
 }