Example #1
0
        public static IBookResult CreateMonthlyAmountPaymentsResult(IPayrollConcept concept, IBookIndex element, IPayrollArticle article, ITargetValues targets,
                                                                    decimal factorValue, decimal amountValue, Int32 recordHours)
        {
            IResultValues results = ResultValueBuilder.BuildMonthlyAmountPaymentsResult(targets, factorValue, amountValue, recordHours);

            return(new BookResult(element, article, results, concept.TargetValues(), concept.ResultValues()));
        }
Example #2
0
        public static IBookResult[] BuildListWithCloneResult(IPayrollConcept concept, IBookIndex element, IPayrollArticle article, ITargetValues targets)
        {
            IBookResult result = BookResultBuilder.CreateCloneResult(concept, element, article, targets);

            IBookResult[] resultList = BuildListWithResult(result);

            return(resultList);
        }
Example #3
0
        public static IBookResult[] BuildPositionEmplTermResults(IPayrollConcept concept, IBookIndex element, IPayrollArticle article,
                                                                 ITargetValues targets, uint dayFromOrdinal, uint dayEndsOrdinal)
        {
            IBookResult result = BookResultBuilder.CreatePositionEmplTermResult(concept, element, article, targets, dayFromOrdinal, dayEndsOrdinal);

            IBookResult[] resultList = BuildListWithResult(result);

            return(resultList);
        }
Example #4
0
        public static IBookResult[] BuildTimesheetWorkingResult(IPayrollConcept concept, IBookIndex element, IPayrollArticle article,
                                                                ITargetValues targets, Int32[] timeTable)
        {
            IBookResult result = BookResultBuilder.CreateWorkTimetableResult(concept, element, article, targets, timeTable);

            IBookResult[] resultList = BuildListWithResult(result);

            return(resultList);
        }
Example #5
0
        public static IBookResult[] BuildTimehoursAbsenceResult(IPayrollConcept concept, IBookIndex element, IPayrollArticle article,
                                                                ITargetValues targets, Int32 timeValue)
        {
            IBookResult result = BookResultBuilder.CreateAbsenceCountResult(concept, element, article, targets, timeValue);

            IBookResult[] resultList = BuildListWithResult(result);

            return(resultList);
        }
Example #6
0
            public static IPayrollConcept FindConceptForCode(IDictionary <uint, IPayrollConcept> models, uint conceptCode)
            {
                IPayrollConcept baseInstance = null;

                if (models.ContainsKey(conceptCode))
                {
                    baseInstance = models[conceptCode];
                }
                return(baseInstance);
            }
Example #7
0
        public static IBookResult[] BuildSalaryBaseResult(IPayrollConcept concept, IBookIndex element, IPayrollArticle article,
                                                          ITargetValues targets, decimal factorValue, decimal amountValue, Int32 recordWorking)
        {
            IBookResult result = BookResultBuilder.CreateMonthlyAmountPaymentsResult(concept, element, article, targets,
                                                                                     factorValue, amountValue, recordWorking);

            IBookResult[] resultList = BuildListWithResult(result);

            return(resultList);
        }
Example #8
0
        public BookTarget(IBookIndex bookElement, IPayrollArticle bookArticle, IPayrollConcept bookConcept, ITargetValues bookValues)
        {
            __element = bookElement;

            __article = bookArticle;

            __concept = bookConcept;

            __values = bookValues;
        }
Example #9
0
        public static IBookResult[] BuildIncomeGrossResult(IPayrollConcept concept, IBookIndex element, IPayrollArticle article,
                                                           ITargetValues targets, decimal incomeValue)
        {
            IBookResult result = BookResultBuilder.CreateRecordIncomeResult(concept, element, article, targets,
                                                                            incomeValue);

            IBookResult[] resultList = BuildListWithResult(result);

            return(resultList);
        }
Example #10
0
        public IPayrollConcept ConfigureConcept(SymbolName concept,
                                                bool nodeContract, bool nodePosition, bool qualContract, bool qualPosition,
                                                string targetValues, string resultValues,
                                                GeneralModule.EvaluateDelegate evaluate)
        {
            IPayrollConcept conceptInstance = GeneralPayrollConcept.CreateConcept(
                concept, nodeContract, nodePosition, qualContract, qualPosition,
                targetValues, resultValues, evaluate);

            return(ConfigureModel(conceptInstance, concept.Code));
        }
        public void Should_Return_UnknownConcept_As_TypeOf()
        {
            SymbolName testSpecName = ConceptSymbolName.REF_UNKNOWN;

            Assembly configAssembly = typeof(ProcessConfigSetCzModule).Assembly;

            IPayrollConcept testConcept = PayrollConceptFactory.ConceptFor(configAssembly, testSpecName.Name);

            Type testTypeOfConcept = testConcept.GetType();

            Assert.AreSame(typeof(UnknownConcept), testTypeOfConcept);
        }
