Index: Riskeer/Common/src/Riskeer.Common.Forms/Views/CalculationsView.Designer.cs
===================================================================
diff -u -r949f796e9fe316104fedcf080748c10e80118a43 -r9821911d27e7995e4cfdc9b644bf1a21e6f49c1c
--- Riskeer/Common/src/Riskeer.Common.Forms/Views/CalculationsView.Designer.cs (.../CalculationsView.Designer.cs) (revision 949f796e9fe316104fedcf080748c10e80118a43)
+++ Riskeer/Common/src/Riskeer.Common.Forms/Views/CalculationsView.Designer.cs (.../CalculationsView.Designer.cs) (revision 9821911d27e7995e4cfdc9b644bf1a21e6f49c1c)
@@ -177,6 +177,11 @@
private Core.Common.Controls.DataGrid.DataGridViewControl dataGridViewControl;
private System.Windows.Forms.Button generateButton;
+ protected System.Windows.Forms.TableLayoutPanel DataGridTableLayoutPanel
+ {
+ get => this.dataGridTableLayoutPanel;
+ }
+
protected System.Windows.Forms.Button GenerateButton
{
get => this.generateButton;
Index: Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/Properties/Resources.Designer.cs
===================================================================
diff -u -rdc2c591a6e3796a05d1bbb7f9a4b3d64a977bc30 -r9821911d27e7995e4cfdc9b644bf1a21e6f49c1c
--- Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision dc2c591a6e3796a05d1bbb7f9a4b3d64a977bc30)
+++ Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 9821911d27e7995e4cfdc9b644bf1a21e6f49c1c)
@@ -1,4 +1,4 @@
-// Copyright (C) Stichting Deltares 2019. All rights reserved.
+// Copyright (C) Stichting Deltares 2019. All rights reserved.
//
// This file is part of Riskeer.
//
@@ -271,6 +271,16 @@
}
///
+ /// Looks up a localized string similar to Als u het dijkprofiel van een berekening wijzigt kan de berekening in een ander vak komen te liggen..
+ ///
+ public static string GrassCoverErosionInwardsCalculationsView_AddWarningMessage_Calculation_can_change_section_when_DikeProfile_is_changed {
+ get {
+ return ResourceManager.GetString("GrassCoverErosionInwardsCalculationsView_AddWarningMessage_Calculation_can_change" +
+ "_section_when_DikeProfile_is_changed", resourceCulture);
+ }
+ }
+
+ ///
/// Looks up a localized string similar to Selecteer dijkprofielen.
///
public static string GrassCoverErosionInwardsDikeProfileSelectionDialog_Select_DikeProfiles {
Index: Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/Properties/Resources.resx
===================================================================
diff -u -rba47735ba43eefc2a0d69d7cef9432614d05b7a6 -r9821911d27e7995e4cfdc9b644bf1a21e6f49c1c
--- Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/Properties/Resources.resx (.../Resources.resx) (revision ba47735ba43eefc2a0d69d7cef9432614d05b7a6)
+++ Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/Properties/Resources.resx (.../Resources.resx) (revision 9821911d27e7995e4cfdc9b644bf1a21e6f49c1c)
@@ -267,4 +267,7 @@
Standaardafwijking kritiek overslagdebiet [m3/m/s]
+
+ Als u het dijkprofiel van een berekening wijzigt kan de berekening in een ander vak komen te liggen.
+
\ No newline at end of file
Index: Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsCalculationsView.cs
===================================================================
diff -u -r8dbe77c4864b019630360007c972593b2e91a753 -r9821911d27e7995e4cfdc9b644bf1a21e6f49c1c
--- Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsCalculationsView.cs (.../GrassCoverErosionInwardsCalculationsView.cs) (revision 8dbe77c4864b019630360007c972593b2e91a753)
+++ Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsCalculationsView.cs (.../GrassCoverErosionInwardsCalculationsView.cs) (revision 9821911d27e7995e4cfdc9b644bf1a21e6f49c1c)
@@ -21,6 +21,7 @@
using System;
using System.Collections.Generic;
+using System.Drawing;
using System.Linq;
using System.Windows.Forms;
using Core.Common.Base;
@@ -59,6 +60,8 @@
public GrassCoverErosionInwardsCalculationsView(CalculationGroup data, GrassCoverErosionInwardsFailureMechanism failureMechanism, IAssessmentSection assessmentSection)
: base(data, failureMechanism, assessmentSection)
{
+ AddWarningMessage();
+
dikeProfilesObserver = new Observer(() =>
{
PrefillComboBoxListItemsAtColumnLevel();
@@ -191,6 +194,31 @@
#endregion
+ private void AddWarningMessage()
+ {
+ var warningPanel = new Panel();
+ var warningText = new Label();
+ var warningIcon = new PictureBox();
+
+ warningPanel.Controls.Add(warningText);
+ warningPanel.Controls.Add(warningIcon);
+ warningPanel.Dock = DockStyle.Fill;
+
+ warningIcon.Dock = DockStyle.Left;
+ warningIcon.Image = RiskeerCommonFormsResources.warning.ToBitmap();
+ warningIcon.Location = new Point(0, 0);
+ warningIcon.Size = new Size(20, 14);
+
+ warningText.Name = "warningText";
+ warningText.AutoSize = true;
+ warningText.Dock = DockStyle.Left;
+ warningText.Text = Resources.GrassCoverErosionInwardsCalculationsView_AddWarningMessage_Calculation_can_change_section_when_DikeProfile_is_changed;
+
+ DataGridTableLayoutPanel.RowCount = 2;
+ DataGridTableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 30));
+ DataGridTableLayoutPanel.Controls.Add(warningPanel, 0, 1);
+ }
+
#region Event handling
private void HandleCellStyling(object sender, DataGridViewCellFormattingEventArgs e)
Index: Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsCalculationsViewTest.cs
===================================================================
diff -u -r72b33880a86de98a6d4c49394fc5a71e94afd00b -r9821911d27e7995e4cfdc9b644bf1a21e6f49c1c
--- Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsCalculationsViewTest.cs (.../GrassCoverErosionInwardsCalculationsViewTest.cs) (revision 72b33880a86de98a6d4c49394fc5a71e94afd00b)
+++ Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsCalculationsViewTest.cs (.../GrassCoverErosionInwardsCalculationsViewTest.cs) (revision 9821911d27e7995e4cfdc9b644bf1a21e6f49c1c)
@@ -39,6 +39,7 @@
using Riskeer.Common.Data.FailureMechanism;
using Riskeer.Common.Data.Hydraulics;
using Riskeer.Common.Data.TestUtil;
+using Riskeer.Common.Forms.Views;
using Riskeer.GrassCoverErosionInwards.Data;
using Riskeer.GrassCoverErosionInwards.Data.TestUtil;
using Riskeer.GrassCoverErosionInwards.Forms.PresentationObjects;
@@ -64,22 +65,17 @@
[Test]
public void Constructor_ExpectedValues()
{
- // Setup
- var mocks = new MockRepository();
- var assessmentSection = mocks.Stub();
- mocks.ReplayAll();
-
- ConfigureHydraulicBoundaryDatabase(assessmentSection);
- GrassCoverErosionInwardsFailureMechanism failureMechanism = ConfigureFailureMechanism();
-
// Call
- var calculationsView = new GrassCoverErosionInwardsCalculationsView(ConfigureCalculationGroup(failureMechanism, assessmentSection), failureMechanism, assessmentSection);
+ GrassCoverErosionInwardsCalculationsView view = ShowCalculationsView(new CalculationGroup(), new GrassCoverErosionInwardsFailureMechanism(), new AssessmentSectionStub());
// Assert
- Assert.IsInstanceOf(calculationsView);
- Assert.IsInstanceOf(calculationsView);
- Assert.IsInstanceOf(calculationsView);
- mocks.VerifyAll();
+ Assert.IsInstanceOf>(view);
+
+ var button = (Button) new ControlTester("generateButton").TheObject;
+ Assert.AreEqual("Genereer &berekeningen...", button.Text);
+
+ var label = (Label) new ControlTester("warningText").TheObject;
+ Assert.AreEqual("Als u het dijkprofiel van een berekening wijzigt kan de berekening in een ander vak komen te liggen.", label.Text);
}
[Test]