Ejemplo n.º 1
0
        public static IEnumerable <ResultPack> EvaluateConcept(ConfigBase evalConfig, Period evalPeriod, IPeriodProfile evalProfile,
                                                               Result <MasterItem.EvaluateSource, string> prepValues)
        {
            IEmployProfile conceptProfile = evalProfile.Employ();

            if (conceptProfile == null)
            {
                return(EvaluateUtils.DecoratedError(CONCEPT_DESCRIPTION_ERROR_FORMAT, CONCEPT_PROFILE_NULL_TEXT));
            }

            MasterItem.EvaluateSource conceptValues = prepValues.Value;
            // EVALUATION
            TSeconds[] scheduleRealMonth = conceptValues.RealMonthHours.ToArray();
            TSeconds[] scheduleTermMonth = conceptProfile.TimesheetWorkSchedule(evalPeriod, scheduleRealMonth, conceptValues.DayTermFrom, conceptValues.DayTermStop);
            // EVALUATION

            IArticleResult conceptResult = new ArticleGeneralResult(evalConfig);

            // SET RESULT VALUES
            conceptResult.AddWorkMonthRealScheduleValue(scheduleRealMonth);
            conceptResult.AddWorkMonthTermScheduleValue(scheduleTermMonth);
            // SET RESULT VALUES

            return(EvaluateUtils.Results(conceptResult));
        }
Ejemplo n.º 2
0
        public static IEnumerable <ResultPack> EvaluateConcept(ConfigBase evalConfig, Period evalPeriod, IPeriodProfile evalProfile,
                                                               Result <MasterItem.EvaluateSource, string> prepValues)
        {
            IEmployProfile conceptProfile = evalProfile.Employ();

            if (conceptProfile == null)
            {
                return(EvaluateUtils.DecoratedError(CONCEPT_DESCRIPTION_ERROR_FORMAT, CONCEPT_PROFILE_NULL_TEXT));
            }

            MasterItem.EvaluateSource conceptValues = prepValues.Value;
            // EVALUATION
            TSeconds[] contractMonth = PeriodUtils.EmptyMonthSchedule();
            TDay       periodDay     = 1;

            foreach (var position in conceptValues.PositionList)
            {
                contractMonth = PeriodUtils.ScheduleFromTemplateStopInc(contractMonth, position.ScheduleWorks, position.DayPeriodFrom, position.DayPeriodStop);

                periodDay = (TDay)(position.DayPeriodStop + 1);
            }
            // EVALUATION

            IArticleResult conceptResult = new ArticleGeneralResult(evalConfig);

            // SET RESULT VALUES
            conceptResult.AddWorkMonthRealScheduleValue(contractMonth);
            // SET RESULT VALUES

            return(EvaluateUtils.Results(conceptResult));
        }
Ejemplo n.º 3
0
        public static IEnumerable <ResultPack> EvaluateConcept(ConfigBase evalConfig, Period evalPeriod, IPeriodProfile evalProfile,
                                                               Result <MasterItem.EvaluateSource, string> prepValues)
        {
            IEmployProfile conceptProfile = evalProfile.Employ();

            if (conceptProfile == null)
            {
                return(EvaluateUtils.DecoratedError(CONCEPT_DESCRIPTION_ERROR_FORMAT, CONCEPT_PROFILE_NULL_TEXT));
            }

            MasterItem.EvaluateSource conceptValues = prepValues.Value;
            // EVALUATION
            TSeconds[] hoursFullWeeks = new TSeconds[0];
            TSeconds[] hoursRealWeeks = new TSeconds[0];
            TSeconds[] hoursFullMonth = new TSeconds[0];
            TSeconds[] hoursRealMonth = new TSeconds[0];

            if (conceptValues.ScheduleType == WorkScheduleType.SCHEDULE_NORMALY_WEEK)
            {
                hoursFullWeeks = conceptProfile.TimesheetWeekSchedule(evalPeriod, conceptValues.ShiftLiable, 5);
                hoursRealWeeks = conceptProfile.TimesheetWeekSchedule(evalPeriod, conceptValues.ShiftActual, 5);
                hoursFullMonth = conceptProfile.TimesheetFullSchedule(evalPeriod, hoursFullWeeks);
                hoursRealMonth = conceptProfile.TimesheetFullSchedule(evalPeriod, hoursRealWeeks);
            }
            else
            {
                return(EvaluateUtils.DecoratedErrors(CONCEPT_DESCRIPTION_ERROR_FORMAT, SCHEDULE_TYPE_NOTIMPLEMENTED_TEXT));
            }
            // EVALUATION

            IArticleResult conceptResult = new ArticleGeneralResult(evalConfig);

            // SET RESULT VALUES
            conceptResult.AddWorkWeeksFullScheduleValue(hoursFullWeeks);
            conceptResult.AddWorkWeeksRealScheduleValue(hoursRealWeeks);
            conceptResult.AddWorkMonthFullScheduleValue(hoursFullMonth);
            conceptResult.AddWorkMonthRealScheduleValue(hoursRealMonth);
            // SET RESULT VALUES

            return(EvaluateUtils.Results(conceptResult));
        }