Example #12
0
        public void Should_Return_UnknownConcept_From_Models()
        {
            SymbolName testSpecName = ConceptSymbolName.REF_UNKNOWN;

            IPayrollConcept testConcept = testConfig.FindConcept(testSpecName.Code);

            Type testTypeOfConcept = testConcept.GetType();

            Assert.AreSame(typeof(UnknownConcept), testTypeOfConcept);

            Assert.AreEqual(testConcept.ConceptCode(), testSpecName.Code);
        }
Example #13
0
            static public IBookTarget BuildTargetFromElement(IBookIndex element, ITargetValues values, IProcessConfig config)
            {
                uint articleCode = element.Code();

                IPayrollArticle targetArticle = config.FindArticle(articleCode);

                IPayrollConcept targetConcept = config.FindConcept(targetArticle.ConceptCode());

                IBookTarget target = TargetFactory.BuildTargetWithValues(element, targetArticle, targetConcept, values);

                return(target);
            }
Example #14
0
            public static IDictionary <IBookIndex, IBookTarget> BuildEvaluationStream(IDictionary <IBookIndex, IBookTarget> initialStream,
                                                                                      IBookParty[] contracts, IBookParty[] positions, IPayrollArticle article, IProcessConfig configModule)
            {
                ITargetValues emptyValues = null;

                IPayrollConcept concept = configModule.FindConcept(article.ConceptCode());

                IBookParty[] parties = concept.GetTargetParties(BookParty.GetEmpty(), contracts, positions);

                var targets = parties.Aggregate(initialStream,
                                                (agr, party) => BuildArticleTarget(initialStream, party, article, emptyValues, configModule));

                return(targets);
            }
Example #15
0
            public static string LogConceptInfo(IPayrollConcept concept, IPayrollArticle article)
            {
                string calcDefinition = Enum.ToObject(typeof(ProcessCategory), article.Category()).ToString();

                string lineDefinition = string.Format("{0}\t{1}\t{2}\t", article.ArticleName(), concept.ConceptName(), calcDefinition);

                lineDefinition += LogPendingArticlesInfo(article);

                lineDefinition += LogSummaryArticlesInfo(article);

                lineDefinition += LogSpecValuesInfo(concept);

                return(lineDefinition);
            }
Example #16
0
        public void LogArticlesNames(IPayrollArticle[] articles, IDictionary <uint, IPayrollConcept> concepts, string testName)
        {
            OpenLogStream(testName);

            using (StreamWriter logWriter = new StreamWriter(LogFileStream))
            {
                string lineDefinition = "\n--- begin ---";

                foreach (var article in articles)
                {
                    lineDefinition += ModelConceptsLogger.LogArticleInfo(article);

                    IPayrollConcept concept = ModelConceptsLogger.FindConceptForCode(concepts, article.ConceptCode());

                    foreach (string target in concept.TargetValues())
                    {
                        lineDefinition += string.Format("{0} - {1}\n", "TARGET", target);
                    }
                    foreach (string result in concept.ResultValues())
                    {
                        lineDefinition += string.Format("{0} - {1}\n", "RESULT", result);
                    }
                }

                foreach (var article in articles)
                {
                    lineDefinition += ModelConceptsLogger.LogArticleEvalNames(article);
                }

                foreach (var article in articles)
                {
                    IPayrollConcept concept = ModelConceptsLogger.FindConceptForCode(concepts, article.ConceptCode());

                    if (concept.TargetValues().Length > 0)
                    {
                        lineDefinition += ModelConceptsLogger.LogArticleValuesNames(article);
                    }
                }

                if (lineDefinition.Length > 0)
                {
                    logWriter.WriteLine(lineDefinition);
                }
                logWriter.WriteLine("--- end ---");
            }
        }
Example #17
0
        public void LogConceptsInModels(IDictionary <uint, IPayrollArticle> articles, IDictionary <uint, IPayrollConcept> concepts, string testName)
        {
            Stream logStream = OpenCustomStream(testName);

            using (StreamWriter logWriter = new StreamWriter(logStream))
            {
                logWriter.WriteLine("\n--- begin ---");

                foreach (var articlePair in articles)
                {
                    IPayrollArticle article = articlePair.Value;

                    IPayrollConcept concept = ModelConceptsLogger.FindConceptForCode(concepts, article.ConceptCode());

                    string lineDefinition = ModelConceptsLogger.LogConceptNames(concept, article);

                    logWriter.WriteLine(lineDefinition);
                }

                logWriter.WriteLine("--- end ---");
            }
        }
