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 --- Gestor.Model/Model.Domain.Seguros/Granizo.cs | 247 --------------------------- 1 file changed, 247 deletions(-) delete mode 100644 Gestor.Model/Model.Domain.Seguros/Granizo.cs (limited to 'Gestor.Model/Model.Domain.Seguros/Granizo.cs') diff --git a/Gestor.Model/Model.Domain.Seguros/Granizo.cs b/Gestor.Model/Model.Domain.Seguros/Granizo.cs deleted file mode 100644 index 8f6036c..0000000 --- a/Gestor.Model/Model.Domain.Seguros/Granizo.cs +++ /dev/null @@ -1,247 +0,0 @@ -using Gestor.Model.Domain.Generic; -using Gestor.Model.Helper; -using Gestor.Model.Resources; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Globalization; -using System.Runtime.CompilerServices; - -namespace Gestor.Model.Domain.Seguros -{ - public class Granizo : EnderecoBase, IDomain - { - private string _cultura; - - private string _sitio; - - private string _observacao; - - public string Area - { - get; - set; - } - - public string Cultura - { - get - { - string str = this._cultura; - if (str != null) - { - return str.ToUpper(); - } - return null; - } - set - { - this._cultura = value; - } - } - - public Gestor.Model.Domain.Seguros.Item Item - { - get; - set; - } - - public string Observacao - { - get - { - string str = this._observacao; - if (str != null) - { - return str.ToUpper(); - } - return null; - } - set - { - this._observacao = value; - } - } - - public string Sitio - { - get - { - string str = this._sitio; - if (str != null) - { - return str.ToUpper(); - } - return null; - } - set - { - this._sitio = value; - } - } - - public decimal? SubsidioEstadual - { - get; - set; - } - - public decimal? SubsidioFederal - { - get; - set; - } - - [JsonIgnore] - public Func>> ValidationEvent - { - get - { - Granizo granizo = this; - return new Func>>(granizo.Validate); - } - } - - public Granizo() - { - } - - public static List Log(Gestor.Model.Domain.Seguros.Item item) - { - decimal valueOrDefault; - string str; - string str1; - List tupleLists = new List(); - TupleList tupleList = new TupleList(); - ObservableCollection> observableCollection = new ObservableCollection>() - { - new Tuple("CEP", (string.IsNullOrWhiteSpace(item.Granizo.Cep) ? "" : item.Granizo.Cep), ""), - new Tuple("ENDEREÇO", (string.IsNullOrWhiteSpace(item.Granizo.Endereco) ? "" : item.Granizo.Endereco.ToUpper()), ""), - new Tuple("NÚMERO", (string.IsNullOrWhiteSpace(item.Granizo.Numero) ? "" : item.Granizo.Numero), ""), - new Tuple("COMPLEMENTO", (string.IsNullOrWhiteSpace(item.Granizo.Complemento) ? "" : item.Granizo.Complemento.ToUpper()), ""), - new Tuple("BAIRRO", (string.IsNullOrWhiteSpace(item.Granizo.Bairro) ? "" : item.Granizo.Bairro.ToUpper()), ""), - new Tuple("CIDADE", (string.IsNullOrWhiteSpace(item.Granizo.Cidade) ? "" : item.Granizo.Cidade.ToUpper()), ""), - new Tuple("ESTADO", (string.IsNullOrWhiteSpace(item.Granizo.Estado) ? "" : item.Granizo.Estado.ToUpper()), ""), - new Tuple("CULTURA", (string.IsNullOrWhiteSpace(item.Granizo.Cultura) ? "" : item.Granizo.Cultura.ToUpper()), ""), - new Tuple("SÍTIO", (string.IsNullOrWhiteSpace(item.Granizo.Sitio) ? "" : item.Granizo.Sitio.ToUpper()), "") - }; - decimal? subsidioFederal = item.Granizo.SubsidioFederal; - if (!subsidioFederal.HasValue) - { - str = ""; - } - else - { - subsidioFederal = item.Granizo.SubsidioFederal; - if (subsidioFederal.HasValue) - { - valueOrDefault = subsidioFederal.GetValueOrDefault(); - str = valueOrDefault.ToString("C", new CultureInfo("pt-BR", false)); - } - else - { - str = null; - } - } - observableCollection.Add(new Tuple("SUBSÍDIO FEDERAL", str, "")); - subsidioFederal = item.Granizo.SubsidioEstadual; - if (!subsidioFederal.HasValue) - { - str1 = ""; - } - else - { - subsidioFederal = item.Granizo.SubsidioEstadual; - if (subsidioFederal.HasValue) - { - valueOrDefault = subsidioFederal.GetValueOrDefault(); - str1 = valueOrDefault.ToString("C", new CultureInfo("pt-BR", false)); - } - else - { - str1 = null; - } - } - observableCollection.Add(new Tuple("SUBSÍDIO ESTADUAL", str1, "")); - observableCollection.Add(new Tuple("OBSERVAÇÕES", (string.IsNullOrWhiteSpace(item.Granizo.Observacao) ? "" : item.Granizo.Observacao.ToUpper()), "")); - tupleList.Tuples = observableCollection; - tupleLists.Add(tupleList); - List tupleLists1 = tupleLists; - ObservableCollection> observableCollection1 = new ObservableCollection>() - { - new Tuple("COBERTURAS$", "", "") - }; - foreach (Cobertura cobertura in item.Coberturas) - { - observableCollection1.Add(new Tuple(string.Format(" COBERTURA {0}$", item.Coberturas.IndexOf(cobertura) + 1), "", "")); - observableCollection1.Add(new Tuple(" OBSERVAÇÃO", (string.IsNullOrWhiteSpace(cobertura.Observacao) ? "" : cobertura.Observacao.ToUpper()), "")); - valueOrDefault = cobertura.Premio; - observableCollection1.Add(new Tuple(" PRÊMIO", valueOrDefault.ToString("C", new CultureInfo("pt-BR", false)), "")); - valueOrDefault = cobertura.Franquia; - observableCollection1.Add(new Tuple(" FRANQUIA", valueOrDefault.ToString("C", new CultureInfo("pt-BR", false)), "")); - valueOrDefault = cobertura.Lmi; - observableCollection1.Add(new Tuple(" L.M.I.", valueOrDefault.ToString("C", new CultureInfo("pt-BR", false)), "")); - } - tupleLists1.Add(new TupleList() - { - Tuples = observableCollection1 - }); - return tupleLists1; - } - - public List> Validate() - { - List> keyValuePairs = ValidationHelper.AddValue(); - if (string.IsNullOrWhiteSpace(base.Cep)) - { - keyValuePairs.AddValue("Cep", Messages.Obrigatorio, true); - } - else if (!base.Cep.ValidacaoCep()) - { - keyValuePairs.AddValue("Cep", Messages.Invalido, true); - } - if (string.IsNullOrWhiteSpace(this.Cultura)) - { - keyValuePairs.AddValue("Cultura", Messages.Obrigatorio, true); - } - if (!string.IsNullOrWhiteSpace(this.Cultura) && this.Cultura.Length > 60) - { - keyValuePairs.AddValue("Cultura", string.Format(Messages.MaiorQueLimite, 60), true); - } - if (string.IsNullOrWhiteSpace(this.Sitio)) - { - keyValuePairs.AddValue("Sitio", Messages.Obrigatorio, true); - } - if (!string.IsNullOrWhiteSpace(this.Sitio) && this.Sitio.Length > 100) - { - keyValuePairs.AddValue("Sitio", string.Format(Messages.MaiorQueLimite, 100), true); - } - if (string.IsNullOrWhiteSpace(base.Endereco)) - { - keyValuePairs.AddValue("Endereco", Messages.Obrigatorio, true); - } - if (string.IsNullOrWhiteSpace(base.Numero)) - { - keyValuePairs.AddValue("Numero", Messages.Obrigatorio, true); - } - if (string.IsNullOrWhiteSpace(base.Bairro)) - { - keyValuePairs.AddValue("Bairro", Messages.Obrigatorio, true); - } - if (string.IsNullOrWhiteSpace(base.Cidade)) - { - keyValuePairs.AddValue("Cidade", Messages.Obrigatorio, true); - } - if (string.IsNullOrWhiteSpace(base.Estado)) - { - keyValuePairs.AddValue("Estado", Messages.Obrigatorio, true); - } - else if (!base.Estado.ValidacaoEstado()) - { - keyValuePairs.AddValue("Estado", Messages.Invalido, true); - } - return keyValuePairs; - } - } -} \ No newline at end of file -- cgit v1.2.3