Refactored field validation; work on Add Person

This commit is contained in:
Rick Falkvinge
2014-12-08 12:58:14 +01:00
parent 24d75fa23b
commit 407d5ef795
13 changed files with 153 additions and 50 deletions
+2 -28
View File
@@ -58,34 +58,8 @@ public class FieldValidation : WebService
[WebMethod]
public bool IsAmountValid (string amount)
public bool IsDateValid (string input)
{
CultureInfo culture = GetUserCulture();
// Try to parse the string we got as a double
try
{
Double.Parse (HttpUtility.UrlDecode (amount), NumberStyles.Number, culture);
return true;
}
catch (Exception)
{
}
return false;
}
[WebMethod]
public bool AreDocumentsUploaded (string guidString)
{
Documents documents = Documents.RecentFromDescription (guidString);
if (documents.Count == 0)
{
return false;
}
return true;
}
}