primera version estable

This commit is contained in:
2026-09-07 12:17:10 +02:00
parent a644c843f4
commit 160122ce5e
22 changed files with 1333 additions and 7 deletions

59
bdEmtusa/Utilidades.cs Normal file
View File

@@ -0,0 +1,59 @@
using bdEmtusa.db;
using bdEmtusa.dbcontext;
using Microsoft.VisualBasic;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.CompilerServices;
namespace bdEmtusa
{
public class Utilidades
{
public static string? VersionPrograma { get; set; }
// public static double PorcentajeIva { get; set; }
public static void GeneraNotificacion(tsUtilidades.TsNotificacionesClient.TipoNotificacionEnum Tipo, string Titulo, string? Cuerpo=null, Exception? ex=null, byte[]? FicheroImagen = null, [CallerMemberName] string? Caller = null)
{
try
{
string sMensaje = ((VersionPrograma != null ? "Versión Programa: " + VersionPrograma : "")
+ (Caller != null ? " Rutina: " + Caller : "")
+ (Cuerpo != null ? Cuerpo : Titulo)
).Trim();
if (ex != null)
{
string sStackTrace = "Tipo excepción: " + ex.ToString() + Constants.vbCrLf;
var exError = ex;
do
{
sStackTrace += exError.StackTrace + Constants.vbCrLf;
exError = exError.InnerException;
}
while (exError != null);
if (!string.IsNullOrEmpty(sStackTrace))
sMensaje += Constants.vbCrLf + "StackTrace: " + sStackTrace;
}
if (FicheroImagen is null)
{
tsUtilidades.TsNotificacionesClient.RegistrarAsync(Titulo, sMensaje, Tipo);
}
else
{
tsUtilidades.TsNotificacionesClient.RegistrarAsync(Titulo, sMensaje, Tipo, FicheroImagen);
}
}
catch (Exception ex2)
{
throw new Exception(ex2.Message, ex2);
}
}
}
}