/// <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); InkoAquisitionServiceHelper.UpdateAquisitionAverageAndStv(result.TestSheetId); return(result); }
/// <summary> /// Saves or updates the InkoAquisitionEditViewModel /// </summary> /// <param name="viewModel">The viewmodel which will be saved or updated</param> /// <returns>The saved or updated TestValue</returns> public TestValue Save(InkoAquisitionEditViewModel viewModel) { TestValue testValue; try { testValue = viewModel.TestValueId <= 0 ? InkoAquisitionServiceHelper.SaveNewAquisitionTest(viewModel) : InkoAquisitionServiceHelper.UpdateAquisitionTest(viewModel); InkoAquisitionServiceHelper.UpdateAquisitionAverageAndStv(viewModel.TestSheetId); } catch (Exception e) { Logger.Error("Update oder Create new Test Value ist fehlgeschlagen: " + e.Message); testValue = null; } return(testValue); }