diff --git a/Business/Data/Laboratorio/Item.cs b/Business/Data/Laboratorio/Item.cs index c7f10712..58cdca60 100644 --- a/Business/Data/Laboratorio/Item.cs +++ b/Business/Data/Laboratorio/Item.cs @@ -48,7 +48,6 @@ public sealed class Item : Business.BaseDataAccess private bool m_disponible; private bool m_codificahiv; private int m_multiplicador; - private int m_limiteturnosdia; private bool m_etiquetaadicional; private bool m_informable; private bool m_requierecaracter; @@ -93,7 +92,6 @@ public Item() m_codificahiv = false; m_disponible = true; m_multiplicador = 1; - m_limiteturnosdia = 0; m_etiquetaadicional = false; m_informable = true; m_requierecaracter = false; @@ -462,16 +460,7 @@ public int IdItemReferencia } - public int LimiteTurnosDia - { - get { return m_limiteturnosdia; } - set - { - m_isChanged |= (m_limiteturnosdia != value); - m_limiteturnosdia = value; - } - - } + /// diff --git a/Business/Data/Laboratorio/Item.hbm.xml b/Business/Data/Laboratorio/Item.hbm.xml index 2846683d..4b23e1c0 100644 --- a/Business/Data/Laboratorio/Item.hbm.xml +++ b/Business/Data/Laboratorio/Item.hbm.xml @@ -44,7 +44,6 @@ - diff --git a/Business/Data/Laboratorio/ItemEfector.cs b/Business/Data/Laboratorio/ItemEfector.cs index 9ae6ba06..7284a1e5 100644 --- a/Business/Data/Laboratorio/ItemEfector.cs +++ b/Business/Data/Laboratorio/ItemEfector.cs @@ -33,6 +33,7 @@ public sealed class ItemEfector : Business.BaseDataAccess private int m_idpresentacion; private String m_resultadoDefecto; + private int m_limiteturnosdia; #endregion @@ -44,8 +45,9 @@ public ItemEfector() { m_iditemEfector = 0; m_iditem = new Item(); - m_idefector = new Efector(); - + m_idefector = new Efector(); + m_limiteturnosdia = 0; + m_idefectorderivacion = new Efector(); m_disponible = true; @@ -249,10 +251,16 @@ public int IdPresentacionDefecto } - /// - /// - /// + public int LimiteTurnosDia + { + get { return m_limiteturnosdia; } + set + { + m_isChanged |= (m_limiteturnosdia != value); + m_limiteturnosdia = value; + } + } /// /// Returns whether or not the object has changed it's values. diff --git a/Business/Data/Laboratorio/ItemEfector.hbm.xml b/Business/Data/Laboratorio/ItemEfector.hbm.xml index 80a1d043..e23aa362 100644 --- a/Business/Data/Laboratorio/ItemEfector.hbm.xml +++ b/Business/Data/Laboratorio/ItemEfector.hbm.xml @@ -23,6 +23,7 @@ + diff --git a/Business/Utility.cs b/Business/Utility.cs index 5518d367..c619a0de 100644 --- a/Business/Utility.cs +++ b/Business/Utility.cs @@ -879,7 +879,7 @@ public void CargarRadioButton(RadioButtonList buttons, String strSql, String Cam #region Excel - public static void ExportDataTableToXlsx(DataTable dataTable, string filename) + public static void ExportDataTableToXlsx(DataTable dataTable, string filename, string header="") { //Version final 29/4/26 // ⚠️ Si usas EPPlus v5.x o superior, descomenta esta línea: @@ -890,26 +890,43 @@ public static void ExportDataTableToXlsx(DataTable dataTable, string filename) HttpResponse response = HttpContext.Current.Response; - // Color finalBackColor = ColorTranslator.FromHtml("#2b3e4c"); //azul-neuquen - // Color fontColor = Color.White + // Color finalBackColor = ColorTranslator.FromHtml("#2b3e4c"); //azul-neuquen + // Color fontColor = Color.White using (ExcelPackage package = new ExcelPackage()) { // Crear una nueva hoja de trabajo ExcelWorksheet worksheet = package.Workbook.Worksheets.Add(filename); + + int filaInicioTabla = string.IsNullOrWhiteSpace(header) ? 1 : 2; + // Cargar la DataTable en la hoja de trabajo. 'true' incluye los encabezados. - worksheet.Cells["A1"].LoadFromDataTable(dataTable, true); + worksheet.Cells[filaInicioTabla, 1].LoadFromDataTable(dataTable, true); int colCount = dataTable.Columns.Count; + // Header + if (!string.IsNullOrWhiteSpace(header)) + { + worksheet.Cells[1, 1].Value = header; + + // combinar columnas + worksheet.Cells[1, 1, 1, colCount+1].Merge = true; + + // estilo + worksheet.Cells[1, 1, 1, colCount].Style.Font.Bold = true; + worksheet.Cells[1, 1, 1, colCount].Style.Font.Size = 14; + worksheet.Cells[1, 1, 1, colCount].Style.HorizontalAlignment = ExcelHorizontalAlignment.Center; + } + // --- ENCABEZADOS --- for (int c = 0; c < colCount; c++) { - worksheet.Cells[1, c + 1].Value = dataTable.Columns[c].ColumnName; + worksheet.Cells[filaInicioTabla, c + 1].Value = dataTable.Columns[c].ColumnName; } // --- DATOS --- - int filaExcel = 2; + int filaExcel = filaInicioTabla +1 ; foreach (DataRow row in dataTable.Rows) { @@ -996,7 +1013,7 @@ out numero //int colCount = dataTable.Columns.Count; // Rango del encabezado: Desde A1 hasta el final de la primera fila - using (var range = worksheet.Cells[1, 1, 1, colCount]) + using (var range = worksheet.Cells[filaInicioTabla, 1, filaInicioTabla, colCount]) { ExcelEstilo(range); } @@ -1005,7 +1022,8 @@ out numero worksheet.Cells[worksheet.Dimension.Address].AutoFitColumns(); //Todas las celdas - var range2 = worksheet.Cells[1, 1, rowCount+1, colCount]; //row+1 asi cuenta la fila del encabezado. + int ultimaFila = rowCount + filaInicioTabla; + var range2 = worksheet.Cells[filaInicioTabla, 1, ultimaFila, colCount]; //row+1 asi cuenta la fila del encabezado. ExcelBordes(range2); // --- CONFIGURAR RESPUESTA HTTP --- response.Clear(); diff --git a/WebLab/App_Data/dsInformes.Designer.cs b/WebLab/App_Data/dsInformes.Designer.cs index 25d7f70b..491fc259 100644 --- a/WebLab/App_Data/dsInformes.Designer.cs +++ b/WebLab/App_Data/dsInformes.Designer.cs @@ -3491,6 +3491,8 @@ public partial class turnoDataTable : global::System.Data.TypedTableBase diff --git a/WebLab/App_Data/dsInformes.xsd b/WebLab/App_Data/dsInformes.xsd index b4c2aa8e..544ebbf4 100644 --- a/WebLab/App_Data/dsInformes.xsd +++ b/WebLab/App_Data/dsInformes.xsd @@ -171,6 +171,7 @@ + @@ -228,7 +229,7 @@ - + @@ -242,7 +243,7 @@ - + @@ -425,7 +426,7 @@ - + diff --git a/WebLab/App_Data/dsInformes.xss b/WebLab/App_Data/dsInformes.xss index 2d8f5242..3cf17b04 100644 --- a/WebLab/App_Data/dsInformes.xss +++ b/WebLab/App_Data/dsInformes.xss @@ -6,17 +6,17 @@ --> - - - - + + + + - - - - - - + + + + + + \ No newline at end of file diff --git a/WebLab/Estadisticas/Grafico.aspx b/WebLab/Estadisticas/Grafico.aspx index 1abc6726..8e0e22a2 100644 --- a/WebLab/Estadisticas/Grafico.aspx +++ b/WebLab/Estadisticas/Grafico.aspx @@ -5,14 +5,86 @@ Estadisticas SIL - + <%-- --%> + <%-- --%> + +
-
- - -
+
+ + +
+ diff --git a/WebLab/Estadisticas/Grafico.aspx.cs b/WebLab/Estadisticas/Grafico.aspx.cs index f61857b5..d468e66c 100644 --- a/WebLab/Estadisticas/Grafico.aspx.cs +++ b/WebLab/Estadisticas/Grafico.aspx.cs @@ -6,121 +6,97 @@ using System.Web.UI.WebControls; using System.Data; using InfoSoftGlobal; +using System.Web.Script.Serialization; namespace WebLab.Estadisticas { public partial class Grafico : System.Web.UI.Page { + public string LabelsJson { get; set; } + public string DatosJson { get; set; } + public string TipoGrafico { get; set; } + public string TituloJson { get; set; } + public string TooltipsJson { get; set; } + protected void Page_Load(object sender, EventArgs e) { - if (int.Parse(Request["tipo"].ToString())!=2) - - FCLiteral.Text = mostrarGrafico(int.Parse(Request["tipo"].ToString())); - else - FCLiteral.Text = mostrarGrafico2(); ; + if (!IsPostBack) + { + mostrarGraficoNuevo(int.Parse(Request["tipo"].ToString())); + } } - private string mostrarGrafico2() + // ====================================================== + // mostrarGraficoNuevo + // ====================================================== + // Esta función prepara la información que será utilizada + // por Chart.js para renderizar gráficos estadísticos. + // + // Flujo general: + // 1. Define el título del gráfico según el parámetro recibido. + // 2. Determina el tipo de gráfico (bar o pie). + // 3. Lee los datos enviados en Request["valores"]. + // 4. Separa labels y cantidades. + // 5. Serializa los datos a JSON para JavaScript. + // ====================================================== + + + private void mostrarGraficoNuevo(int p) { - // string s_titulo = ""; - // string s_tipo = ""; - // string s_tipografico = "../FusionCharts/FCF_MSColumn3D.swf"; + string tipo = ""; + string s_tipo = ""; - string strXML = ""; - string strCategories = ""; + List labels = new List(); + List datos = new List(); - - string strDataR = ""; - string strDataS = ""; - string strDataI = ""; + // Tooltips personalizados + //List tooltips = new List(); - string valorrecibido=Request["valores"].ToString(); - string[] arr = valorrecibido.Split(("=").ToCharArray()); - foreach (string item in arr) + switch (p) { - string[] arr2 =item.ToString().Split((";").ToCharArray()); - if (arr2[0].ToString() != "") - { - strCategories = strCategories + ""; - if (arr2[1].ToString()=="") - strDataR = strDataR + ""; - else - strDataR = strDataR + ""; - - if (arr2[2].ToString() == "") - strDataS = strDataS + ""; - else - strDataS = strDataS + ""; - - if (arr2[3].ToString() == "") - strDataI = strDataI + ""; - else - strDataI = strDataI + ""; - } + case 0: s_tipo = "Casos por tipo de muestra"; break; + case 1: s_tipo = "Aislamientos"; break; + case 2: s_tipo = "Resistencia en ATB"; break; + case 3: s_tipo = "Casos por Resultados Obtenidos"; break; + case 4: s_tipo = "Casos de Mecanismos de Resistencia"; break; } + - //'Close element - strCategories = strCategories + ""; - - //'Close elements - strDataR= strDataR + ""; - strDataS = strDataS + ""; - strDataI = strDataI + ""; - - //'Assemble the entire XML now - strXML = strXML + strCategories + strDataR + strDataS +strDataI +""; - - return FusionCharts.RenderChart("../FusionCharts/FCF_MSColumn3D.swf", "", strXML, "productSales", "800", "500", false, false); - } - - private string mostrarGrafico(int p) - { - string s_titulo = ""; - string s_tipo = ""; - string strXML = ""; - string strDetalle = ""; + // Tipo de gráfico + if (Request["tipoGrafico"] != null) + { + if (Request["tipoGrafico"] == "barra") + tipo = "bar"; + else + tipo = "pie"; + } - //s_tipografico = "../FusionCharts/FCF_MSColumn3D.swf"; + // Lectura de datos + if (!string.IsNullOrEmpty(Request["valores"])) + { + string[] arr = Request["valores"].Split(';'); - s_titulo = "";// ddlAnalisis.SelectedItem.Text; - if (p==0) s_tipo = "Casos por tipo de muestra"; - else - { if (p == 3) s_tipo = "Casos por Resultados Obtenidos"; else s_tipo = "Aislamientos"; } + foreach (string item in arr) + { + string[] items = item.Split('|'); - string s_ancho = "700"; - string s_alto= "400"; + string label = items[0]; + int valor = int.Parse(items[1]); - string[] arr = Request["valores"].ToString().Split((";").ToCharArray()); - foreach (string item in arr) - { - strDetalle += ""; + labels.Add(label); + datos.Add(valor); + } } - string s_tipografico = "../FusionCharts/FCF_Pie3D.swf"; - if (Request["tipoGrafico"] != null) - { - if (Request["tipoGrafico"].ToString() == "torta") - { - s_tipografico = "../FusionCharts/FCF_Pie3D.swf"; - strXML = ""; - strXML += strDetalle; - strXML += ""; - } - if (Request["tipoGrafico"].ToString() == "barra") - { - s_ancho = "700"; - s_alto = "350"; - s_tipografico = "../FusionCharts/FCF_Column2D.swf"; - strXML = ""; - strXML += strDetalle; - strXML += ""; - } - } + var js = new JavaScriptSerializer(); - return FusionCharts.RenderChart(s_tipografico, p.ToString(), strXML, p.ToString(), s_ancho, s_alto, false, false); - } + LabelsJson = js.Serialize(labels); + DatosJson = js.Serialize(datos); + //TooltipsJson = js.Serialize(tooltips); - + TipoGrafico = js.Serialize(tipo); + TituloJson = js.Serialize(s_tipo); + } } } \ No newline at end of file diff --git a/WebLab/Estadisticas/Grafico.aspx.designer.cs b/WebLab/Estadisticas/Grafico.aspx.designer.cs index bc4b3105..2e1b9b41 100644 --- a/WebLab/Estadisticas/Grafico.aspx.designer.cs +++ b/WebLab/Estadisticas/Grafico.aspx.designer.cs @@ -7,11 +7,13 @@ // //------------------------------------------------------------------------------ -namespace WebLab.Estadisticas { - - - public partial class Grafico { - +namespace WebLab.Estadisticas +{ + + + public partial class Grafico + { + /// /// form1 control. /// @@ -20,7 +22,7 @@ public partial class Grafico { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// /// FCLiteral control. /// @@ -29,5 +31,14 @@ public partial class Grafico { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Literal FCLiteral; + + /// + /// miGrafico control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl miGrafico; } } diff --git a/WebLab/Estadisticas/ReporteMicrobiologia.aspx b/WebLab/Estadisticas/ReporteMicrobiologia.aspx index 4e1f6582..0cf66bbe 100644 --- a/WebLab/Estadisticas/ReporteMicrobiologia.aspx +++ b/WebLab/Estadisticas/ReporteMicrobiologia.aspx @@ -1,27 +1,19 @@ <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ReporteMicrobiologia.aspx.cs" Inherits="WebLab.Estadisticas.ReporteMicrobiologia" MasterPageFile="~/Site1.Master" ValidateRequest="false"%> <%@ Register assembly="Anthem" namespace="Anthem" tagprefix="anthem" %> - - - - - - - - - - - - - - + - - + + + - - + + + function verGraficoMecanismosResistencia(tipoGrafico) { + var dom = document.domain; + var domArray = dom.split('.'); + for (var i = domArray.length - 1; i >= 0; i--) { + try { + var dom = ''; + for (var j = domArray.length - 1; j >= i; j--) { + dom = (j == domArray.length - 1) ? (domArray[j]) : domArray[j] + '.' + dom; + } + document.domain = dom; + break; + } catch (E) { + } + } + + + var $this = $(this); + $('