From 1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1 Mon Sep 17 00:00:00 2001 From: Lucas Faria Mendes Date: Mon, 30 Mar 2026 10:38:18 -0300 Subject: chore: location --- .../Model.Domain.Seguros/ControleSinistro.cs | 118 --------------------- 1 file changed, 118 deletions(-) delete mode 100644 Gestor.Model/Model.Domain.Seguros/ControleSinistro.cs (limited to 'Gestor.Model/Model.Domain.Seguros/ControleSinistro.cs') diff --git a/Gestor.Model/Model.Domain.Seguros/ControleSinistro.cs b/Gestor.Model/Model.Domain.Seguros/ControleSinistro.cs deleted file mode 100644 index 13207b6..0000000 --- a/Gestor.Model/Model.Domain.Seguros/ControleSinistro.cs +++ /dev/null @@ -1,118 +0,0 @@ -using Gestor.Model.Attributes; -using Gestor.Model.Domain.Generic; -using Gestor.Model.Helper; -using Gestor.Model.Resources; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Runtime.CompilerServices; - -namespace Gestor.Model.Domain.Seguros -{ - public class ControleSinistro : DomainBase, IDomain - { - private DateTime? _dataSinistro; - - private DateTime? _horaSinistro; - - [Description("DATA SINISTRO")] - [Log(true)] - [Name(true)] - public DateTime? DataSinistro - { - get - { - return this._dataSinistro; - } - set - { - if (!value.HasValue) - { - this._dataSinistro = null; - return; - } - if (!this.HoraSinistro.HasValue) - { - this.HoraSinistro = value; - } - object obj = value.Value; - DateTime? horaSinistro = this.HoraSinistro; - this._dataSinistro = new DateTime?(DateTime.Parse(string.Format("{0:d} {1:T}", obj, horaSinistro.Value))); - } - } - - public DateTime? HoraSinistro - { - get - { - return this._horaSinistro; - } - set - { - DateTime? nullable; - this._horaSinistro = value; - if (!value.HasValue) - { - return; - } - DateTime? dataSinistro = this.DataSinistro; - if (!dataSinistro.HasValue || !value.HasValue) - { - dataSinistro = null; - nullable = dataSinistro; - } - else - { - dataSinistro = this.DataSinistro; - nullable = new DateTime?(DateTime.Parse(string.Format("{0:d} {1:T}", dataSinistro.Value, value))); - } - this.DataSinistro = nullable; - } - } - - public Gestor.Model.Domain.Seguros.Item Item - { - get; - set; - } - - public List Sinistros - { - get; - set; - } - - [JsonIgnore] - public Func>> ValidationEvent - { - get - { - ControleSinistro controleSinistro = this; - return new Func>>(controleSinistro.Validate); - } - } - - public ControleSinistro() - { - } - - public List> Validate() - { - List> keyValuePairs = ValidationHelper.AddValue(); - if (!this.DataSinistro.HasValue) - { - keyValuePairs.AddValue("DataSinistro", Messages.Obrigatorio, true); - } - if (this.DataSinistro.HasValue && (DateTime.Compare(this.DataSinistro.Value, new DateTime(1753, 1, 1)) < 0 || DateTime.Compare(this.DataSinistro.Value, new DateTime(9999, 12, 31)) > 0)) - { - keyValuePairs.AddValue("DataSinistro", string.Format(Messages.DataInvalida, Array.Empty()), true); - } - if (this.HoraSinistro.HasValue && (DateTime.Compare(this.HoraSinistro.Value, new DateTime(1753, 1, 1)) < 0 || DateTime.Compare(this.HoraSinistro.Value, new DateTime(9999, 12, 31)) > 0)) - { - keyValuePairs.AddValue("HoraSinistro", string.Format(Messages.DataInvalida, Array.Empty()), true); - } - return keyValuePairs; - } - } -} \ No newline at end of file -- cgit v1.2.3