Beispiel #1
0
        /// <summary>
        ///     Updates an given Testvalue from the view model
        /// </summary>
        /// <param name="viewModel">the data from the view</param>
        /// <returns>the updated test value</returns>
        public TestValue UpdateRetentionTest(InkoRetentionEditViewModel viewModel)
        {
            var testValue = TestBll.GetTestValue(viewModel.TestValueId);

            if (testValue.IsNull() || (testValue.ArticleTestType != ArticleType.IncontinencePad) ||
                (testValue.IncontinencePadTestValue.TestType != TestTypeIncontinencePad.Retention))
            {
                Logger.Error("Old Test not found in DB");
                return(null);
            }
            testValue.LastEditedDateTime         = DateTime.Now;
            testValue.LastEditedPerson           = viewModel.TestPerson;
            testValue.DayInYearOfArticleCreation = viewModel.ProductionCodeDay;
            testValue.IncontinencePadTestValue.IncontinencePadTime      = viewModel.ProductionCodeTime;
            testValue.IncontinencePadTestValue.ExpireMonth              = viewModel.ExpireMonth;
            testValue.IncontinencePadTestValue.ExpireYear               = viewModel.ExpireYear;
            testValue.IncontinencePadTestValue.RetentionWeight          = viewModel.InkoWeight;
            testValue.IncontinencePadTestValue.RetentionWetValue        = viewModel.InkoWeightWet;
            testValue.IncontinencePadTestValue.RetentionAfterZentrifuge = viewModel.InkoWeightAfterZentrifuge;
            testValue.IncontinencePadTestValue.TestType = TestTypeIncontinencePad.Retention;

            TestServiceHelper.UpdateNotes(viewModel.Notes, testValue);

            testValue.IncontinencePadTestValue = CalculateInkoRetentionValues(testValue.IncontinencePadTestValue, viewModel.TestSheetId);

            TestBll.UpdateTestValue(testValue);
            return(testValue);
        }
        /// <summary>
        ///     Updates an given Testvalue from the view model
        /// </summary>
        /// <param name="viewModel">the data from the view</param>
        /// <returns>the updated test value</returns>
        public TestValue UpdateAquisitionTest(InkoAquisitionEditViewModel viewModel)
        {
            var testValue = TestBll.GetTestValue(viewModel.TestValueId);

            if (testValue.IsNull() || (testValue.ArticleTestType != ArticleType.IncontinencePad) ||
                (testValue.IncontinencePadTestValue.TestType != TestTypeIncontinencePad.AcquisitionTimeAndRewet))
            {
                Logger.Error("Old Test not found in DB");
                return(null);
            }
            testValue.LastEditedDateTime         = DateTime.Now;
            testValue.LastEditedPerson           = viewModel.TestPerson;
            testValue.DayInYearOfArticleCreation = viewModel.ProductionCodeDay;
            testValue.IncontinencePadTestValue.IncontinencePadTime   = viewModel.ProductionCodeTime;
            testValue.IncontinencePadTestValue.ExpireMonth           = viewModel.ExpireMonth;
            testValue.IncontinencePadTestValue.ExpireYear            = viewModel.ExpireYear;
            testValue.IncontinencePadTestValue.AcquisitionTimeFirst  = viewModel.AquisitionAddition1;
            testValue.IncontinencePadTestValue.AcquisitionTimeSecond = viewModel.AquisitionAddition2;
            testValue.IncontinencePadTestValue.AcquisitionTimeThird  = viewModel.AquisitionAddition3;
            testValue.IncontinencePadTestValue.AcquisitionWeight     = viewModel.InkoWeight;
            testValue.IncontinencePadTestValue.RewetAfterAcquisitionTimeDryWeight = viewModel.FPDry;
            testValue.IncontinencePadTestValue.RewetAfterAcquisitionTimeWetWeight = viewModel.FPWet;
            testValue.IncontinencePadTestValue.TestType = TestTypeIncontinencePad.AcquisitionTimeAndRewet;

            TestServiceHelper.UpdateNotes(viewModel.Notes, testValue);

            testValue.IncontinencePadTestValue = CalculateInkoAquisitionValues(testValue.IncontinencePadTestValue, viewModel.TestSheetId);

            TestBll.UpdateTestValue(testValue);
            return(testValue);
        }
