Ejemplo n.º 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);

            InkoRetentionServiceHelper.UpdateRetentionAverageAndStv(result.TestSheetId);
            return(result);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     Saves or updates the InkoRetentionEditViewModel
        /// </summary>
        /// <param name="viewModel">The viewmodel which will be saved or updated</param>
        /// <returns>The saved or updated TestValue</returns>
        public TestValue Save(InkoRetentionEditViewModel viewModel)
        {
            TestValue testValue;

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