From 0440c722a221b8068bbf388c1c0c51f0faff0451 Mon Sep 17 00:00:00 2001 From: Lucas Faria Mendes Date: Mon, 30 Mar 2026 14:17:46 -0300 Subject: some dlls --- .../CoberturaGranizo.cs | 74 ++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 Gestor.Model/Gestor.Model.Domain.Seguros/CoberturaGranizo.cs (limited to 'Gestor.Model/Gestor.Model.Domain.Seguros/CoberturaGranizo.cs') diff --git a/Gestor.Model/Gestor.Model.Domain.Seguros/CoberturaGranizo.cs b/Gestor.Model/Gestor.Model.Domain.Seguros/CoberturaGranizo.cs new file mode 100644 index 0000000..fe689b3 --- /dev/null +++ b/Gestor.Model/Gestor.Model.Domain.Seguros/CoberturaGranizo.cs @@ -0,0 +1,74 @@ +using System; +using System.Collections.Generic; +using Gestor.Model.Domain.Generic; +using Gestor.Model.Helper; +using Gestor.Model.Resources; +using Newtonsoft.Json; + +namespace Gestor.Model.Domain.Seguros; + +public class CoberturaGranizo : DomainBase, IDomain +{ + private string _variedade; + + private string _quadra; + + public Item Item { get; set; } + + public Granizo Granizo { get; set; } + + public string Variedade + { + get + { + return _variedade?.ToUpper(); + } + set + { + _variedade = value; + } + } + + public string Quadra + { + get + { + return _quadra?.ToUpper(); + } + set + { + _quadra = value; + } + } + + public decimal? Produtividade { get; set; } + + public decimal? Lmi { get; set; } + + public decimal? Premio { get; set; } + + public decimal? Area { get; set; } + + public DateTime? Plantio { get; set; } + + [JsonIgnore] + public Func>> ValidationEvent => Validate; + + public List> Validate() + { + List> list = ValidationHelper.AddValue(); + if (Plantio.HasValue && (DateTime.Compare(Plantio.Value, new DateTime(1753, 1, 1)) < 0 || DateTime.Compare(Plantio.Value, new DateTime(9999, 12, 31)) > 0)) + { + list.AddValue("Plantio", string.Format(Messages.DataInvalida)); + } + if (string.IsNullOrWhiteSpace(Variedade) && Variedade.Length > 60) + { + list.AddValue("Variedade", string.Format(Messages.MaiorQueLimite, 60)); + } + if (string.IsNullOrWhiteSpace(Quadra) && Quadra.Length > 30) + { + list.AddValue("Quadra", string.Format(Messages.MaiorQueLimite, 30)); + } + return list; + } +} -- cgit v1.2.3