/// <summary>
        ///     Updates the Average and standard deviation values of the testsheet for retention values
        /// </summary>
        /// <param name="testSheetId">id of the test sheet</param>
        /// <returns>the updated test sheet</returns>
        public TestSheet UpdateRetentionAverageAndStv(Int32 testSheetId)
        {
            var testSheet        = TestBll.GetTestSheetInfo(testSheetId);
            var retentionTestAvg =
                testSheet.TestValues.FirstOrDefault(
                    tv =>
                    (tv.ArticleTestType == ArticleType.BabyDiaper) && (tv.BabyDiaperTestValue.TestType == TestTypeBabyDiaper.Retention) &&
                    (tv.TestValueType == TestValueType.Average));
            var retentionTestStDev =
                testSheet.TestValues.FirstOrDefault(
                    tv =>
                    (tv.ArticleTestType == ArticleType.BabyDiaper) && (tv.BabyDiaperTestValue.TestType == TestTypeBabyDiaper.Retention) &&
                    (tv.TestValueType == TestValueType.StandardDeviation));

            UpdateRetentionAvg(testSheet, retentionTestAvg);
            UpdateRetentionStDev(testSheet, retentionTestAvg, retentionTestStDev);
            TestBll.UpdateTestSheet();
            return(testSheet);
        }
Esempio n. 2
0
        /// <summary>
        ///     Updates the Average and standard deviation values of the testsheet for retention values
        /// </summary>
        /// <param name="testSheetId">id of the test sheet</param>
        /// <returns>the updated test sheet</returns>
        public TestSheet UpdateRetentionAverageAndStv(Int32 testSheetId)
        {
            var testSheet            = TestBll.GetTestSheetInfo(testSheetId);
            var inkoRetentionTestAvg =
                testSheet.TestValues.FirstOrDefault(
                    tv =>
                    (tv.ArticleTestType == ArticleType.IncontinencePad) &&
                    (tv.IncontinencePadTestValue.TestType == TestTypeIncontinencePad.Retention) &&
                    (tv.TestValueType == TestValueType.Average));
            var inkoRetentionTestStDev =
                testSheet.TestValues.FirstOrDefault(
                    tv =>
                    (tv.ArticleTestType == ArticleType.IncontinencePad) &&
                    (tv.IncontinencePadTestValue.TestType == TestTypeIncontinencePad.Retention) &&
                    (tv.TestValueType == TestValueType.StandardDeviation));

            UpdateInkoRetentionAvg(testSheet, inkoRetentionTestAvg);
            UpdateInkoRetentionStDev(testSheet, inkoRetentionTestAvg, inkoRetentionTestStDev);

            TestBll.UpdateTestSheet();
            return(testSheet);
        }