diff options
Diffstat (limited to 'Decompiler/Gestor.Application.Helpers/ArquivoDigital.cs')
| -rw-r--r-- | Decompiler/Gestor.Application.Helpers/ArquivoDigital.cs | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Decompiler/Gestor.Application.Helpers/ArquivoDigital.cs b/Decompiler/Gestor.Application.Helpers/ArquivoDigital.cs new file mode 100644 index 0000000..4926944 --- /dev/null +++ b/Decompiler/Gestor.Application.Helpers/ArquivoDigital.cs @@ -0,0 +1,38 @@ +using ArquivoDigital.Infrastructure.UnitOfWork.Logic; +using Gestor.Application.Servicos.Generic; +using Gestor.Model.Domain.Common; + +namespace Gestor.Application.Helpers; + +public static class ArquivoDigital +{ + public static string ConexaoAd = null; + + public static UnitOfWork Commited => UnitOfWork(); + + public static UnitOfWork Read => UnitOfWork(withTransaction: false); + + public static string Banco { get; set; } + + public static string Tabela { get; set; } = "arquivodigital"; + + + private static UnitOfWork UnitOfWork(bool withTransaction = true, bool reconect = false) + { + //IL_001c: Unknown result type (might be due to invalid IL or missing references) + //IL_0022: Expected O, but got Unknown + if (ConexaoAd == null) + { + SetConnection(); + } + return new UnitOfWork(ConexaoAd, Tabela, withTransaction); + } + + public static void SetConnection(string banco = "") + { + ControleArquivoDigital val = (string.IsNullOrEmpty(banco) ? new BaseServico().ArquivoDigital().Result : new BaseServico().ArquivoDigital(banco).Result); + Banco = val.Catalogo; + Tabela = (string.IsNullOrWhiteSpace(val.Tabela) ? "arquivodigital" : val.Tabela); + ConexaoAd = "Server=" + Connection.Server + ";initial catalog=" + val.Catalogo + ";user=" + Connection.User + ";password=" + Connection.Password + ";"; + } +} |