Skip to content

Commit

Permalink
MONAHRQ-57: Remove Red Border
Browse files Browse the repository at this point in the history
  • Loading branch information
ychiu authored and Chris Carlson committed Sep 14, 2017
1 parent 98c818f commit 956a762
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions Source/Libraries/Monahrq.Websites/ViewModels/MeasureModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -815,10 +815,21 @@ private void ValidateLess(string lowerName, string lowerValue, string upperName,
private void ValidateNumeric(string p, string value)
{
ClearErrors(p);
if (!IsNumeric(value))
if (p == "NumeratorOverride" || p == "DenominatorOverride")
{
SetError(p, "Please provide a valid numeric value.");
if (!String.IsNullOrEmpty(value) && !IsNumeric(value))
{
SetError(p, "Please provide a valid numeric value.");
}
}
else
{
if (!IsNumeric(value))
{
SetError(p, "Please provide a valid numeric value.");
}
}

}

private bool IsNumeric(string value)
Expand Down Expand Up @@ -1268,7 +1279,7 @@ public string NumeratorOverride

const string propertyName = "NumeratorOverride"; // ExtractPropertyName(() => NumeratorOverride);
ValidateNumeric(propertyName, value);
if (GetErrors(propertyName) == null)
if (GetErrors(propertyName) == null && !String.IsNullOrEmpty(value))
MeasureOverwrite.SuppressionNumerator = decimal.Parse(value);
}
}
Expand All @@ -1284,7 +1295,7 @@ public string DenominatorOverride

var propertyName = "DenominatorOverride"; // ExtractPropertyName(() => DenominatorOverride);
ValidateNumeric(propertyName, value);
if (GetErrors(propertyName) == null)
if (GetErrors(propertyName) == null && !String.IsNullOrEmpty(value))
MeasureOverwrite.SuppressionDenominator = decimal.Parse(value);
}
}
Expand Down

0 comments on commit 956a762

Please sign in to comment.