From 5747a6ceac5ad4d2f361fb655d43858152641a2e Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 21 Feb 2025 11:01:42 -0700 Subject: [PATCH] =?UTF-8?q?--=20mejoras=20en=20visualizaci=C3=B3n=20de=20c?= =?UTF-8?q?orreo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TareasProgramadas/TareasReporteDiario.ashx | 47 ++++++++++------------ 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/TareasProgramadas/TareasReporteDiario.ashx b/TareasProgramadas/TareasReporteDiario.ashx index ab5d729b9..429c429fb 100644 --- a/TareasProgramadas/TareasReporteDiario.ashx +++ b/TareasProgramadas/TareasReporteDiario.ashx @@ -83,54 +83,53 @@ public class TareasReporteDairio : IHttpHandler private string ConvertDataTableToHtml(DataTable table) { StringBuilder html = new StringBuilder(); - - + string ColumnaTitulo = "Titulo"; html.Append(""); + if(table.Columns[0].ColumnName==ColumnaTitulo && table.Rows.Count > 0) html.AppendFormat(" ", table.Rows[0][ColumnaTitulo]); - - html.Append(""); + html.Append(""); foreach (DataColumn column in table.Columns) { - html.Append($""); + if (ColumnaTitulo != column.ColumnName) html.Append($""); } html.Append(""); - html.Append(""); foreach (DataRow row in table.Rows) { html.Append(""); foreach (DataColumn column in table.Columns) { - object value = row[column]; - string cellValue; - - - if (column.DataType == typeof(int) || column.DataType == typeof(decimal) || column.DataType == typeof(double) || column.DataType == typeof(float)) + if (ColumnaTitulo != column.ColumnName) { - if (value != DBNull.Value && decimal.TryParse(value.ToString(), out decimal numericValue)) + object value = row[column]; + string cellValue; + if (column.DataType == typeof(int) || column.DataType == typeof(decimal) || column.DataType == typeof(double) || column.DataType == typeof(float)) { - if (numericValue != 0) + if (value != DBNull.Value && decimal.TryParse(value.ToString(), out decimal numericValue)) { - cellValue = numericValue.ToString("N2"); + if (numericValue != 0) + { + cellValue = numericValue.ToString("N2"); + } + else + { + cellValue = "";//0.00 + } } else { cellValue = "";//0.00 } + html.Append($""); } else { - - cellValue = "";//0.00 + cellValue = value?.ToString() ?? string.Empty; + html.Append($""); } - html.Append($""); - } - else - { - cellValue = value?.ToString() ?? string.Empty; - html.Append($""); } + } html.Append(""); } @@ -180,15 +179,13 @@ public class TareasReporteDairio : IHttpHandler private void MandaCorreo(string Cuerpo, bool PrceosoOK) { - try { - List ListaArchivos = new List(); ClsSisMail Correo = new ClsSisMail(); //string Para = "julian@adssistemas.mx;rene.molina@adssistemas.mx;oscar.irigoyen@adssistemas.mx"; - string Para = "oscar.irigoyen@adssistemas.mx;rene.molina@adssistemas.mx"; + string Para = "rene.molina@adssistemas.mx"; // oscar.irigoyen@adssistemas.mx; string Asunto = PrceosoOK ? $"Reporte Diario":"Reporte Diario Error"; Asunto = $"{Asunto} {DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss")}";
{0}
{column.ColumnName}{column.ColumnName}
{cellValue}{cellValue}{cellValue}{cellValue}