Example #1
0
        /// <summary>
        ///     deletes the testvalue
        /// </summary>
        /// <param name="testValueId">id of the testvalue</param>
        /// <returns>The deleted testvalue</returns>
        public TestValue Delete(Int32 testValueId)
        {
            var result = TestBll.DeleteTestValue(testValueId);

            InkoRewetServiceHelper.UpdateRewetAverageAndStv(result.TestSheetId);
            return(result);
        }
Example #2
0
        /// <summary>
        ///     Saves or updates the InkoRewetEditViewModel
        /// </summary>
        /// <param name="viewModel">The viewmodel which will be saved or updated</param>
        /// <returns>The saved or updated TestValue</returns>
        public TestValue Save(InkoRewetEditViewModel viewModel)
        {
            TestValue testValue;

            try
            {
                testValue = viewModel.TestValueId <= 0
                    ? InkoRewetServiceHelper.SaveNewRewetTest(viewModel)
                    : InkoRewetServiceHelper.UpdateRewetTest(viewModel);
                InkoRewetServiceHelper.UpdateRewetAverageAndStv(viewModel.TestSheetId);
            }
            catch (Exception e)
            {
                Logger.Error("Update oder Create new Test Value ist fehlgeschlagen: " + e.Message);
                testValue = null;
            }
            return(testValue);
        }