Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/MacroStabilityOutwardsSectionResultRow.cs =================================================================== diff -u -r0212a34000a191d09b6c59274b26e7bfbfa01f4d -rb51d0436ee3fa6b8acb84d32be9a463a1411d4d9 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/MacroStabilityOutwardsSectionResultRow.cs (.../MacroStabilityOutwardsSectionResultRow.cs) (revision 0212a34000a191d09b6c59274b26e7bfbfa01f4d) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/MacroStabilityOutwardsSectionResultRow.cs (.../MacroStabilityOutwardsSectionResultRow.cs) (revision b51d0436ee3fa6b8acb84d32be9a463a1411d4d9) @@ -26,6 +26,7 @@ using Ringtoets.AssemblyTool.Data; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.Exceptions; +using Ringtoets.Common.Forms.Helpers; using Ringtoets.Common.Forms.TypeConverters; using Ringtoets.Common.Forms.Views; using Ringtoets.Common.Primitives; @@ -306,6 +307,12 @@ /// could not be created. private void Update() { + UpdateData(); + UpdateColumnDefinitionStates(); + } + + private void UpdateData() + { SimpleAssemblyCategoryGroup = MacroStabilityOutwardsFailureMechanismSectionResultAssemblyFactory.AssembleSimpleAssessment(SectionResult); DetailedAssemblyCategoryGroup = MacroStabilityOutwardsFailureMechanismSectionResultAssemblyFactory.AssembleDetailedAssembly( @@ -324,6 +331,55 @@ assessmentSection); } + private void UpdateColumnDefinitionStates() + { + bool simpleAssessmentSufficient = GetSimpleAssessmentSufficient(); + + SetColumnState(detailedAssessmentResultIndex, simpleAssessmentSufficient); + SetColumnState(detailedAssessmentProbabilityIndex, simpleAssessmentSufficient); + SetColumnState(tailorMadeAssessmentResultIndex, simpleAssessmentSufficient); + SetColumnState(tailorMadeAssessmentProbabilityIndex, simpleAssessmentSufficient); + } + + private void SetColumnState(int columnIndex, bool shouldDisable) + { + if (shouldDisable) + { + DisableColumn(columnIndex); + } + else + { + EnableColumn(columnIndex); + } + } + + private void EnableColumn(int index) + { + ColumnStateDefinitions[index].ReadOnly = false; + ColumnStateDefinitions[index].Style = CellStyle.Enabled; + } + + private void DisableColumn(int index) + { + ColumnStateDefinitions[index].ReadOnly = true; + ColumnStateDefinitions[index].Style = CellStyle.Disabled; + } + + private bool GetSimpleAssessmentSufficient() + { + return FailureMechanismResultViewHelper.SimpleAssessmentIsSufficient(SimpleAssessmentResult); + } + + private bool GetDetailedAssessmentResultIsNotProbability() + { + return DetailedAssessmentResult != DetailedAssessmentResultType.Probability; + } + + private bool GetTailorMadeAssessmentResultIsNotProbability() + { + return TailorMadeAssessmentResult != TailorMadeAssessmentProbabilityAndDetailedCalculationResultType.Probability; + } + /// /// Class holding the various construction parameters for . ///