Commit inicial Ventas Productivo
This commit is contained in:
652
Prospectos/Solicitudes/CatProspectosSolicitudes.aspx.vb.exclude
Normal file
652
Prospectos/Solicitudes/CatProspectosSolicitudes.aspx.vb.exclude
Normal file
@@ -0,0 +1,652 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
Imports System.Runtime.InteropServices
|
||||
Imports System.IO
|
||||
Imports System.Data
|
||||
|
||||
Partial Class Prospectos_Solicitudes_CatProspectosSolicitudes
|
||||
Inherits ClsPaginas
|
||||
'Confinguración
|
||||
|
||||
Private Property DTProspectosValores As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DTProspectosValores"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTProspectosValores") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private ReadOnly Property CveProspecto As Integer
|
||||
Get
|
||||
Return ViewState("CveProspecto").ToString.ToEntero
|
||||
End Get
|
||||
End Property
|
||||
Private ReadOnly Property CveProspectoSolicitud As Integer
|
||||
Get
|
||||
Return ViewState("CveProspectoSolicitud").ToString.ToEntero
|
||||
End Get
|
||||
End Property
|
||||
Private ReadOnly Property CveProspectoApoyo As Integer
|
||||
Get
|
||||
Return ViewState("CveProspectoApoyo").ToString.ToEntero
|
||||
End Get
|
||||
End Property
|
||||
Private ReadOnly Property CveApoyoTipo As Integer
|
||||
Get
|
||||
Return ViewState("CveApoyoTipo").ToString.ToEntero
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
|
||||
DdlPaises.DataSource = GlobalDTGralPaises : DdlPaises.DataBind()
|
||||
DdlEmpresaPaises.DataSource = GlobalDTGralPaises : DdlEmpresaPaises.DataBind()
|
||||
DdlFiscalEstados.DataSource = GlobalDTGralEstados(1) : DdlFiscalEstados.DataBind()
|
||||
|
||||
'DdlMunicipios.DataSource = GlobalDTGralMunicipios : DdlMunicipios.DataBind()
|
||||
|
||||
If Request("CveProspecto") IsNot Nothing AndAlso IsNumeric(Request("CveProspecto")) AndAlso Request("CveProspecto").ToEntero > 0 Then
|
||||
ViewState("CveProspecto") = Request("CveProspecto")
|
||||
CargaDatos()
|
||||
'Configuración de Modalidad Update
|
||||
BtnGuardar.Text = "Guardar Cambios"
|
||||
LtlTitulo.Text = "Consulta del Prospecto:"
|
||||
|
||||
If Request("CveProspectoSolicitud") IsNot Nothing AndAlso IsNumeric(Request("CveProspectoSolicitud")) AndAlso Request("CveProspectoSolicitud").ToEntero > 0 Then
|
||||
ViewState("CveProspectoSolicitud") = Request("CveProspectoSolicitud")
|
||||
CargaDatosProspectosSolicitudes()
|
||||
'Configuración de Modalidad Update
|
||||
BtnAgregarSolicitud.Text = "Guardar Cambios"
|
||||
Else
|
||||
|
||||
|
||||
ViewState("CveProspectoSolicitud") = -1
|
||||
ViewState("CveProspectoApoyo") = -1
|
||||
End If
|
||||
|
||||
Else
|
||||
CargaEstados(DdlEstados, DdlPaises.SelectedValue.ToEntero)
|
||||
CargaMunicipios(DdlMunicipios, DdlEstados.SelectedValue.ToEntero)
|
||||
|
||||
CargaEstados(DdlEmpresaEstados, DdlEmpresaPaises.SelectedValue.ToEntero)
|
||||
CargaMunicipios(DdlEmpresaMunicipios, DdlEmpresaEstados.SelectedValue.ToEntero)
|
||||
|
||||
CargaMunicipios(DdlFiscalMunicipios, DdlFiscalEstados.SelectedValue.ToEntero)
|
||||
|
||||
ViewState("CveProspecto") = -1
|
||||
End If
|
||||
|
||||
CargarSolicitudesTipos()
|
||||
CargarApoyosTipos()
|
||||
CargarSolicitudesEstatus()
|
||||
|
||||
CargaCaracteristicas()
|
||||
CargarProspectosApoyos()
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjProspectos As New ClsProspectos
|
||||
If ObjProspectos.GetProspectos(CveProspecto, "-1", "-1", -1, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa) Then
|
||||
If ObjProspectos.DtResultados.Rows.Count > 0 Then
|
||||
TxtCveProspecto.Text = ObjProspectos.CveProspecto.ToString
|
||||
TxtApellidoPaterno.Text = ObjProspectos.ApellidoPaterno
|
||||
TxtApellidoMaterno.Text = ObjProspectos.ApellidoMaterno
|
||||
TxtNombres.Text = ObjProspectos.Nombres
|
||||
TxtFechaNacimiento.Text = ObjProspectos.FechaNacimiento.ToString
|
||||
TxtLugarNacimiento.Text = ObjProspectos.LugarNacimiento
|
||||
TxtRFC.Text = ObjProspectos.RFC
|
||||
TxtNacionalidad.Text = ObjProspectos.Nacionalidad
|
||||
TxtCalle.Text = ObjProspectos.Calle
|
||||
TxtNumero.Text = ObjProspectos.Numero
|
||||
TxtNumeroInterior.Text = ObjProspectos.NumeroInterior
|
||||
TxtColonia.Text = ObjProspectos.Colonia
|
||||
TxtCodigoPostal.Text = ObjProspectos.CodigoPostal.ToString
|
||||
DdlSexo.SelectedValue = ObjProspectos.Sexo.ToString
|
||||
|
||||
DdlPaises.SelectedValue = ObjProspectos.CvePais.ToString
|
||||
CargaEstados(DdlEstados, DdlPaises.SelectedValue.ToEntero)
|
||||
DdlEstados.SelectedValue = ObjProspectos.CveEstado.ToString
|
||||
CargaMunicipios(DdlMunicipios, DdlEstados.SelectedValue.ToEntero)
|
||||
DdlMunicipios.SelectedValue = ObjProspectos.CveMunicipio.ToString
|
||||
|
||||
TxtTelefono.Text = ObjProspectos.Telefono
|
||||
TxtFax.Text = ObjProspectos.Fax
|
||||
TxtCorreo.Text = ObjProspectos.Correo
|
||||
TxtEmpresaNombre.Text = ObjProspectos.EmpresaNombre
|
||||
TxtEmpresaGiro.Text = ObjProspectos.EmpresaGiro
|
||||
TxtEmpresaSector.Text = ObjProspectos.EmpresaSector
|
||||
TxtEmpresaPagina.Text = ObjProspectos.EmpresaPagina
|
||||
TxtEmpresaCalle.Text = ObjProspectos.EmpresaCalle
|
||||
TxtEmpresaNumero.Text = ObjProspectos.EmpresaNumero
|
||||
TxtEmpresaColonia.Text = ObjProspectos.EmpresaColonia
|
||||
TxtEmpresaCodigoPostal.Text = ObjProspectos.EmpresaCodigoPostal
|
||||
|
||||
DdlEmpresaPaises.SelectedValue = ObjProspectos.CveEmpresaPais.ToString
|
||||
CargaEstados(DdlEmpresaEstados, DdlEmpresaPaises.SelectedValue.ToEntero)
|
||||
DdlEmpresaEstados.SelectedValue = ObjProspectos.CveEmpresaEstado.ToString
|
||||
CargaMunicipios(DdlEmpresaMunicipios, DdlEmpresaEstados.SelectedValue.ToEntero)
|
||||
DdlEmpresaMunicipios.SelectedValue = ObjProspectos.CveEmpresaMunicipio.ToString
|
||||
|
||||
TxtEmpresaTelefono.Text = ObjProspectos.EmpresaTelefono
|
||||
TxtEmpresaFax.Text = ObjProspectos.EmpresaFax
|
||||
TxtEmpresaCorreo.Text = ObjProspectos.EmpresaCorreo
|
||||
TxtEmpresaPuesto.Text = ObjProspectos.EmpresaPuesto
|
||||
TxtEmpresaEspecialidad.Text = ObjProspectos.EmpresaEspecialidad
|
||||
ChkEnvioCorrespondencia.Checked = ObjProspectos.EnvioCorrespondencia
|
||||
TxtFiscalRazonSocial.Text = ObjProspectos.FiscalRazonSocial
|
||||
TxtFiscalDomicilio.Text = ObjProspectos.FiscalDomicilio
|
||||
TxtFiscalColonia.Text = ObjProspectos.FiscalColonia
|
||||
TxtFiscalCodigoPostal.Text = ObjProspectos.FiscalCodigoPostal
|
||||
|
||||
CargaEstados(DdlFiscalEstados, 1)
|
||||
DdlFiscalEstados.SelectedValue = ObjProspectos.CveFiscalEstado.ToString
|
||||
CargaMunicipios(DdlFiscalMunicipios, DdlFiscalEstados.SelectedValue.ToEntero)
|
||||
DdlFiscalMunicipios.SelectedValue = ObjProspectos.CveFiscalMunicipio.ToString
|
||||
|
||||
TxtFiscalRFC.Text = ObjProspectos.FiscalRFC
|
||||
|
||||
'Cargar los Valores de las Caractertisticas
|
||||
If ObjProspectos.GetProspectosValores(CveProspecto) Then
|
||||
ViewState("DTProspectosValores") = ObjProspectos.DtResultados
|
||||
End If
|
||||
|
||||
'Cargar Referencias de Beneficiarios
|
||||
If ObjProspectos.GetProspectosReferencias(CveProspecto) Then
|
||||
Dim Beneficiarios As DataTable = ObjProspectos.DtResultados.FiltraParametros("CveTipoReferencia = " + ClsProspectos.TipoReferencias.Beneficiario.ToEntero.ToString)
|
||||
Dim Sustitutos As DataTable = ObjProspectos.DtResultados.FiltraParametros("CveTipoReferencia = " + ClsProspectos.TipoReferencias.Sustituto.ToEntero.ToString)
|
||||
|
||||
If Beneficiarios.Rows.Count > 0 Then
|
||||
HdnCveReferencia1.Value = Beneficiarios.Rows(0)("CveReferencia").ToString
|
||||
TxtNombreReferencia1.Text = Beneficiarios.Rows(0)("NombreReferencia").ToString
|
||||
TxtParentesco1.Text = Beneficiarios.Rows(0)("Parentesco").ToString
|
||||
TxtPorcentaje1.Text = If(Beneficiarios.Rows(0)("Porcentaje").ToString.ToDouble <> 0, Beneficiarios.Rows(0)("Porcentaje").ToString, "")
|
||||
End If
|
||||
If Beneficiarios.Rows.Count > 1 Then
|
||||
HdnCveReferencia2.Value = Beneficiarios.Rows(1)("CveReferencia").ToString
|
||||
TxtNombreReferencia2.Text = Beneficiarios.Rows(1)("NombreReferencia").ToString
|
||||
TxtParentesco2.Text = Beneficiarios.Rows(1)("Parentesco").ToString
|
||||
TxtPorcentaje2.Text = If(Beneficiarios.Rows(1)("Porcentaje").ToString.ToDouble <> 0, Beneficiarios.Rows(1)("Porcentaje").ToString, "")
|
||||
End If
|
||||
If Beneficiarios.Rows.Count > 2 Then
|
||||
HdnCveReferencia3.Value = Beneficiarios.Rows(2)("CveReferencia").ToString
|
||||
TxtNombreReferencia3.Text = Beneficiarios.Rows(2)("NombreReferencia").ToString
|
||||
TxtParentesco3.Text = Beneficiarios.Rows(2)("Parentesco").ToString
|
||||
TxtPorcentaje3.Text = If(Beneficiarios.Rows(2)("Porcentaje").ToString.ToDouble <> 0, Beneficiarios.Rows(2)("Porcentaje").ToString, "")
|
||||
End If
|
||||
If Beneficiarios.Rows.Count > 3 Then
|
||||
HdnCveReferencia4.Value = Beneficiarios.Rows(3)("CveReferencia").ToString
|
||||
TxtNombreReferencia4.Text = Beneficiarios.Rows(3)("NombreReferencia").ToString
|
||||
TxtParentesco4.Text = Beneficiarios.Rows(3)("Parentesco").ToString
|
||||
TxtPorcentaje4.Text = If(Beneficiarios.Rows(3)("Porcentaje").ToString.ToDouble <> 0, Beneficiarios.Rows(3)("Porcentaje").ToString, "")
|
||||
End If
|
||||
|
||||
If Sustitutos.Rows.Count > 0 Then
|
||||
HdnCveReferenciaSustituto1.Value = Sustitutos.Rows(0)("CveReferencia").ToString
|
||||
TxtNombreReferenciaSustituto1.Text = Sustitutos.Rows(0)("NombreReferencia").ToString
|
||||
TxtParentescoSustituto1.Text = Sustitutos.Rows(0)("Parentesco").ToString
|
||||
End If
|
||||
If Sustitutos.Rows.Count > 1 Then
|
||||
HdnCveReferenciaSustituto2.Value = Sustitutos.Rows(1)("CveReferencia").ToString
|
||||
TxtNombreReferenciaSustituto2.Text = Sustitutos.Rows(1)("NombreReferencia").ToString
|
||||
TxtParentescoSustituto2.Text = Sustitutos.Rows(1)("Parentesco").ToString
|
||||
End If
|
||||
If Sustitutos.Rows.Count > 2 Then
|
||||
HdnCveReferenciaSustituto3.Value = Sustitutos.Rows(2)("CveReferencia").ToString
|
||||
TxtNombreReferenciaSustituto3.Text = Sustitutos.Rows(2)("NombreReferencia").ToString
|
||||
TxtParentescoSustituto3.Text = Sustitutos.Rows(2)("Parentesco").ToString
|
||||
End If
|
||||
End If
|
||||
|
||||
CargaCaracteristicas()
|
||||
CargarSolicitudes(CveProspecto)
|
||||
End If
|
||||
End If
|
||||
ObjProspectos.Dispose()
|
||||
End Sub
|
||||
Private Sub CargaEstados(ddl As DropDownList, CvePais As Integer)
|
||||
ddl.DataSource = GlobalDTGralEstados(CvePais) : ddl.DataBind()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaMunicipios(ddl As DropDownList, CveEstado As Integer)
|
||||
ddl.DataSource = GlobalDTGralMunicipios(CveEstado) : ddl.DataBind()
|
||||
End Sub
|
||||
|
||||
Protected Sub CargaCaracteristicas()
|
||||
Dim objClasificaciones As New ClsProspectos
|
||||
|
||||
If objClasificaciones.GetCaracteristicasClasificaciones(UsuarioActual.CveEmpresa) Then
|
||||
GvClasificaciones.DataSource = objClasificaciones.DtResultados
|
||||
GvClasificaciones.DataBind()
|
||||
End If
|
||||
|
||||
objClasificaciones.Dispose()
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnGuardar_Click(sender As Object, e As System.EventArgs) Handles BtnGuardar.Click
|
||||
|
||||
Dim ObjProspectos As New ClsProspectos
|
||||
If CveProspecto = -1 Then
|
||||
If ObjProspectos.AddProspectos(-1, TxtApellidoPaterno.Text.Trim, TxtApellidoMaterno.Text.Trim,
|
||||
TxtNombres.Text.Trim, TxtFechaNacimiento.Text.Trim.ToDate, TxtLugarNacimiento.Text.Trim, TxtRFC.Text.Trim, TxtNacionalidad.Text.Trim, DdlSexo.SelectedValue.ToEntero, TxtCalle.Text.Trim,
|
||||
TxtNumero.Text.Trim, TxtNumeroInterior.Text.Trim, "", "", TxtColonia.Text.Trim, TxtCodigoPostal.Text.Trim.ToEntero, DdlMunicipios.SelectedValue.ToEntero,
|
||||
TxtTelefono.Text.Trim, "", TxtFax.Text.Trim, "", TxtCorreo.Text.Trim, "", "", "", -1, -1, -1, TxtEmpresaNombre.Text.Trim, TxtEmpresaGiro.Text.Trim, TxtEmpresaSector.Text.Trim,
|
||||
TxtEmpresaPagina.Text.Trim, TxtEmpresaCalle.Text.Trim, TxtEmpresaNumero.Text.Trim, TxtEmpresaColonia.Text.Trim, TxtEmpresaCodigoPostal.Text.Trim, DdlEmpresaMunicipios.SelectedValue.ToEntero,
|
||||
TxtEmpresaTelefono.Text.Trim, TxtEmpresaFax.Text.Trim, TxtEmpresaCorreo.Text.Trim, TxtEmpresaPuesto.Text.Trim,
|
||||
TxtEmpresaEspecialidad.Text.Trim, ChkEnvioCorrespondencia.Checked, TxtFiscalRazonSocial.Text.Trim, TxtFiscalDomicilio.Text.Trim, TxtFiscalColonia.Text.Trim,
|
||||
TxtFiscalCodigoPostal.Text.Trim, DdlFiscalMunicipios.SelectedValue.ToEntero, TxtFiscalRFC.Text.Trim, -1, -1, -1, "", -1, -1, -1, False, "", -1, -1, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) > 0 Then
|
||||
ViewState("CveProspecto") = ObjProspectos.CveProspecto
|
||||
|
||||
GuardarCaracteristicas()
|
||||
GuardarReferencias()
|
||||
|
||||
Alert("El Prospecto se guardó correctamente.", TipoMensaje.MsgInformacion, "document.location.href=""/Prospectos/Prospectos.aspx"";")
|
||||
End If
|
||||
Else
|
||||
If ObjProspectos.UpdateProspectos(-1, TxtApellidoPaterno.Text.Trim, TxtApellidoMaterno.Text.Trim,
|
||||
TxtNombres.Text.Trim, TxtFechaNacimiento.Text.Trim.ToDate, TxtLugarNacimiento.Text.Trim, TxtRFC.Text.Trim, TxtNacionalidad.Text.Trim, DdlSexo.SelectedValue.ToEntero, TxtCalle.Text.Trim,
|
||||
TxtNumero.Text.Trim, TxtNumeroInterior.Text.Trim, "", "", TxtColonia.Text.Trim, TxtCodigoPostal.Text.Trim.ToEntero, DdlMunicipios.SelectedValue.ToEntero,
|
||||
TxtTelefono.Text.Trim, "", TxtFax.Text.Trim, "", TxtCorreo.Text.Trim, "", "", "", -1, -1, -1, TxtEmpresaNombre.Text.Trim, TxtEmpresaGiro.Text.Trim, TxtEmpresaSector.Text.Trim,
|
||||
TxtEmpresaPagina.Text.Trim, TxtEmpresaCalle.Text.Trim, TxtEmpresaNumero.Text.Trim, TxtEmpresaColonia.Text.Trim, TxtEmpresaCodigoPostal.Text.Trim, DdlEmpresaMunicipios.SelectedValue.ToEntero,
|
||||
TxtEmpresaTelefono.Text.Trim, TxtEmpresaFax.Text.Trim, TxtEmpresaCorreo.Text.Trim, TxtEmpresaPuesto.Text.Trim,
|
||||
TxtEmpresaEspecialidad.Text.Trim, ChkEnvioCorrespondencia.Checked, TxtFiscalRazonSocial.Text.Trim, TxtFiscalDomicilio.Text.Trim, TxtFiscalColonia.Text.Trim,
|
||||
TxtFiscalCodigoPostal.Text.Trim, DdlFiscalMunicipios.SelectedValue.ToEntero, TxtFiscalRFC.Text.Trim, -1, -1, -1, "", -1, -1, -1, False, "", -1, -1, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveProspecto) Then
|
||||
|
||||
GuardarCaracteristicas()
|
||||
GuardarReferencias()
|
||||
|
||||
UpDatos.Update()
|
||||
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
End If
|
||||
|
||||
ObjProspectos.Dispose()
|
||||
End Sub
|
||||
|
||||
Protected Sub GuardarCaracteristicas()
|
||||
Dim objProspectosValores As New ClsProspectos
|
||||
For Each DR As GridViewRow In GvClasificaciones.Rows
|
||||
For Each DR_TipoCaracteristica As GridViewRow In DR.FCGridView("GvTiposCaracteristicas").Rows
|
||||
For Each DR_Caracteristica As GridViewRow In DR_TipoCaracteristica.FCGridView("GvCaracteristicas").Rows
|
||||
Dim CveOpcion As Integer = -1
|
||||
Dim CveValor As Integer = DR_Caracteristica.FCHiddenField("HdnCveValor").Value.ToEntero
|
||||
Dim Valor As String = DR_Caracteristica.FCTextBox("TxtValor").Text.Trim
|
||||
Dim CveCaracteristica As Integer = DR_Caracteristica.FCHiddenField("HdnCveCaracteristica").Value.ToEntero
|
||||
Select Case DR_Caracteristica.FCHiddenField("HdnEsOpcion").Value
|
||||
Case "1" 'Listado o DropDownList
|
||||
CveOpcion = DR_Caracteristica.FCDropDownList("DdlOpcion").SelectedValue.ToEntero
|
||||
Case "2" 'Radio o RadioButtonList
|
||||
CveOpcion = DR_Caracteristica.FCRadioButtonList("RbOpcion").SelectedValue.ToEntero
|
||||
End Select
|
||||
|
||||
|
||||
If CveValor = -1 Then
|
||||
objProspectosValores.AddProspectosValores(CveProspecto, CveCaracteristica, CveOpcion, If(Valor = "", "-1", Valor), UsuarioActual.CveUsuario)
|
||||
Else
|
||||
objProspectosValores.UpdateProspectosValores(CveProspecto, CveCaracteristica, CveOpcion, If(Valor = "", "-1", Valor), UsuarioActual.CveUsuario, CveValor)
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
Next
|
||||
objProspectosValores.Dispose()
|
||||
End Sub
|
||||
|
||||
Protected Sub GuardarReferencias()
|
||||
Dim objProspectosReferencias As New ClsProspectos
|
||||
|
||||
If HdnCveReferencia1.Value = "-1" Then
|
||||
objProspectosReferencias.AddProspectosReferencias(CveProspecto, ClsProspectos.TipoReferencias.Beneficiario, TxtNombreReferencia1.Text, TxtParentesco1.Text, "", TxtPorcentaje1.Text.ToDouble, UsuarioActual.CveUsuario)
|
||||
Else
|
||||
objProspectosReferencias.UpdateProspectosReferencias(CveProspecto, ClsProspectos.TipoReferencias.Beneficiario, TxtNombreReferencia1.Text, TxtParentesco1.Text, "", TxtPorcentaje1.Text.ToDouble, HdnCveReferencia1.Value.ToEntero)
|
||||
End If
|
||||
If HdnCveReferencia2.Value = "-1" Then
|
||||
objProspectosReferencias.AddProspectosReferencias(CveProspecto, ClsProspectos.TipoReferencias.Beneficiario, TxtNombreReferencia2.Text, TxtParentesco2.Text, "", TxtPorcentaje2.Text.ToDouble, UsuarioActual.CveUsuario)
|
||||
Else
|
||||
objProspectosReferencias.UpdateProspectosReferencias(CveProspecto, ClsProspectos.TipoReferencias.Beneficiario, TxtNombreReferencia2.Text, TxtParentesco2.Text, "", TxtPorcentaje2.Text.ToDouble, HdnCveReferencia2.Value.ToEntero)
|
||||
End If
|
||||
If HdnCveReferencia3.Value = "-1" Then
|
||||
objProspectosReferencias.AddProspectosReferencias(CveProspecto, ClsProspectos.TipoReferencias.Beneficiario, TxtNombreReferencia3.Text, TxtParentesco3.Text, "", TxtPorcentaje3.Text.ToDouble, UsuarioActual.CveUsuario)
|
||||
Else
|
||||
objProspectosReferencias.UpdateProspectosReferencias(CveProspecto, ClsProspectos.TipoReferencias.Beneficiario, TxtNombreReferencia3.Text, TxtParentesco3.Text, "", TxtPorcentaje3.Text.ToDouble, HdnCveReferencia3.Value.ToEntero)
|
||||
End If
|
||||
If HdnCveReferencia4.Value = "-1" Then
|
||||
objProspectosReferencias.AddProspectosReferencias(CveProspecto, ClsProspectos.TipoReferencias.Beneficiario, TxtNombreReferencia4.Text, TxtParentesco4.Text, "", TxtPorcentaje4.Text.ToDouble, UsuarioActual.CveUsuario)
|
||||
Else
|
||||
objProspectosReferencias.UpdateProspectosReferencias(CveProspecto, ClsProspectos.TipoReferencias.Beneficiario, TxtNombreReferencia4.Text, TxtParentesco4.Text, "", TxtPorcentaje4.Text.ToDouble, HdnCveReferencia4.Value.ToEntero)
|
||||
End If
|
||||
|
||||
|
||||
If HdnCveReferenciaSustituto1.Value = "-1" Then
|
||||
objProspectosReferencias.AddProspectosReferencias(CveProspecto, ClsProspectos.TipoReferencias.Sustituto, TxtNombreReferenciaSustituto1.Text, TxtParentescoSustituto1.Text, "", 0, UsuarioActual.CveUsuario)
|
||||
Else
|
||||
objProspectosReferencias.UpdateProspectosReferencias(CveProspecto, ClsProspectos.TipoReferencias.Sustituto, TxtNombreReferenciaSustituto1.Text, TxtParentescoSustituto1.Text, "", 0, HdnCveReferenciaSustituto1.Value.ToEntero)
|
||||
End If
|
||||
If HdnCveReferenciaSustituto2.Value = "-1" Then
|
||||
objProspectosReferencias.AddProspectosReferencias(CveProspecto, ClsProspectos.TipoReferencias.Sustituto, TxtNombreReferenciaSustituto2.Text, TxtParentescoSustituto2.Text, "", 0, UsuarioActual.CveUsuario)
|
||||
Else
|
||||
objProspectosReferencias.UpdateProspectosReferencias(CveProspecto, ClsProspectos.TipoReferencias.Sustituto, TxtNombreReferenciaSustituto2.Text, TxtParentescoSustituto2.Text, "", 0, HdnCveReferenciaSustituto2.Value.ToEntero)
|
||||
End If
|
||||
If HdnCveReferenciaSustituto3.Value = "-1" Then
|
||||
objProspectosReferencias.AddProspectosReferencias(CveProspecto, ClsProspectos.TipoReferencias.Sustituto, TxtNombreReferenciaSustituto3.Text, TxtParentescoSustituto3.Text, "", 0, UsuarioActual.CveUsuario)
|
||||
Else
|
||||
objProspectosReferencias.UpdateProspectosReferencias(CveProspecto, ClsProspectos.TipoReferencias.Sustituto, TxtNombreReferenciaSustituto3.Text, TxtParentescoSustituto3.Text, "", 0, HdnCveReferenciaSustituto3.Value.ToEntero)
|
||||
End If
|
||||
objProspectosReferencias.Dispose()
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnEliminar_Click(sender As Object, e As System.EventArgs) Handles BtnEliminar.Click
|
||||
|
||||
Dim ObjProspectos As New ClsProspectos()
|
||||
If ObjProspectos.RemoveProspectos(CveProspecto) Then
|
||||
Alert("El Prospecto se Eliminó correctamente.", TipoMensaje.MsgInformacion, "document.location.href=""/Prospectos/CatProspectos.aspx""")
|
||||
End If
|
||||
ObjProspectos.Dispose()
|
||||
End Sub
|
||||
|
||||
Protected Sub GvClasificaciones_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvClasificaciones.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DBCampo("CveCaracteristicaClasificacion").ToEntero > 1 Then
|
||||
e.Row.FCLabel("LblClasificacion").CssClass = "CaracteristicaPrincipal"
|
||||
End If
|
||||
|
||||
Dim objTiposCaracteristicas As New ClsProspectos
|
||||
|
||||
If objTiposCaracteristicas.GetTiposCaracteristicas(UsuarioActual.CveEmpresa) Then
|
||||
With e.Row.FCGridView("GvTiposCaracteristicas")
|
||||
.DataSource = objTiposCaracteristicas.DtResultados.FiltraParametros("CveCaracteristicaClasificacion = " + e.Row.DBCampo("CveCaracteristicaClasificacion"))
|
||||
.DataBind()
|
||||
End With
|
||||
End If
|
||||
|
||||
objTiposCaracteristicas.Dispose()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvTiposCaracteristicas_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DBCampo("CaracteristicaClasificacion").Trim = "" Then
|
||||
e.Row.FCLabel("LblTipoCaracteristica").CssClass = "CaracteristicaPrincipal"
|
||||
End If
|
||||
|
||||
Dim objCaracteristicas As New ClsProspectos
|
||||
|
||||
If objCaracteristicas.GetCaracteristicas(UsuarioActual.CveEmpresa) Then
|
||||
With e.Row.FCGridView("GvCaracteristicas")
|
||||
.DataSource = objCaracteristicas.DtResultados.FiltraParametros("Estatus = 'Activo' and CveCaracteristicaTipo = " + e.Row.DBCampo("CveCaracteristicaTipo"))
|
||||
.DataBind()
|
||||
End With
|
||||
End If
|
||||
|
||||
objCaracteristicas.Dispose()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvCaracteristicas_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
Dim EsOpcion As Integer = e.Row.FCHiddenField("HdnEsOpcion").Value.ToEntero
|
||||
Dim CveCaracteristica As Integer = e.Row.DBCampo("CveCaracteristica").ToEntero
|
||||
|
||||
'Dim RowProspectoValor As DataRowCollection = CType(ViewState("DTPS"), DataTable).FiltraParametros("CveCaracteristica = " + CveCaracteristica.ToString).Rows
|
||||
Dim RowProspectoValor As DataRowCollection = DTProspectosValores.FiltraParametros("CveCaracteristica = " + CveCaracteristica.ToString).Rows
|
||||
Dim CveValor As Integer = -1
|
||||
Dim Valor As String = ""
|
||||
Dim CveOpcion As Integer = -1
|
||||
|
||||
If RowProspectoValor.Count > 0 Then
|
||||
e.Row.FCHiddenField("HdnCveValor").Value = RowProspectoValor(0)("CveValor").ToString
|
||||
Valor = RowProspectoValor(0)("Valor").ToString
|
||||
CveOpcion = RowProspectoValor(0)("CveOpcion").ToString.ToEntero
|
||||
End If
|
||||
|
||||
Select Case EsOpcion
|
||||
Case 0, 4 'Texto, Multiline
|
||||
With e.Row.FCTextBox("TxtValor")
|
||||
.Text = Valor
|
||||
.Visible = True
|
||||
If EsOpcion = 4 Then
|
||||
.Rows = 3
|
||||
.TextMode = TextBoxMode.MultiLine
|
||||
End If
|
||||
End With
|
||||
Case 1, 2 'DropDownList, Radios
|
||||
Dim objOpciones As New ClsProspectos
|
||||
If objOpciones.GetCaracteristicasOpciones(CveCaracteristica, UsuarioActual.CveEmpresa) Then
|
||||
If EsOpcion = 1 Then
|
||||
With e.Row.FCDropDownList("DdlOpcion")
|
||||
.Visible = True
|
||||
.DataSource = objOpciones.DtResultados.FiltraParametros("Estatus = 'Activo'")
|
||||
.DataBind()
|
||||
.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
|
||||
.SelectedValue = CveOpcion.ToString
|
||||
End With
|
||||
ElseIf EsOpcion = 2 Then
|
||||
With e.Row.FCRadioButtonList("RbOpcion")
|
||||
.Visible = True
|
||||
.DataSource = objOpciones.DtResultados.FiltraParametros("Estatus = 'Activo'")
|
||||
.DataBind()
|
||||
If CveOpcion > 0 Then
|
||||
.SelectedValue = CveOpcion.ToString
|
||||
End If
|
||||
End With
|
||||
End If
|
||||
End If
|
||||
|
||||
objOpciones.Dispose()
|
||||
Case 3 'Fecha
|
||||
With e.Row.FCTextBox("TxtValor")
|
||||
If Valor <> "" Then
|
||||
.Text = Valor
|
||||
End If
|
||||
.Visible = True
|
||||
.Width = New Unit(80)
|
||||
End With
|
||||
e.Row.FCImageButton("ImgTxtValor").Visible = True
|
||||
e.Row.FCMaskedEditExtender("MEETxtValor").Enabled = True
|
||||
e.Row.FCCalendarExtender("CETxtValor").Enabled = True
|
||||
End Select
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlPaises_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPaises.SelectedIndexChanged
|
||||
CargaEstados(DdlEstados, DdlPaises.SelectedValue.ToEntero)
|
||||
UPPEstados.Update()
|
||||
CargaMunicipios(DdlMunicipios, DdlEstados.SelectedValue.ToEntero)
|
||||
UPPMunicipios.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlEstados_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlEstados.SelectedIndexChanged
|
||||
CargaMunicipios(DdlMunicipios, DdlEstados.SelectedValue.ToEntero)
|
||||
UPPMunicipios.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlEmpresaPaises_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlEmpresaPaises.SelectedIndexChanged
|
||||
CargaEstados(DdlEmpresaEstados, DdlEmpresaPaises.SelectedValue.ToEntero)
|
||||
UPPEmpresaEstados.Update()
|
||||
CargaMunicipios(DdlEmpresaMunicipios, DdlEmpresaEstados.SelectedValue.ToEntero)
|
||||
UPPEmpresaMunicipios.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlEmpresaEstados_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlEmpresaEstados.SelectedIndexChanged
|
||||
CargaMunicipios(DdlEmpresaMunicipios, DdlEmpresaEstados.SelectedValue.ToEntero)
|
||||
UPPEmpresaMunicipios.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlFiscalEstados_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlFiscalEstados.SelectedIndexChanged
|
||||
CargaMunicipios(DdlFiscalMunicipios, DdlFiscalEstados.SelectedValue.ToEntero)
|
||||
UPPFiscalMunicipios.Update()
|
||||
End Sub
|
||||
|
||||
#Region "E S C O L A R I D A D"
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "S O L I C I T U D E S"
|
||||
Private Sub CargarSolicitudesTipos()
|
||||
DdlSolicitudTipo.DataSource = GlobalDTProspectosSolicitudesTipos(UsuarioActual.CveEmpresa)
|
||||
DdlSolicitudTipo.DataBind()
|
||||
End Sub
|
||||
Private Sub CargarSolicitudesEstatus()
|
||||
DdlSolicitudEstatus.DataSource = GlobalDTProspectosSolicitudesEstatus(UsuarioActual.CveEmpresa)
|
||||
DdlSolicitudEstatus.DataBind()
|
||||
End Sub
|
||||
Private Sub CargarSolicitudes(CveProspecto As Integer)
|
||||
Dim ObjSolicitudes As New ClsProspectos
|
||||
|
||||
If CveProspecto > 0 Then
|
||||
If ObjSolicitudes.GetProspectosSolicitudes(CveProspecto, -1, -1, UsuarioActual.CveEmpresa) Then
|
||||
GvSolicitudes.DataSource = ObjSolicitudes.DtResultados
|
||||
Else
|
||||
GvSolicitudes.DataSource = Nothing
|
||||
End If
|
||||
End If
|
||||
|
||||
ObjSolicitudes.Dispose()
|
||||
GvSolicitudes.DataBind()
|
||||
End Sub
|
||||
Private Sub CargarSolicitudesApoyos()
|
||||
Dim ObjSolicitudesApoyos As New ClsProspectos
|
||||
|
||||
If Request("CveProspectoSolicitud") IsNot Nothing AndAlso IsNumeric(Request("CveProspectoSolicitud")) AndAlso Request("CveProspectoSolicitud").ToEntero > 0 Then
|
||||
If ObjSolicitudesApoyos.GetProspectosSolicitudesApoyos(CveProspectoSolicitud, -1) Then
|
||||
GvApoyos.DataSource = ObjSolicitudesApoyos.DtResultados
|
||||
Else
|
||||
GvApoyos.DataSource = Nothing
|
||||
End If
|
||||
End If
|
||||
|
||||
ObjSolicitudesApoyos.Dispose()
|
||||
GvApoyos.DataBind()
|
||||
End Sub
|
||||
Protected Sub CargaDatosProspectosSolicitudes()
|
||||
Dim ObjProspectosSolicitudes As New ClsProspectos
|
||||
|
||||
If ObjProspectosSolicitudes.GetProspectosSolicitudes(CveProspecto, CveApoyoTipo, CveProspectoSolicitud, UsuarioActual.CveEmpresa) Then
|
||||
If ObjProspectosSolicitudes.DtResultados.Rows.Count > 0 Then
|
||||
TxtSolicitud.Text = ObjProspectosSolicitudes.Solicitud.ToString
|
||||
TxtDescripcion.Text = ObjProspectosSolicitudes.Descripcion.ToString
|
||||
DdlSolicitudTipo.SelectedValue = ObjProspectosSolicitudes.CveSolicitudTipo.ToString
|
||||
DdlSolicitudEstatus.SelectedValue = ObjProspectosSolicitudes.CveSolicitudEstatus.ToString
|
||||
|
||||
Tab.ActiveTabIndex = 3
|
||||
End If
|
||||
End If
|
||||
ObjProspectosSolicitudes.Dispose()
|
||||
|
||||
End Sub
|
||||
Private Sub CargarApoyosTipos()
|
||||
DdlApoyoTipo.DataSource = GlobalDTProspectosApoyosTipos(UsuarioActual.CveEmpresa)
|
||||
DdlApoyoTipo.DataBind()
|
||||
End Sub
|
||||
Private Sub CargarProspectosApoyos()
|
||||
DdlProspectoApoyo.DataSource = GlobalDTProspectosApoyos(UsuarioActual.CveEmpresa)
|
||||
DdlProspectoApoyo.DataBind()
|
||||
End Sub
|
||||
#End Region
|
||||
Protected Sub BtnAgregarSolicitud_Click(sender As Object, e As EventArgs) Handles BtnAgregarSolicitud.Click
|
||||
Dim ObjSolicitudes As New ClsProspectos
|
||||
If CveProspectoSolicitud = -1 Then
|
||||
If ObjSolicitudes.AddProspectosSolicitudes(CveProspecto, DdlApoyoTipo.SelectedValue.ToEntero, TxtSolicitud.Text.Trim, TxtDescripcion.Text.Trim, "", DdlSolicitudTipo.SelectedValue.ToEntero, DdlSolicitudEstatus.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
ViewState("CveProspectoSolicitud") = ObjSolicitudes.CveProspectoSolicitud
|
||||
UpSolicitudes.Update()
|
||||
Alert("La Solicitud se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
If ObjSolicitudes.GetProspectosSolicitudes(CveProspecto, -1, -1, UsuarioActual.CveEmpresa) Then
|
||||
GvSolicitudes.DataSource = ObjSolicitudes.DtResultados
|
||||
Else
|
||||
GvSolicitudes.DataSource = Nothing
|
||||
End If
|
||||
GvSolicitudes.DataBind()
|
||||
End If
|
||||
Else
|
||||
If ObjSolicitudes.UpdateProspectosSolicitudes(CveProspecto, TxtSolicitud.Text.Trim, TxtDescripcion.Text.Trim, "", DdlSolicitudTipo.SelectedValue.ToEntero, DdlSolicitudEstatus.SelectedValue.ToEntero, CveProspectoSolicitud) Then
|
||||
UpSolicitudes.Update()
|
||||
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
If ObjSolicitudes.GetProspectosSolicitudes(CveProspecto, -1, -1, UsuarioActual.CveEmpresa) Then
|
||||
GvSolicitudes.DataSource = ObjSolicitudes.DtResultados
|
||||
Else
|
||||
GvSolicitudes.DataSource = Nothing
|
||||
End If
|
||||
GvSolicitudes.DataBind()
|
||||
End If
|
||||
End If
|
||||
|
||||
ObjSolicitudes.Dispose()
|
||||
End Sub
|
||||
|
||||
'Protected Sub BtnNuevaSolicitud_Click(sender As Object, e As EventArgs) Handles BtnNuevaSolicitud.Click
|
||||
' If CveProspectoSolicitud > -1 Then
|
||||
' ViewState("CveProspectoSolicitud") = -1
|
||||
' Response.Redirect("/Prospectos/Solicitudes/CatProspectosSolicitudes.aspx?CveProspecto=" & CveProspecto & "")
|
||||
' Tab.TabIndex = 3
|
||||
' End If
|
||||
'End Sub
|
||||
|
||||
Protected Sub GvSolicitudes_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GvSolicitudes.RowCommand
|
||||
Dim ObjProsp As New ClsProspectos
|
||||
If e.CommandName = "Carga" Then
|
||||
If ObjProsp.GetProspectosSolicitudes(-1, -1, e.CommandArgument.ToString.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
ViewState("CveProspectoSolicitud") = e.CommandArgument.ToString.ToEntero
|
||||
TxtSolicitud.Text = ObjProsp.Solicitud
|
||||
TxtDescripcion.Text = ObjProsp.Descripcion
|
||||
DdlSolicitudTipo.SelectedValue = ObjProsp.CveSolicitudTipo.ToString
|
||||
DdlSolicitudEstatus.SelectedValue = ObjProsp.CveSolicitudEstatus.ToString
|
||||
UpAgregarSolicitud.Update()
|
||||
RegistraScript("$find('CPESolicitud').expandPanel();")
|
||||
End If
|
||||
End If
|
||||
If e.CommandName = "CargaApoyoSolicitud" Then
|
||||
Dim Gvr As GridViewRow = DirectCast(DirectCast(e.CommandSource, ImageButton).BindingContainer, GridViewRow)
|
||||
GvSolicitudes.SelectedIndex = Gvr.RowIndex
|
||||
ViewState("CveProspectoSolicitud") = e.CommandArgument.ToString.ToEntero
|
||||
If ObjProsp.GetProspectosSolicitudesApoyos(e.CommandArgument.ToString.ToEntero, -1) Then
|
||||
TxtCantidad.Text = ""
|
||||
TxtImporte.Text = ""
|
||||
PnlApoyos.Visible = True
|
||||
UppApoyos.Update()
|
||||
LblTituloApoyo.Text = Gvr.FCLinkButton("LnkSolicitud").Text
|
||||
GvApoyos.DataSource = ObjProsp.DtResultados
|
||||
GvApoyos.DataBind()
|
||||
End If
|
||||
|
||||
ObjProsp.Dispose()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkApoyoAgregar_Click(sender As Object, e As EventArgs) Handles LnkApoyoAgregar.Click
|
||||
|
||||
Dim ObjApoyo As New ClsProspectos
|
||||
|
||||
If ObjApoyo.AddProspectosSolicitudesApoyos(CveProspectoSolicitud, DdlProspectoApoyo.SelectedValue.ToEntero, TxtCantidad.Text.ToDouble, TxtImporte.Text.ToDouble, 1) Then
|
||||
|
||||
GvApoyos.DataSource = ObjApoyo.DtResultados
|
||||
GvApoyos.DataBind()
|
||||
Alert("Apoyo Agregado")
|
||||
End If
|
||||
|
||||
ObjApoyo.Dispose()
|
||||
End Sub
|
||||
|
||||
Protected Sub GvSolicitudes_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvSolicitudes.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(65)
|
||||
e.Row.Cells(1).Width = Unit.Pixel(300)
|
||||
e.Row.Cells(2).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(3).Width = Unit.Pixel(80)
|
||||
e.Row.Cells(4).Width = Unit.Pixel(50)
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("Apoyos").ToEntero > 0 Then
|
||||
e.Row.FCImageButton("ImgFlag").ImageUrl = "/Imagenes/flag_green.png"
|
||||
e.Row.FCImageButton("ImgFlag").ToolTip = String.Format("Apoyos:{0}", e.Row.DBCampo("Apoyos"))
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user