Example #1
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 #2
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 ---");
            }
        }