예제 #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
            TDay dayTermFrom = conceptProfile.DateFromInPeriod(evalPeriod, conceptValues.DateTermFrom);

            if (dayTermFrom < conceptValues.DayContractFrom)
            {
                dayTermFrom = conceptValues.DayContractFrom;
            }
            TDay dayTermStop = conceptProfile.DateStopInPeriod(evalPeriod, conceptValues.DateTermStop);

            if (dayTermStop > conceptValues.DayContractStop)
            {
                dayTermStop = conceptValues.DayContractStop;
            }
            // EVALUATION

            IArticleResult conceptResult = new ArticleGeneralResult(evalConfig);

            // SET RESULT VALUES
            conceptResult.AddPositionFromStop(conceptValues.DateTermFrom, conceptValues.DateTermStop, conceptValues.PositionType);
            conceptResult.AddMonthFromStop(dayTermFrom, dayTermStop);
            // SET RESULT VALUES

            return(EvaluateUtils.Results(conceptResult));
        }