Indicadores Medicos, procedimientos
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
|
||||
Imports Microsoft.Extensions.Primitives
|
||||
|
||||
Partial Class Ventas_CatMedicos
|
||||
Inherits ClsPaginas
|
||||
@@ -21,7 +21,9 @@ Partial Class Ventas_CatMedicos
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CargaCombos()
|
||||
CargaDatos()
|
||||
BtnConsultar_Click(Nothing, Nothing)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -41,8 +43,12 @@ Partial Class Ventas_CatMedicos
|
||||
|
||||
GvDatos.DataBind()
|
||||
|
||||
ValidaExcelTab()
|
||||
|
||||
UpDatos.Update()
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
|
||||
@@ -134,8 +140,6 @@ Partial Class Ventas_CatMedicos
|
||||
TxtCelular.Text = ""
|
||||
TxtEspecialidad.Text = ""
|
||||
|
||||
|
||||
|
||||
DVEstatus.Visible = False
|
||||
ChkEstatus.Checked = True
|
||||
|
||||
@@ -177,4 +181,95 @@ Partial Class Ventas_CatMedicos
|
||||
|
||||
|
||||
|
||||
#Region "INDICADORES"
|
||||
|
||||
Private Sub CargaCombos()
|
||||
|
||||
|
||||
Dim EsWS As Boolean = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False)
|
||||
If EsWS Then
|
||||
DdlClientes.setEsWebService(True)
|
||||
Else
|
||||
DdlClientes.setEsWebService(False)
|
||||
DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
|
||||
DdlClientes.DataBind()
|
||||
DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End If
|
||||
|
||||
|
||||
|
||||
txtFechaI.Text = NowADS().FirstDayOfMonth.ToShortDateString
|
||||
txtFechaF.Text = NowADS().ToShortDateString
|
||||
|
||||
DdlMedico.DataSource = GlobalDTMedicos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
|
||||
DdlMedico.DataBind()
|
||||
|
||||
DdlProcedimiento.DataSource = GlobalDTProcedimientos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
|
||||
DdlProcedimiento.DataBind()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
|
||||
|
||||
|
||||
Dim objVentas As New ClsVentas
|
||||
Dim CveCliente As Integer = If(DdlClientes.SelectedValue.ToEntero > 0, DdlClientes.SelectedValue.ToEntero, -1)
|
||||
If objVentas.GetVentasMedicasIndicadoresRep(DdlGrupo.SelectedValue.ToEntero, txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, CveCliente, DdlMedico.SelectedValue.ToEntero, DdlProcedimiento.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
GvIndicadores.DataSource = objVentas.DtResultados
|
||||
End If
|
||||
|
||||
objVentas.Dispose()
|
||||
|
||||
GvIndicadores.DataBind()
|
||||
|
||||
ValidaExcelTab()
|
||||
|
||||
UpIndicadores.Update()
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "EXCEL"
|
||||
|
||||
Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
|
||||
|
||||
|
||||
If Tabs.ActiveTabIndex = 0 Then
|
||||
Dim SbFiltros As New StringBuilder()
|
||||
SbFiltros.AppendFormat($"Fecha Inicio: {txtFechaI.Text} Fecha Fin: {txtFechaF.Text}|")
|
||||
SbFiltros.Append($"Grupo:{DdlGrupo.SelectedItem.Text}, Médico: {DdlMedico.SelectedItem.Text}, Procedimiento: {DdlProcedimiento.SelectedItem.Text}")
|
||||
GvIndicadores.ExportToExcelGembox("IndicadoresMedicos", UsuarioActual, "Indicadores Médicos", DatoTituloExtra:=$"", DatosFiltros:=SbFiltros.ToString())
|
||||
Else
|
||||
GvDatos.Columns(10).Visible = False
|
||||
Dim SbFiltros As New StringBuilder()
|
||||
SbFiltros.AppendFormat($"Fecha Inicio: {txtFechaI.Text} Fecha Fin: {txtFechaF.Text}|")
|
||||
GvDatos.ExportToExcelGembox("CatMedicos", UsuarioActual, "Catálogo de Médicos", DatoTituloExtra:=$"", DatosFiltros:=SbFiltros.ToString())
|
||||
GvDatos.Columns(10).Visible = True
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)
|
||||
End Sub
|
||||
|
||||
|
||||
Sub ValidaExcelTab()
|
||||
If Tabs.ActiveTabIndex = 0 Then
|
||||
LnkExportar.Visible = GvDatos.Rows.Count > 0
|
||||
Else
|
||||
LnkExportar.Visible = GvIndicadores.Rows.Count > 0
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user