diff options
| author | Lucas Faria Mendes <lucas.fariamo08@gmail.com> | 2026-03-30 17:17:46 +0000 |
|---|---|---|
| committer | Lucas Faria Mendes <lucas.fariamo08@gmail.com> | 2026-03-30 17:17:46 +0000 |
| commit | 0440c722a221b8068bbf388c1c0c51f0faff0451 (patch) | |
| tree | 169cbf90c50ff7961db82ecb606c50c2a45a1688 /Gestor.Common/Gestor.Common.Validation/ValidacaoValorMaiorQueZero.cs | |
| parent | 225aa1499e37faf9d38257caabbadc68d78b427e (diff) | |
| download | gestor-0440c722a221b8068bbf388c1c0c51f0faff0451.tar.gz gestor-0440c722a221b8068bbf388c1c0c51f0faff0451.zip | |
Diffstat (limited to 'Gestor.Common/Gestor.Common.Validation/ValidacaoValorMaiorQueZero.cs')
| -rw-r--r-- | Gestor.Common/Gestor.Common.Validation/ValidacaoValorMaiorQueZero.cs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Gestor.Common/Gestor.Common.Validation/ValidacaoValorMaiorQueZero.cs b/Gestor.Common/Gestor.Common.Validation/ValidacaoValorMaiorQueZero.cs new file mode 100644 index 0000000..c0a7459 --- /dev/null +++ b/Gestor.Common/Gestor.Common.Validation/ValidacaoValorMaiorQueZero.cs @@ -0,0 +1,24 @@ +using System.Globalization; +using System.Windows.Controls; + +namespace Gestor.Common.Validation; + +public class ValidacaoValorMaiorQueZero : ValidationRule +{ + public override ValidationResult Validate(object value, CultureInfo cultureInfo) + { + //IL_0052: Unknown result type (might be due to invalid IL or missing references) + //IL_0058: Expected O, but got Unknown + //IL_0046: Unknown result type (might be due to invalid IL or missing references) + //IL_004c: Expected O, but got Unknown + if (!string.IsNullOrWhiteSpace((value ?? "").ToString())) + { + if (!value.ToString().ValidateDouble() || (decimal)value < 0.01m) + { + return new ValidationResult(false, (object)"Valor Inválido"); + } + return ValidationResult.ValidResult; + } + return new ValidationResult(false, (object)"Obrigatório"); + } +} |