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/Turno.rpt b/WebLab/Estadisticas/Turno.rpt index 2c9c06e9..77c3065a 100644 Binary files a/WebLab/Estadisticas/Turno.rpt and b/WebLab/Estadisticas/Turno.rpt differ diff --git a/WebLab/Estadisticas/Turnos.aspx b/WebLab/Estadisticas/Turnos.aspx index 3245f547..8d0932d3 100644 --- a/WebLab/Estadisticas/Turnos.aspx +++ b/WebLab/Estadisticas/Turnos.aspx @@ -51,12 +51,21 @@ Efector: - + + + + + + + + Fecha Desde: diff --git a/WebLab/Estadisticas/Turnos.aspx.cs b/WebLab/Estadisticas/Turnos.aspx.cs index 846275aa..593a9e18 100644 --- a/WebLab/Estadisticas/Turnos.aspx.cs +++ b/WebLab/Estadisticas/Turnos.aspx.cs @@ -115,8 +115,11 @@ private void CargarListas() { m_ssql = "select E.idEfector, E.nombre from sys_efector E (nolock) where E.idEfector= " + oUser.IdEfector.IdEfector.ToString(); oUtil.CargarCombo(ddlEfector, m_ssql, "idEfector", "nombre", connReady); + listaEfectorSolicitante(); + } + m_ssql = null; oUtil = null; @@ -215,6 +218,10 @@ private DataTable getDatosEstadisticos(string tipo) cmd.Parameters.Add("@idEfector", SqlDbType.Int); cmd.Parameters["@idEfector"].Value = int.Parse(ddlEfector.SelectedValue); + cmd.Parameters.Add("@idEfectorSolicitante", SqlDbType.Int); + int idEfectorSolicitante = (ddlEfectorSolicitante.SelectedValue != "") ? int.Parse(ddlEfectorSolicitante.SelectedValue) : 0; + cmd.Parameters["@idEfectorSolicitante"].Value = idEfectorSolicitante; + cmd.Connection = conn; SqlDataAdapter da = new SqlDataAdapter(cmd); @@ -223,23 +230,23 @@ private DataTable getDatosEstadisticos(string tipo) return Ds.Tables[0]; } - private string CreateChart1(DataTable dataTable) - { - string strXML = ""; + //private string CreateChart1(DataTable dataTable) + //{ + // string strXML = ""; - if (dataTable.Rows.Count > 0) - { - for (int i = 0; i < dataTable.Rows.Count-1; i++) - { - strXML += ""; - } - } + // if (dataTable.Rows.Count > 0) + // { + // for (int i = 0; i < dataTable.Rows.Count-1; i++) + // { + // strXML += ""; + // } + // } - strXML += ""; + // strXML += ""; - return FusionCharts.RenderChart("../FusionCharts/FCF_Pie3D.swf", "", strXML, "Sales", "400", "200", false, false); - } + // return FusionCharts.RenderChart("../FusionCharts/FCF_Pie3D.swf", "", strXML, "Sales", "400", "200", false, false); + //} protected void imgPdf_Click(object sender, ImageClickEventArgs e) { @@ -310,7 +317,8 @@ private void MostrarPDF() if (oEfector != null) { Configuracion oCon = new Configuracion(); - oCon = (Configuracion)oCon.Get(typeof(Configuracion), "IdEfector", oEfector ); + oCon = (Configuracion)oCon.Get(typeof(Configuracion), "IdEfector", oEfector); + //ParameterDiscreteValue encabezado1 = new ParameterDiscreteValue(); encabezado1.Value = oCon.EncabezadoLinea1; @@ -319,6 +327,17 @@ private void MostrarPDF() //ParameterDiscreteValue encabezado3 = new ParameterDiscreteValue(); encabezado3.Value = oCon.EncabezadoLinea3; + + if(ddlEfectorSolicitante.SelectedValue != "" && ddlEfectorSolicitante.SelectedValue != "0") + { + Efector oEfectorSolicitante = new Efector(); + oEfectorSolicitante = (Efector)oEfectorSolicitante.Get(typeof(Efector), int.Parse(ddlEfectorSolicitante.SelectedValue)); + if (oEfectorSolicitante != null) + { + encabezado3.Value = oEfectorSolicitante.Nombre; + } + } + } } @@ -363,6 +382,49 @@ protected void imgExcel_Click(object sender, ImageClickEventArgs e) protected void btnDescargarDetallado_Click(object sender, EventArgs e) { + } + + private void listaEfectorSolicitante() + { + Utility oUtil = new Utility(); + string connReady = ConfigurationManager.ConnectionStrings["SIL_ReadOnly"].ConnectionString; ///Performance: conexion de solo lectura + + string m_ssql = @" SELECT distinct e.idEfector,E.nombre as nombre + FROM LAB_Agenda A (nolock) + INNER JOIN sys_Efector E (nolock) on E.idEfector=A.idEfectorSolicitante + where A.baja=0 and a.idEfector=" + ddlEfector.SelectedValue.ToString() + " and a.idEfectorSolicitante<>" + ddlEfector.SelectedValue.ToString(); + oUtil.CargarCombo(ddlEfectorSolicitante, m_ssql, "idEfector", "nombre", connReady); + + if (ddlEfectorSolicitante.Items.Count > 0) + { + ddlEfectorSolicitante.Items.Insert(0, new ListItem("--TODOS--", "0")); + ddlEfectorSolicitante.Visible = true; lblEfectorSolicitante.Visible = true; + } + else + { + ddlEfectorSolicitante.Visible = false; lblEfectorSolicitante.Visible = false; + } + } + + protected void ddlEfector_SelectedIndexChanged(object sender, EventArgs e) + { + if (oUser.IdEfector.IdEfector == 227) + { + if (ddlEfector.SelectedIndex != 0) + { + //Borro las Caps de otro Efector y vuelvo a cargar + ddlEfectorSolicitante.Items.Clear(); + listaEfectorSolicitante(); + } + else + { + ddlEfectorSolicitante.Visible = false; lblEfectorSolicitante.Visible = false; + ddlEfectorSolicitante.Items.Clear(); + } + } + + + } } } diff --git a/WebLab/Estadisticas/Turnos.aspx.designer.cs b/WebLab/Estadisticas/Turnos.aspx.designer.cs index ff0d6eb9..4e01767c 100644 --- a/WebLab/Estadisticas/Turnos.aspx.designer.cs +++ b/WebLab/Estadisticas/Turnos.aspx.designer.cs @@ -7,11 +7,13 @@ // //------------------------------------------------------------------------------ -namespace WebLab.Estadisticas { - - - public partial class Turnos { - +namespace WebLab.Estadisticas +{ + + + public partial class Turnos + { + /// /// ddlEfector control. /// @@ -20,7 +22,25 @@ public partial class Turnos { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.DropDownList ddlEfector; - + + /// + /// lblEfectorSolicitante control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblEfectorSolicitante; + + /// + /// ddlEfectorSolicitante control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlEfectorSolicitante; + /// /// txtFechaDesde control. /// @@ -29,7 +49,7 @@ public partial class Turnos { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.HtmlControls.HtmlInputText txtFechaDesde; - + /// /// txtFechaHasta control. /// @@ -38,7 +58,7 @@ public partial class Turnos { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.HtmlControls.HtmlInputText txtFechaHasta; - + /// /// CustomValidator1 control. /// @@ -47,7 +67,7 @@ public partial class Turnos { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.CustomValidator CustomValidator1; - + /// /// ddlServicio control. /// @@ -56,7 +76,7 @@ public partial class Turnos { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.DropDownList ddlServicio; - + /// /// btnGenerar control. /// @@ -65,7 +85,7 @@ public partial class Turnos { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Button btnGenerar; - + /// /// pnlSinDatos control. /// @@ -74,7 +94,7 @@ public partial class Turnos { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Panel pnlSinDatos; - + /// /// Label1 control. /// @@ -83,7 +103,7 @@ public partial class Turnos { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label Label1; - + /// /// pnlDatos control. /// @@ -92,7 +112,7 @@ public partial class Turnos { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Panel pnlDatos; - + /// /// gvLista control. /// @@ -101,7 +121,7 @@ public partial class Turnos { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.GridView gvLista; - + /// /// imgPdf control. /// @@ -110,7 +130,7 @@ public partial class Turnos { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.ImageButton imgPdf; - + /// /// imgExcel control. /// diff --git a/WebLab/Informes/PlanillaDetalladaTurno.cs b/WebLab/Informes/PlanillaDetalladaTurno.cs new file mode 100644 index 00000000..479cebf4 --- /dev/null +++ b/WebLab/Informes/PlanillaDetalladaTurno.cs @@ -0,0 +1,249 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebLab.Informes { + using System; + using System.ComponentModel; + using CrystalDecisions.Shared; + using CrystalDecisions.ReportSource; + using CrystalDecisions.CrystalReports.Engine; + + + public class PlanillaDetalladaTurno : ReportClass { + + public PlanillaDetalladaTurno() { + } + + public override string ResourceName { + get { + return "PlanillaDetalladaTurno.rpt"; + } + set { + // Do nothing + } + } + + public override bool NewGenerator { + get { + return true; + } + set { + // Do nothing + } + } + + public override string FullResourceName { + get { + return "WebLab.Informes.PlanillaDetalladaTurno.rpt"; + } + set { + // Do nothing + } + } + + [Browsable(false)] + [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public CrystalDecisions.CrystalReports.Engine.Section Section1 { + get { + return this.ReportDefinition.Sections[0]; + } + } + + [Browsable(false)] + [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public CrystalDecisions.CrystalReports.Engine.Section Section2 { + get { + return this.ReportDefinition.Sections[1]; + } + } + + [Browsable(false)] + [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public CrystalDecisions.CrystalReports.Engine.Section GroupHeaderSection5 { + get { + return this.ReportDefinition.Sections[2]; + } + } + + [Browsable(false)] + [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public CrystalDecisions.CrystalReports.Engine.Section GroupHeaderSection3 { + get { + return this.ReportDefinition.Sections[3]; + } + } + + [Browsable(false)] + [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public CrystalDecisions.CrystalReports.Engine.Section GroupHeaderSection4 { + get { + return this.ReportDefinition.Sections[4]; + } + } + + [Browsable(false)] + [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public CrystalDecisions.CrystalReports.Engine.Section GroupHeaderSection1 { + get { + return this.ReportDefinition.Sections[5]; + } + } + + [Browsable(false)] + [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public CrystalDecisions.CrystalReports.Engine.Section GroupHeaderSection2 { + get { + return this.ReportDefinition.Sections[6]; + } + } + + [Browsable(false)] + [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public CrystalDecisions.CrystalReports.Engine.Section Section3 { + get { + return this.ReportDefinition.Sections[7]; + } + } + + [Browsable(false)] + [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public CrystalDecisions.CrystalReports.Engine.Section GroupFooterSection1 { + get { + return this.ReportDefinition.Sections[8]; + } + } + + [Browsable(false)] + [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public CrystalDecisions.CrystalReports.Engine.Section GroupFooterSection3 { + get { + return this.ReportDefinition.Sections[9]; + } + } + + [Browsable(false)] + [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public CrystalDecisions.CrystalReports.Engine.Section GroupFooterSection2 { + get { + return this.ReportDefinition.Sections[10]; + } + } + + [Browsable(false)] + [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public CrystalDecisions.CrystalReports.Engine.Section GroupFooterSection4 { + get { + return this.ReportDefinition.Sections[11]; + } + } + + [Browsable(false)] + [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public CrystalDecisions.CrystalReports.Engine.Section Section4 { + get { + return this.ReportDefinition.Sections[12]; + } + } + + [Browsable(false)] + [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public CrystalDecisions.CrystalReports.Engine.Section Section5 { + get { + return this.ReportDefinition.Sections[13]; + } + } + + [Browsable(false)] + [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public CrystalDecisions.Shared.IParameterField Parameter_encabezado1 { + get { + return this.DataDefinition.ParameterFields[0]; + } + } + + [Browsable(false)] + [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public CrystalDecisions.Shared.IParameterField Parameter_encabezado2 { + get { + return this.DataDefinition.ParameterFields[1]; + } + } + + [Browsable(false)] + [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public CrystalDecisions.Shared.IParameterField Parameter_encabezado3 { + get { + return this.DataDefinition.ParameterFields[2]; + } + } + } + + [System.Drawing.ToolboxBitmapAttribute(typeof(CrystalDecisions.Shared.ExportOptions), "report.bmp")] + public class CachedPlanillaDetalladaTurno : Component, ICachedReport { + + public CachedPlanillaDetalladaTurno() { + } + + [Browsable(false)] + [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public virtual bool IsCacheable { + get { + return true; + } + set { + // + } + } + + [Browsable(false)] + [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public virtual bool ShareDBLogonInfo { + get { + return false; + } + set { + // + } + } + + [Browsable(false)] + [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public virtual System.TimeSpan CacheTimeOut { + get { + return CachedReportConstants.DEFAULT_TIMEOUT; + } + set { + // + } + } + + public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { + PlanillaDetalladaTurno rpt = new PlanillaDetalladaTurno(); + rpt.Site = this.Site; + return rpt; + } + + public virtual string GetCustomizedCacheKey(RequestContext request) { + String key = null; + // // The following is the code used to generate the default + // // cache key for caching report jobs in the ASP.NET Cache. + // // Feel free to modify this code to suit your needs. + // // Returning key == null causes the default cache key to + // // be generated. + // + // key = RequestContext.BuildCompleteCacheKey( + // request, + // null, // sReportFilename + // this.GetType(), + // this.ShareDBLogonInfo ); + return key; + } + } +} diff --git a/WebLab/Informes/PlanillaDetalladaTurno.rpt b/WebLab/Informes/PlanillaDetalladaTurno.rpt index e7140711..5aefa095 100644 Binary files a/WebLab/Informes/PlanillaDetalladaTurno.rpt and b/WebLab/Informes/PlanillaDetalladaTurno.rpt differ diff --git a/WebLab/Informes/PlanillaTurno.cs b/WebLab/Informes/PlanillaTurno.cs new file mode 100644 index 00000000..d3b370e2 --- /dev/null +++ b/WebLab/Informes/PlanillaTurno.cs @@ -0,0 +1,209 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebLab.Informes { + using System; + using System.ComponentModel; + using CrystalDecisions.Shared; + using CrystalDecisions.ReportSource; + using CrystalDecisions.CrystalReports.Engine; + + + public class PlanillaTurno : ReportClass { + + public PlanillaTurno() { + } + + public override string ResourceName { + get { + return "PlanillaTurno.rpt"; + } + set { + // Do nothing + } + } + + public override bool NewGenerator { + get { + return true; + } + set { + // Do nothing + } + } + + public override string FullResourceName { + get { + return "WebLab.Informes.PlanillaTurno.rpt"; + } + set { + // Do nothing + } + } + + [Browsable(false)] + [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public CrystalDecisions.CrystalReports.Engine.Section Section1 { + get { + return this.ReportDefinition.Sections[0]; + } + } + + [Browsable(false)] + [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public CrystalDecisions.CrystalReports.Engine.Section Section2 { + get { + return this.ReportDefinition.Sections[1]; + } + } + + [Browsable(false)] + [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public CrystalDecisions.CrystalReports.Engine.Section GroupHeaderSection2 { + get { + return this.ReportDefinition.Sections[2]; + } + } + + [Browsable(false)] + [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public CrystalDecisions.CrystalReports.Engine.Section GroupHeaderSection1 { + get { + return this.ReportDefinition.Sections[3]; + } + } + + [Browsable(false)] + [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public CrystalDecisions.CrystalReports.Engine.Section Section3 { + get { + return this.ReportDefinition.Sections[4]; + } + } + + [Browsable(false)] + [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public CrystalDecisions.CrystalReports.Engine.Section GroupFooterSection1 { + get { + return this.ReportDefinition.Sections[5]; + } + } + + [Browsable(false)] + [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public CrystalDecisions.CrystalReports.Engine.Section GroupFooterSection2 { + get { + return this.ReportDefinition.Sections[6]; + } + } + + [Browsable(false)] + [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public CrystalDecisions.CrystalReports.Engine.Section Section4 { + get { + return this.ReportDefinition.Sections[7]; + } + } + + [Browsable(false)] + [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public CrystalDecisions.CrystalReports.Engine.Section Section5 { + get { + return this.ReportDefinition.Sections[8]; + } + } + + [Browsable(false)] + [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public CrystalDecisions.Shared.IParameterField Parameter_encabezado1 { + get { + return this.DataDefinition.ParameterFields[0]; + } + } + + [Browsable(false)] + [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public CrystalDecisions.Shared.IParameterField Parameter_encabezado2 { + get { + return this.DataDefinition.ParameterFields[1]; + } + } + + [Browsable(false)] + [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public CrystalDecisions.Shared.IParameterField Parameter_encabezado3 { + get { + return this.DataDefinition.ParameterFields[2]; + } + } + } + + [System.Drawing.ToolboxBitmapAttribute(typeof(CrystalDecisions.Shared.ExportOptions), "report.bmp")] + public class CachedPlanillaTurno : Component, ICachedReport { + + public CachedPlanillaTurno() { + } + + [Browsable(false)] + [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public virtual bool IsCacheable { + get { + return true; + } + set { + // + } + } + + [Browsable(false)] + [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public virtual bool ShareDBLogonInfo { + get { + return false; + } + set { + // + } + } + + [Browsable(false)] + [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public virtual System.TimeSpan CacheTimeOut { + get { + return CachedReportConstants.DEFAULT_TIMEOUT; + } + set { + // + } + } + + public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { + PlanillaTurno rpt = new PlanillaTurno(); + rpt.Site = this.Site; + return rpt; + } + + public virtual string GetCustomizedCacheKey(RequestContext request) { + String key = null; + // // The following is the code used to generate the default + // // cache key for caching report jobs in the ASP.NET Cache. + // // Feel free to modify this code to suit your needs. + // // Returning key == null causes the default cache key to + // // be generated. + // + // key = RequestContext.BuildCompleteCacheKey( + // request, + // null, // sReportFilename + // this.GetType(), + // this.ShareDBLogonInfo ); + return key; + } + } +} diff --git a/WebLab/Informes/PlanillaTurno.rpt b/WebLab/Informes/PlanillaTurno.rpt index 3f18c82a..bc336092 100644 Binary files a/WebLab/Informes/PlanillaTurno.rpt and b/WebLab/Informes/PlanillaTurno.rpt differ diff --git a/WebLab/Turnos/TurnoList.aspx b/WebLab/Turnos/TurnoList.aspx index 2fe56064..309680a8 100644 --- a/WebLab/Turnos/TurnoList.aspx +++ b/WebLab/Turnos/TurnoList.aspx @@ -69,7 +69,7 @@ - + @@ -230,6 +230,11 @@  Buscar + + + + + diff --git a/WebLab/Turnos/TurnoList.aspx.cs b/WebLab/Turnos/TurnoList.aspx.cs index 1461ef87..bc6120f8 100644 --- a/WebLab/Turnos/TurnoList.aspx.cs +++ b/WebLab/Turnos/TurnoList.aspx.cs @@ -7,6 +7,7 @@ using NHibernate.Collection; using NHibernate.Expression; using System; +using System; using System.Collections; using System.Configuration; using System.Data; @@ -62,58 +63,63 @@ protected void Page_PreInit(object sender, EventArgs e) } protected void Page_Load(object sender, EventArgs e) - { - if (!Page.IsPostBack) - { - if (Request["tipo"]!=null) - Session["tipo"] = Request["tipo"].ToString(); + { - if (Session["tipo"].ToString() == "recepcion") - { - VerificaPermisos("Pacientes con turno"); - //pnlDerecho.BackColor = Color.White; - lblTitulo.Text = "PLANILLA DIARIA" ; - lblSubTitulo.Text = "Recepción de Pacientes con Turno"; - lblSubTitulo.Visible = true; - cldTurno.SelectedDate = DateTime.Now; - cldTurno.TodaysDate = DateTime.Now; - cldTurno.VisibleDate = DateTime.Now; - MostrarUltimoProtocolo(); - // btnNuevo.Visible = true; - } - else + if (Session["idUsuario"] != null) + { + if (!Page.IsPostBack) { - string labo = ""; - if (oUser.IdPerfil.IdPerfil == 15) + if (Request["tipo"] != null) + Session["tipo"] = Request["tipo"].ToString(); + + if (Session["tipo"].ToString() == "recepcion") { - labo = oUser.IdEfectorDestino.Nombre; - lnkProtocolo.Visible = false; /// no es posible registrar pacientes sin turno + VerificaPermisos("Pacientes con turno"); + //pnlDerecho.BackColor = Color.White; + lblTitulo.Text = "PLANILLA DIARIA"; + lblSubTitulo.Text = "Recepción de Pacientes con Turno"; + lblSubTitulo.Visible = true; + cldTurno.SelectedDate = DateTime.Now; + cldTurno.TodaysDate = DateTime.Now; + cldTurno.VisibleDate = DateTime.Now; + MostrarUltimoProtocolo(); + // btnNuevo.Visible = true; } - else - labo = oUser.IdEfector.Nombre; - VerificaPermisos("Asignacion de turnos"); - lblTitulo.Text = "TURNOS PARA " + labo.ToUpper(); - cldTurno.SelectedDate = DateTime.Now.AddDays(1); - cldTurno.VisibleDate = DateTime.Now.AddDays(1); - cldTurno.TodaysDate = DateTime.Now.AddDays(1); - - imgServicioView.Visible = true; - imgServicioView.Attributes.Add("onClick", "javascript: CalendarioView (" + ddlTipoServicio.SelectedValue + "," + ddlItem.SelectedValue + "); return false"); - + { + string labo = ""; + if (oUser.IdPerfil.IdPerfil == 15) + { + labo = oUser.IdEfectorDestino.Nombre; + lnkProtocolo.Visible = false; /// no es posible registrar pacientes sin turno + } + + else + labo = oUser.IdEfector.Nombre; + VerificaPermisos("Asignacion de turnos"); + lblTitulo.Text = "TURNOS PARA " + labo.ToUpper(); + cldTurno.SelectedDate = DateTime.Now.AddDays(1); + cldTurno.VisibleDate = DateTime.Now.AddDays(1); + cldTurno.TodaysDate = DateTime.Now.AddDays(1); + + imgServicioView.Visible = true; + imgServicioView.Attributes.Add("onClick", "javascript: CalendarioView (" + ddlTipoServicio.SelectedValue + "," + ddlItem.SelectedValue + "); return false"); + + } + CargarListas(); + //VerificarAgenda(); + //IdentificarDiasNoHabiles(); + + + Actualizar(); + + + // if (Session["tipo"].ToString() == "recepcion") btnNuevo.Visible = false; + + } - CargarListas(); - //VerificarAgenda(); - //IdentificarDiasNoHabiles(); - - - Actualizar(); - - - // if (Session["tipo"].ToString() == "recepcion") btnNuevo.Visible = false; - - } + else Response.Redirect("../FinSesion.aspx", false); } protected void Page_Unload(object sender, EventArgs e) @@ -448,7 +454,8 @@ from sys_Efector where idEfector in m_ssql = @"SELECT distinct I.idItem, I.nombre FROM LAB_Agenda A with (nolock) -INNER JOIN LAB_Item I with (nolock) ON A.idItem = I.idItem where A.baja=0 and I.baja=0 " + m_filtro; //and A.fechaDesde>='" + fecha.ToString("yyyyMMdd") + "'"; + INNER JOIN LAB_Item I with (nolock) ON A.idItem = I.idItem where A.baja=0 and I.baja=0 " + m_filtro + + " and idTipoServicio="+ddlTipoServicio.SelectedValue; //and A.fechaDesde>='" + fecha.ToString("yyyyMMdd") + "'"; oUtil.CargarCombo(ddlItem, m_ssql, "idItem", "nombre"); ddlItem.Items.Insert(0, new ListItem("--Seleccione práctica--", "0")); if (Session["idItem"] != null) ddlItem.SelectedValue = Session["idItem"].ToString(); @@ -596,9 +603,12 @@ private void Actualizar() if (Session["tipo"].ToString() != "recepcion") ///Sólo para asignacion de turnos { if (ddlItem.SelectedValue != "0") { imgCalendarioView.Visible = true; imgCalendarioView.Attributes.Add("onClick", "javascript: CalendarioView (" + ddlTipoServicio.SelectedValue + "," + ddlItem.SelectedValue + "); return false"); } - else imgCalendarioView.Visible = false; + else + { + imgCalendarioView.Visible = false; - imgServicioView.Attributes.Add("onClick", "javascript: CalendarioView (" + ddlTipoServicio.SelectedValue + ",0); return false"); + imgServicioView.Attributes.Add("onClick", "javascript: CalendarioView (" + ddlTipoServicio.SelectedValue + ",0); return false"); + } } CargarTurnos(); @@ -637,6 +647,20 @@ private void Actualizar() protected void ddlTipoServicio_SelectedIndexChanged(object sender, EventArgs e) { + //Se debe actualizar los items cuando se cambia de servicio + Utility oUtil = new Utility(); + + string m_filtro = "and idEfectorSolicitante= " + oUser.IdEfector.IdEfector.ToString(); //si es generacion solo puede ver agendas de su efector + if (Request["tipo"] == "recepcion") //los turnos que asiganron todos + m_filtro = "and A.idEfector = " + oCon.IdEfector.IdEfector.ToString(); + + string m_ssql = @"SELECT distinct I.idItem, I.nombre FROM LAB_Agenda A with (nolock) + INNER JOIN LAB_Item I with (nolock) ON A.idItem = I.idItem where A.baja=0 and I.baja=0 " + m_filtro + + " and idTipoServicio=" + ddlTipoServicio.SelectedValue; + oUtil.CargarCombo(ddlItem, m_ssql, "idItem", "nombre"); + ddlItem.Items.Insert(0, new ListItem("--Seleccione práctica--", "0")); + + Actualizar(); } @@ -828,7 +852,21 @@ private void PintarReferencias() protected void btnBuscar_Click(object sender, EventArgs e) { if (Page.IsValid) - Actualizar(); + { + lblMensajeBusqueda.Visible = false; + if (rdbBusqueda.Items[0].Selected) // DNI + { + long dni; + if (!long.TryParse(txtPaciente.Text, out dni)) + { + lblMensajeBusqueda.Visible = true; + lblMensajeBusqueda.Text = "El DNI ingresado no es válido"; + return; + } + } + + Actualizar(); + } } protected void cldTurno_DayRender(object sender, DayRenderEventArgs e) @@ -1062,5 +1100,10 @@ protected void ddlEfectorSolicitante_SelectedIndexChanged(object sender, EventAr { Actualizar(); } + + protected void ddlItem_SelectedIndexChanged(object sender, EventArgs e) + { + Actualizar(); + } } } diff --git a/WebLab/Turnos/TurnoList.aspx.designer.cs b/WebLab/Turnos/TurnoList.aspx.designer.cs index f2ee3d25..8ecd5d11 100644 --- a/WebLab/Turnos/TurnoList.aspx.designer.cs +++ b/WebLab/Turnos/TurnoList.aspx.designer.cs @@ -1,10 +1,10 @@ //------------------------------------------------------------------------------ -// -// Este código fue generado por una herramienta. +// +// This code was generated by a tool. // -// Los cambios en este archivo podrían causar un comportamiento incorrecto y se perderán si -// se vuelve a generar el código. -// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// //------------------------------------------------------------------------------ namespace WebLab.Turnos @@ -15,272 +15,281 @@ public partial class TurnoList { /// - /// Control lblTitulo. + /// lblTitulo control. /// /// - /// Campo generado automáticamente. - /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label lblTitulo; /// - /// Control lblSubTitulo. + /// lblSubTitulo control. /// /// - /// Campo generado automáticamente. - /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label lblSubTitulo; /// - /// Control pnlDerecho. + /// pnlDerecho control. /// /// - /// Campo generado automáticamente. - /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.HtmlControls.HtmlGenericControl pnlDerecho; /// - /// Control ddlTipoServicio. + /// ddlTipoServicio control. /// /// - /// Campo generado automáticamente. - /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.DropDownList ddlTipoServicio; /// - /// Control imgServicioView. + /// imgServicioView control. /// /// - /// Campo generado automáticamente. - /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.ImageButton imgServicioView; /// - /// Control ddlItem. + /// ddlItem control. /// /// - /// Campo generado automáticamente. - /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.DropDownList ddlItem; /// - /// Control imgCalendarioView. + /// imgCalendarioView control. /// /// - /// Campo generado automáticamente. - /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.ImageButton imgCalendarioView; /// - /// Control btnActualizar. + /// btnActualizar control. /// /// - /// Campo generado automáticamente. - /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Button btnActualizar; /// - /// Control cldTurno. + /// cldTurno control. /// /// - /// Campo generado automáticamente. - /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Calendar cldTurno; /// - /// Control btnNuevo. + /// btnNuevo control. /// /// - /// Campo generado automáticamente. - /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Button btnNuevo; /// - /// Control lnkProtocolo. + /// lnkProtocolo control. /// /// - /// Campo generado automáticamente. - /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.LinkButton lnkProtocolo; /// - /// Control lblMensaje. + /// lblMensaje control. /// /// - /// Campo generado automáticamente. - /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label lblMensaje; /// - /// Control lblMensajeSolicitante. + /// lblMensajeSolicitante control. /// /// - /// Campo generado automáticamente. - /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label lblMensajeSolicitante; /// - /// Control lblHoraTurno. + /// lblHoraTurno control. /// /// - /// Campo generado automáticamente. - /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label lblHoraTurno; /// - /// Control lblTipoServicio. + /// lblTipoServicio control. /// /// - /// Campo generado automáticamente. - /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label lblTipoServicio; /// - /// Control lblFecha. + /// lblFecha control. /// /// - /// Campo generado automáticamente. - /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label lblFecha; /// - /// Control lblHorario. + /// lblHorario control. /// /// - /// Campo generado automáticamente. - /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label lblHorario; /// - /// Control lblLimiteTurnos. + /// lblLimiteTurnos control. /// /// - /// Campo generado automáticamente. - /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label lblLimiteTurnos; /// - /// Control lblTurnosDados. + /// lblTurnosDados control. /// /// - /// Campo generado automáticamente. - /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label lblTurnosDados; /// - /// Control lblTurnosDisponibles. + /// lblTurnosDisponibles control. /// /// - /// Campo generado automáticamente. - /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label lblTurnosDisponibles; /// - /// Control ddlEfectorSolicitante. + /// ddlEfectorSolicitante control. /// /// - /// Campo generado automáticamente. - /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.DropDownList ddlEfectorSolicitante; /// - /// Control ddlEstadoTurno. + /// ddlEstadoTurno control. /// /// - /// Campo generado automáticamente. - /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.DropDownList ddlEstadoTurno; /// - /// Control txtPaciente. + /// txtPaciente control. /// /// - /// Campo generado automáticamente. - /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox txtPaciente; /// - /// Control rdbBusqueda. + /// rdbBusqueda control. /// /// - /// Campo generado automáticamente. - /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.RadioButtonList rdbBusqueda; /// - /// Control btnBuscar. + /// btnBuscar control. /// /// - /// Campo generado automáticamente. - /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.LinkButton btnBuscar; /// - /// Control cvNumeroDesde. + /// lblMensajeBusqueda control. /// /// - /// Campo generado automáticamente. - /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblMensajeBusqueda; + + /// + /// cvNumeroDesde control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.CustomValidator cvNumeroDesde; /// - /// Control lblUltimoProtocolo. + /// lblUltimoProtocolo control. /// /// - /// Campo generado automáticamente. - /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label lblUltimoProtocolo; /// - /// Control gvLista. + /// gvLista control. /// /// - /// Campo generado automáticamente. - /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.GridView gvLista; /// - /// Control lnkPlanilla. + /// lnkPlanilla control. /// /// - /// Campo generado automáticamente. - /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.LinkButton lnkPlanilla; /// - /// Control lnkPlanillaDetallada. + /// lnkPlanillaDetallada control. /// /// - /// Campo generado automáticamente. - /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.LinkButton lnkPlanillaDetallada; } diff --git a/WebLab/Turnos/calendarioView.aspx.cs b/WebLab/Turnos/calendarioView.aspx.cs index ffae366a..c6c682dc 100644 --- a/WebLab/Turnos/calendarioView.aspx.cs +++ b/WebLab/Turnos/calendarioView.aspx.cs @@ -150,12 +150,16 @@ public class CalendarioTurnos } private string CalcularTurnoDisponible( DateTime fecha) { - // DateTime fecha = DateTime.Parse(cldTurno.SelectedDate.ToShortDateString()); - string m_strSQL = @" SELECT idTurno AS idturno, hora FROM LAB_Turno AS T (nolock) - WHERE (T.baja = 0) and T.idEfector="+oUser.IdEfector.IdEfector.ToString()+ - @" and T.idEfectorSolicitante= " + oCon.IdEfector.IdEfector.ToString() + + // DateTime fecha = DateTime.Parse(cldTurno.SelectedDate.ToShortDateString()); + string m_strSQL = @"SELECT idTurno AS idturno, hora FROM LAB_Turno AS T (nolock) + WHERE(T.baja = 0) AND T.fecha = '" + fecha.ToString("yyyyMMdd") + "' AND T.IdItem = " + Request["idItem"].ToString(); + + if (oUser.IdPerfil.IdPerfil != 15) + m_strSQL += @" and T.idEfector=" + oUser.IdEfector.IdEfector.ToString() +" and T.idEfectorSolicitante= " + oCon.IdEfector.IdEfector.ToString() +" ORDER BY idturno DESC "; + + else m_strSQL += @" and T.idEfector=" + oUser.IdEfectorDestino.IdEfector.ToString() + " and T.idEfectorSolicitante= " + oUser.IdEfector.IdEfector.ToString() + " ORDER BY idturno DESC "; + - " AND T.fecha='" + fecha.ToString("yyyyMMdd") + "' AND T.IdItem=" + Request["idItem"].ToString() +" ORDER BY idturno DESC "; DataSet Ds = new DataSet(); //SqlConnection conn = (SqlConnection)NHibernateHttpModule.CurrentSession.Connection; SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["SIL_ReadOnly"].ConnectionString); ///Performance: conexion de solo lectura diff --git a/WebLab/WebLab.csproj b/WebLab/WebLab.csproj index 91563043..58e4802b 100644 --- a/WebLab/WebLab.csproj +++ b/WebLab/WebLab.csproj @@ -4948,6 +4948,18 @@ PacientesList.aspx + + True + True + PlanillaDetalladaTurno.rpt + Component + + + True + True + PlanillaTurno.rpt + Component + ResultadosporServicio.aspx ASPXCodeBehind