summaryrefslogtreecommitdiff
path: root/Gestor.Common/Gestor.Common.Validation/ValidacaoDataPassadaObrigatoria.cs
blob: 456a6d8f719c5fab2f5c8b6d1504c1b851a3bdaa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using System.Globalization;
using System.Windows.Controls;

namespace Gestor.Common.Validation;

public class ValidacaoDataPassadaObrigatoria : ValidationRule
{
	public override ValidationResult Validate(object value, CultureInfo cultureInfo)
	{
		//IL_003b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0041: Expected O, but got Unknown
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Expected O, but got Unknown
		if (!string.IsNullOrWhiteSpace((value ?? "").ToString()))
		{
			if (value.ToString().ValidatePastDate())
			{
				return ValidationResult.ValidResult;
			}
			return new ValidationResult(false, (object)"Data Inválida");
		}
		return new ValidationResult(false, (object)"Obrigatório");
	}
}