diff options
| author | Lucas Faria Mendes <lucas.fariamo08@gmail.com> | 2026-03-30 13:35:25 +0000 |
|---|---|---|
| committer | Lucas Faria Mendes <lucas.fariamo08@gmail.com> | 2026-03-30 13:35:25 +0000 |
| commit | 674ca83ba9243a9e95a7568c797668dab6aee26a (patch) | |
| tree | 4a905b3fb1d827665a34d63f67bc5559f8e7235b /Gestor.Application/Helpers/Erro.cs | |
| download | gestor-674ca83ba9243a9e95a7568c797668dab6aee26a.tar.gz gestor-674ca83ba9243a9e95a7568c797668dab6aee26a.zip | |
feat: upload files
Diffstat (limited to 'Gestor.Application/Helpers/Erro.cs')
| -rw-r--r-- | Gestor.Application/Helpers/Erro.cs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Gestor.Application/Helpers/Erro.cs b/Gestor.Application/Helpers/Erro.cs new file mode 100644 index 0000000..52f70f5 --- /dev/null +++ b/Gestor.Application/Helpers/Erro.cs @@ -0,0 +1,24 @@ +using Gestor.Application.Views.Generic;
+using Gestor.Model.API;
+using System;
+using System.IO;
+using System.Runtime.CompilerServices;
+using System.Windows;
+using System.Windows.Threading;
+
+namespace Gestor.Application.Helpers
+{
+ public static class Erro
+ {
+ public static void RegistrarErro(LogError log, bool abrirTela = true)
+ {
+ string str = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Gestor.Exceptions.log");
+ File.AppendAllText(str, string.Format("CORRETORA: {1} - {2}{0} USUÁRIO LOGADO: {3}{0} VERSÃO: {4}{0} DATA: {5}{0} ERRO: {6} - {7}{0} HRESULT: {8}{0} HELPLINK: {9}{0} MESSAGE: {10}{0} SOURCE: {11}{0} STACKTRACE: {12}{0} MAQUINA: {13}{0} USUARIO MAQUINA: {14}{0} LINHA: {15}{0} OBJETO: {16}{0} {0}", new object[] { Environment.NewLine, log.get_IdFornecedor(), log.get_Fornecedor(), log.get_UsuarioLogado(), log.get_Versao(), log.get_Data(), log.get_IdErro(), log.get_Erro(), log.get_HResult(), log.get_HelpLink(), log.get_Message(), log.get_Source(), log.get_StackTrace(), log.get_Maquina(), log.get_UsuarioMaquina(), log.get_Linha(), log.get_Objeto() }));
+ if (!abrirTela)
+ {
+ return;
+ }
+ System.Windows.Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() => (new ErrorWindow(log.get_IdErro(), false)).ShowDialog()));
+ }
+ }
+}
\ No newline at end of file |