From 3e8bddd0312b70752004a79b2a9fdbc2890a7ab8 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 21 Jun 2025 13:47:32 -0700 Subject: [PATCH] - --- Ventas/CatMedicos.aspx.vb | 58 +++++++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 24 deletions(-) diff --git a/Ventas/CatMedicos.aspx.vb b/Ventas/CatMedicos.aspx.vb index cbf1d8755..01126181c 100644 --- a/Ventas/CatMedicos.aspx.vb +++ b/Ventas/CatMedicos.aspx.vb @@ -2,6 +2,8 @@ Option Strict On Imports Extensiones +Imports ADSNetLibrary.SIGAPI.Models.CRM.Request +Imports ADSNetLibrary.SIGAPI.Services.CRM Partial Class Ventas_CatMedicos Inherits ClsPaginas @@ -18,8 +20,6 @@ Partial Class Ventas_CatMedicos End Set End Property - - Public Property CveMedicoEspecialidad As Integer Get If ViewState("CveMedicoEspecialidad") Is Nothing Then @@ -50,24 +50,49 @@ Partial Class Ventas_CatMedicos If Not Page.IsPostBack Then + If (Request("CveEmpresaCRM") IsNot Nothing) Then + ' ICRMService CRMService = New CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString) + 'RequestEmpresasCRM parametros = New RequestEmpresasCRM(UsuarioActual.CveEmpresa, CveEmpresaCRM); + 'var objServicio = cRMService.GetEmpresasCRM(parametros); + 'If (objServicio.Result.Count > 0) Then + ' { + ' EsEditar = True; + ' LblEncabezadoEmpresa.Text = String.Format("Consulta de la Empresa: {0}", objServicio.Result[0].Empresa); + ' TxtNombreEmpresa.Text = objServicio.Result[0].Empresa; + ' TxtRFC.Text = objServicio.Result[0].RFC; + ' DdlTipoProceso2.SelectedValueExist(objServicio.Result[0].CveTipoProceso); + ' CargaMetodosCaptacion(); + ' TxtCorreoEmpresaCRM.Text = objServicio.Result[0].Correo; + ' DdlMedioCaptacion.SelectedValueExist(objServicio.Result[0].CveMedioCaptacion); + ' CveEncuestaAplicada = objServicio.Result[0].CveEncuestaAplicada > 0 ? objServicio.Result[0].CveEncuestaAplicada.ToEntero() : -1; + ' CveVendedor = objServicio.Result[0].CveVendedorAsignado.ToEntero(); + ' CveSubProyecto = objServicio.Result[0].CveSubProyecto.ToEntero(); + ' CveCliente = objServicio.Result[0].CveCliente.ToEntero(); + ' CveGiroClasificacion = objServicio.Result[0].CveGiroClasificacion > 0 ? objServicio.Result[0].CveGiroClasificacion.ToEntero() : -1; + ' If (!(CveCliente > 0)) Then + ' { + ' HplCrearCliente.Visible = True; + ' HplCrearCliente.NavigateUrl = String.Format("/Ventas/Clientes.aspx?CveEmpresaCRM={0}", CveEmpresaCRM); + ' If (UsuarioActual.Empresa.Funcionalidad(578) == "1") Then + ' { + ' HplCrearCliente.Text = "Crear Médico"; + ' HplCrearCliente.NavigateUrl = String.Format("/Ventas/CatMedicos.aspx?CveEmpresaCRM={0}", CveEmpresaCRM); + ' } + ' } + + RegistraScript("$('#DvModalAddMedico').modal({ backdrop: 'static', keyboard: false });") + End If CargaCombos() CargaDatos() BtnConsultar_Click(Nothing, Nothing) - - - End If - End Sub - Public Sub CargaDatos() - Dim ObjVentas As New ClsVentas - If ObjVentas.GetMedicos(-1, UsuarioActual.CveEmpresa, -1) Then If UsuarioActual.CveVendedor > 0 Then @@ -75,23 +100,15 @@ Partial Class Ventas_CatMedicos Else GvDatos.DataSource = ObjVentas.DtResultados End If - - - Else GvDatos.DataSource = Nothing End If ObjVentas.Dispose() - GvDatos.DataBind() - ValidaExcelTab() - UpDatos.Update() - - End Sub 'Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click @@ -166,8 +183,6 @@ Partial Class Ventas_CatMedicos End Sub #End Region - - Public Sub LnkAgregarMedico_Click(sender As Object, e As EventArgs) AddMedicoControl.CveMedico = -1 @@ -188,8 +203,6 @@ Partial Class Ventas_CatMedicos - - 'TxtMedico.Text = GvRow.DataKey("Medico") 'TxtCedulaProfecional.Text = GvRow.DataKey("CedulaProfesional") 'TxtFechaNacimiento.Text = GvRow.DataKey("FechaNacimiento").ToDate().ToString("dd/MM/yyyy") @@ -239,8 +252,6 @@ Partial Class Ventas_CatMedicos DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1")) End If - - txtFechaI.Text = NowADS().FirstDayOfMonth.ToShortDateString txtFechaF.Text = NowADS().ToShortDateString @@ -254,7 +265,6 @@ Partial Class Ventas_CatMedicos Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) - Dim objVentas As New ClsVentas Dim CveVendedor As Integer = If(UsuarioActual.CveVendedor > 0, UsuarioActual.CveVendedor, -1) Dim CveCliente As Integer = If(DdlClientes.SelectedValue.ToEntero > 0, DdlClientes.SelectedValue.ToEntero, -1)