Beispiel #3
0
        /// <summary>
        ///     Updates an given Testvalue from the view model
        /// </summary>
        /// <param name="viewModel">the data from the view</param>
        /// <returns>the updated test value</returns>
        public TestValue UpdateRewetTest(BabyDiaperRewetEditViewModel viewModel)
        {
            var testValue = TestBll.GetTestValue(viewModel.TestValueId);

            if (testValue.IsNull() || (testValue.ArticleTestType != ArticleType.BabyDiaper) ||
                ((testValue.BabyDiaperTestValue.TestType != TestTypeBabyDiaper.Rewet) &&
                 (testValue.BabyDiaperTestValue.TestType != TestTypeBabyDiaper.RewetAndPenetrationTime)))
            {
                Logger.Error("Old Test not found in DB");
                return(null);
            }
            testValue.LastEditedDateTime                                = DateTime.Now;
            testValue.LastEditedPerson                                  = viewModel.TestPerson;
            testValue.DayInYearOfArticleCreation                        = viewModel.ProductionCodeDay;
            testValue.BabyDiaperTestValue.DiaperCreatedTime             = viewModel.ProductionCodeTime;
            testValue.BabyDiaperTestValue.WeightDiaperDry               = viewModel.DiaperWeight;
            testValue.BabyDiaperTestValue.Rewet140Value                 = viewModel.RewetAfter140;
            testValue.BabyDiaperTestValue.Rewet210Value                 = viewModel.RewetAfter210;
            testValue.BabyDiaperTestValue.StrikeTroughValue             = viewModel.StrikeThrough;
            testValue.BabyDiaperTestValue.DistributionOfTheStrikeTrough = viewModel.Distribution;
            if (viewModel.TestType == TestTypeBabyDiaper.RewetAndPenetrationTime)
            {
                testValue.BabyDiaperTestValue.PenetrationTimeAdditionFirst  = viewModel.PenetrationTime1;
                testValue.BabyDiaperTestValue.PenetrationTimeAdditionSecond = viewModel.PenetrationTime2;
                testValue.BabyDiaperTestValue.PenetrationTimeAdditionThird  = viewModel.PenetrationTime3;
                testValue.BabyDiaperTestValue.PenetrationTimeAdditionFourth = viewModel.PenetrationTime4;
            }
            else
            {
                testValue.BabyDiaperTestValue.PenetrationTimeAdditionFirst  = 0;
                testValue.BabyDiaperTestValue.PenetrationTimeAdditionSecond = 0;
                testValue.BabyDiaperTestValue.PenetrationTimeAdditionThird  = 0;
                testValue.BabyDiaperTestValue.PenetrationTimeAdditionFourth = 0;
            }
            testValue.BabyDiaperTestValue.TestType = viewModel.TestType;

            TestServiceHelper.UpdateNotes(viewModel.Notes, testValue);

            testValue.BabyDiaperTestValue = CalculateBabyDiaperRewetValues(testValue.BabyDiaperTestValue,
                                                                           viewModel.TestSheetId);

            TestBll.UpdateTestValue(testValue);
            return(testValue);
        }
        /// <summary>
        ///     Updates an given Testvalue from the view model
        /// </summary>
        /// <param name="viewModel">the data from the view</param>
        /// <returns>the updated test value</returns>
        public TestValue UpdateRetentionTest(BabyDiaperRetentionEditViewModel viewModel)
        {
            var testValue = TestBll.GetTestValue(viewModel.TestValueId);

            if (testValue.IsNull() || (testValue.ArticleTestType != ArticleType.BabyDiaper) || (testValue.BabyDiaperTestValue.TestType != TestTypeBabyDiaper.Retention))
            {
                Logger.Error("Old Test not found in DB");
                return(null);
            }
            testValue.LastEditedDateTime                     = DateTime.Now;
            testValue.LastEditedPerson                       = viewModel.TestPerson;
            testValue.DayInYearOfArticleCreation             = viewModel.ProductionCodeDay;
            testValue.BabyDiaperTestValue.DiaperCreatedTime  = viewModel.ProductionCodeTime;
            testValue.BabyDiaperTestValue.WeightDiaperDry    = viewModel.DiaperWeight;
            testValue.BabyDiaperTestValue.RetentionWetWeight = viewModel.WeightRetentionWet;

            TestServiceHelper.UpdateNotes(viewModel.Notes, testValue);

            testValue.BabyDiaperTestValue = CalculateBabyDiaperRetentionValues(testValue.BabyDiaperTestValue,
                                                                               viewModel.TestSheetId);

            TestBll.UpdateTestValue(testValue);
            return(testValue);
        }