Example #18
0
        public ITargetStream AddTargetIntoSubLevel(SymbolName article, ITargetValues values, IProcessConfig config)
        {
            uint articleCode = article.Code;

            IPayrollArticle targetArticle = config.FindArticle(articleCode);

            uint conceptCode = targetArticle.ConceptCode();

            IPayrollConcept targetConcept = config.FindConcept(conceptCode);

            IBookParty addParty = targetConcept.GetTargetParty(LastParty());

            var retTuple = TargetsTupleComposer.AddTargetBySymbol(Targets(),
                                                                  addParty, article, values, config);

            var nextFacts = retTuple.Item2;

            var nextIndex = retTuple.Item1;

            var nextParty = targetConcept.GetNextTargetParty(nextIndex);

            return(new TargetStream(nextFacts, nextParty, nextIndex));
        }
Example #19
0
        public static IBookResult CreateTimesheetScheduleResult(IPayrollConcept concept, IBookIndex element, IPayrollArticle article, ITargetValues targets, Int32[] timeTable)
        {
            IResultValues results = ResultValueBuilder.BuildTimesheetScheduleResult(targets, timeTable);

            return(new BookResult(element, article, results, concept.TargetValues(), concept.ResultValues()));
        }
Example #20
0
        public static IBookResult CreatePositionEmplTermResult(IPayrollConcept concept, IBookIndex element, IPayrollArticle article, ITargetValues targets, uint dayFromOrdinal, uint dayEndsOrdinal)
        {
            IResultValues results = ResultValueBuilder.BuildPositionEmplTermResult(targets, dayFromOrdinal, dayEndsOrdinal);

            return(new BookResult(element, article, results, concept.TargetValues(), concept.ResultValues()));
        }
Example #21
0
        public static IBookResult CreateCloneResult(IPayrollConcept concept, IBookIndex element, IPayrollArticle article, ITargetValues targets)
        {
            IResultValues results = ResultValueBuilder.BuildTargetResult(targets);

            return(new BookResult(element, article, results, concept.TargetValues(), concept.ResultValues()));
        }
Example #22
0
        public static IBookResult CreateAmountDeductedResult(IPayrollConcept concept, IBookIndex element, IPayrollArticle article, ITargetValues targets, decimal amountValue)
        {
            IResultValues results = ResultValueBuilder.BuildAmountDeductedResult(targets, amountValue);

            return(new BookResult(element, article, results, concept.TargetValues(), concept.ResultValues()));
        }
Example #23
0
 public static IBookTarget BuildTargetWithValues(IBookIndex element, IPayrollArticle article, IPayrollConcept concept, ITargetValues values)
 {
     return(new BookTarget(element, article, concept, values));
 }
Example #24
0
        public IPayrollConcept ArticleConceptFromModels(Assembly configAssembly, IPayrollArticle article)
        {
            IPayrollConcept baseConcept = ConceptFromModels(configAssembly, article.ConceptCode());

            return(baseConcept);
        }
Example #25
0
            public static string LogConceptNames(IPayrollConcept concept, IPayrollArticle article)
            {
                string lineDefinition = string.Format("\n{0}", PayrollArticleFactory.ClassNameFor(article.ArticleName()));

                return(lineDefinition);
            }
Example #26
0
        public static IBookResult CreateRecordTimeResult(IPayrollConcept concept, IBookIndex element, IPayrollArticle article, ITargetValues targets, Int32 timeValue)
        {
            IResultValues results = ResultValueBuilder.BuildRecordTimeResult(targets, timeValue);

            return(new BookResult(element, article, results, concept.TargetValues(), concept.ResultValues()));
        }
Example #27
0
        public IPayrollConcept FindConcept(uint conceptCode)
        {
            IPayrollConcept baseConcept = FindInstanceForCode(conceptCode);

            return(baseConcept);
        }
Example #28
0
        public IPayrollConcept ConceptFromModels(Assembly configAssembly, uint conceptCode)
        {
            IPayrollConcept baseConcept = InstanceFromModels(configAssembly, conceptCode);

            return(baseConcept);
        }
Example #29
0
        protected override IPayrollConcept InstanceFor(Assembly configAssembly, SymbolName configSymbol)
        {
            IPayrollConcept emptyConcept = PayrollConceptFactory.ConceptFor(configAssembly, configSymbol.Name);

            return(emptyConcept);
        }
Example #30
0
            public static string LogSpecValuesInfo(IPayrollConcept concept)
            {
                string lineDefinition = string.Join(", ", concept.TargetValues());

                return(lineDefinition);
            }