Skip to content

Commit

Permalink
Merge pull request #207 from avenueconsultants/Lat/LongBandaid
Browse files Browse the repository at this point in the history
Lat/long bandaid
  • Loading branch information
avetraffic authored Jan 24, 2023
2 parents 45827ca + 9b1e610 commit bafb345
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions MOE.Common/Models/Signal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,13 @@ public string SignalID
[Required]
[StringLength(30)]
[DataMember]
[RegularExpression(@"^-?([0-9]{1,2}|1[0-7][0-9]|180)(\.[0-9]{1,10})?$")]
public string Latitude { get; set; }

[Required]
[StringLength(30)]
[DataMember]
[RegularExpression(@"^-?([0-9]{1,2}|1[0-7][0-9]|180)(\.[0-9]{1,10})?$")]
public string Longitude { get; set; }

[Required]
Expand Down
4 changes: 4 additions & 0 deletions SPM/Controllers/SignalsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,10 @@ public ActionResult Edit(Signal signal)
}
return Content("Save Successful! " + DateTime.Now.ToString());
}
if (signal.Latitude.Contains("°") || signal.Longitude.Contains("°"))
{
return Content("Latitude/Longitude must be typed in decimal format. Do not include degree symbols or minute/second indicators.");
}
return Content("There was a validation error.");
}

Expand Down

0 comments on commit bafb345

Please sign in to comment.