diff options
| author | Lucas Faria Mendes <lucas.fariamo08@gmail.com> | 2026-03-30 13:38:18 +0000 |
|---|---|---|
| committer | Lucas Faria Mendes <lucas.fariamo08@gmail.com> | 2026-03-30 13:38:18 +0000 |
| commit | 1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1 (patch) | |
| tree | e1c3b20ea08f0cf71122a1e73f0d395f8fd83874 /Gestor.Application/Servicos/Ferramentas/ImpostoServico.cs | |
| parent | 674ca83ba9243a9e95a7568c797668dab6aee26a (diff) | |
| download | gestor-1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1.tar.gz gestor-1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1.zip | |
chore: location
Diffstat (limited to 'Gestor.Application/Servicos/Ferramentas/ImpostoServico.cs')
| -rw-r--r-- | Gestor.Application/Servicos/Ferramentas/ImpostoServico.cs | 171 |
1 files changed, 0 insertions, 171 deletions
diff --git a/Gestor.Application/Servicos/Ferramentas/ImpostoServico.cs b/Gestor.Application/Servicos/Ferramentas/ImpostoServico.cs deleted file mode 100644 index ac8cd9f..0000000 --- a/Gestor.Application/Servicos/Ferramentas/ImpostoServico.cs +++ /dev/null @@ -1,171 +0,0 @@ -using Gestor.Application.Helpers;
-using Gestor.Application.Servicos.Generic;
-using Gestor.Application.ViewModels;
-using Gestor.Infrastructure.Repository.Interface;
-using Gestor.Infrastructure.UnitOfWork.Generic;
-using Gestor.Infrastructure.UnitOfWork.Logic;
-using Gestor.Model.Common;
-using Gestor.Model.Domain.Common;
-using Gestor.Model.Domain.Ferramentas;
-using Gestor.Model.Domain.Generic;
-using Newtonsoft.Json;
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Linq;
-using System.Net;
-using System.Net.Sockets;
-using System.Runtime.CompilerServices;
-using System.Threading.Tasks;
-
-namespace Gestor.Application.Servicos.Ferramentas
-{
- public class ImpostoServico : BaseServico
- {
- public ImpostoServico()
- {
- }
-
- public async Task<List<Imposto>> Buscar(bool? ativo)
- {
- int num = 3;
- List<Imposto> impostos1 = await Task.Run<List<Imposto>>(() => {
- List<Imposto> impostos;
- while (num > 0)
- {
- try
- {
- using (UnitOfWork read = Instancia.Read)
- {
- impostos = read.get_ImpostoRepository().DefaultSelect(ativo);
- }
- }
- catch (Exception exception)
- {
- num = base.Registrar(exception, 317, num, ativo, true);
- continue;
- }
- return impostos;
- }
- return new List<Imposto>();
- });
- return impostos1;
- }
-
- public async Task<List<Imposto>> BuscarPorRamo(long id)
- {
- int num = 3;
- List<Imposto> impostos1 = await Task.Run<List<Imposto>>(() => {
- List<Imposto> impostos;
- while (num > 0)
- {
- try
- {
- using (UnitOfWork read = Instancia.Read)
- {
- impostos = read.get_ImpostoRepository().FindByRamo(id);
- }
- }
- catch (Exception exception)
- {
- num = base.Registrar(exception, 317, num, id, true);
- continue;
- }
- return impostos;
- }
- return new List<Imposto>();
- });
- return impostos1;
- }
-
- public async Task<List<Imposto>> BuscarPorSeguradora(long id)
- {
- int num = 3;
- List<Imposto> impostos1 = await Task.Run<List<Imposto>>(() => {
- List<Imposto> impostos;
- while (num > 0)
- {
- try
- {
- using (UnitOfWork read = Instancia.Read)
- {
- impostos = read.get_ImpostoRepository().FindBySeguradora(id);
- }
- }
- catch (Exception exception)
- {
- num = base.Registrar(exception, 317, num, id, true);
- continue;
- }
- return impostos;
- }
- return new List<Imposto>();
- });
- return impostos1;
- }
-
- public async Task<Imposto> Salvar(Imposto imposto)
- {
- int num = 3;
- Imposto imposto2 = await Task.Run<Imposto>(() => {
- Imposto imposto3;
- string str;
- while (num > 0)
- {
- this.Sucesso = true;
- try
- {
- using (UnitOfWork commited = Instancia.Commited)
- {
- TipoAcao tipoAcao = (imposto.get_Id() == 0 ? 0 : 1);
- Imposto imposto1 = (tipoAcao == null ? commited.get_ImpostoRepository().SaveOrUpdate(imposto) : commited.get_ImpostoRepository().Merge(imposto));
- IPHostEntry hostEntry = Dns.GetHostEntry(Dns.GetHostName());
- RegistroLog registroLog = new RegistroLog();
- registroLog.set_Acao(tipoAcao);
- registroLog.set_Usuario(Recursos.Usuario);
- registroLog.set_DataHora(Funcoes.GetNetworkTime());
- JsonSerializerSettings jsonSerializerSetting = new JsonSerializerSettings();
- jsonSerializerSetting.set_ReferenceLoopHandling(1);
- registroLog.set_Descricao(JsonConvert.SerializeObject(imposto1, jsonSerializerSetting));
- registroLog.set_EntidadeId(imposto1.get_Id());
- registroLog.set_Tela(56);
- registroLog.set_Versao(LoginViewModel.VersaoAtual);
- registroLog.set_NomeMaquina(Environment.MachineName);
- registroLog.set_UsuarioMaquina(Environment.UserName);
- IPAddress[] addressList = hostEntry.AddressList;
- Func<IPAddress, bool> u003cu003e9_31 = ImpostoServico.u003cu003ec.u003cu003e9__3_1;
- if (u003cu003e9_31 == null)
- {
- u003cu003e9_31 = (IPAddress ip) => ip.AddressFamily == AddressFamily.InterNetwork;
- ImpostoServico.u003cu003ec.u003cu003e9__3_1 = u003cu003e9_31;
- }
- IPAddress pAddress = ((IEnumerable<IPAddress>)addressList).FirstOrDefault<IPAddress>(u003cu003e9_31);
- if (pAddress != null)
- {
- str = pAddress.ToString();
- }
- else
- {
- str = null;
- }
- registroLog.set_Ip(str);
- base.SaveLog(registroLog, commited);
- commited.Commit();
- imposto3 = imposto1;
- }
- }
- catch (Exception exception1)
- {
- Exception exception = exception1;
- this.Sucesso = false;
- num = base.Registrar(exception, 318, num, imposto, false);
- continue;
- }
- return imposto3;
- }
- return imposto;
- });
- return imposto2;
- }
- }
-}
\ No newline at end of file |