5841 lines
226 KiB
VB.net
5841 lines
226 KiB
VB.net
Option Strict On
|
|
|
|
Imports System.Data
|
|
Imports Extensiones
|
|
Imports System.IO
|
|
|
|
Imports System.Web.Services
|
|
Imports System.Web.Script.Serialization
|
|
Imports System.Globalization
|
|
|
|
|
|
Partial Class RH_Reclutamiento
|
|
Inherits ClsPaginas
|
|
|
|
Protected CveTipoEncuestaSeccionPersonal As Integer = 2
|
|
|
|
Protected CveTipoEncuestaSeccionReferencias As Integer = 3
|
|
|
|
|
|
|
|
Private Property CveEstatusPersonal As Integer
|
|
Get
|
|
If ViewState("CveEstatusPersonal") Is Nothing Then
|
|
Return -1
|
|
Else
|
|
Return DirectCast(ViewState("CveEstatusPersonal"), Integer)
|
|
End If
|
|
End Get
|
|
Set(value As Integer)
|
|
ViewState("CveEstatusPersonal") = value
|
|
End Set
|
|
|
|
End Property
|
|
Private Property TempImgFileName As String
|
|
Get
|
|
If ViewState("TempImgFileName") Is Nothing Then
|
|
Return ""
|
|
Else
|
|
Return ViewState("TempImgFileName").ToString()
|
|
End If
|
|
End Get
|
|
Set(value As String)
|
|
ViewState("TempImgFileName") = value
|
|
End Set
|
|
End Property
|
|
Private Property URL As String
|
|
Get
|
|
If ViewState("URL") Is Nothing Then
|
|
Return ""
|
|
Else
|
|
Return ViewState("URL").ToString()
|
|
End If
|
|
End Get
|
|
Set(value As String)
|
|
ViewState("URL") = value
|
|
End Set
|
|
End Property
|
|
Property Edad As Integer
|
|
Get
|
|
If ViewState("Edad") Is Nothing Then
|
|
Return -1
|
|
Else
|
|
Return DirectCast(ViewState("Edad"), Integer)
|
|
End If
|
|
End Get
|
|
Set(value As Integer)
|
|
ViewState("Edad") = value
|
|
End Set
|
|
End Property
|
|
Private Property MotivoDescarto As String
|
|
Get
|
|
If ViewState("MotivoDescarto") Is Nothing Then
|
|
Return ""
|
|
Else
|
|
Return ViewState("MotivoDescarto").ToString()
|
|
End If
|
|
End Get
|
|
Set(value As String)
|
|
ViewState("MotivoDescarto") = value
|
|
End Set
|
|
End Property
|
|
|
|
Property CveSubProyecto As Integer
|
|
Get
|
|
If ViewState("CveSubProyecto") Is Nothing Then
|
|
Return -1
|
|
Else
|
|
Return DirectCast(ViewState("CveSubProyecto"), Integer)
|
|
End If
|
|
End Get
|
|
Set(value As Integer)
|
|
ViewState("CveSubProyecto") = value
|
|
End Set
|
|
End Property
|
|
|
|
Property CveSubProyectoZona As Integer
|
|
Get
|
|
If ViewState("CveSubProyectoZona") Is Nothing Then
|
|
Return -1
|
|
Else
|
|
Return DirectCast(ViewState("CveSubProyectoZona"), Integer)
|
|
End If
|
|
End Get
|
|
Set(value As Integer)
|
|
ViewState("CveSubProyectoZona") = value
|
|
End Set
|
|
End Property
|
|
|
|
#Region "Propiedades Paso Uno"
|
|
|
|
Private Property IndexActual As Integer
|
|
Get
|
|
If ViewState("IndexActual") Is Nothing Then
|
|
Return -1
|
|
Else
|
|
Return DirectCast(ViewState("IndexActual"), Integer)
|
|
End If
|
|
End Get
|
|
Set(value As Integer)
|
|
ViewState("IndexActual") = value
|
|
End Set
|
|
End Property
|
|
|
|
|
|
|
|
Private Property CvePersonal As Integer
|
|
Get
|
|
If ViewState("CvePersonal") Is Nothing Then
|
|
Return -1
|
|
Else
|
|
Return DirectCast(ViewState("CvePersonal"), Integer)
|
|
End If
|
|
End Get
|
|
Set(value As Integer)
|
|
ViewState("CvePersonal") = value
|
|
End Set
|
|
End Property
|
|
|
|
|
|
|
|
|
|
Private Property ActualizarFamiliar As Boolean
|
|
Get
|
|
If ViewState("ActualizarFamiliar") Is Nothing Then
|
|
Return True
|
|
Else
|
|
Return DirectCast(ViewState("ActualizarFamiliar"), Boolean)
|
|
|
|
End If
|
|
End Get
|
|
Set(value As Boolean)
|
|
ViewState("ActualizarFamiliar") = value
|
|
End Set
|
|
End Property
|
|
Private Property CveFamiliar As Integer
|
|
Get
|
|
If ViewState("CveFamiliar") Is Nothing Then
|
|
Return -1
|
|
Else
|
|
Return DirectCast(ViewState("CveFamiliar"), Integer)
|
|
End If
|
|
|
|
End Get
|
|
Set(value As Integer)
|
|
ViewState("CveFamiliar") = value
|
|
End Set
|
|
End Property
|
|
|
|
Private Property CveEscolaridad As Integer
|
|
Get
|
|
If ViewState("CveEscolaridad") Is Nothing Then
|
|
Return -1
|
|
Else
|
|
Return DirectCast(ViewState("CveEscolaridad"), Integer)
|
|
End If
|
|
End Get
|
|
Set(value As Integer)
|
|
ViewState("CveEscolaridad") = value
|
|
End Set
|
|
End Property
|
|
Private Property ActualizarEscolaridad As Boolean
|
|
Get
|
|
If ViewState("ActualizarEscolaridad") Is Nothing Then
|
|
Return False
|
|
Else
|
|
Return DirectCast(ViewState("ActualizarEscolaridad"), Boolean)
|
|
End If
|
|
End Get
|
|
Set(value As Boolean)
|
|
ViewState("ActualizarEscolaridad") = value
|
|
End Set
|
|
End Property
|
|
|
|
Private Property CveReferenciaLaboral As Integer
|
|
Get
|
|
If ViewState("CveReferenciaLaboral") Is Nothing Then
|
|
Return -1
|
|
Else
|
|
Return DirectCast(ViewState("CveReferenciaLaboral"), Integer)
|
|
End If
|
|
End Get
|
|
Set(value As Integer)
|
|
ViewState("CveReferenciaLaboral") = value
|
|
End Set
|
|
End Property
|
|
Private Property ActualizarReferenciaLaboral As Boolean
|
|
Get
|
|
If ViewState("ActualizarReferenciaLaboral") Is Nothing Then
|
|
Return False
|
|
Else
|
|
Return DirectCast(ViewState("ActualizarReferenciaLaboral"), Boolean)
|
|
End If
|
|
End Get
|
|
Set(value As Boolean)
|
|
ViewState("ActualizarReferenciaLaboral") = value
|
|
End Set
|
|
End Property
|
|
|
|
|
|
Private Property CveReferenciaPersonal As Integer
|
|
Get
|
|
If ViewState("CveReferenciaPersonal") Is Nothing Then
|
|
Return -1
|
|
Else
|
|
Return DirectCast(ViewState("CveReferenciaPersonal"), Integer)
|
|
End If
|
|
End Get
|
|
Set(value As Integer)
|
|
ViewState("CveReferenciaPersonal") = value
|
|
End Set
|
|
End Property
|
|
|
|
Private Property ActualizarReferenciaPersonal As Boolean
|
|
Get
|
|
If ViewState("ActualizarReferenciaPersonal") Is Nothing Then
|
|
Return False
|
|
Else
|
|
Return DirectCast(ViewState("ActualizarReferenciaPersonal"), Boolean)
|
|
End If
|
|
End Get
|
|
Set(value As Boolean)
|
|
ViewState("ActualizarReferenciaPersonal") = value
|
|
End Set
|
|
End Property
|
|
|
|
|
|
Private Property ValPadre As Boolean
|
|
Get
|
|
If ViewState("ValPadre") Is Nothing Then
|
|
Return False
|
|
Else
|
|
Return DirectCast(ViewState("ValPadre"), Boolean)
|
|
End If
|
|
End Get
|
|
Set(value As Boolean)
|
|
ViewState("ValPadre") = value
|
|
End Set
|
|
End Property
|
|
|
|
Private Property ValMadre As Boolean
|
|
Get
|
|
If ViewState("ValMadre") Is Nothing Then
|
|
Return False
|
|
Else
|
|
Return DirectCast(ViewState("ValMadre"), Boolean)
|
|
End If
|
|
End Get
|
|
Set(value As Boolean)
|
|
ViewState("ValMadre") = value
|
|
End Set
|
|
End Property
|
|
|
|
|
|
#End Region
|
|
|
|
#Region "PASO DOS"
|
|
|
|
Property CvePaso As Integer
|
|
|
|
Get
|
|
If ViewState("CvePaso") Is Nothing Then
|
|
Return -1
|
|
Else
|
|
Return DirectCast(ViewState("CvePaso"), Integer)
|
|
End If
|
|
End Get
|
|
Set(value As Integer)
|
|
ViewState("CvePaso") = value
|
|
End Set
|
|
End Property
|
|
|
|
Private Property PasoActual As Integer
|
|
Get
|
|
If ViewState("PasoActual") Is Nothing Then
|
|
Return -1
|
|
Else
|
|
Return DirectCast(ViewState("PasoActual"), Integer)
|
|
End If
|
|
End Get
|
|
Set(value As Integer)
|
|
ViewState("PasoActual") = value
|
|
End Set
|
|
End Property
|
|
|
|
Private Property NumeroDePasos As Integer
|
|
Get
|
|
If ViewState("NumeroDePasos") Is Nothing Then
|
|
Return -1
|
|
Else
|
|
Return DirectCast(ViewState("NumeroDePasos"), Integer)
|
|
End If
|
|
End Get
|
|
Set(value As Integer)
|
|
ViewState("NumeroDePasos") = value
|
|
End Set
|
|
End Property
|
|
|
|
Property DTPasos As DataTable
|
|
Get
|
|
If ViewState("DTPasos") Is Nothing Then
|
|
Return New DataTable
|
|
Else
|
|
Return DirectCast(ViewState("DTPasos"), DataTable)
|
|
End If
|
|
End Get
|
|
Set(value As DataTable)
|
|
ViewState("DTPasos") = value
|
|
End Set
|
|
End Property
|
|
|
|
#End Region
|
|
|
|
|
|
#Region "E N T R E V I S T A"
|
|
|
|
|
|
Private Property DTRespuestas As DataTable
|
|
|
|
Get
|
|
If ViewState("DTRespuestas") Is Nothing Then
|
|
Return New DataTable
|
|
Else
|
|
Return DirectCast(ViewState("DTRespuestas"), DataTable)
|
|
End If
|
|
End Get
|
|
Set(value As DataTable)
|
|
ViewState("DTRespuestas") = value
|
|
End Set
|
|
End Property
|
|
|
|
Private Property CveEncuestaAplicada As Integer
|
|
Get
|
|
If ViewState("CveEncuestaAplicada") Is Nothing Then
|
|
Return -1
|
|
Else
|
|
Return DirectCast(ViewState("CveEncuestaAplicada"), Integer)
|
|
End If
|
|
End Get
|
|
Set(value As Integer)
|
|
ViewState("CveEncuestaAplicada") = value
|
|
End Set
|
|
|
|
End Property
|
|
|
|
#End Region
|
|
|
|
#Region "D O C U M E T A C I O N"
|
|
|
|
Private Property DTDocumentacion As DataTable
|
|
Get
|
|
If ViewState("DTDocumentacion") Is Nothing Then
|
|
Return New DataTable
|
|
Else
|
|
Return DirectCast(ViewState("DTDocumentacion"), DataTable)
|
|
End If
|
|
End Get
|
|
Set(value As DataTable)
|
|
ViewState("DTDocumentacion") = value
|
|
End Set
|
|
End Property
|
|
|
|
Property NombreCompleto As String
|
|
Get
|
|
If ViewState("NombreCompleto") Is Nothing Then
|
|
Return "-1"
|
|
Else
|
|
Return ViewState("NombreCompleto").ToString
|
|
End If
|
|
End Get
|
|
Set(value As String)
|
|
ViewState("NombreCompleto") = value
|
|
End Set
|
|
End Property
|
|
Property CredencialElector As String
|
|
Get
|
|
If ViewState("CredencialElector") Is Nothing Then
|
|
Return "-1"
|
|
Else
|
|
Return ViewState("CredencialElector").ToString
|
|
End If
|
|
End Get
|
|
Set(value As String)
|
|
ViewState("CredencialElector") = value
|
|
End Set
|
|
End Property
|
|
|
|
Property Documentacion As String
|
|
Get
|
|
If ViewState("Documentacion") Is Nothing Then
|
|
Return "-1"
|
|
Else
|
|
Return ViewState("Documentacion").ToString
|
|
End If
|
|
End Get
|
|
Set(value As String)
|
|
ViewState("Documentacion") = value
|
|
End Set
|
|
End Property
|
|
Property CveDocumentacion As Integer
|
|
Get
|
|
If ViewState("CveDocumentacion") Is Nothing Then
|
|
Return -1
|
|
Else
|
|
Return DirectCast(ViewState("CveDocumentacion"), Integer)
|
|
End If
|
|
End Get
|
|
Set(value As Integer)
|
|
ViewState("CveDocumentacion") = value
|
|
End Set
|
|
End Property
|
|
|
|
Property CveDocumentacionElectronica As Integer
|
|
Get
|
|
If ViewState("CvePersonalClienteDocumentacion") Is Nothing Then
|
|
Return -1
|
|
Else
|
|
Return DirectCast(ViewState("CvePersonalClienteDocumentacion"), Integer)
|
|
End If
|
|
End Get
|
|
Set(value As Integer)
|
|
ViewState("CvePersonalClienteDocumentacion") = value
|
|
End Set
|
|
End Property
|
|
|
|
Property ActualizarDocumentacion As Boolean
|
|
Get
|
|
If ViewState("ActualizarDocumentacion") Is Nothing Then
|
|
Return True
|
|
Else
|
|
Return DirectCast(ViewState("ActualizarDocumentacion"), Boolean)
|
|
End If
|
|
End Get
|
|
Set(value As Boolean)
|
|
ViewState("ActualizarDocumentacion") = value
|
|
End Set
|
|
End Property
|
|
|
|
Private Property FechaLimite As Date
|
|
Get
|
|
If ViewState("FechaLimite") Is Nothing Then
|
|
Return Date.Now.AddDays(15)
|
|
Else
|
|
Return ViewState("FechaLimite").ToString.ToDate
|
|
End If
|
|
End Get
|
|
Set(value As Date)
|
|
ViewState("FechaLimite") = value
|
|
End Set
|
|
|
|
End Property
|
|
|
|
Private Property FechaVigencia As Date
|
|
Get
|
|
If ViewState("FechaVigencia") Is Nothing Then
|
|
Return Nothing
|
|
Else
|
|
Return ViewState("FechaVigencia").ToString.ToDate
|
|
End If
|
|
End Get
|
|
Set(value As Date)
|
|
ViewState("FechaVigencia") = value
|
|
End Set
|
|
End Property
|
|
|
|
Property Estatus As Integer
|
|
Get
|
|
If ViewState("Estatus") Is Nothing Then
|
|
Return 0
|
|
Else
|
|
Return DirectCast(ViewState("Estatus"), Integer)
|
|
End If
|
|
End Get
|
|
Set(value As Integer)
|
|
ViewState("Estatus") = value
|
|
End Set
|
|
End Property
|
|
|
|
|
|
Property ObservacionDocumentacion As String
|
|
Get
|
|
If ViewState("ObservacionDocumentacion") Is Nothing Then
|
|
Return ""
|
|
Else
|
|
Return ViewState("ObservacionDocumentacion").ToString
|
|
End If
|
|
End Get
|
|
Set(value As String)
|
|
ViewState("ObservacionDocumentacion") = value
|
|
End Set
|
|
End Property
|
|
|
|
Property AdjuntoDocumentacion As String
|
|
Get
|
|
If ViewState("AdjuntoDocumentacion") Is Nothing Then
|
|
Return ""
|
|
Else
|
|
Return ViewState("AdjuntoDocumentacion").ToString
|
|
End If
|
|
End Get
|
|
Set(value As String)
|
|
ViewState("AdjuntoDocumentacion") = value
|
|
End Set
|
|
End Property
|
|
|
|
Property AplicaFechaVencimiento As Boolean
|
|
Get
|
|
If ViewState("AplicaFechaVencimiento") Is Nothing Then
|
|
Return True
|
|
Else
|
|
Return DirectCast(ViewState("AplicaFechaVencimiento"), Boolean)
|
|
End If
|
|
End Get
|
|
Set(value As Boolean)
|
|
ViewState("AplicaFechaVencimiento") = value
|
|
End Set
|
|
End Property
|
|
|
|
Property DiasVigencia As Integer
|
|
Get
|
|
If ViewState("DiasVigencia") Is Nothing Then
|
|
Return 0
|
|
Else
|
|
Return DirectCast(ViewState("DiasVigencia"), Integer)
|
|
End If
|
|
End Get
|
|
Set(value As Integer)
|
|
ViewState("DiasVigencia") = value
|
|
End Set
|
|
End Property
|
|
Property AplicaDocumentacion As Boolean
|
|
Get
|
|
If ViewState("AplicaDocumentacion") Is Nothing Then
|
|
Return True
|
|
Else
|
|
Return DirectCast(ViewState("AplicaDocumentacion"), Boolean)
|
|
End If
|
|
End Get
|
|
Set(value As Boolean)
|
|
ViewState("AplicaDocumentacion") = value
|
|
End Set
|
|
End Property
|
|
#End Region
|
|
|
|
#Region "Caracteristicas"
|
|
Private Property CveCaracteristica As Integer
|
|
Get
|
|
If ViewState("CveCaracteristica") Is Nothing Then
|
|
Return -1
|
|
Else
|
|
Return DirectCast(ViewState("CveCaracteristica"), Integer)
|
|
End If
|
|
End Get
|
|
Set(value As Integer)
|
|
ViewState("CveCaracteristica") = value
|
|
End Set
|
|
End Property
|
|
|
|
Private Property ActualizarPersonalCaracteristica As Boolean
|
|
Get
|
|
|
|
If ViewState("ActualizarPersonalCaracteristica") Is Nothing Then
|
|
Return False
|
|
Else
|
|
Return DirectCast(ViewState("ActualizarPersonalCaracteristica"), Boolean)
|
|
End If
|
|
|
|
End Get
|
|
Set(value As Boolean)
|
|
ViewState("ActualizarPersonalCaracteristica") = value
|
|
End Set
|
|
End Property
|
|
|
|
Property DtCaracteristicas As DataTable
|
|
Get
|
|
If ViewState("DtCaracteristicas") Is Nothing Then
|
|
Return New DataTable
|
|
Else
|
|
Return DirectCast(ViewState("DtCaracteristicas"), DataTable)
|
|
End If
|
|
End Get
|
|
Set(value As DataTable)
|
|
ViewState("DtCaracteristicas") = value
|
|
End Set
|
|
End Property
|
|
|
|
|
|
Property DtCaracteristicasOpciones As DataTable
|
|
Get
|
|
If ViewState("DtCaracteristicasOpciones") Is Nothing Then
|
|
Return New DataTable
|
|
Else
|
|
Return DirectCast(ViewState("DtCaracteristicasOpciones"), DataTable)
|
|
End If
|
|
End Get
|
|
Set(value As DataTable)
|
|
ViewState("DtCaracteristicasOpciones") = value
|
|
End Set
|
|
End Property
|
|
|
|
Private Property DtCaracteristicasValor As DataTable
|
|
Get
|
|
If ViewState("DtCaracteristicasValor") Is Nothing Then
|
|
Return New DataTable
|
|
Else
|
|
Return DirectCast(ViewState("DtCaracteristicasValor"), DataTable)
|
|
End If
|
|
End Get
|
|
Set(value As DataTable)
|
|
ViewState("DtCaracteristicasValor") = value
|
|
End Set
|
|
End Property
|
|
#End Region
|
|
|
|
#Region "VERIFICACION REFERENCIAS"
|
|
Private Property DTRespuestasReferencias As DataTable
|
|
Get
|
|
If ViewState(" DTRespuestasReferencias") Is Nothing Then
|
|
Return New DataTable
|
|
Else
|
|
Return DirectCast(ViewState(" DTRespuestasReferencias"), DataTable)
|
|
End If
|
|
End Get
|
|
Set(value As DataTable)
|
|
ViewState(" DTRespuestasReferencias") = value
|
|
End Set
|
|
|
|
|
|
End Property
|
|
|
|
|
|
Private Property TipoReferenciaVerificacion As String
|
|
Get
|
|
If ViewState("TipoReferenciaVerificacion") Is Nothing Then
|
|
Return ""
|
|
Else
|
|
Return ViewState("TipoReferenciaVerificacion").ToString
|
|
End If
|
|
End Get
|
|
Set(value As String)
|
|
ViewState("TipoReferenciaVerificacion") = value
|
|
End Set
|
|
End Property
|
|
|
|
|
|
Private Property NombreReferenciaVerificacion As String
|
|
Get
|
|
If ViewState("NombreReferenciaVerificacion") Is Nothing Then
|
|
|
|
Return ""
|
|
Else
|
|
Return ViewState("NombreReferenciaVerificacion").ToString
|
|
End If
|
|
End Get
|
|
Set(value As String)
|
|
ViewState("NombreReferenciaVerificacion") = value
|
|
End Set
|
|
|
|
|
|
End Property
|
|
|
|
Private Property TelefonoReferenciaVerificacion As String
|
|
Get
|
|
If ViewState("TelefonoReferenciaVerificacion") Is Nothing Then
|
|
Return ""
|
|
Else
|
|
Return ViewState("TelefonoReferenciaVerificacion").ToString
|
|
End If
|
|
End Get
|
|
Set(value As String)
|
|
ViewState("TelefonoReferenciaVerificacion") = value
|
|
End Set
|
|
End Property
|
|
|
|
Private Property CveReferenciaVerificacion As Integer
|
|
|
|
Get
|
|
If ViewState("CveReferenciaVerificacion") Is Nothing Then
|
|
Return -1
|
|
Else
|
|
Return DirectCast(ViewState("CveReferenciaVerificacion"), Integer)
|
|
End If
|
|
End Get
|
|
Set(value As Integer)
|
|
ViewState("CveReferenciaVerificacion") = value
|
|
End Set
|
|
|
|
End Property
|
|
|
|
#End Region
|
|
|
|
Property CveEmpresaBase As Integer
|
|
Get
|
|
If ViewState("CveEmpresaBase") Is Nothing Then
|
|
Return -1
|
|
Else
|
|
Return DirectCast(ViewState("CveEmpresaBase"), Integer)
|
|
End If
|
|
End Get
|
|
Set(value As Integer)
|
|
ViewState("CveEmpresaBase") = value
|
|
End Set
|
|
End Property
|
|
|
|
Property DTSubproyectoZona As DataTable
|
|
Get
|
|
If ViewState("DTSubproyectoZona") Is Nothing Then
|
|
Return New DataTable
|
|
Else
|
|
Return DirectCast(ViewState("DTSubproyectoZona"), DataTable)
|
|
End If
|
|
End Get
|
|
Set(value As DataTable)
|
|
ViewState("DTSubproyectoZona") = value
|
|
End Set
|
|
End Property
|
|
|
|
#Region "TABLAS DE REFERENCIAS"
|
|
|
|
Property DTFamiliares As DataTable
|
|
Get
|
|
Return DirectCast(ViewState("DTFamiliares"), DataTable)
|
|
End Get
|
|
Set(value As DataTable)
|
|
ViewState("DTFamiliares") = value
|
|
End Set
|
|
End Property
|
|
|
|
Property DTEscolaridad As DataTable
|
|
Get
|
|
Return DirectCast(ViewState("DTEscolaridad"), DataTable)
|
|
End Get
|
|
Set(value As DataTable)
|
|
ViewState("DTEscolaridad") = value
|
|
End Set
|
|
End Property
|
|
|
|
Property DTRefenciasPersonales As DataTable
|
|
Get
|
|
Return DirectCast(ViewState("DTRefenciasPersonales"), DataTable)
|
|
End Get
|
|
Set(value As DataTable)
|
|
ViewState("DTRefenciasPersonales") = value
|
|
End Set
|
|
End Property
|
|
|
|
Property DTRefenciasLabolares As DataTable
|
|
Get
|
|
Return DirectCast(ViewState("DTRefenciasLabolares"), DataTable)
|
|
End Get
|
|
Set(value As DataTable)
|
|
ViewState("DTRefenciasLabolares") = value
|
|
End Set
|
|
End Property
|
|
|
|
#End Region
|
|
|
|
|
|
Private Sub RH_Reclutamiento_Load(sender As Object, e As EventArgs) Handles Me.Load
|
|
|
|
Try
|
|
|
|
HdfEmpresa.Value = UsuarioActual.CveEmpresa.ToString
|
|
|
|
If Page.ClientQueryString.Contains("CvePersonal") Then
|
|
Dim tmpString = Request.QueryString("CvePersonal").ToString
|
|
CvePersonal = tmpString.ToEntero
|
|
HdfPersonal.Value = CvePersonal.ToString
|
|
BtnGuardar4.Text = "Actualizar"
|
|
LnkDescartarCandidato.Visible = True
|
|
Else
|
|
CvePersonal = -1
|
|
PasoActual = 1
|
|
AsignaGruposValidacion()
|
|
End If
|
|
Catch ex As Exception
|
|
CvePersonal = -1
|
|
PasoActual = 1
|
|
AsignaGruposValidacion()
|
|
End Try
|
|
|
|
|
|
|
|
|
|
If Not Page.IsPostBack Then
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CrearEstructuraTablasTemporales()
|
|
|
|
DDLEstadoCivil4.DataSource = GlobalDTEstadoCivil
|
|
DDLEstadoCivil4.DataBind()
|
|
|
|
If UsuarioActual.CveSubProyecto > 0 Then
|
|
'DdlSubproyecto.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, 1).FiltraParametros($"CveSubProyecto={UsuarioActual.CveSubProyecto}")
|
|
DdlSubproyecto.DataSource = GlobalDTSubProyectosUsuarios(-1, -1, UsuarioActual.CveEmpresa, CveEstatus:=1).FiltraParametros($"CveUsuario={UsuarioActual.CveUsuario}")
|
|
Else
|
|
'DdlSubproyecto.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, 1)
|
|
DdlSubproyecto.DataSource = GlobalDTSubProyectosUsuarios(-1, -1, UsuarioActual.CveEmpresa, CveEstatus:=1).FiltraParametros($"CveUsuario={UsuarioActual.CveUsuario}")
|
|
End If
|
|
|
|
DdlSubproyecto.DataBind()
|
|
DdlSubproyecto.Items.Insert(0, New ListItem("Seleccione una sucursal", "-1"))
|
|
|
|
|
|
'DDLSucursal4
|
|
|
|
UPDatosGenerales4.Update()
|
|
|
|
DdlEmpresaAsiganada.DataSource = GlobalDTEmpresas.FiltraParametros(" CveEmpresa in (4,7,11,12,113,114) ")
|
|
DdlEmpresaAsiganada.DataBind()
|
|
DdlEmpresaAsiganada.Items.Insert(0, New ListItem("Seleccione una empresa", "-1"))
|
|
|
|
DdlEscolaridad.DataSource = GlobalDTEscolaridad
|
|
DdlEscolaridad.DataBind()
|
|
|
|
'DdlRuta.DataSource = GlobalDTRutas.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
|
'DdlRuta.DataBind()
|
|
|
|
Dim objRH As New ClsRH
|
|
|
|
If objRH.SubproyectoZonaGet(-1, -1, UsuarioActual.Empresa.CveEmpresa) Then
|
|
|
|
DTSubproyectoZona = objRH.DtResultados.FiltraParametros("Estatus=1")
|
|
Else
|
|
DTSubproyectoZona = Nothing
|
|
End If
|
|
|
|
objRH.Dispose()
|
|
' DdlSubproyectoZona.DataBind()
|
|
|
|
|
|
AplicaDocumentacion = True
|
|
|
|
CargaGVHojaRetencion()
|
|
|
|
CargaDatos()
|
|
|
|
CargaPasos()
|
|
Pasos()
|
|
|
|
CargaDTSCaracteristicas()
|
|
|
|
If PasoActual = 7 Then
|
|
btnNext.Visible = False
|
|
Else
|
|
btnNext.Visible = True
|
|
End If
|
|
|
|
If PasoActual > 1 Then
|
|
btnBack.Visible = True
|
|
Else
|
|
btnBack.Visible = False
|
|
End If
|
|
|
|
End If
|
|
|
|
If CvePersonal <> -1 Then
|
|
|
|
End If
|
|
|
|
If UsuarioActual.CveRol <> 1 Then
|
|
LnkPruebaEnviarCorreo.Visible = False
|
|
End If
|
|
|
|
|
|
End Sub
|
|
|
|
Private Sub CargaCaptaciones()
|
|
Dim objRH As New ClsRH
|
|
|
|
If objRH.CaptacionCatalogoGet(-1, 1, UsuarioActual.CveEmpresa) Then
|
|
|
|
DdlCaptacion.DataSource = objRH.DtResultados
|
|
DdlCaptacion.DataBind()
|
|
|
|
DdlCaptacion.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
|
|
|
|
End If
|
|
|
|
objRH.Dispose()
|
|
End Sub
|
|
|
|
#Region "Carga Datos"
|
|
|
|
Private Sub CargaDatos()
|
|
|
|
TabReferencias.Visible = True
|
|
|
|
If CvePersonal > 0 Then
|
|
CargaCaptaciones()
|
|
CargaDatosGenerales()
|
|
|
|
CargaFamiliares()
|
|
CargaEscolaridad()
|
|
CargaReferenciasLaborales()
|
|
CargaReferenciasPersonales()
|
|
|
|
CargaEntrevista()
|
|
CargaDocumentacion()
|
|
PasosAutorizadoPor()
|
|
CargaDatosCaracteristicas()
|
|
CargaReferenciaAValidar()
|
|
CargaDocumentacionAntidoping()
|
|
CargaDocumentacionInvestigacion()
|
|
CargaDocumentacionFirmaDecontratos()
|
|
End If
|
|
|
|
|
|
End Sub
|
|
|
|
Private Sub CargaDatosGenerales()
|
|
|
|
If CvePersonal <> -1 Then
|
|
Dim objRH As New ClsRH
|
|
|
|
If objRH.PersonalReclutamientoGet(CvePersonal, UsuarioActual.Empresa.CveEmpresa) Then
|
|
|
|
If objRH.DtResultados.Rows.Count > 0 Then
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("CveSubProyecto")) Then
|
|
DdlSubproyecto.SelectedValueExistInsert(objRH.DtResultados(0)("CveSubProyecto").ToString.ToEntero, objRH.DtResultados(0)("SubProyecto").ToString)
|
|
CargaSubProyectosZona()
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("CveSubProyectoZona")) Then
|
|
DdlSubproyectoZona.SelectedValueExist(objRH.DtResultados(0)("CveSubProyectoZona").ToString.ToEntero)
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("CveEmpresa")) Then
|
|
DdlEmpresaAsiganada.SelectedValueExist(objRH.DtResultados(0)("CveEmpresa").ToString.ToEntero)
|
|
CargaCobosFirma()
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("Nombres")) Then
|
|
TxtNombres4.Text = objRH.DtResultados(0)("Nombres").ToString
|
|
End If
|
|
|
|
If Not objRH.DtResultados(0)("APaterno") Is Nothing Then
|
|
TxtAPaterno4.Text = objRH.DtResultados(0)("APaterno").ToString
|
|
End If
|
|
|
|
If Not objRH.DtResultados(0)("AMaterno") Is Nothing Then
|
|
TxtAmaterno4.Text = objRH.DtResultados(0)("AMaterno").ToString
|
|
End If
|
|
|
|
NombreCompleto = TxtNombres4.Text & " " & TxtAPaterno4.Text & " " & TxtAmaterno4.Text
|
|
lblCabecera.Text = " " & NombreCompleto
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("Estatura")) Then
|
|
TxtEstatura4.Text = objRH.DtResultados(0)("Estatura").ToString
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("Peso")) Then
|
|
TxtPeso4.Text = objRH.DtResultados(0)("Peso").ToString
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("LugarNacimiento")) Then
|
|
TxtLugarnacimiento4.Text = objRH.DtResultados(0)("LugarNacimiento").ToString
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("Edad")) Then
|
|
Edad = objRH.DtResultados(0)("Edad").ToString.ToEntero
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("NombreTelEmergencia")) Then
|
|
TxtContactoEmergencia4.Text = objRH.DtResultados(0)("NombreTelEmergencia").ToString
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("TipoSangre")) Then
|
|
TxtTipoSangre4.Text = objRH.DtResultados(0)("TipoSangre").ToString
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("Vivienda")) Then
|
|
TxtViveCon4.Text = objRH.DtResultados(0)("Vivienda").ToString
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("ViviendaDueno")) Then
|
|
txtCasaDondevive4.Text = objRH.DtResultados(0)("ViviendaDueno").ToString
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("CveEstado")) Then
|
|
DDLEstadoCivil4.SelectedValueExist(objRH.DtResultados(0)("CveEstado").ToString.ToEntero)
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("CreditoInfonavit")) Then
|
|
chkInfonavid4.Checked = DirectCast(objRH.DtResultados(0)("CreditoInfonavit"), Boolean)
|
|
OcultarMostarControlesCreditoInfonavit()
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("RentaMensual")) Then
|
|
TxtAbonomensual4.Text = objRH.DtResultados(0)("RentaMensual").ToString.ToDecimal.ToString("###,###,###.00")
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("TransportePublico")) Then
|
|
TxtCamimones4.Text = objRH.DtResultados(0)("TransportePublico").ToString
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("TrabajadoAnteriormente")) Then
|
|
chkTrabajoAnterior4.Checked = DirectCast(objRH.DtResultados(0)("TrabajadoAnteriormente"), Boolean)
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("TrabajadoAnteriormenteObservaciones")) Then
|
|
TxtTrbajoDetalle4.Text = objRH.DtResultados(0)("TrabajadoAnteriormenteObservaciones").ToString
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("ParientesEmpresa")) Then
|
|
chkParientesempresa4.Checked = DirectCast(objRH.DtResultados(0)("ParientesEmpresa"), Boolean)
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("AcusadoDelito")) Then
|
|
chkDelito4.Checked = DirectCast(objRH.DtResultados(0)("AcusadoDelito"), Boolean)
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("AcusadoDelitoObservaciones")) Then
|
|
TxtObserbacion4.Text = objRH.DtResultados(0)("AcusadoDelitoObservaciones").ToString
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("Direccion")) Then
|
|
TxtDomicilio4.Text = objRH.DtResultados(0)("Direccion").ToString
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("Calle")) Then
|
|
TxtCalleNumero4.Text = objRH.DtResultados(0)("Calle").ToString
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("Colonia")) Then
|
|
TxtColonia4.Text = objRH.DtResultados(0)("Colonia").ToString
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("CP")) Then
|
|
TxtCodigoPostal4.Text = objRH.DtResultados(0)("CP").ToString
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("Telefono")) Then
|
|
TxtTelLocal4.Text = objRH.DtResultados(0)("Telefono").ToString
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("Celular")) Then
|
|
TxtCell4.Text = objRH.DtResultados(0)("Celular").ToString
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("Correo")) Then
|
|
TxtEmail4.Text = objRH.DtResultados(0)("Correo").ToString
|
|
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("NumeroSS")) Then
|
|
TxtSeguroSocial4.Text = objRH.DtResultados(0)("NumeroSS").ToString
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("Licencia")) Then
|
|
TxtLicencia4.Text = objRH.DtResultados(0)("Licencia").ToString
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("CveTipoLicencia")) Then
|
|
DDLTipoLicencia4.SelectedValueExist(objRH.DtResultados(0)("CveTipoLicencia"))
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("CartillaMilitar")) Then
|
|
TxtCartilla4.Text = objRH.DtResultados(0)("CartillaMilitar").ToString
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("CURP")) Then
|
|
TxtCurp4.Text = objRH.DtResultados(0)("CURP").ToString.Trim.ToUpper
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("AutorizaAntidoping")) Then
|
|
ChkAceptaAntidiping4.Checked = DirectCast(objRH.DtResultados(0)("AutorizaAntidoping"), Boolean)
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("Observaciones")) Then
|
|
TxtObservaciones4.Text = objRH.DtResultados(0)("Observaciones").ToString
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("CredencialElector")) Then
|
|
TxtCredencialElector4.Text = objRH.DtResultados(0)("CredencialElector").ToString
|
|
CredencialElector = TxtCredencialElector4.Text
|
|
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("InformacionFidedigno")) Then
|
|
' chkFidedigna4.Checked = DirectCast(objRH.DtResultados(0)("InformacionFidedigno"), Boolean)
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("FechaNacimiento")) Then
|
|
TxtFechaN4.Text = objRH.DtResultados(0)("FechaNacimiento").ToString.ToDate.ToString("dd/MM/yyyy")
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("FechaInicioContrato")) Then
|
|
If objRH.DtResultados(0)("FechaInicioContrato").ToString.ToDate().ToString("dd/MM/yyyy") = "01/01/0001" Then
|
|
TxtFechaInicio.Text = Now.ToShortDateString
|
|
Else
|
|
TxtFechaInicio.Text = objRH.DtResultados(0)("FechaInicioContrato").ToString.ToDate().ToString("dd/MM/yyyy")
|
|
End If
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("FechaFinContrato")) Then
|
|
TxtFechaFin.Text = objRH.DtResultados(0)("FechaFinContrato").ToString.ToDate().ToString("dd/MM/yyyy")
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("CveEstatusPersonal")) Then
|
|
CveEstatusPersonal = objRH.DtResultados(0)("CveEstatusPersonal").ToString.ToEntero
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("CveEmpresaAsignado")) Then
|
|
DdlEmpresaAsiganada.SelectedValueExist(objRH.DtResultados(0)("CveEmpresaAsignado").ToString.ToEntero)
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("CveEscolaridad")) Then
|
|
DdlEscolaridad.SelectedValueExist(objRH.DtResultados(0)("CveEscolaridad").ToString.ToEntero)
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("Lg")) Then
|
|
txtLg.Text = objRH.DtResultados(0)("Lg").ToString
|
|
Else
|
|
txtLg.Text = "0"
|
|
End If
|
|
If Not IsDBNull(objRH.DtResultados(0)("Lt")) Then
|
|
txtLt.Text = objRH.DtResultados(0)("Lt").ToString
|
|
Else
|
|
txtLt.Text = "0"
|
|
End If
|
|
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("CveUsuarioNomina")) Then
|
|
DDLUsuarioNomina.SelectedValueExist(objRH.DtResultados(0)("CveUsuarioNomina").ToString.ToEntero)
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("RFC")) Then
|
|
TxtRFC4.Text = objRH.DtResultados(0)("RFC").ToString.ToUpper
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("CveCaptacion")) Then
|
|
DdlCaptacion.SelectedValueExist(objRH.DtResultados(0)("CveCaptacion").ToString.ToEntero)
|
|
End If
|
|
|
|
'If Not IsDBNull(objRH.DtResultados(0)("CveCaptacion")) Then
|
|
' DdlCaptacion.SelectedValueExist(objRH.DtResultados(0)("CveCaptacion").ToString.ToEntero)
|
|
'End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("MedioCaptacion")) Then
|
|
TxtMedioCaptacion.Text = objRH.DtResultados(0)("MedioCaptacion").ToString
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("ParientesEmpresaDetalle")) Then
|
|
TxtParientesEmpresaDetalle.Text = objRH.DtResultados(0)("ParientesEmpresaDetalle").ToString
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("InfonavitNoCredito")) Then
|
|
TxtInfonavitNo.Text = objRH.DtResultados(0)("InfonavitNoCredito").ToString
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("CveGenero")) Then
|
|
DdlSexo.SelectedValueExist(objRH.DtResultados(0)("CveGenero").ToString.ToEntero)
|
|
End If
|
|
|
|
DdlUniforme.SelectedValueExist(objRH.DtResultados(0)("CveUniforme").ToString)
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("CveEstatusPersonal")) Then
|
|
TxtModalCveCandidato.Text = CvePersonal.ToString
|
|
|
|
If objRH.DtResultados(0)("CveEstatusPersonal").ToString.ToEntero = 4 Then
|
|
|
|
LblModalDescartadoMensaje.Text = "El candidato fue descartado"
|
|
LblModalDescartadoRFC.Text = "<b>RFC:</b> " & objRH.DtResultados(0)("RFC").ToString
|
|
LblModalDescartadoMotivoDesacartado.Text = "<b>Motivo:</b>" & objRH.DtResultados(0)("MotivoDescartado").ToString
|
|
LblModalDescartadoFechaDescartado.Text = "<b>Fecha:</b> " & objRH.DtResultados(0)("FechaDescartado").ToString.ToDate().ToString("dd/MM/yyyy")
|
|
|
|
RegistraScript("$('#ModalDescartadoMensaje').modal({ backdrop: 'static', keyboard: false });")
|
|
|
|
LnkDescartarCandidato.Visible = False
|
|
|
|
If UsuarioActual.TienePermisoProceso(195) Then
|
|
BtnModalActivarCandidato.Enabled = True
|
|
Else
|
|
BtnModalActivarCandidato.Enabled = False
|
|
End If
|
|
Else ' btnDescartarCandidato.Visible = True
|
|
LnkDescartarCandidato.Visible = True
|
|
End If
|
|
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("CveClienteAsignado")) Then
|
|
DdlCliente.SelectedValueExist(objRH.DtResultados(0)("CveClienteAsignado").ToString.ToEntero)
|
|
End If
|
|
|
|
If Not IsDBNull(objRH.DtResultados(0)("CvePuesto")) Then
|
|
ddlPuesto.SelectedValueExist(objRH.DtResultados(0)("CvePuesto").ToString.ToEntero)
|
|
End If
|
|
|
|
ImgPersonal4.ImageUrl = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/RH/Personal/" & CvePersonal & ".png"
|
|
UPDatosGenerales4.Update()
|
|
|
|
LnkSurtirUniforme.NavigateUrl = $"../Inventarios/ResguardoMaterial.aspx?CvePersonal={CvePersonal}"
|
|
|
|
|
|
Else
|
|
Alert("No se ha encontrado el registro de personal.")
|
|
End If
|
|
|
|
|
|
'ListaTagsDocumentos = ListaTagsDocumentost
|
|
|
|
End If
|
|
|
|
objRH.Dispose()
|
|
|
|
End If
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub CargaFamiliares()
|
|
|
|
If CvePersonal <> -1 Then
|
|
|
|
Dim objRH As New ClsRH
|
|
|
|
If objRH.PersonalFamiliaresGet(-1, CvePersonal) Then
|
|
|
|
If objRH.DtResultados.Rows.Count > 0 Then
|
|
DTFamiliares = objRH.DtResultados
|
|
DTFamiliares.Columns.Add("Accion", Type.GetType("System.String"))
|
|
DTFamiliares.AcceptChanges()
|
|
GvFamiliares4.DataSource = DTFamiliares
|
|
Else
|
|
DTFamiliares.Rows.Clear()
|
|
GvFamiliares4.DataSource = DTFamiliares
|
|
End If
|
|
|
|
Else
|
|
GvFamiliares4.DataSource = Nothing
|
|
End If
|
|
|
|
objRH.Dispose()
|
|
GvFamiliares4.DataBind()
|
|
UPTabFamiliares4.Update()
|
|
|
|
End If
|
|
|
|
|
|
End Sub
|
|
|
|
Private Sub CargaEscolaridad()
|
|
If CvePersonal <> -1 Then
|
|
Dim objRH As New ClsRH
|
|
If objRH.PersonalEscolaridadGet(-1, CvePersonal) Then
|
|
If objRH.DtResultados.Rows.Count > 0 Then
|
|
DTEscolaridad = objRH.DtResultados
|
|
DTEscolaridad.Columns.Add("Accion", Type.GetType("System.String"))
|
|
DTEscolaridad.AcceptChanges()
|
|
GvEscolaridad4.DataSource = DTEscolaridad
|
|
Else
|
|
DTEscolaridad.Rows.Clear()
|
|
GvEscolaridad4.DataSource = DTEscolaridad
|
|
End If
|
|
|
|
Else
|
|
GvEscolaridad4.DataSource = DTEscolaridad
|
|
End If
|
|
|
|
objRH.Dispose()
|
|
GvEscolaridad4.DataBind()
|
|
UPTabEscolaridad4.Update()
|
|
End If
|
|
|
|
|
|
End Sub
|
|
|
|
Private Sub CargaReferenciasLaborales()
|
|
|
|
If CvePersonal <> -1 Then
|
|
Dim objRH As New ClsRH
|
|
|
|
If objRH.PersonalReferenciasLaboralesGet(-1, CvePersonal) Then
|
|
|
|
If objRH.DtResultados.Rows.Count > 0 Then
|
|
|
|
DTRefenciasLabolares = objRH.DtResultados
|
|
DTRefenciasLabolares.Columns.Add("Accion", Type.GetType("System.String"))
|
|
DTRefenciasPersonales.AcceptChanges()
|
|
GvReferenciasLaborales4.DataSource = DTRefenciasLabolares
|
|
|
|
Else
|
|
DTRefenciasLabolares.Rows.Clear()
|
|
GvReferenciasLaborales4.DataSource = DTRefenciasLabolares
|
|
End If
|
|
|
|
Else
|
|
GvReferenciasLaborales4.DataSource = DTRefenciasLabolares
|
|
End If
|
|
|
|
objRH.Dispose()
|
|
GvReferenciasLaborales4.DataBind()
|
|
UPTabReferenciasLaborales4.Update()
|
|
End If
|
|
|
|
End Sub
|
|
|
|
Private Sub CargaReferenciasPersonales()
|
|
|
|
If CvePersonal <> -1 Then
|
|
Dim objRH As New ClsRH
|
|
|
|
If objRH.PersonalReferenciasPersonalesGet(-1, CvePersonal) Then
|
|
|
|
If objRH.DtResultados.Rows.Count > 0 Then
|
|
DTRefenciasPersonales = objRH.DtResultados
|
|
DTRefenciasPersonales.Columns.Add("Accion", Type.GetType("System.String"))
|
|
DTRefenciasPersonales.AcceptChanges()
|
|
GvReferenciasPersonales4.DataSource = DTRefenciasPersonales
|
|
Else
|
|
DTRefenciasPersonales.Rows.Clear()
|
|
GvReferenciasPersonales4.DataSource = DTRefenciasPersonales
|
|
End If
|
|
|
|
Else
|
|
GvReferenciasPersonales4.DataSource = DTRefenciasPersonales
|
|
End If
|
|
|
|
objRH.Dispose()
|
|
GvReferenciasPersonales4.DataBind()
|
|
UPTabReferenciasPersonales4.Update()
|
|
End If
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
#End Region
|
|
|
|
#Region "Button Menu click Event"
|
|
|
|
Protected Sub BtnAgregarFamiliar_Click(sender As Object, e As EventArgs) Handles BtnAgregarFamiliar4.Click
|
|
resetFormFamiliares()
|
|
RegistraScript("$('#divAgregarFamiliar').modal({ backdrop: 'static', keyboard: false});")
|
|
End Sub
|
|
|
|
Protected Sub BtnAgregarEscolaridad_Click(sender As Object, e As EventArgs) Handles BtnAgregarEscolaridad4.Click
|
|
resetFormEscolaridad()
|
|
RegistraScript("$('#divAgregarEscolaridad').modal({ backdrop: 'static', keyboard: false});")
|
|
End Sub
|
|
|
|
Protected Sub BtnAgregarReferenciaLaboral_Click(sender As Object, e As EventArgs) Handles BtnAgregarReferenciaLaboral4.Click
|
|
resetFormReferenciasLaborales()
|
|
RegistraScript("$('#divAgregarRL').modal({ backdrop: 'static', keyboard: false});")
|
|
End Sub
|
|
|
|
Protected Sub BtnReferenciaPersonal_Click(sender As Object, e As EventArgs) Handles BtnReferenciaPersonal4.Click
|
|
resetFormReferenciasPersonales()
|
|
RegistraScript("$('#divAgregarRP').modal({ backdrop: 'static', keyboard: false});")
|
|
End Sub
|
|
|
|
#End Region
|
|
|
|
#Region "Edit Referencias"
|
|
|
|
Public Sub Edit_ClickFamiliar(sender As Object, e As EventArgs)
|
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
|
Dim activo As Boolean = True
|
|
|
|
CveFamiliar = GvRow.DataKey("CveFamiliar").ToString.ToEntero
|
|
ActualizarFamiliar = True
|
|
IndexActual = GvRow.RowIndex
|
|
|
|
LtlTituloModalFamiliar4.Text = "Editar Familiar"
|
|
BtnAgregarFamiliarModal4.Text = "Actualizar"
|
|
|
|
TxtNombreFamiliar4.Text = GvRow.DataKey("Nombre")
|
|
DDLParentescoFamiliar4.SelectedValueExist(GvRow.DataKey("CveParentesco"))
|
|
TxtDomicilioFamiliar4.Text = GvRow.DataKey("Domicilio")
|
|
TxtEdadFamiliar4.Text = GvRow.DataKey("Edad")
|
|
TxtOcupacionFamiliar4.Text = GvRow.DataKey("Ocupacion")
|
|
TxtTelefonoFamiliar.Text = GvRow.DataKey("Telefono")
|
|
TxtObservacionesFamiliar.Text = GvRow.DataKey("Observaciones")
|
|
|
|
UpModalFamiliar.Update()
|
|
RegistraScript("$('#divAgregarFamiliar').modal({ backdrop: 'static', keyboard: false});")
|
|
|
|
End Sub
|
|
|
|
Public Sub Edit_ClickEscolaridad(sender As Object, e As EventArgs)
|
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
|
|
|
CveEscolaridad = GvRow.DataKey("CveEscolaridad").ToString.ToEntero
|
|
ActualizarEscolaridad = True
|
|
IndexActual = GvRow.RowIndex
|
|
LtlTituloModalEscolaridad4.Text = "Editar Escolaridad"
|
|
BtnAgregarEscolaridadModal4.Text = "Actualizar"
|
|
|
|
|
|
DDLEscolaridad4.SelectedValueExist(GvRow.DataKey("CveNivelEscolar"))
|
|
TxtAniosCursados4.Text = GvRow.DataKey("AniosCursados")
|
|
TxtTituloRecibido4.Text = GvRow.DataKey("TituloRecibido")
|
|
TxtInstitucion4.Text = GvRow.DataKey("NombreInstitucion")
|
|
|
|
UpModalEscolaridad.Update()
|
|
RegistraScript("$('#divAgregarEscolaridad').modal({ backdrop: 'static', keyboard: false});")
|
|
|
|
End Sub
|
|
|
|
Public Sub Edit_ClickReferenciasLaborales(sender As Object, e As EventArgs)
|
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
|
|
|
CveReferenciaLaboral = GvRow.DataKey("CveReferenciaLaboral").ToString.ToEntero
|
|
ActualizarReferenciaLaboral = True
|
|
IndexActual = GvRow.RowIndex
|
|
|
|
LtlTituloModalRL4.Text = "Editar Referencia Laboral"
|
|
BtnAgragarReferenciaLaboralModal4.Text = "Actualizar"
|
|
|
|
TxtEmpresaRL4.Text = GvRow.DataKey("Empresa")
|
|
TxtDireccionRL4.Text = GvRow.DataKey("Direccion")
|
|
TxtTel1RL4.Text = GvRow.DataKey("Tel1")
|
|
TxtTel2RL4.Text = GvRow.DataKey("Tel2")
|
|
TxtPuestoRL4.Text = GvRow.DataKey("Puesto")
|
|
txtFechaI4.Text = Date.Parse(GvRow.DataKey("FechaInicio").ToString).ToString("dd/MM/yyyy")
|
|
txtFechaF4.Text = Date.Parse(GvRow.DataKey("FechaTermino").ToString()).ToString("dd/MM/yyyy")
|
|
TxtSalarioInicialRL4.Text = GvRow.DataKey("SalarioInicial").ToString.ToDecimal.ToString("###,###,###.00")
|
|
TxtSalariofinalRL4.Text = GvRow.DataKey("SalarioFinal").ToString.ToDecimal.ToString("###,###,###.00")
|
|
TxtJefeDirectoRL4.Text = GvRow.DataKey("JefeDirecto")
|
|
TxtRazonSalidaRL4.Text = GvRow.DataKey("RazonDeSalida")
|
|
TxtResponsabilidadesRL4.Text = "Responsabilidades"
|
|
|
|
UpModalReferenciaLaboral4.Update()
|
|
RegistraScript("$('#divAgregarRL').modal({ backdrop: 'static', keyboard: false});")
|
|
|
|
End Sub
|
|
|
|
Public Sub Edit_ClickReferenciasPersonales(sender As Object, e As EventArgs)
|
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
|
|
|
CveReferenciaPersonal = GvRow.DataKey("CveReferenciaPersonal").ToString.ToEntero
|
|
ActualizarReferenciaPersonal = True
|
|
IndexActual = GvRow.RowIndex
|
|
|
|
LtlTituloModalRL4.Text = "Editar Referencia Personal"
|
|
BtnAgragarReferenciaLaboralModal4.Text = "Actualizar"
|
|
|
|
TxtNombreRP4.Text = GvRow.DataKey("Nombre")
|
|
DDLParentescoRP4.SelectedValueExist(GvRow.DataKey("CveParentesco"))
|
|
TxtTiempoDeConocerloRP4.Text = GvRow.DataKey("TiempoDeConocerlo")
|
|
TxtTelefonoRP4.Text = GvRow.DataKey("Telefono")
|
|
|
|
UpModalReferenciaPersonal4.Update()
|
|
RegistraScript("$('#divAgregarRP').modal({ backdrop: 'static', keyboard: false});")
|
|
|
|
End Sub
|
|
|
|
#End Region
|
|
|
|
#Region "Reset Referencias Controles"
|
|
|
|
Private Sub resetFormFamiliares()
|
|
ActualizarFamiliar = False
|
|
CveFamiliar = -1
|
|
|
|
LtlTituloModalFamiliar4.Text = "Agregar Familiar"
|
|
BtnAgregarFamiliarModal4.Text = "Agregar Familiar"
|
|
TxtNombreFamiliar4.Text = ""
|
|
TxtDomicilioFamiliar4.Text = ""
|
|
TxtEdadFamiliar4.Text = ""
|
|
TxtOcupacionFamiliar4.Text = ""
|
|
TxtTelefonoFamiliar.Text = ""
|
|
TxtObservacionesFamiliar.Text = ""
|
|
DDLParentescoFamiliar4.SelectedIndex = 0
|
|
UpModalFamiliar.Update()
|
|
End Sub
|
|
|
|
Private Sub resetFormEscolaridad()
|
|
ActualizarEscolaridad = False
|
|
CveEscolaridad = -1
|
|
|
|
LtlTituloModalEscolaridad4.Text = "Agregar Escolaridad"
|
|
BtnAgregarEscolaridadModal4.Text = "Agregar"
|
|
|
|
DDLEscolaridad4.SelectedIndex = 0
|
|
TxtTituloRecibido4.Text = ""
|
|
TxtAniosCursados4.Text = ""
|
|
TxtInstitucion4.Text = ""
|
|
|
|
UpModalEscolaridad.Update()
|
|
End Sub
|
|
|
|
Private Sub resetFormReferenciasLaborales()
|
|
ActualizarReferenciaLaboral = False
|
|
CveReferenciaLaboral = -1
|
|
|
|
LtlTituloModalRL4.Text = "Agregar Referencia Laboral"
|
|
BtnAgragarReferenciaLaboralModal4.Text = "Agregar"
|
|
|
|
TxtEmpresaRL4.Text = ""
|
|
TxtDireccionRL4.Text = ""
|
|
TxtTel1RL4.Text = ""
|
|
TxtTel2RL4.Text = ""
|
|
TxtPuestoRL4.Text = ""
|
|
txtFechaI4.Text = ""
|
|
txtFechaF4.Text = ""
|
|
TxtSalarioInicialRL4.Text = ""
|
|
TxtSalariofinalRL4.Text = ""
|
|
TxtJefeDirectoRL4.Text = ""
|
|
TxtRazonSalidaRL4.Text = ""
|
|
TxtResponsabilidadesRL4.Text = ""
|
|
|
|
UpModalReferenciaLaboral4.Update()
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub resetFormReferenciasPersonales()
|
|
ActualizarReferenciaPersonal = False
|
|
CveReferenciaPersonal = -1
|
|
|
|
LtlTituloModalRP4.Text = "Agregar Referencia Personal"
|
|
BtnAgragarReferenciaPersonalModal4.Text = "Agregar"
|
|
|
|
TxtNombreRP4.Text = ""
|
|
DDLParentescoRP4.SelectedIndex = 0
|
|
TxtTiempoDeConocerloRP4.Text = ""
|
|
TxtTelefonoRP4.Text = ""
|
|
|
|
UpModalReferenciaPersonal4.Update()
|
|
|
|
End Sub
|
|
|
|
#End Region
|
|
|
|
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar4.Click
|
|
GuardarDatosGeneralesEvento()
|
|
End Sub
|
|
|
|
|
|
Function ExistePasoHistorial(paso As Integer) As Boolean
|
|
Dim objRh As New ClsRH
|
|
Dim respuesta As Boolean = False
|
|
|
|
If objRh.PersonalEstatusIngresoGet(CvePersonal, UsuarioActual.Empresa.CveEmpresa) Then
|
|
|
|
For Each drow As DataRow In objRh.DtResultados.Rows
|
|
If drow("CveEstatusIngreso").ToString.ToEntero = paso And Not IsDBNull(drow("CveEstatusIngresoHistorial")) Then
|
|
respuesta = True
|
|
Exit For
|
|
End If
|
|
Next
|
|
|
|
End If
|
|
objRh.Dispose()
|
|
Return respuesta
|
|
|
|
End Function
|
|
|
|
Private Sub GuardarDatosGeneralesEvento()
|
|
|
|
Dim objRh As New ClsRH
|
|
Dim existePaso As Boolean = True
|
|
Dim fechafinContrato As Date
|
|
Dim _CveSubProyectoZona As Integer
|
|
Dim _ParientesEmpresaDetalle As String
|
|
Dim _InfonavitNoCredito As String
|
|
Dim CveCaptacion As Integer = If(DdlCaptacion.SelectedValue.ToEntero = 0, -1, DdlCaptacion.SelectedValue.ToEntero)
|
|
Edad = Now.Year - TxtFechaN4.Text.ToDate.Year
|
|
|
|
If TxtParientesEmpresaDetalle.Text.Trim.Length > 0 Then
|
|
_ParientesEmpresaDetalle = TxtParientesEmpresaDetalle.Text.Trim
|
|
Else
|
|
_ParientesEmpresaDetalle = "-1"
|
|
End If
|
|
|
|
If TxtInfonavitNo.Text.Trim.Length > 0 Then
|
|
_InfonavitNoCredito = TxtInfonavitNo.Text.Trim
|
|
Else
|
|
_InfonavitNoCredito = "-1"
|
|
End If
|
|
|
|
|
|
If DdlSubproyectoZona.SelectedIndex = 0 Then
|
|
_CveSubProyectoZona = Nothing
|
|
Else
|
|
_CveSubProyectoZona = DdlSubproyectoZona.SelectedValue.ToEntero
|
|
End If
|
|
|
|
If TxtFechaFin.Text.Length = 10 Then
|
|
fechafinContrato = TxtFechaFin.Text.ToDate
|
|
Else
|
|
fechafinContrato = Nothing
|
|
End If
|
|
|
|
If CvePersonal = -1 Then
|
|
|
|
If TempImgFileName.Length <> 0 Then
|
|
URL = "1"
|
|
End If
|
|
|
|
If objRh.PersonalReclutamientoAdd(TxtNombres4.Text, TxtAPaterno4.Text, TxtAmaterno4.Text, TxtEstatura4.Text.ToDecimal, TxtPeso4.Text.ToDecimal,
|
|
TxtLugarnacimiento4.Text, TxtContactoEmergencia4.Text, TxtTipoSangre4.Text, TxtViveCon4.Text, txtCasaDondevive4.Text, DDLEstadoCivil4.SelectedValue.ToEntero,
|
|
Convert.ToInt32(chkInfonavid4.Checked), TxtAbonomensual4.Text.ToDecimal, TxtCamimones4.Text, Convert.ToInt32(chkTrabajoAnterior4.Checked), TxtTrbajoDetalle4.Text, Convert.ToInt32(chkParientesempresa4.Checked), Convert.ToInt32(chkDelito4.Checked),
|
|
TxtObserbacion4.Text, TxtDomicilio4.Text, TxtCalleNumero4.Text, TxtColonia4.Text, TxtCodigoPostal4.Text, TxtTelLocal4.Text, TxtCell4.Text, TxtEmail4.Text, TxtSeguroSocial4.Text, TxtLicencia4.Text,
|
|
DDLTipoLicencia4.SelectedValue.ToEntero, TxtCartilla4.Text, TxtCurp4.Text.Trim.ToUpper, Convert.ToInt32(ChkAceptaAntidiping4.Checked), TxtObservaciones4.Text, 1, Edad, TxtFechaN4.Text.ToDate, TxtCredencialElector4.Text, txtLt.Text, txtLg.Text,
|
|
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, URL, DDLUsuarioNomina.SelectedValue.ToEntero, TxtRFC4.Text.Trim.ToUpper, CveCaptacion, TxtMedioCaptacion.Text.Trim, CveSubproyectoZona:=_CveSubProyectoZona,
|
|
ParientesEmpresaDetalle:=_ParientesEmpresaDetalle, InfonavitNoCredito:=_InfonavitNoCredito, CveGenero:=DdlSexo.SelectedValue.ToEntero, CveSubProyecto:=DdlSubproyecto.SelectedValue.ToEntero, CveUniforme:=DdlUniforme.SelectedValue.ToEntero,
|
|
CveEscolaridad:=DdlEscolaridad.SelectedValue.ToEntero, CveRuta:=DdlRuta.SelectedValue.ToEntero) Then
|
|
|
|
Try
|
|
CvePersonal = objRh.DtResultados(0)(0).ToString.ToEntero
|
|
|
|
ProcesaReferencias()
|
|
|
|
If Not Directory.Exists(UsuarioActual.Empresa.Ruta & "RH\Personal\") Then
|
|
Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "RH\Personal\")
|
|
|
|
End If
|
|
|
|
Dim RutaDestino As String = UsuarioActual.Empresa.Ruta & "RH\" & "Personal\" & CvePersonal & ".png"
|
|
If TempImgFileName <> "" Then
|
|
File.Move(TempImgFileName, RutaDestino)
|
|
End If
|
|
|
|
If (objRh.PersonalEstatusIngresoAdd(CvePersonal, 1, UsuarioActual.CveUsuario, "")) Then
|
|
Response.Redirect("./reclutamiento.aspx?CvePersonal=" & CvePersonal, True)
|
|
End If
|
|
|
|
Catch ex As Exception
|
|
|
|
End Try
|
|
|
|
CargaDatos()
|
|
CargaPasos()
|
|
Pasos()
|
|
|
|
If ValPadre And ValMadre Then
|
|
PasoSiguiente()
|
|
Alert(" Registro agregado correctamente", TipoMensaje.MsgInformacion)
|
|
|
|
Else
|
|
If ValPadre = False And ValMadre = False Then
|
|
Alert("Para avanzar al siguiente paso se debe de agregar la madre y padre del candidato.", TipoMensaje.MsgAdvertencia)
|
|
Else
|
|
If ValPadre = True Then
|
|
Alert("Para avanzar al siguiente paso se debe de agregar a la madre del candidato.", TipoMensaje.MsgAdvertencia)
|
|
Else
|
|
Alert("Para avanzar al siguiente paso se debe de agregar a la padre del candidato.", TipoMensaje.MsgAdvertencia)
|
|
End If
|
|
End If
|
|
|
|
End If
|
|
|
|
End If
|
|
|
|
Else
|
|
|
|
If TempImgFileName <> "" Then
|
|
URL = CvePersonal.ToString
|
|
End If
|
|
|
|
If objRh.PersonalReclutamientoUpdate(CvePersonal, TxtNombres4.Text, TxtAPaterno4.Text, TxtAmaterno4.Text, TxtEstatura4.Text.ToDecimal, TxtPeso4.Text.ToDecimal,
|
|
TxtLugarnacimiento4.Text, TxtContactoEmergencia4.Text, TxtTipoSangre4.Text, TxtViveCon4.Text, txtCasaDondevive4.Text, DDLEstadoCivil4.Text.ToEntero,
|
|
Convert.ToInt32(chkInfonavid4.Checked), TxtAbonomensual4.Text.ToDecimal, TxtCamimones4.Text, Convert.ToInt32(chkTrabajoAnterior4.Checked), TxtTrbajoDetalle4.Text, Convert.ToInt32(chkParientesempresa4.Checked), Convert.ToInt32(chkDelito4.Checked),
|
|
TxtObserbacion4.Text, TxtDomicilio4.Text, TxtCalleNumero4.Text, TxtColonia4.Text, TxtCodigoPostal4.Text, TxtTelLocal4.Text, TxtCell4.Text, TxtEmail4.Text, TxtSeguroSocial4.Text, TxtLicencia4.Text,
|
|
DDLTipoLicencia4.SelectedValue.ToEntero, TxtCartilla4.Text, TxtCurp4.Text.Trim.ToUpper, Convert.ToInt32(ChkAceptaAntidiping4.Checked), TxtObservaciones4.Text, 1, Edad, TxtFechaN4.Text.ToDate, TxtCredencialElector4.Text, txtLt.Text, txtLg.Text,
|
|
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 3, -1, TxtFechaInicio.Text.ToDate, URL, MotivoDescarto, DDLUsuarioNomina.SelectedValue.ToEntero, TxtRFC4.Text.Trim.ToUpper, CveCaptacion, TxtMedioCaptacion.Text.Trim, -1, -1,
|
|
CveSubproyectoZona:=_CveSubProyectoZona, FechaFinContrato:=fechafinContrato, ParientesEmpresaDetalle:=_ParientesEmpresaDetalle, InfonavitNoCredito:=_InfonavitNoCredito, CveGenero:=DdlSexo.SelectedValue.ToEntero,
|
|
CveSubProyecto:=DdlSubproyecto.SelectedValue.ToEntero, CveUniforme:=DdlUniforme.SelectedValue.ToEntero, CveEscolaridad:=DdlEscolaridad.SelectedValue.ToEntero, CveRuta:=DdlRuta.SelectedValue.ToEntero) Then
|
|
|
|
ProcesaReferencias()
|
|
|
|
|
|
Dim RutaDestino As String = UsuarioActual.Empresa.Ruta & "RH\" & "Personal\" & CvePersonal & ".png"
|
|
|
|
If TempImgFileName <> "" Then
|
|
|
|
If File.Exists(RutaDestino) Then
|
|
File.Delete(RutaDestino)
|
|
End If
|
|
|
|
If Not Directory.Exists(UsuarioActual.Empresa.Ruta & "RH\Personal\") Then
|
|
Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "RH\Personal\")
|
|
|
|
End If
|
|
File.Move(TempImgFileName, RutaDestino)
|
|
TempImgFileName = ""
|
|
End If
|
|
|
|
CargaDatos()
|
|
|
|
|
|
If TempImgFileName <> "" Then
|
|
|
|
End If
|
|
|
|
If Not ExistePasoHistorial(1) Then
|
|
objRh.PersonalEstatusIngresoAdd(CvePersonal, 1, UsuarioActual.CveUsuario, "")
|
|
End If
|
|
|
|
|
|
|
|
If ValPadre And ValMadre Then
|
|
Alert("Registro actualizado correctamente.", TipoMensaje.MsgInformacion)
|
|
PasoSiguiente()
|
|
Else
|
|
If ValPadre = False And ValMadre = False Then
|
|
Alert("Para avanzar al siguiente paso se debe de agregar a la madre y padre del candidato.", TipoMensaje.MsgAdvertencia)
|
|
Else
|
|
If ValPadre = True Then
|
|
Alert("Para avanzar al siguiente paso se debe de agregar a la madre del candidato.", TipoMensaje.MsgAdvertencia)
|
|
Else
|
|
Alert("Para avanzar al siguiente paso se debe de agregar a el padre del candidato.", TipoMensaje.MsgAdvertencia)
|
|
End If
|
|
End If
|
|
|
|
End If
|
|
|
|
End If
|
|
|
|
End If
|
|
|
|
objRh.Dispose()
|
|
End Sub
|
|
|
|
|
|
Private Sub CrearEstructuraTablaFamiliares()
|
|
|
|
End Sub
|
|
|
|
Private Sub CrearEstructuraTablasTemporales()
|
|
'Inicio Referencias
|
|
|
|
Dim Familiares As New DataTable
|
|
Dim Escolaridad As New DataTable
|
|
Dim ReferenciasLaborales As New DataTable
|
|
Dim ReferenciasPersonales As New DataTable
|
|
|
|
Familiares.Columns.Add("CveFamiliar", Type.GetType("System.Int32"))
|
|
Familiares.Columns.Add("CvePersonal", Type.GetType("System.Int32"))
|
|
Familiares.Columns.Add("CveParentesco", Type.GetType("System.Int32"))
|
|
Familiares.Columns.Add("Parentesco", Type.GetType("System.String"))
|
|
Familiares.Columns.Add("Nombre", Type.GetType("System.String"))
|
|
Familiares.Columns.Add("Domicilio", Type.GetType("System.String"))
|
|
Familiares.Columns.Add("Edad", Type.GetType("System.Int32"))
|
|
Familiares.Columns.Add("Ocupacion", Type.GetType("System.String"))
|
|
Familiares.Columns.Add("Fecha", Type.GetType("System.DateTime"))
|
|
Familiares.Columns.Add("Usuario", Type.GetType("System.String"))
|
|
Familiares.Columns.Add("Telefono", Type.GetType("System.String"))
|
|
Familiares.Columns.Add("Accion", Type.GetType("System.String"))
|
|
Familiares.Columns.Add("Observaciones", Type.GetType("System.String"))
|
|
DTFamiliares = Familiares
|
|
|
|
Escolaridad.Columns.Add("CveEscolaridad", Type.GetType("System.Int32"))
|
|
Escolaridad.Columns.Add("CvePersonal", Type.GetType("System.Int32"))
|
|
Escolaridad.Columns.Add("NivelEscolar", Type.GetType("System.String"))
|
|
Escolaridad.Columns.Add("CveNivelEscolar", Type.GetType("System.Int32"))
|
|
Escolaridad.Columns.Add("NombreInstitucion", Type.GetType("System.String"))
|
|
Escolaridad.Columns.Add("AniosCursados", Type.GetType("System.Int32"))
|
|
Escolaridad.Columns.Add("TituloRecibido", Type.GetType("System.String"))
|
|
Escolaridad.Columns.Add("FechaIng", Type.GetType("System.DateTime"))
|
|
Escolaridad.Columns.Add("Usuario", Type.GetType("System.String"))
|
|
Escolaridad.Columns.Add("Accion", Type.GetType("System.String"))
|
|
DTEscolaridad = Escolaridad
|
|
|
|
|
|
|
|
ReferenciasLaborales.Columns.Add("CveReferenciaLaboral", Type.GetType("System.Int32"))
|
|
ReferenciasLaborales.Columns.Add("CvePersonal", Type.GetType("System.Int32"))
|
|
ReferenciasLaborales.Columns.Add("Empresa", Type.GetType("System.String"))
|
|
ReferenciasLaborales.Columns.Add("Direccion", Type.GetType("System.String"))
|
|
ReferenciasLaborales.Columns.Add("Tel1", Type.GetType("System.String"))
|
|
ReferenciasLaborales.Columns.Add("Tel2", Type.GetType("System.String"))
|
|
ReferenciasLaborales.Columns.Add("Puesto", Type.GetType("System.String"))
|
|
ReferenciasLaborales.Columns.Add("FechaInicio", Type.GetType("System.DateTime"))
|
|
ReferenciasLaborales.Columns.Add("FechaTermino", Type.GetType("System.DateTime"))
|
|
ReferenciasLaborales.Columns.Add("SalarioInicial", Type.GetType("System.Decimal"))
|
|
ReferenciasLaborales.Columns.Add("SalarioFinal", Type.GetType("System.Decimal"))
|
|
ReferenciasLaborales.Columns.Add("JefeDirecto", Type.GetType("System.String"))
|
|
ReferenciasLaborales.Columns.Add("RazonDeSalida", Type.GetType("System.String"))
|
|
ReferenciasLaborales.Columns.Add("Responsabilidades", Type.GetType("System.String"))
|
|
'ReferenciasLaborales.Columns.Add("Fecha", Type.GetType("System.DateTime"))
|
|
' ReferenciasLaborales.Columns.Add("Usuario", Type.GetType("System.String"))
|
|
ReferenciasLaborales.Columns.Add("Accion", Type.GetType("System.String"))
|
|
DTRefenciasLabolares = ReferenciasLaborales
|
|
|
|
ReferenciasPersonales.Columns.Add("CvePersonal", Type.GetType("System.Int32"))
|
|
ReferenciasPersonales.Columns.Add("CveReferenciaPersonal", Type.GetType("System.Int32"))
|
|
ReferenciasPersonales.Columns.Add("Nombre", Type.GetType("System.String"))
|
|
ReferenciasPersonales.Columns.Add("CveParentesco", Type.GetType("System.Int32"))
|
|
ReferenciasPersonales.Columns.Add("Parentesco", Type.GetType("System.String"))
|
|
ReferenciasPersonales.Columns.Add("TiempoDeConocerlo", Type.GetType("System.String"))
|
|
ReferenciasPersonales.Columns.Add("Telefono", Type.GetType("System.String"))
|
|
ReferenciasPersonales.Columns.Add("Fecha", Type.GetType("System.DateTime"))
|
|
ReferenciasPersonales.Columns.Add("Usuario", Type.GetType("System.String"))
|
|
ReferenciasPersonales.Columns.Add("Accion", Type.GetType("System.String"))
|
|
DTRefenciasPersonales = ReferenciasPersonales
|
|
|
|
End Sub
|
|
|
|
#Region "Referencias AgregarModal(Inserts Update)"
|
|
|
|
Protected Sub BtnAgregarFamiliarModal_Click(sender As Object, e As EventArgs) Handles BtnAgregarFamiliarModal4.Click
|
|
|
|
|
|
If ActualizarFamiliar Then
|
|
|
|
'DtRowFamiliar("CveFamiliar") = -1
|
|
DTFamiliares(IndexActual)("CvePersonal") = -1
|
|
DTFamiliares(IndexActual)("Parentesco") = DDLParentescoFamiliar4.SelectedItem.Text
|
|
DTFamiliares(IndexActual)("CveParentesco") = DDLParentescoFamiliar4.SelectedValue.ToEntero
|
|
DTFamiliares(IndexActual)("Nombre") = TxtNombreFamiliar4.Text.Trim
|
|
DTFamiliares(IndexActual)("Domicilio") = TxtDomicilioFamiliar4.Text.Trim
|
|
DTFamiliares(IndexActual)("Edad") = TxtEdadFamiliar4.Text.ToEntero
|
|
DTFamiliares(IndexActual)("Ocupacion") = TxtOcupacionFamiliar4.Text.Trim
|
|
DTFamiliares(IndexActual)("Telefono") = TxtTelefonoFamiliar.Text.Trim
|
|
DTFamiliares(IndexActual)("Observaciones") = TxtObservacionesFamiliar.Text.Trim
|
|
|
|
If DTFamiliares(IndexActual)("CveFamiliar").ToString = "-1" Then
|
|
DTFamiliares(IndexActual)("Accion") = "2"
|
|
Else
|
|
DTFamiliares(IndexActual)("Accion") = "1"
|
|
End If
|
|
|
|
DTFamiliares.AcceptChanges()
|
|
|
|
Else
|
|
|
|
Dim DtRowFamiliar As DataRow
|
|
DtRowFamiliar = DTFamiliares.NewRow
|
|
|
|
DtRowFamiliar("CveFamiliar") = -1
|
|
DtRowFamiliar("CvePersonal") = -1
|
|
DtRowFamiliar("Parentesco") = DDLParentescoFamiliar4.SelectedItem.Text
|
|
DtRowFamiliar("CveParentesco") = DDLParentescoFamiliar4.SelectedValue.ToEntero
|
|
DtRowFamiliar("Nombre") = TxtNombreFamiliar4.Text.Trim
|
|
DtRowFamiliar("Domicilio") = TxtDomicilioFamiliar4.Text.Trim
|
|
DtRowFamiliar("Edad") = TxtEdadFamiliar4.Text.ToEntero
|
|
DtRowFamiliar("Ocupacion") = TxtOcupacionFamiliar4.Text.Trim
|
|
DtRowFamiliar("Telefono") = TxtTelefonoFamiliar.Text.Trim
|
|
DtRowFamiliar("Observaciones") = TxtObservacionesFamiliar.Text.Trim
|
|
|
|
DtRowFamiliar("Accion") = "2"
|
|
|
|
DTFamiliares.Rows.Add(DtRowFamiliar)
|
|
DTFamiliares.AcceptChanges()
|
|
|
|
End If
|
|
|
|
IndexActual = -1
|
|
|
|
|
|
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAgregarFamiliar"))
|
|
'CargaFamiliares()
|
|
|
|
GvFamiliares4.DataSource = DTFamiliares
|
|
GvFamiliares4.DataBind()
|
|
UPTabFamiliares4.Update()
|
|
|
|
CveFamiliar = -1
|
|
ActualizarFamiliar = False
|
|
End Sub
|
|
|
|
Protected Sub BtnAgregarEscolaridadModal_Click(sender As Object, e As EventArgs) Handles BtnAgregarEscolaridadModal4.Click
|
|
|
|
|
|
If ActualizarEscolaridad Then
|
|
|
|
DTEscolaridad(IndexActual)("CvePersonal") = -1
|
|
DTEscolaridad(IndexActual)("CveEscolaridad") = -1
|
|
DTEscolaridad(IndexActual)("NivelEscolar") = DDLEscolaridad4.SelectedItem.Text
|
|
DTEscolaridad(IndexActual)("CveNivelEscolar") = DDLEscolaridad4.SelectedValue.ToEntero
|
|
DTEscolaridad(IndexActual)("NombreInstitucion") = TxtInstitucion4.Text.Trim
|
|
DTEscolaridad(IndexActual)("AniosCursados") = TxtAniosCursados4.Text.ToEntero
|
|
DTEscolaridad(IndexActual)("TituloRecibido") = TxtTituloRecibido4.Text.Trim
|
|
|
|
If DTEscolaridad(IndexActual)("CveEscolaridad").ToString = "-1" Then
|
|
DTEscolaridad(IndexActual)("Accion") = "2"
|
|
Else
|
|
DTEscolaridad(IndexActual)("Accion") = "1"
|
|
End If
|
|
DTEscolaridad.AcceptChanges()
|
|
|
|
Else
|
|
|
|
Dim DtRowEscolaridad As DataRow
|
|
DtRowEscolaridad = DTEscolaridad.NewRow
|
|
|
|
DtRowEscolaridad("CvePersonal") = -1
|
|
DtRowEscolaridad("CveEscolaridad") = -1
|
|
DtRowEscolaridad("NivelEscolar") = DDLEscolaridad4.SelectedItem.Text
|
|
DtRowEscolaridad("CveNivelEscolar") = DDLEscolaridad4.SelectedValue.ToEntero
|
|
DtRowEscolaridad("NombreInstitucion") = TxtInstitucion4.Text.Trim
|
|
DtRowEscolaridad("AniosCursados") = TxtAniosCursados4.Text.ToEntero
|
|
DtRowEscolaridad("TituloRecibido") = TxtTituloRecibido4.Text.Trim
|
|
DtRowEscolaridad("Accion") = "2"
|
|
|
|
DTEscolaridad.Rows.Add(DtRowEscolaridad)
|
|
DTEscolaridad.AcceptChanges()
|
|
|
|
End If
|
|
|
|
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAgregarEscolaridad"))
|
|
|
|
GvEscolaridad4.DataSource = DTEscolaridad
|
|
GvEscolaridad4.DataBind()
|
|
UPTabEscolaridad4.Update()
|
|
|
|
CveEscolaridad = -1
|
|
ActualizarEscolaridad = False
|
|
|
|
End Sub
|
|
|
|
Protected Sub BtnAgragarReferenciaLaboralModal_Click(sender As Object, e As EventArgs) Handles BtnAgragarReferenciaLaboralModal4.Click
|
|
|
|
|
|
If ActualizarReferenciaLaboral Then
|
|
|
|
DTRefenciasLabolares(IndexActual)("CvePersonal") = "-1"
|
|
DTRefenciasLabolares(IndexActual)("Empresa") = TxtEmpresaRL4.Text.Trim
|
|
DTRefenciasLabolares(IndexActual)("Direccion") = TxtDireccionRL4.Text.Trim
|
|
DTRefenciasLabolares(IndexActual)("Tel1") = TxtTel1RL4.Text.Trim
|
|
DTRefenciasLabolares(IndexActual)("Tel2") = TxtTel1RL4.Text.Trim
|
|
DTRefenciasLabolares(IndexActual)("Puesto") = TxtPuestoRL4.Text.Trim
|
|
DTRefenciasLabolares(IndexActual)("FechaInicio") = txtFechaI4.Text.ToDate
|
|
DTRefenciasLabolares(IndexActual)("FechaTermino") = txtFechaF4.Text.ToDate
|
|
DTRefenciasLabolares(IndexActual)("SalarioInicial") = TxtSalarioInicialRL4.Text.ToDecimal
|
|
DTRefenciasLabolares(IndexActual)("SalarioFinal") = TxtSalariofinalRL4.Text.ToDecimal
|
|
DTRefenciasLabolares(IndexActual)("JefeDirecto") = TxtJefeDirectoRL4.Text.Trim
|
|
DTRefenciasLabolares(IndexActual)("RazonDeSalida") = TxtRazonSalidaRL4.Text.Trim
|
|
DTRefenciasLabolares(IndexActual)("Responsabilidades") = TxtResponsabilidadesRL4.Text
|
|
|
|
If DTRefenciasLabolares(IndexActual)("CveReferenciaLaboral").ToString = "-1" Then
|
|
DTRefenciasLabolares(IndexActual)("Accion") = "2"
|
|
Else
|
|
DTRefenciasLabolares(IndexActual)("Accion") = "1"
|
|
End If
|
|
|
|
DTRefenciasLabolares.AcceptChanges()
|
|
|
|
Else
|
|
|
|
Dim DtRowReferenciasLaborales As DataRow
|
|
DtRowReferenciasLaborales = DTRefenciasLabolares.NewRow
|
|
|
|
DtRowReferenciasLaborales("CveReferenciaLaboral") = -1
|
|
'DtRowReferenciasLaborales("CvePersonal") = -1
|
|
DtRowReferenciasLaborales("Empresa") = TxtEmpresaRL4.Text.Trim
|
|
DtRowReferenciasLaborales("Direccion") = TxtDireccionRL4.Text.Trim
|
|
DtRowReferenciasLaborales("Tel1") = TxtTel1RL4.Text.Trim
|
|
DtRowReferenciasLaborales("Tel2") = TxtTel1RL4.Text.Trim
|
|
DtRowReferenciasLaborales("Puesto") = TxtPuestoRL4.Text.Trim
|
|
DtRowReferenciasLaborales("FechaInicio") = txtFechaI4.Text.ToDate
|
|
DtRowReferenciasLaborales("FechaTermino") = txtFechaF4.Text.ToDate
|
|
DtRowReferenciasLaborales("SalarioInicial") = TxtSalarioInicialRL4.Text.ToDecimal
|
|
DtRowReferenciasLaborales("SalarioFinal") = TxtSalariofinalRL4.Text.ToDecimal
|
|
DtRowReferenciasLaborales("JefeDirecto") = TxtJefeDirectoRL4.Text.Trim
|
|
DtRowReferenciasLaborales("RazonDeSalida") = TxtRazonSalidaRL4.Text.Trim
|
|
DtRowReferenciasLaborales("Responsabilidades") = TxtResponsabilidadesRL4.Text
|
|
|
|
DtRowReferenciasLaborales("Accion") = "2"
|
|
|
|
DTRefenciasLabolares.Rows.Add(DtRowReferenciasLaborales)
|
|
DtRowReferenciasLaborales.AcceptChanges()
|
|
|
|
End If
|
|
|
|
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAgregarRL"))
|
|
|
|
GvReferenciasLaborales4.DataSource = DTRefenciasLabolares
|
|
GvReferenciasLaborales4.DataBind()
|
|
UPTabReferenciasLaborales4.Update()
|
|
|
|
CveReferenciaLaboral = -1
|
|
ActualizarReferenciaLaboral = False
|
|
|
|
End Sub
|
|
|
|
Protected Sub BtnAgragarReferenciaPersonalModal_Click(sender As Object, e As EventArgs) Handles BtnAgragarReferenciaPersonalModal4.Click
|
|
|
|
|
|
|
|
If ActualizarReferenciaPersonal Then
|
|
'DTRefenciasPersonales(IndexActual)("CveReferenciaPersonal") = -1
|
|
DTRefenciasPersonales(IndexActual)("Nombre") = TxtNombreRP4.Text.Trim
|
|
DTRefenciasPersonales(IndexActual)("CveParentesco") = DDLParentescoRP4.SelectedValue.ToEntero
|
|
DTRefenciasPersonales(IndexActual)("Parentesco") = DDLParentescoRP4.SelectedItem.Text
|
|
DTRefenciasPersonales(IndexActual)("TiempoDeConocerlo") = TxtTiempoDeConocerloRP4.Text.Trim
|
|
DTRefenciasPersonales(IndexActual)("Telefono") = TxtTelefonoRP4.Text.Trim
|
|
|
|
If DTRefenciasPersonales(IndexActual)("CveReferenciaPersonal").ToString = "-1" Then
|
|
DTRefenciasPersonales(IndexActual)("Accion") = "2"
|
|
Else
|
|
DTRefenciasPersonales(IndexActual)("Accion") = "1"
|
|
End If
|
|
DTRefenciasPersonales.AcceptChanges()
|
|
Else
|
|
|
|
Dim DtRowReferenciasPersonales As DataRow
|
|
DtRowReferenciasPersonales = DTRefenciasPersonales.NewRow
|
|
|
|
DtRowReferenciasPersonales("Nombre") = TxtNombreRP4.Text.Trim
|
|
DtRowReferenciasPersonales("CveParentesco") = DDLParentescoRP4.SelectedValue.ToEntero
|
|
DtRowReferenciasPersonales("Parentesco") = DDLParentescoRP4.SelectedItem.Text
|
|
DtRowReferenciasPersonales("TiempoDeConocerlo") = TxtTiempoDeConocerloRP4.Text.Trim
|
|
DtRowReferenciasPersonales("Telefono") = TxtTelefonoRP4.Text.Trim
|
|
DtRowReferenciasPersonales("Accion") = "2"
|
|
|
|
DTRefenciasPersonales.Rows.Add(DtRowReferenciasPersonales)
|
|
DTRefenciasPersonales.AcceptChanges()
|
|
|
|
|
|
End If
|
|
|
|
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAgregarRP"))
|
|
|
|
GvReferenciasPersonales4.DataSource = DTRefenciasPersonales
|
|
GvReferenciasPersonales4.DataBind()
|
|
UPTabReferenciasPersonales4.Update()
|
|
|
|
|
|
CveReferenciaPersonal = -1
|
|
ActualizarReferenciaPersonal = False
|
|
End Sub
|
|
|
|
|
|
#End Region
|
|
|
|
|
|
#Region "Referencias Remove "
|
|
|
|
Public Sub Remove_ClickFamiliar(sender As Object, e As EventArgs)
|
|
|
|
|
|
|
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
|
IndexActual = GvRow.RowIndex
|
|
Dim activo As Boolean = False
|
|
Dim CveFamiliar As Integer = GvRow.DataKey("CveFamiliar").ToString.ToEntero
|
|
|
|
If CveFamiliar > 0 Then
|
|
|
|
DTFamiliares.Rows(IndexActual)("Accion") = "3"
|
|
ProcesaDTFamiliares()
|
|
CargaFamiliares()
|
|
|
|
Else
|
|
DTFamiliares.Rows(IndexActual).Delete()
|
|
DTFamiliares.AcceptChanges()
|
|
GvFamiliares4.DataSource = DTFamiliares
|
|
GvFamiliares4.DataBind()
|
|
UPTabFamiliares4.Update()
|
|
End If
|
|
IndexActual = -1
|
|
|
|
End Sub
|
|
|
|
Public Sub Remove_ClickEscolaridad(sender As Object, e As EventArgs)
|
|
|
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
|
IndexActual = GvRow.RowIndex
|
|
Dim activo As Boolean = False
|
|
Dim CveEscolaridadI As Integer = GvRow.DataKey("CveEscolaridad").ToEntero.ToEntero
|
|
|
|
If CveEscolaridadI > 0 Then
|
|
|
|
DTEscolaridad.Rows(IndexActual)("Accion") = "3"
|
|
ProcesaDTEscolaridad()
|
|
CargaEscolaridad()
|
|
|
|
Else
|
|
DTEscolaridad.Rows(IndexActual).Delete()
|
|
DTEscolaridad.AcceptChanges()
|
|
GvEscolaridad4.DataSource = DTEscolaridad
|
|
GvEscolaridad4.DataBind()
|
|
UPTabEscolaridad4.Update()
|
|
End If
|
|
|
|
IndexActual = -1
|
|
|
|
End Sub
|
|
|
|
Public Sub Remove_ClickReferenciasLaborales(sender As Object, e As EventArgs)
|
|
|
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
|
IndexActual = GvRow.RowIndex
|
|
|
|
Dim CveReferenciaLaborali As Integer = GvRow.DataKey("CveReferenciaLaboral").ToString.ToEntero
|
|
|
|
If CveReferenciaLaborali > 0 Then
|
|
|
|
DTRefenciasLabolares.Rows(IndexActual)("Accion") = "3"
|
|
ProcesaDTReferenciasLAborales()
|
|
CargaReferenciasLaborales()
|
|
Else
|
|
DTRefenciasLabolares.Rows(IndexActual).Delete()
|
|
DTRefenciasLabolares.AcceptChanges()
|
|
GvReferenciasLaborales4.DataSource = DTRefenciasLabolares
|
|
GvReferenciasLaborales4.DataBind()
|
|
UPTabReferenciasLaborales4.Update()
|
|
End If
|
|
|
|
IndexActual = -1
|
|
|
|
End Sub
|
|
|
|
Public Sub Remove_ClickReferenciasPersonales(sender As Object, e As EventArgs)
|
|
|
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
|
|
|
IndexActual = GvRow.RowIndex
|
|
|
|
Dim CveReferenciaPersonali As Integer = GvRow.DataKey("CveReferenciaPersonal").ToString.ToEntero
|
|
|
|
If CveReferenciaPersonali > 0 Then
|
|
|
|
DTRefenciasPersonales.Rows(IndexActual)("Accion") = "3"
|
|
ProcesaDTReferenciasPersonales()
|
|
CargaReferenciasPersonales()
|
|
Else
|
|
|
|
DTRefenciasPersonales.Rows(IndexActual).Delete()
|
|
DTRefenciasPersonales.AcceptChanges()
|
|
GvReferenciasPersonales4.DataSource = DTRefenciasPersonales
|
|
GvReferenciasPersonales4.DataBind()
|
|
UPTabReferenciasPersonales4.Update()
|
|
End If
|
|
|
|
|
|
IndexActual = -1
|
|
End Sub
|
|
#End Region
|
|
|
|
#Region "Referencias Procesa datatables"
|
|
|
|
Private Sub ProcesaReferencias()
|
|
ProcesaDTFamiliares()
|
|
ProcesaDTEscolaridad()
|
|
ProcesaDTReferenciasLAborales()
|
|
ProcesaDTReferenciasPersonales()
|
|
End Sub
|
|
Private Sub ProcesaDTFamiliares()
|
|
|
|
Dim objRH As New ClsRH
|
|
|
|
ValPadre = False
|
|
ValMadre = False
|
|
|
|
For Each dRow As DataRow In DTFamiliares.Rows
|
|
|
|
If dRow("Accion").ToString = "1" Then 'Actualiza
|
|
objRH.PersonalFamiliaresUpdate(dRow("CveFamiliar").ToString.ToEntero, CvePersonal, dRow("CveParentesco").ToString.ToEntero, dRow("Nombre").ToString, dRow("Domicilio").ToString, dRow("Edad").ToString.ToEntero, dRow("Ocupacion").ToString, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, dRow("Telefono").ToString, If(dRow("Observaciones").ToString.Trim = "", "-1", dRow("Observaciones").ToString.Trim))
|
|
End If
|
|
If dRow("Accion").ToString = "2" Then 'Inserta
|
|
objRH.PersonalFamiliaresAdd(CvePersonal, dRow("CveParentesco").ToString.ToEntero, dRow("Nombre").ToString, dRow("Domicilio").ToString, dRow("Edad").ToString.ToEntero, dRow("Ocupacion").ToString, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, dRow("Telefono").ToString, If(dRow("Observaciones").ToString.Trim = "", "-1", dRow("Observaciones").ToString.Trim))
|
|
End If
|
|
|
|
If dRow("CveParentesco").ToString.ToEntero = 1 Then
|
|
ValPadre = True
|
|
End If
|
|
|
|
If dRow("CveParentesco").ToString.ToEntero = 2 Then
|
|
ValMadre = True
|
|
End If
|
|
|
|
If dRow("Accion").ToString = "3" Then 'Borra
|
|
objRH.PersonalFamiliaresRemove(dRow("CveFamiliar").ToString.ToEntero, -1)
|
|
End If
|
|
|
|
Next
|
|
|
|
objRH.Dispose()
|
|
|
|
End Sub
|
|
Private Sub ProcesaDTEscolaridad()
|
|
|
|
Dim objRH As New ClsRH
|
|
|
|
For Each dRow As DataRow In DTEscolaridad.Rows
|
|
|
|
If dRow("Accion").ToString = "1" Then 'Actualiza
|
|
objRH.PersonalEscolaridadUpdate(dRow("CveEscolaridad").ToString.ToEntero, CvePersonal, dRow("CveNivelEscolar").ToString.ToEntero, dRow("NombreInstitucion").ToString, dRow("AniosCursados").ToString.ToEntero, dRow("TituloRecibido").ToString, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
|
End If
|
|
|
|
If dRow("Accion").ToString = "2" Then 'Inserta
|
|
objRH.PersonalEscolaridadAdd(CvePersonal, dRow("CveNivelEscolar").ToString.ToEntero, dRow("NombreInstitucion").ToString, dRow("AniosCursados").ToString.ToEntero, dRow("TituloRecibido").ToString, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
|
End If
|
|
|
|
If dRow("Accion").ToString = "3" Then 'Borra
|
|
objRH.PersonalEscolaridadRemove(dRow("CveEscolaridad").ToString.ToEntero)
|
|
End If
|
|
|
|
Next
|
|
|
|
objRH.Dispose()
|
|
End Sub
|
|
|
|
Private Sub ProcesaDTReferenciasLAborales()
|
|
Dim objRH As New ClsRH
|
|
|
|
For Each dRow As DataRow In DTRefenciasLabolares.Rows
|
|
|
|
If dRow("Accion").ToString = "1" Then 'Actualiza
|
|
objRH.PersonalReferenciasLaboralesUpdate(dRow("CveReferenciaLaboral").ToString.ToEntero, CvePersonal, dRow("Empresa").ToString, dRow("Direccion").ToString, dRow("Tel1").ToString, dRow("Tel2").ToString, dRow("Puesto").ToString,
|
|
dRow("FechaInicio").ToString.ToDate, dRow("FechaTermino").ToString.ToDate, dRow("SalarioInicial").ToString.ToDecimal, dRow("SalarioFinal").ToString.ToDecimal, dRow("JefeDirecto").ToString,
|
|
dRow("RazonDeSalida").ToString, dRow("Responsabilidades").ToString, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
|
End If
|
|
If dRow("Accion").ToString = "2" Then 'Inserta
|
|
|
|
objRH.PersonalReferenciasLaboralesAdd(CvePersonal, dRow("Empresa").ToString, dRow("Direccion").ToString, dRow("Tel1").ToString, dRow("Tel2").ToString, dRow("Puesto").ToString,
|
|
dRow("FechaInicio").ToString.ToDate, dRow("FechaTermino").ToString.ToDate, dRow("SalarioInicial").ToString.ToDecimal, dRow("SalarioFinal").ToString.ToDecimal, dRow("JefeDirecto").ToString,
|
|
dRow("RazonDeSalida").ToString, dRow("Responsabilidades").ToString, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
|
End If
|
|
|
|
If dRow("Accion").ToString = "3" Then 'Borra
|
|
objRH.PersonalReferenciasLaboralesRemove(dRow("CveReferenciaLaboral").ToString.ToEntero)
|
|
End If
|
|
|
|
Next
|
|
|
|
objRH.Dispose()
|
|
End Sub
|
|
|
|
Private Sub ProcesaDTReferenciasPersonales()
|
|
Dim objRH As New ClsRH
|
|
|
|
For Each dRow As DataRow In DTRefenciasPersonales.Rows
|
|
|
|
If dRow("Accion").ToString = "1" Then 'Actualiza
|
|
objRH.PersonalReferenciasPersonalesUpdate(dRow("CveReferenciaPersonal").ToString.ToEntero, CvePersonal, dRow("Nombre").ToString, dRow("CveParentesco").ToString.ToEntero, dRow("TiempoDeConocerlo").ToString, dRow("Telefono").ToString, UsuarioActual.CveUsuario, UsuarioActual.Empresa.CveEmpresa)
|
|
End If
|
|
If dRow("Accion").ToString = "2" Then 'Inserta
|
|
objRH.PersonalReferenciasPersonalesAdd(CvePersonal, dRow("Nombre").ToString, dRow("CveParentesco").ToString.ToEntero, dRow("TiempoDeConocerlo").ToString, dRow("Telefono").ToString, UsuarioActual.CveUsuario, UsuarioActual.Empresa.CveEmpresa)
|
|
End If
|
|
|
|
If dRow("Accion").ToString = "3" Then 'Borra
|
|
objRH.PersonalReferenciasPersonalesRemove(dRow("CveReferenciaPersonal").ToString.ToEntero)
|
|
End If
|
|
|
|
Next
|
|
|
|
objRH.Dispose()
|
|
End Sub
|
|
|
|
#End Region
|
|
Protected Sub BtnFileBit_Click(sender As Object, e As EventArgs) Handles btnFileBit4.Click
|
|
|
|
Dim FileExtension As String = "-1"
|
|
Dim Filesgral As List(Of Archivo) = txtFileBit4.getfiles().Archivos
|
|
Dim Filename As String = ""
|
|
|
|
For Each fileItem As Archivo In Filesgral
|
|
|
|
FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
|
|
|
|
Dim tempArray() As String
|
|
tempArray = fileItem.filename.ToString().Split("-".ToCharArray())
|
|
|
|
Dim rutaDestino As String = UsuarioActual.Empresa.Ruta & "Temp\" & CvePersonal & ".png"
|
|
Dim rutaAdjuntoAnterior As String = UsuarioActual.Empresa.Ruta & "Personal\" & CvePersonal & "\" & AdjuntoDocumentacion
|
|
|
|
Try
|
|
If Not System.IO.Directory.Exists(UsuarioActual.Empresa.Ruta & "Temp\") Then
|
|
System.IO.Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "Temp\")
|
|
End If
|
|
|
|
If File.Exists(rutaAdjuntoAnterior) And AdjuntoDocumentacion.Trim.Length > 0 Then
|
|
File.Delete(rutaAdjuntoAnterior)
|
|
End If
|
|
|
|
If System.IO.File.Exists(rutaDestino) Then
|
|
|
|
System.IO.File.Delete(rutaDestino)
|
|
TempImgFileName = rutaDestino
|
|
|
|
End If
|
|
System.IO.File.Move(fileItem.FileUrl, rutaDestino)
|
|
TempImgFileName = rutaDestino
|
|
txtFileBit4.Text = ""
|
|
|
|
Catch ex As Exception
|
|
TempImgFileName = ""
|
|
End Try
|
|
|
|
If TempImgFileName <> "" Then
|
|
ImgPersonal4.ImageUrl = "/Empresas/" & UsuarioActual.CveEmpresa & "/Temp/" & CvePersonal & ".png"
|
|
End If
|
|
UpImgBit4.Update()
|
|
Next
|
|
|
|
RegistraScript("$('#ModalUploadBit').modal('hide')", "hidemodal2")
|
|
|
|
End Sub
|
|
|
|
#Region "PASOS"
|
|
|
|
Private Sub Pasos()
|
|
|
|
|
|
|
|
If DTPasos.Rows.Count > 0 Then
|
|
|
|
' ContadorPAsosACtuales = DTPasos.Rows.Count
|
|
|
|
Dim contador As Integer = 1
|
|
For Each dRow As DataRow In DTPasos.Rows
|
|
|
|
Try
|
|
|
|
Dim CveEstatusingreso As String = dRow("CveEstatusIngreso").ToString
|
|
Dim Orden As Integer = dRow("Orden").ToString.ToEntero
|
|
Dim PasoText = dRow("EstatusIngreso").ToString
|
|
|
|
Dim HControl As Control = DirectCast(Page.Master.FindControl("C").FindControl("Htab" & CveEstatusingreso), Control)
|
|
Dim LControl As Literal = DirectCast(HControl.Controls(1), Literal)
|
|
Dim LControlText As Literal = DirectCast(HControl.Controls(3), Literal)
|
|
|
|
Dim das As Type = WLtl24.GetType
|
|
|
|
HControl.Visible = True
|
|
LControl.Text = contador.ToString
|
|
LControlText.Text = PasoText
|
|
|
|
contador = contador + 1
|
|
|
|
Catch ex As Exception
|
|
contador = contador + 1
|
|
End Try
|
|
|
|
Next
|
|
Else
|
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub CargaPasos()
|
|
|
|
Dim contadorPosition As Integer = 0
|
|
|
|
If True Then
|
|
'If CvePersonal <> -1 Then
|
|
Dim objRH As New ClsRH
|
|
If objRH.PersonalEstatusIngresoGet(CvePersonal, UsuarioActual.Empresa.CveEmpresa) Then
|
|
DTPasos = objRH.DtResultados
|
|
NumeroDePasos = DTPasos.Rows.Count
|
|
|
|
For Each drow As DataRow In DTPasos.Rows
|
|
contadorPosition = contadorPosition + 1
|
|
CvePaso = drow("CveEstatusIngreso").ToString.ToEntero
|
|
|
|
If IsDBNull(drow("CveEstatusIngresoHistorial")) Then
|
|
LblEstado.CssClass = "caption-subject font-red bold uppercase"
|
|
'LblEstado.Text = "<i class='fa fa-list-ol' aria-hidden='true'></i> Estatus " & CvePaso & " " & drow("EstatusIngreso").ToString
|
|
LblEstado.Text = "<i class='fa fa-list-ol' aria-hidden='true'></i> Estatus Actual: " & drow("EstatusIngreso").ToString
|
|
Exit For
|
|
End If
|
|
|
|
Next
|
|
|
|
If (contadorPosition <> 1) Then
|
|
Dim x As Integer = 1
|
|
Dim scripts As String = ""
|
|
|
|
For x = 1 To contadorPosition - 1
|
|
scripts = scripts & " $(document).ready(function(){ $('#form_wizard_1').bootstrapWizard('next'); }); "
|
|
Next
|
|
|
|
RegistraScript(scripts)
|
|
|
|
End If
|
|
|
|
UPBtnentrevistaEliminar4.Visible = True
|
|
If contadorPosition > 3 Then
|
|
BtnDocumentacionNext4.Visible = False
|
|
Else
|
|
BtnDocumentacionNext4.Visible = False
|
|
End If
|
|
|
|
|
|
PasoActual = contadorPosition
|
|
AsignaGruposValidacion()
|
|
|
|
Else
|
|
DTPasos = Nothing
|
|
contadorPosition = -1
|
|
NumeroDePasos = -1
|
|
CvePaso = -1
|
|
PasoActual = -1
|
|
End If
|
|
objRH.Dispose()
|
|
End If
|
|
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
Private Sub PasosAutorizadoPor()
|
|
Dim contadorPosition As Integer = 0
|
|
|
|
If True Then
|
|
'If CvePersonal <> -1 Then
|
|
Dim objRH As New ClsRH
|
|
If objRH.PersonalEstatusIngresoGet(CvePersonal, UsuarioActual.Empresa.CveEmpresa) Then
|
|
DTPasos = objRH.DtResultados
|
|
NumeroDePasos = DTPasos.Rows.Count
|
|
|
|
|
|
|
|
For Each drow As DataRow In DTPasos.Rows
|
|
contadorPosition = contadorPosition + 1
|
|
CvePaso = drow("CveEstatusIngreso").ToString.ToEntero
|
|
|
|
|
|
If Not IsDBNull(drow("Fecha")) Then
|
|
|
|
Select Case CvePaso
|
|
Case 1
|
|
LblPaso1.Text = "<b>Revisó proceso: </b>" & drow("Usuario").ToString & "<br/> <b>Fecha:</b> " & drow("Fecha").ToString.ToDate.ToString("dd/MM/yyyy")
|
|
Exit Select
|
|
Case 2
|
|
LblPaso2.Text = "<b>Revisó proceso: </b>" & drow("Usuario").ToString & "<br/> <b>Fecha:</b> " & drow("Fecha").ToString.ToDate.ToString("dd/MM/yyyy")
|
|
Exit Select
|
|
Case 4
|
|
LblPaso4.Text = "<b>Revisó proceso: </b>" & drow("Usuario").ToString & "<br/> <b>Fecha:</b> " & drow("Fecha").ToString.ToDate.ToString("dd/MM/yyyy")
|
|
Exit Select
|
|
Case 5
|
|
LblPaso5.Text = "<b>Revisó proceso: </b>" & drow("Usuario").ToString & "<br/> <b>Fecha:</b> " & drow("Fecha").ToString.ToDate.ToString("dd/MM/yyyy")
|
|
Exit Select
|
|
Case 7
|
|
LblPaso7.Text = "<b>Revisó proceso: </b>" & drow("Usuario").ToString & "<br/> <b>Fecha:</b> " & drow("Fecha").ToString.ToDate.ToString("dd/MM/yyyy")
|
|
Exit Select
|
|
Case 8
|
|
LblPaso8.Text = "<b>Revisó proceso: </b>" & drow("Usuario").ToString & "<br/> <b>Fecha:</b> " & drow("Fecha").ToString.ToDate.ToString("dd/MM/yyyy")
|
|
Exit Select
|
|
Case 9
|
|
LblPaso9.Text = "<b>Revisó proceso: </b>" & drow("Usuario").ToString & "<br/> <b>Fecha:</b> " & drow("Fecha").ToString.ToDate.ToString("dd/MM/yyyy")
|
|
Exit Select
|
|
End Select
|
|
Else
|
|
Exit For
|
|
End If
|
|
|
|
Next
|
|
|
|
End If
|
|
objRH.Dispose()
|
|
End If
|
|
|
|
|
|
End Sub
|
|
|
|
Private Sub PasoSiguiente()
|
|
|
|
If PasoActual < 8 Then
|
|
RegistraScript(" $(document).ready(function(){ $('#form_wizard_1').bootstrapWizard('next'); }); ")
|
|
PasoActual = (PasoActual + 1)
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub PasoAnterior()
|
|
|
|
|
|
|
|
If PasoActual > 1 Then
|
|
RegistraScript(" $(document).ready(function(){ $('#form_wizard_1').bootstrapWizard('previous'); }); ")
|
|
PasoActual = (PasoActual - 1)
|
|
End If
|
|
|
|
End Sub
|
|
|
|
Dim listaControles As New List(Of Control)
|
|
|
|
Public Function GetAllcontrols() As List(Of Control)
|
|
listaControles.Clear()
|
|
|
|
RetrieveAllControls(Me.Page)
|
|
|
|
Return listaControles
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
Private Sub LnkPasos_Click(sender As Object, e As EventArgs) Handles LnkPasos.Click
|
|
Dim LnkPasoSeleccionado As LinkButton = DirectCast(sender, LinkButton)
|
|
Dim PasoDestido As Integer = TxtPasoActual.Text.ToEntero + 1
|
|
Dim ScriptMovimiento As String = ""
|
|
|
|
If PasoActual <> PasoDestido Then
|
|
|
|
|
|
|
|
If PasoDestido > CvePaso Then
|
|
PasoDestido = CvePaso
|
|
End If
|
|
|
|
For x As Integer = 1 To PasoDestido - 1
|
|
ScriptMovimiento = ScriptMovimiento & ("$(document).ready(function(){$('#form_wizard_1').bootstrapWizard('next');});" & vbCrLf)
|
|
Next
|
|
|
|
PasoActual = PasoDestido
|
|
|
|
If PasoActual < 8 Then
|
|
btnNext.Visible = True
|
|
Else
|
|
btnNext.Visible = False
|
|
End If
|
|
|
|
UpBtnNext.Update()
|
|
|
|
If PasoActual > 1 Then
|
|
btnBack.Visible = True
|
|
Else
|
|
btnBack.Visible = False
|
|
End If
|
|
UpBtnNext.Update()
|
|
|
|
RegistraScript(ScriptMovimiento)
|
|
|
|
End If
|
|
End Sub
|
|
Public Sub RetrieveAllControls(control As Control)
|
|
|
|
For Each ctr As Control In control.Controls
|
|
If ctr IsNot Nothing Then
|
|
|
|
listaControles.Add(ctr)
|
|
If ctr.HasControls() Then
|
|
RetrieveAllControls(ctr)
|
|
End If
|
|
End If
|
|
Next
|
|
|
|
End Sub
|
|
|
|
Protected Sub BtnBack_Click(sender As Object, e As EventArgs) Handles btnBack.Click
|
|
|
|
PasoAnterior()
|
|
|
|
AsignaGruposValidacion()
|
|
|
|
If PasoActual = 7 Then
|
|
btnNext.Visible = False
|
|
Else
|
|
btnNext.Visible = True
|
|
End If
|
|
|
|
End Sub
|
|
|
|
Protected Sub BtnNext_Click(sender As Object, e As EventArgs) Handles btnNext.Click
|
|
|
|
|
|
If PasoActual = 2 And DDLTipoEntrevista4.Visible = True And DDLTipoEntrevista4.SelectedIndex = 0 Then
|
|
Exit Sub
|
|
End If
|
|
|
|
Dim avanzar As Boolean = False
|
|
|
|
Select Case PasoActual
|
|
Case -1
|
|
GuardaCaracteristicas()
|
|
GuardarDatosGeneralesEvento()
|
|
|
|
Exit Sub
|
|
Case 1
|
|
GuardaCaracteristicas()
|
|
GuardarDatosGeneralesEvento()
|
|
|
|
Exit Select
|
|
Case 2
|
|
Dim objEnc As New ClsEncuestas
|
|
|
|
If objEnc.GetEncuestaAplicada(-1, -1, -1, CvePersonal, -1, CveTipoEncuestaSeccionPersonal, UsuarioActual.CveEmpresa) Then
|
|
If objEnc.DtResultados.Rows.Count = 0 Then
|
|
GuardarEntrevistaEvento()
|
|
Else
|
|
PasoSiguiente()
|
|
End If
|
|
|
|
End If
|
|
objEnc.Dispose()
|
|
Exit Select
|
|
Case 3
|
|
GuardarDocumentos()
|
|
ValidarGuardaDocumentacionEvento()
|
|
Exit Select
|
|
Case 4
|
|
'Investigacion antecedentes etc
|
|
'Guardad
|
|
GuardarDocumentosInvestigacion()
|
|
ValidaGuardaInvestigacionEvento()
|
|
Exit Select
|
|
Case 5
|
|
Referencias()
|
|
PasoSiguiente()
|
|
|
|
Exit Select
|
|
Case 6
|
|
GuardarDocumentosAntidoping()
|
|
Antidoping()
|
|
ValidaGuardaAntidopingEvento()
|
|
GuardarDatosGeneralesEvento()
|
|
Exit Select
|
|
Case 7
|
|
ValidaGuardaFirmaContratoEvento()
|
|
End Select
|
|
|
|
If PasoActual = 7 Then
|
|
btnNext.Visible = False
|
|
'Manda a seccion Personal
|
|
|
|
Else
|
|
btnNext.Visible = True
|
|
End If
|
|
AsignaGruposValidacion()
|
|
PasosAutorizadoPor()
|
|
End Sub
|
|
|
|
Private Sub AsignaGruposValidacion()
|
|
'If PasoActual = 1 Then
|
|
' btnNext.ValidationGroup = "registro"
|
|
'ElseIf PasoActual = 2 Then
|
|
' btnNext.ValidationGroup = "GrpEntrevista"
|
|
' btnBack.ValidationGroup = "GrpEntrevista"
|
|
'Else
|
|
' btnNext.ValidationGroup = ""
|
|
' btnBack.ValidationGroup = ""
|
|
'End If
|
|
End Sub
|
|
|
|
#End Region
|
|
|
|
|
|
#Region "E N T R E V I S T A"
|
|
|
|
Private Sub CargaEntrevista()
|
|
Dim objRH As New ClsEncuestas
|
|
|
|
If objRH.GetEncuestaAplicada(-1, -1, -1, CvePersonal, -1, CveTipoEncuestaSeccionPersonal, UsuarioActual.CveEmpresa) Then
|
|
|
|
If objRH.DtResultados.Rows.Count > 0 Then
|
|
GvRespuestas4.Visible = True
|
|
|
|
GvRespuestas4.DataSource = objRH.DtResultados
|
|
GvRespuestas4.DataBind()
|
|
|
|
GvPreguntas4.DataSource = Nothing
|
|
GvPreguntas4.DataBind()
|
|
BtnEntrevistaNext4.Visible = False
|
|
|
|
DDLTipoEntrevista4.Visible = False
|
|
GvPreguntas4.Visible = False
|
|
DDLTipoEntrevista4.Visible = False
|
|
lblEntrevistaTitulo4.Visible = False
|
|
|
|
|
|
TableEntrevistaDatos.Visible = True
|
|
CveEncuestaAplicada = objRH.DtResultados(0)("CveEncuestaAplicada").ToString.ToEntero
|
|
lblEntrevistaRevizo1.Text = objRH.DtResultados(0)("NombreEncuesta").ToString
|
|
lblEntrevistaRevizo2.Text = objRH.DtResultados(0)("Fecha").ToString.ToDate.ToString("dd/MM/yyyy")
|
|
lblEntrevistaRevizo3.Text = objRH.DtResultados(0)("Usuario").ToString
|
|
|
|
LnkEntrevistaEliminar4.Visible = True
|
|
UPBtnentrevistaEliminar4.Update()
|
|
Else
|
|
GvRespuestas4.DataSource = Nothing
|
|
GvRespuestas4.DataBind()
|
|
GvRespuestas4.Visible = False
|
|
|
|
GvPreguntas4.Visible = True
|
|
lblEntrevistaTitulo4.Text = "Seleccione una entrevista"
|
|
DDLTipoEntrevista4.Visible = True
|
|
lblEntrevistaTitulo4.Visible = True
|
|
CargaComboTiposEntrevista()
|
|
|
|
TableEntrevistaDatos.Visible = False
|
|
lblEntrevistaRevizo1.Text = ""
|
|
lblEntrevistaRevizo2.Text = ""
|
|
lblEntrevistaRevizo3.Text = ""
|
|
|
|
LnkEntrevistaEliminar4.Visible = False
|
|
End If
|
|
|
|
End If
|
|
|
|
objRH.Dispose()
|
|
|
|
End Sub
|
|
|
|
Private Sub CargaComboTiposEntrevista()
|
|
|
|
Dim encuesta As New ClsEncuestas
|
|
|
|
If encuesta.GetEncuestas(UsuarioActual.Empresa.CveEmpresa) Then
|
|
|
|
DDLTipoEntrevista4.DataSource = encuesta.DtResultados.FiltraParametros(" CveTipoEncuesta = 3 ")
|
|
DDLTipoEntrevista4.DataBind()
|
|
DDLTipoEntrevista4.Items.Insert(0, New ListItem("Seleccione una entrevista", "-1"))
|
|
|
|
End If
|
|
|
|
encuesta.Dispose()
|
|
|
|
|
|
End Sub
|
|
|
|
Protected Sub DDLTipoEntrevista_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DDLTipoEntrevista4.SelectedIndexChanged
|
|
Dim objencuesta As New ClsEncuestas
|
|
|
|
If DDLTipoEntrevista4.SelectedIndex <> 0 Then
|
|
BtnEntrevistaNext4.Visible = False
|
|
If objencuesta.GetRespuestas(DDLTipoEntrevista4.SelectedValue.ToEntero) Then
|
|
DTRespuestas = objencuesta.DtResultados
|
|
End If
|
|
|
|
If objencuesta.GetPreguntas(DDLTipoEntrevista4.SelectedValue.ToEntero, -1, -1, -1, UsuarioActual.Empresa.CveEmpresa) Then
|
|
|
|
GvPreguntas4.DataSource = objencuesta.DtResultados
|
|
GvPreguntas4.DataBind()
|
|
GvPreguntas4.Visible = True
|
|
|
|
End If
|
|
|
|
Else
|
|
BtnEntrevistaNext4.Visible = False
|
|
End If
|
|
objencuesta.Dispose()
|
|
End Sub
|
|
|
|
Private Sub CargaGvDatos()
|
|
Dim ObjEncuestas As New ClsEncuestas
|
|
ObjEncuestas.Dispose()
|
|
GvPreguntas4.DataBind()
|
|
|
|
End Sub
|
|
|
|
Protected Sub GvPreguntas_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvPreguntas4.RowDataBound
|
|
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
Dim EsOpcion As Integer = e.Row.DBCampo("CveTipoPregunta").ToEntero
|
|
Dim CvePregunta As Integer = e.Row.DBCampo("CvePregunta").ToEntero
|
|
|
|
e.Row.FCFilteredTextBoxExtender("filTxtValor4").Enabled = False
|
|
|
|
Select Case EsOpcion
|
|
Case 1 'Texto, Multiline
|
|
With e.Row.FCTextBox("TxtValor4")
|
|
.Visible = True
|
|
If EsOpcion = 4 Then
|
|
.Rows = 3
|
|
.TextMode = TextBoxMode.MultiLine
|
|
End If
|
|
End With
|
|
Case 2, 3, 4 'DropDownList, Radios
|
|
|
|
Dim dt As DataTable = DTRespuestas.FiltraParametros(String.Format(" CvePregunta = {0} ", CvePregunta))
|
|
|
|
If EsOpcion = 3 Then
|
|
With e.Row.FCDropDownList("DdlRespuesta4")
|
|
.Visible = True
|
|
.DataSource = dt
|
|
.DataBind()
|
|
.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
|
|
End With
|
|
ElseIf EsOpcion = 4 Or EsOpcion = 2 Then
|
|
With e.Row.FCRadioButtonList("RbRespuesta4")
|
|
.Visible = True
|
|
.DataSource = dt
|
|
.DataBind()
|
|
|
|
End With
|
|
e.Row.FCRequiredFieldValidator("RFVRbRespuesta4").ErrorMessage = String.Format("ERROR: Falta contestar la pregunta: <b>{0}</b>", e.Row.DBCampo("Pregunta"))
|
|
End If
|
|
|
|
Case 5 'numerico
|
|
With e.Row.FCTextBox("TxtValor")
|
|
.Visible = True
|
|
End With
|
|
|
|
e.Row.FCFilteredTextBoxExtender("filTxtValor4").Enabled = True
|
|
e.Row.FCFilteredTextBoxExtender("filTxtValor4").FilterType = AjaxControlToolkit.FilterTypes.Numbers
|
|
|
|
|
|
End Select
|
|
End If
|
|
End Sub
|
|
|
|
Protected Sub BtnEntrevistaNext_Click(sender As Object, e As EventArgs) Handles BtnEntrevistaNext4.Click
|
|
|
|
|
|
|
|
End Sub
|
|
|
|
Private Sub GuardarEntrevistaEvento()
|
|
|
|
Dim objEnc As New ClsEncuestas
|
|
Dim objRH As New ClsRH
|
|
Dim hasError As Boolean = False
|
|
Dim _CveEncuestaAplicada As Integer = -1
|
|
Dim RespuestaIncompleta As Boolean = False
|
|
|
|
|
|
objEnc.IniciaTransacSQL()
|
|
Try
|
|
If objEnc.AddEncuestaAplicada(DDLTipoEntrevista4.SelectedValue.ToEntero, -1, CvePersonal, UsuarioActual.CveUsuario, UsuarioActual.Empresa.CveEmpresa) Then
|
|
_CveEncuestaAplicada = objEnc.DtResultados(0)(0).ToString.ToEntero
|
|
Else
|
|
hasError = True
|
|
Exit Try
|
|
End If
|
|
|
|
For Each drow As GridViewRow In GvPreguntas4.Rows
|
|
|
|
Dim EsOpcion As Integer = drow.DataKey("CveTipoPregunta").ToEntero
|
|
Dim CvePregunta As Integer = drow.DataKey("CvePregunta").ToEntero
|
|
Dim valorInt As Integer = -1
|
|
Dim valorStr As String = "-1"
|
|
|
|
Dim dt As DataTable = DTRespuestas.FiltraParametros(String.Format(" CvePregunta = {0} ", CvePregunta))
|
|
'Dim CveRespuesta = -1
|
|
|
|
Select Case EsOpcion
|
|
|
|
Case 1 'Texto, Multiline
|
|
|
|
If dt.Rows.Count = 0 Then
|
|
valorInt = -1
|
|
Else
|
|
valorInt = dt(0)("CveRespuesta").ToString.ToEntero
|
|
End If
|
|
|
|
valorStr = drow.FCTextBox("TxtValor4").Text
|
|
|
|
With drow.FCTextBox("TxtValor4")
|
|
.Visible = True
|
|
If EsOpcion = 4 Then
|
|
.Rows = 3
|
|
.TextMode = TextBoxMode.MultiLine
|
|
End If
|
|
End With
|
|
|
|
Case 2, 3, 4 'DropDownList, Radios
|
|
|
|
If EsOpcion = 3 Then
|
|
valorInt = drow.FCDropDownList("DdlRespuesta4").SelectedValue.ToEntero
|
|
valorStr = drow.FCDropDownList("DdlRespuesta4").SelectedItem.Text
|
|
ElseIf EsOpcion = 4 Or EsOpcion = 2 Then
|
|
valorInt = drow.FCRadioButtonList("RbRespuesta4").SelectedValue.ToEntero
|
|
valorStr = ""
|
|
End If
|
|
|
|
Case 5 'Fecha
|
|
|
|
End Select
|
|
|
|
If valorInt = 0 And valorStr = "" Then
|
|
hasError = True
|
|
RespuestaIncompleta = True
|
|
Exit For
|
|
Else
|
|
If Not objEnc.AddEncuestaAplicadaDetalle(_CveEncuestaAplicada, CvePregunta, valorInt, valorStr) Then
|
|
hasError = True
|
|
Exit For
|
|
End If
|
|
End If
|
|
|
|
Next
|
|
|
|
If Not hasError Then
|
|
|
|
Try
|
|
If Not ExistePasoHistorial(2) Then
|
|
objRH.PersonalEstatusIngresoAdd(CvePersonal, 2, UsuarioActual.CveUsuario, "")
|
|
End If
|
|
|
|
objEnc.Commit()
|
|
PasoSiguiente()
|
|
Catch ex As Exception
|
|
objEnc.RollBack()
|
|
OnError("Error al registrar paso", ex)
|
|
End Try
|
|
|
|
Alert("Entrevista guardada correctamente.", TipoMensaje.MsgInformacion)
|
|
CargaEntrevista()
|
|
Else
|
|
objEnc.RollBack()
|
|
|
|
If RespuestaIncompleta Then
|
|
Alert("No se a podido guardar la entrevista(Una vez iniciada la entrevista todas las respuestas deben de ser conetstadas).", TipoMensaje.MsgAdvertencia)
|
|
Else
|
|
Alert("Ocurrio un error en al guardar entrevista.", TipoMensaje.MsgAdvertencia)
|
|
End If
|
|
|
|
End If
|
|
|
|
Catch ex As Exception
|
|
OnError("Error al guardar entrevista ", ex)
|
|
objEnc.RollBack()
|
|
|
|
End Try
|
|
|
|
|
|
objEnc.Dispose()
|
|
objRH.Dispose()
|
|
|
|
End Sub
|
|
|
|
Protected Sub LnkEntrevistaEliminar_Click(sender As Object, e As EventArgs) Handles LnkEntrevistaEliminar4.Click
|
|
|
|
Dim objRH As New ClsRH
|
|
|
|
If objRH.PersonalEstatusIngresoRemove(CvePersonal, 2) Then 'Se elimina el paso dos que es el que corresponde a la entrevista
|
|
If CveEncuestaAplicada <> -1 Then
|
|
Dim Enc As New ClsEncuestas
|
|
|
|
If Enc.RemoveEncuestaAplicada(CveEncuestaAplicada, UsuarioActual.Empresa.CveEmpresa) Then
|
|
Alert("Entrevista Eliminada correctamente.", TipoMensaje.MsgInformacion)
|
|
End If
|
|
Enc.Dispose()
|
|
End If
|
|
End If
|
|
objRH.Dispose()
|
|
CargaEntrevista()
|
|
|
|
End Sub
|
|
|
|
#End Region
|
|
|
|
#Region "D O C U M E N T A C I O N"
|
|
|
|
Private Sub ResetFormDocumentacion()
|
|
|
|
DDLDocumento4.Items.Clear()
|
|
TxtObservacionDocumentacion4.Text = ""
|
|
chkCompletoDocumentacion4.Checked = False
|
|
ActualizarDocumentacion = False
|
|
|
|
End Sub
|
|
|
|
Private Sub CargaDocumentacion()
|
|
|
|
Dim objRH As New ClsEdocumentacion
|
|
|
|
If objRH.DocumentacionElectronicaGet(CvePersonal, -1, -1, UsuarioActual.Empresa.CveEmpresa, -1) Then
|
|
DTDocumentacion = objRH.DtResultados
|
|
GvDocumentos4.DataSource = objRH.DtResultados.FiltraParametros($" CveDocumentacionTipo = {If(UsuarioActual.CveEmpresa = 138, 18, 1)} ")
|
|
Else
|
|
DTDocumentacion = Nothing
|
|
GvDocumentos4.DataSource = Nothing
|
|
End If
|
|
|
|
objRH.Dispose()
|
|
GvDocumentos4.DataBind()
|
|
UPGvDocumentos4.Update()
|
|
|
|
End Sub
|
|
|
|
Public Sub DescarFormato(documento As String)
|
|
|
|
Dim PathRoot As String = Server.MapPath("/")
|
|
Dim PathSource As String
|
|
Dim pathDesti As String
|
|
|
|
PathSource = UsuarioActual.Empresa.Ruta & "Formatos\" & documento
|
|
pathDesti = PathRoot & "Temp\" & CvePersonal & documento
|
|
|
|
If File.Exists(pathDesti) Then
|
|
File.Delete(pathDesti)
|
|
End If
|
|
|
|
File.Copy(PathSource, pathDesti)
|
|
|
|
Dim objDoc As New clsGemBoxDocument(pathDesti)
|
|
Dim objRH As New ClsRH
|
|
Dim FechaActual As String = Now.Day.ToString("0#") & " de " & CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(1).ToString & " del " & Now.Year.ToString()
|
|
|
|
|
|
objDoc.SustituirTags(objRH.GetDatosTagsDocumentos(CvePersonal, UsuarioActual.CveEmpresa))
|
|
|
|
objDoc.Guardar(pathDesti)
|
|
|
|
Dim fileinfo As New FileInfo(pathDesti)
|
|
|
|
Dim baseUrl As String = Request.Url.GetLeftPart(UriPartial.Authority)
|
|
baseUrl = baseUrl & "/temp/" & fileinfo.Name
|
|
|
|
RegistraDescargaJavaScript(baseUrl)
|
|
|
|
objDoc.Dispose()
|
|
objRH.Dispose()
|
|
End Sub
|
|
|
|
|
|
Public Sub UploadModal_ClickDocumentacion(sender As Object, e As EventArgs)
|
|
|
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
|
|
|
Dim chkEstatus As CheckBox
|
|
CveDocumentacionElectronica = GvRow.DataKey("CveDocumentacionElectronica").ToString.ToEntero
|
|
CveDocumentacion = GvRow.DataKey("CveDocumentacion").ToString.ToEntero
|
|
Documentacion = GvRow.DataKey("Documentacion")
|
|
AdjuntoDocumentacion = GvRow.DataKey("Adjunto")
|
|
|
|
|
|
DiasVigencia = GvRow.DataKey("DiasVigencia").ToString.ToEntero
|
|
Dim x As String = GvRow.DataKey("AplicaFechaVencimiento")
|
|
If GvRow.DataKey("AplicaFechaVencimiento") = "1" Then AplicaFechaVencimiento = True Else AplicaFechaVencimiento = False
|
|
|
|
If GvRow.DataKey("Adjunto").ToString.Length > 0 Then
|
|
FechaVigencia = GvRow.DataKey("Adjunto").ToString.ToDate
|
|
Else
|
|
FechaVigencia = Nothing
|
|
End If
|
|
|
|
|
|
chkEstatus = GvRow.FCCheckBox("chkEstatus")
|
|
|
|
If chkEstatus.Checked Then
|
|
Estatus = 1
|
|
Else
|
|
Estatus = 0
|
|
End If
|
|
|
|
ObservacionDocumentacion = GvRow.FCTextBox("TxtObservaciones").Text.Trim.ToUpper
|
|
FechaLimite = GvRow.FCTextBox("TxtFechaLimite").Text.ToDate
|
|
|
|
AdjuntoDocumentacion = GvRow.DataKey("Adjunto")
|
|
|
|
LtlModalUploadTitulo.Text = "Subir " & Documentacion
|
|
|
|
UpModalTitleUploadDocumento.Update()
|
|
|
|
RegistraScript("$('#ModalUploadDoc').modal({ backdrop: 'static', keyboard: false});")
|
|
|
|
End Sub
|
|
|
|
|
|
Protected Sub BtnAgregarDocumentacionModal4_Click(sender As Object, e As EventArgs) Handles BtnAgregarDocumentacionModal4.Click
|
|
|
|
Dim objRH As New ClsEdocumentacion
|
|
Dim intCompleto As Integer = 0
|
|
|
|
If chkCompletoDocumentacion4.Checked Then
|
|
intCompleto = 1
|
|
End If
|
|
|
|
If ActualizarDocumentacion Then
|
|
|
|
If objRH.DocumentacionElectronicaUpdate(CveDocumentacionElectronica, DDLDocumento4.SelectedValue.ToEntero, CvePersonal, -1, -1, intCompleto, TxtObservacionDocumentacion4.Text, "", UsuarioActual.CveUsuario, FechaLimite) Then
|
|
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAgregarDocumentacion"))
|
|
Alert("Documento Actualizado correctamente.", TipoMensaje.MsgInformacion)
|
|
CargaDocumentacion()
|
|
End If
|
|
|
|
Else
|
|
If objRH.DocumentacionElectronicaAdd(DDLDocumento4.SelectedValue.ToEntero, CvePersonal, -1, -1, intCompleto, TxtObservacionDocumentacion4.Text, "", UsuarioActual.CveUsuario, FechaLimite) > 0 Then
|
|
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAgregarDocumentacion"))
|
|
Alert("Documento agregado correctamente.", TipoMensaje.MsgInformacion)
|
|
CargaDocumentacion()
|
|
End If
|
|
End If
|
|
|
|
|
|
ActualizarDocumentacion = False
|
|
|
|
objRH.Dispose()
|
|
|
|
End Sub
|
|
|
|
|
|
Public Sub Edit_ClickDocumentacion(sender As Object, e As EventArgs)
|
|
|
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
|
Dim activo As Boolean = False
|
|
|
|
Dim _CveDocumentacionElectronica As Integer = GvRow.DataKey("CveDocumentacionElectronica").ToString.ToEntero
|
|
Dim _CveDocumentacion As Integer = GvRow.DataKey("CveDocumentacion").ToString.ToEntero
|
|
Dim _Adjunto As String = GvRow.DataKey("Adjunto").ToString
|
|
|
|
Dim Observaciones As String = DirectCast(GvRow.FindControl("TxtObservaciones"), TextBox).Text
|
|
Dim chkCompleto As CheckBox = DirectCast(GvRow.FindControl("chkCompleto"), CheckBox)
|
|
|
|
|
|
Dim objRH As New ClsEdocumentacion
|
|
|
|
If _CveDocumentacionElectronica = -1 Then
|
|
If objRH.DocumentacionElectronicaUpdate(_CveDocumentacionElectronica, _CveDocumentacion, CvePersonal, -1, -1, Convert.ToInt32(chkCompleto.Checked), Observaciones, _Adjunto, UsuarioActual.CveUsuario, FechaLimite) Then
|
|
Alert("Documento actualizado correctamente.", TipoMensaje.MsgInformacion)
|
|
End If
|
|
Else
|
|
If objRH.DocumentacionElectronicaAdd(_CveDocumentacionElectronica, CvePersonal, -1, -1, Convert.ToInt32(chkCompleto.Checked), Observaciones, _Adjunto, UsuarioActual.CveUsuario, FechaLimite) > 0 Then
|
|
Alert("Documento actualizado correctamente.", TipoMensaje.MsgInformacion)
|
|
End If
|
|
End If
|
|
objRH.Dispose()
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
Public Sub Update_ClickDocumentacion(sender As Object, e As EventArgs)
|
|
|
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
|
Dim activo As Boolean = False
|
|
|
|
Dim _CveDocumentacionElectronica As Integer = GvRow.DataKey("CveDocumentacionElectronica").ToString.ToEntero
|
|
Dim _CveDocumentacion As Integer = GvRow.DataKey("CveDocumentacion").ToString.ToEntero
|
|
Dim _Adjunto As String = GvRow.DataKey("Adjunto").ToString
|
|
Dim _fechaLimite As Date = GvRow.FCTextBox("TxtFechaLimite").Text.ToDate
|
|
|
|
Dim Observaciones As String = DirectCast(GvRow.FindControl("TxtObservaciones"), TextBox).Text
|
|
Dim chkCompleto As CheckBox = DirectCast(GvRow.FindControl("chkEstatus"), CheckBox)
|
|
|
|
If chkCompleto.Checked Then
|
|
Estatus = 1
|
|
Else
|
|
Estatus = 0
|
|
End If
|
|
|
|
Dim objRH As New ClsEdocumentacion
|
|
|
|
If Not _CveDocumentacionElectronica = -1 Then
|
|
If objRH.DocumentacionElectronicaUpdate(_CveDocumentacionElectronica, _CveDocumentacion, CvePersonal, -1, -1, Estatus, Observaciones, _Adjunto, UsuarioActual.CveUsuario, _fechaLimite) Then
|
|
Alert("Documento actualizado correctamente.", TipoMensaje.MsgInformacion)
|
|
End If
|
|
Else
|
|
If objRH.DocumentacionElectronicaAdd(_CveDocumentacion, CvePersonal, -1, -1, Estatus, Observaciones, _Adjunto, UsuarioActual.CveUsuario, _fechaLimite) > 0 Then
|
|
Alert("Documento actualizado correctamente.", TipoMensaje.MsgInformacion)
|
|
End If
|
|
End If
|
|
|
|
GuardarDocumentos(_CveDocumentacion)
|
|
CargaDocumentacion()
|
|
objRH.Dispose()
|
|
|
|
End Sub
|
|
|
|
|
|
Protected Sub BtnUploadFileDoc_Click(sender As Object, e As EventArgs) Handles btnUploadFileDoc.Click
|
|
Dim FileExtension As String = "-1"
|
|
Dim Filesgral As List(Of Archivo) = TxtFileDocumentacion.getfiles().Archivos
|
|
Dim Filename As String = ""
|
|
|
|
If AplicaFechaVencimiento And DiasVigencia > 0 Then
|
|
FechaVigencia = DateTime.Today.AddDays(DiasVigencia)
|
|
End If
|
|
|
|
For Each fileItem As Archivo In Filesgral
|
|
Try
|
|
|
|
FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
|
|
Dim tempArray() As String
|
|
tempArray = fileItem.filename.ToString().Split("-".ToCharArray())
|
|
|
|
Dim rutaDestino As String = UsuarioActual.Empresa.Ruta & "Personal\" & CvePersonal & "\" & Documentacion & "." & FileExtension
|
|
Dim rutaAdjuntoAnterior As String = UsuarioActual.Empresa.Ruta & "Personal\" & CvePersonal & "\" & AdjuntoDocumentacion
|
|
|
|
If Not System.IO.Directory.Exists(UsuarioActual.Empresa.Ruta & "Personal\" & CvePersonal & "\") Then
|
|
System.IO.Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "Personal\" & CvePersonal & "\")
|
|
End If
|
|
|
|
If File.Exists(rutaAdjuntoAnterior) And AdjuntoDocumentacion.Trim.Length > 0 Then
|
|
File.Delete(rutaAdjuntoAnterior)
|
|
End If
|
|
|
|
If System.IO.File.Exists(rutaDestino) Then
|
|
System.IO.File.Delete(rutaDestino)
|
|
End If
|
|
|
|
System.IO.File.Move(fileItem.FileUrl, rutaDestino)
|
|
|
|
'VERIFICA SI APLICA DOCUMENTACION ELECTRONICA
|
|
If AplicaDocumentacion Then
|
|
Dim objRH As New ClsEdocumentacion
|
|
|
|
If CveDocumentacionElectronica = -1 Then
|
|
If objRH.DocumentacionElectronicaAdd(CveDocumentacion, CvePersonal, -1, -1, Estatus, ObservacionDocumentacion, Documentacion & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) > 0 Then
|
|
|
|
End If
|
|
Else
|
|
If objRH.DocumentacionElectronicaUpdate(CveDocumentacionElectronica, CveDocumentacion, CvePersonal, -1, -1, Estatus, ObservacionDocumentacion, Documentacion & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) Then
|
|
|
|
End If
|
|
End If
|
|
|
|
objRH.Dispose()
|
|
|
|
GuardarDocumentos(CveDocumentacion)
|
|
CargaDocumentacion()
|
|
Else
|
|
'SI ES HOJA DE RETENCION - NO APLICA DOCUMENTACION
|
|
AplicaDocumentacion = True
|
|
CargaGVHojaRetencion()
|
|
End If
|
|
|
|
TxtFileDocumentacion.Text = ""
|
|
UPModalUploadDoc.Update()
|
|
|
|
Catch ex As Exception
|
|
OnError("Error al cargar archivo", ex)
|
|
End Try
|
|
|
|
Next
|
|
|
|
RegistraScript("$('#ModalUploadDoc').modal('hide')", "hidemodal3")
|
|
|
|
End Sub
|
|
|
|
|
|
Protected Sub GvDocumentos4_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDocumentos4.RowDataBound
|
|
|
|
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
|
|
Dim Adjunto As String = e.Row.DBCampo("Adjunto").ToString
|
|
Dim ImgDownLoad As Literal = e.Row.FCLiteral("ImgDownLoad")
|
|
Dim ImgRequired As Literal = e.Row.FCLiteral("ImgRequired")
|
|
Dim txtFechaLimite As TextBox = e.Row.FCTextBox("TxtFechaLimite")
|
|
Dim txtFechaVigencia As TextBox = e.Row.FCTextBox("TxtFechaVigencia")
|
|
|
|
Dim requerido As Boolean = Boolean.Parse(e.Row.DBCampo("Requerido"))
|
|
|
|
Dim chkEstatus As CheckBox = e.Row.FCCheckBox("chkEstatus")
|
|
Dim separado As Char() = ".".ToCharArray
|
|
Dim array() As String = Adjunto.Split(separado)
|
|
Dim extencion As String = ""
|
|
|
|
Dim DiasLimite As Integer = e.Row.DataKey("DiasLimite").ToString.ToEntero
|
|
Dim AplicaDiasLimite As Boolean = If(e.Row.DataKey("AplicaDiasLimite").ToString = "1", True, False)
|
|
Dim AplicaFechaVencimiento As Boolean = If(e.Row.DataKey("AplicaFechaVencimiento").ToString = "1", True, False)
|
|
|
|
txtFechaLimite.Visible = If(AplicaDiasLimite, True, False)
|
|
txtFechaVigencia.Visible = If(AplicaFechaVencimiento, True, False)
|
|
|
|
|
|
If AplicaFechaVencimiento And e.Row.DataKey("DiasVigencia").ToString.ToEntero > 0 Then
|
|
txtFechaVigencia.Enabled = False
|
|
End If
|
|
|
|
If e.Row.DBCampo("FechaVigencia").ToString.Length > 0 Then
|
|
txtFechaVigencia.Text = e.Row.DBCampo("FechaVigencia").ToString.ToDate.ToString("dd/MM/yyyy")
|
|
If DateTime.Today > e.Row.DBCampo("FechaVigencia").ToString.ToDateTime Then
|
|
txtFechaVigencia.ForeColor = Drawing.Color.Red
|
|
End If
|
|
End If
|
|
|
|
|
|
If array.Length > 0 Then
|
|
extencion = array(array.Length - 1)
|
|
End If
|
|
|
|
If e.Row.DBCampo("Estatus").ToString.ToEntero = 1 Then
|
|
chkEstatus.Checked = True
|
|
Else
|
|
chkEstatus.Checked = False
|
|
End If
|
|
|
|
txtFechaLimite.Text = e.Row.DBCampo("FechaLimite").ToString.ToDate.ToString("dd/MM/yyyy")
|
|
|
|
|
|
|
|
If e.Row.DBCampo("FechaVigencia").ToString.Length > 0 Then
|
|
txtFechaVigencia.Text = e.Row.DBCampo("FechaVigencia").ToString.ToDate.ToString("dd/MM/yyyy")
|
|
End If
|
|
|
|
Dim scripMascara = "$('#" & txtFechaLimite.ClientID & "').mask('00/00/0000');$('#" & txtFechaVigencia.ClientID & "').mask('00/00/0000');"
|
|
RegistraScript(scripMascara, "scriptMascara")
|
|
|
|
If Adjunto.Trim.Length > 0 Then
|
|
|
|
Dim linkDescarga = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/Personal/" & CvePersonal & "/" & Adjunto
|
|
Dim linkDescargaArchivo = UsuarioActual.Empresa.Ruta & "Personal/" & CvePersonal & "/" & Adjunto
|
|
|
|
If File.Exists(linkDescargaArchivo) Then
|
|
ImgDownLoad.Visible = True
|
|
|
|
If extencion.Length > 0 Then
|
|
ImgDownLoad.Text = String.Format(" <a class='btn btn-circle btn-sm blue' href='{0}' target='_black' download='{1}'><i class='fa fa-download' title='Descargar documento'></i></a>", linkDescarga, CvePersonal & Documentacion & "." & extencion)
|
|
Else
|
|
ImgDownLoad.Text = String.Format(" <a class='btn btn-circle btn-sm blue' href='{0}' target='_black' download='{1}'><i class='fa fa-download' title='Descargar documento'></i></a>", linkDescarga, CvePersonal & Documentacion)
|
|
End If
|
|
Else
|
|
ImgDownLoad.Visible = False
|
|
End If
|
|
|
|
|
|
Else
|
|
ImgDownLoad.Visible = False
|
|
End If
|
|
|
|
If requerido Then
|
|
ImgRequired.Text = " <a class='btn btn-circle btn-sm yelow' href='#' data-toggle='tooltip' title=' Requerido!' ><i class='fa fa-asterisk '></i></a>"
|
|
End If
|
|
|
|
chkEstatus.Checked = ImgDownLoad.Visible
|
|
|
|
End If
|
|
End Sub
|
|
|
|
|
|
Public Sub Descarga_ClickDocumentacion(sender As Object, e As EventArgs)
|
|
|
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
|
|
|
CveDocumentacionElectronica = GvRow.DataKey("CveDocumentacionElectronica").ToString.ToEntero
|
|
CveDocumentacion = GvRow.DataKey("CveDocumentacion").ToString.ToEntero
|
|
Documentacion = GvRow.DataKey("Documentacion").ToString
|
|
Estatus = GvRow.DataKey("Estatus").ToString.ToEntero
|
|
ObservacionDocumentacion = GvRow.DataKey("Observacion").ToString
|
|
AdjuntoDocumentacion = GvRow.DataKey("Adjunto").ToString
|
|
|
|
Dim fileinfo As New FileInfo(UsuarioActual.Empresa.Ruta & "personal\" & CvePersonal & "\" & AdjuntoDocumentacion)
|
|
|
|
Response.Clear()
|
|
Response.ClearHeaders()
|
|
Response.ClearContent()
|
|
Response.AddHeader("Content-Disposition", "attachment; filename=" & CvePersonal & "_" & fileinfo.Name)
|
|
Response.AddHeader("Content-Length", fileinfo.Length.ToString())
|
|
Response.ContentType = "text/plain"
|
|
Response.Flush()
|
|
Response.TransmitFile(fileinfo.FullName)
|
|
Response.End()
|
|
|
|
|
|
End Sub
|
|
|
|
Protected Sub BtnDocumentacionNext4_Click(sender As Object, e As EventArgs) Handles BtnDocumentacionNext4.Click
|
|
GuardarDocumentos()
|
|
ValidarGuardaDocumentacionEvento()
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub GuardarDocumentos(Optional _CveDocumentacionExcluir As Integer = -1)
|
|
|
|
Dim hasError As Boolean = True
|
|
Dim objDocumentos As New ClsEdocumentacion
|
|
|
|
For Each dRow As GridViewRow In GvDocumentos4.Rows
|
|
|
|
|
|
|
|
Dim _CveDocumentacion As Integer = dRow.DataKey("CveDocumentacion").ToString.ToEntero
|
|
Dim _Adjunto As String = dRow.DataKey("Adjunto")
|
|
Dim _CveDocumentacionElectronica As Integer = dRow.DataKey("CveDocumentacionElectronica").ToString.ToEntero
|
|
Dim _txtObservaciones As TextBox = dRow.FCTextBox("TxtObservaciones")
|
|
Dim _TxtFechaLimite As TextBox = dRow.FCTextBox("TxtFechaLimite")
|
|
Dim _TxtFechaVigencia As TextBox = dRow.FCTextBox("TxtFechaVigencia")
|
|
|
|
Dim _FechaVigencia As Date
|
|
Dim _FechaLimite As Date
|
|
|
|
Dim chkEstatus As CheckBox = dRow.FCCheckBox("chkEstatus")
|
|
Dim _estatus As Integer
|
|
|
|
If chkEstatus.Checked Then
|
|
_estatus = 1
|
|
Else
|
|
_estatus = 0
|
|
End If
|
|
|
|
Dim DiasLimite As Integer = dRow.DataKey("DiasLimite").ToString.ToEntero
|
|
Dim AplicaDiasLimite As Boolean = If(dRow.DataKey("AplicaDiasLimite").ToString = "1", True, False)
|
|
Dim AplicaFechaVencimiento As Boolean = If(dRow.DataKey("AplicaFechaVencimiento").ToString = "1", True, False)
|
|
|
|
If _TxtFechaVigencia.Text.Length = 10 Then
|
|
_FechaVigencia = _TxtFechaVigencia.Text.ToDate
|
|
Else
|
|
_FechaVigencia = Nothing
|
|
End If
|
|
|
|
If Not AplicaDiasLimite Then
|
|
_FechaLimite = MinFecha
|
|
Else
|
|
_FechaLimite = _TxtFechaLimite.Text.ToDate
|
|
End If
|
|
|
|
If Not AplicaFechaVencimiento Then
|
|
_FechaVigencia = MinFecha
|
|
End If
|
|
|
|
If Not _CveDocumentacionExcluir = _CveDocumentacion Then
|
|
Try
|
|
If _CveDocumentacionElectronica = -1 Then
|
|
|
|
If objDocumentos.DocumentacionElectronicaAdd(_CveDocumentacion, CvePersonal, -1, -1, _estatus, _txtObservaciones.Text.Trim, _Adjunto, UsuarioActual.CveUsuario, _FechaLimite, _FechaVigencia) > 0 Then
|
|
Else
|
|
hasError = True
|
|
Exit For
|
|
End If
|
|
|
|
Else
|
|
If objDocumentos.DocumentacionElectronicaUpdate(_CveDocumentacionElectronica, _CveDocumentacion, CvePersonal, -1, -1, _estatus, _txtObservaciones.Text.Trim, _Adjunto, UsuarioActual.CveUsuario, _FechaLimite, _FechaVigencia) Then
|
|
Else
|
|
hasError = True
|
|
Exit For
|
|
End If
|
|
End If
|
|
|
|
|
|
hasError = False
|
|
Catch ex As Exception
|
|
hasError = True
|
|
Exit For
|
|
End Try
|
|
End If
|
|
Next
|
|
|
|
CargaDocumentacion()
|
|
objDocumentos.Dispose()
|
|
End Sub
|
|
|
|
|
|
Private Sub ValidarGuardaDocumentacionEvento()
|
|
|
|
Dim objEdoc As New ClsEdocumentacion
|
|
Dim objRH As New ClsRH
|
|
|
|
|
|
|
|
If objEdoc.DocumentacionElectronicaGet(CvePersonal, -1, -1, UsuarioActual.Empresa.CveEmpresa, If(UsuarioActual.CveEmpresa = 138, 18, 1)) Then
|
|
Dim insertar As Boolean = True
|
|
|
|
For Each drow As DataRow In objEdoc.DtResultados.Rows
|
|
|
|
Dim documentacionS As String = drow("Documentacion").ToString
|
|
If (drow("CveDocumentacionElectronica").ToString = "-1" And Boolean.Parse(drow("Requerido").ToString) = True Or Boolean.Parse((drow("Requerido").ToString)) = True And drow("Estatus").ToString.ToEntero = 0) Then
|
|
insertar = False
|
|
Alert("Hay documentos requeridos que no han sido entregados.", TipoMensaje.MsgAdvertencia)
|
|
Exit For
|
|
Else
|
|
insertar = True
|
|
End If
|
|
|
|
Next
|
|
|
|
If insertar Then
|
|
|
|
If Not ExistePasoHistorial(4) Then
|
|
If objRH.PersonalEstatusIngresoAdd(CvePersonal, 4, UsuarioActual.CveUsuario, "") Then
|
|
PasoSiguiente()
|
|
End If
|
|
Else
|
|
PasoSiguiente()
|
|
End If
|
|
End If
|
|
End If
|
|
|
|
objEdoc.Dispose()
|
|
objRH.Dispose()
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
#End Region
|
|
|
|
#Region " C A R A C T E R I S T I C A S "
|
|
|
|
Private Sub CargaDTSCaracteristicas()
|
|
|
|
|
|
Dim objCaracteristicas As New ClsGenerales
|
|
If objCaracteristicas.GetCaracteristicasValores(CvePersonal, -1, -1, -1, -1, -1, 2, UsuarioActual.Empresa.CveEmpresa) Then
|
|
DtCaracteristicas = objCaracteristicas.DtResultados
|
|
End If
|
|
|
|
If objCaracteristicas.GetCaracteriscasOpciones(-1, UsuarioActual.Empresa.CveEmpresa) Then
|
|
DtCaracteristicasOpciones = objCaracteristicas.DtResultados
|
|
End If
|
|
|
|
objCaracteristicas.Dispose()
|
|
|
|
End Sub
|
|
|
|
Private Sub CargaDatosCaracteristicas()
|
|
|
|
Dim objCaracteristicas As New ClsGenerales
|
|
|
|
If CvePersonal <> -1 Then
|
|
If objCaracteristicas.GetCaracteristicasValores(CvePersonal, -1, -1, -1, -1, -1, 2, UsuarioActual.Empresa.CveEmpresa) Then
|
|
GvCaracteristicas.DataSource = objCaracteristicas.DtResultados
|
|
DtCaracteristicasValor = objCaracteristicas.DtResultados
|
|
Else
|
|
GvCaracteristicas.DataSource = Nothing
|
|
End If
|
|
End If
|
|
|
|
objCaracteristicas.Dispose()
|
|
GvCaracteristicas.DataBind()
|
|
UPGvCaracteristicas.Update()
|
|
|
|
End Sub
|
|
|
|
Public Sub Edit_ClickCaracteristica(sender As Object, e As EventArgs)
|
|
RegistraScript("$('#divAgregarCaracteristica').modal({ backdrop: 'static', keyboard: false});")
|
|
|
|
End Sub
|
|
|
|
|
|
Public Sub Remove_ClickCaracteristica(sender As Object, e As EventArgs)
|
|
|
|
Dim objRH As New ClsRH
|
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
|
Dim activo As Boolean = False
|
|
Dim _CvePersonalCaracteristica As Integer = GvRow.DataKey("CvePersonalCaracteristica").ToString.ToEntero
|
|
|
|
If objRH.PersonalCaracteristicaRemove(_CvePersonalCaracteristica) Then
|
|
CargaFamiliares()
|
|
|
|
Alert("Caracteristica eliminada correctamente.", TipoMensaje.MsgInformacion)
|
|
|
|
End If
|
|
objRH.Dispose()
|
|
|
|
CargaDatosCaracteristicas()
|
|
End Sub
|
|
|
|
Protected Sub GvCaracteristicas_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvCaracteristicas.RowDataBound
|
|
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
|
|
|
|
Dim _CveCaracteristica As Integer = e.Row.DataKey("CveCaracteristica").ToEntero
|
|
Dim _Caracteristica As String = e.Row.DataKey("Caracteristica")
|
|
|
|
Dim _Requerido As Integer
|
|
If e.Row.DataKey("Requerido").ToString.ToUpper = "TRUE" Then
|
|
_Requerido = 1
|
|
Else
|
|
_Requerido = 0
|
|
End If
|
|
|
|
|
|
Dim _CaracteristicaValor As String = e.Row.DataKey("CaracteristicaValor")
|
|
Dim _CveCaracteristicaValor As Integer = e.Row.DataKey("CveCaracteristicaValor").ToEntero
|
|
Dim _CveCaracteristicaTipo As Integer = e.Row.DataKey("CveCaracteristicaTipo").ToEntero
|
|
Dim _CveCaracteristicaOpcion As Integer = e.Row.DataKey("CveCaracteristicaOpcion").ToEntero
|
|
Dim _Logitud As Integer = e.Row.DataKey("Longitud").ToString.ToEntero
|
|
|
|
Dim _DdlCarcateristicaOpcion As DropDownList = e.Row.FCDropDownList("DdlCarcateristicaOpcion")
|
|
Dim _TxtCaracteristicaOpcion As TextBox = e.Row.FCTextBox("TxtCaracteristicaOpcion")
|
|
Dim _RdlCarcateristicaOpcion As RadioButtonList = e.Row.FCRadioButtonList("RdlCarcateristicaOpcion")
|
|
Dim _chkCaracteristicaValor As CheckBox = e.Row.FCCheckBox("chkCaracteristicaValor")
|
|
|
|
Dim dtTemp As New DataTable
|
|
Dim objCaracteristicas As New ClsGenerales
|
|
|
|
|
|
If objCaracteristicas.GetCaracteriscasOpciones(-1, UsuarioActual.Empresa.CveEmpresa) Then
|
|
dtTemp = objCaracteristicas.DtResultados
|
|
End If
|
|
objCaracteristicas.Dispose()
|
|
|
|
|
|
If _CaracteristicaValor.Length > 0 Then
|
|
_TxtCaracteristicaOpcion.Text = _CaracteristicaValor
|
|
End If
|
|
|
|
_TxtCaracteristicaOpcion.Visible = False
|
|
_TxtCaracteristicaOpcion.Text = _CaracteristicaValor
|
|
Dim _rfvTxtCarcateristicaOpcion As RequiredFieldValidator = e.Row.FCRequiredFieldValidator("rfvTxtCarcateristicaOpcion")
|
|
_rfvTxtCarcateristicaOpcion.Enabled = False
|
|
|
|
_TxtCaracteristicaOpcion.TextMode = Nothing
|
|
|
|
Dim _CalendarioCaractersiticas As AjaxControlToolkit.CalendarExtender = e.Row.FCCalendarExtender("CalendarioCaractersiticas")
|
|
_CalendarioCaractersiticas.Enabled = False
|
|
|
|
_DdlCarcateristicaOpcion.Visible = False
|
|
Dim _rfvDdlCarcateristicaOpcion As RequiredFieldValidator = e.Row.FCRequiredFieldValidator("rfvDdlCarcateristicaOpcion")
|
|
_rfvDdlCarcateristicaOpcion.Enabled = False
|
|
|
|
_RdlCarcateristicaOpcion.Visible = False
|
|
Dim _rfvRdlCarcateristicaOpcion = e.Row.FCRequiredFieldValidator("rfvRdlCarcateristicaOpcion")
|
|
_rfvRdlCarcateristicaOpcion.Enabled = False
|
|
|
|
_chkCaracteristicaValor.Visible = False
|
|
|
|
Dim _cvFechaF As CompareValidator = e.Row.FCCompareValidator("cvFechaF")
|
|
_cvFechaF.Enabled = False
|
|
|
|
Select Case _CveCaracteristicaTipo
|
|
Case 0
|
|
'txt
|
|
_TxtCaracteristicaOpcion.Visible = True
|
|
_TxtCaracteristicaOpcion.MaxLength = _Logitud
|
|
If _Requerido = 1 Then
|
|
' _rfvTxtCarcateristicaOpcion.Enabled = True
|
|
End If
|
|
Exit Select
|
|
Case 1
|
|
'drop
|
|
_DdlCarcateristicaOpcion.Visible = True
|
|
dtTemp = dtTemp.FiltraParametros(" CveCaracteristica = " & _CveCaracteristica)
|
|
_DdlCarcateristicaOpcion.DataSource = dtTemp
|
|
_DdlCarcateristicaOpcion.DataBind()
|
|
_DdlCarcateristicaOpcion.Items.Insert(0, New ListItem("Seleccione una opción", "-1"))
|
|
|
|
If _CveCaracteristicaValor <> -1 Then
|
|
_DdlCarcateristicaOpcion.SelectedValueExist(_CveCaracteristicaOpcion)
|
|
End If
|
|
|
|
If _Requerido = 1 Then
|
|
_rfvDdlCarcateristicaOpcion.Enabled = True
|
|
End If
|
|
|
|
Exit Select
|
|
Case 2
|
|
'radio
|
|
_RdlCarcateristicaOpcion.Visible = True
|
|
dtTemp = dtTemp.FiltraParametros(" CveCaracteristica = " & _CveCaracteristica)
|
|
_RdlCarcateristicaOpcion.DataSource = dtTemp
|
|
_RdlCarcateristicaOpcion.DataBind()
|
|
|
|
If _CveCaracteristicaValor <> -1 Then
|
|
_RdlCarcateristicaOpcion.SelectedValuesIfExist(_CveCaracteristicaOpcion.ToString)
|
|
End If
|
|
|
|
If _Requerido = 1 Then
|
|
' _rfvRdlCarcateristicaOpcion.Enabled = True
|
|
End If
|
|
|
|
Exit Select
|
|
Case 3
|
|
'Fecha txt Fecha
|
|
_TxtCaracteristicaOpcion.Visible = True
|
|
_TxtCaracteristicaOpcion.Width = 120
|
|
_cvFechaF.Enabled = True
|
|
' _CalendarioCaractersiticas.Enabled = True
|
|
RegistraScript(" $('#" & _TxtCaracteristicaOpcion.ClientID & "').mask('00/00/0000'); ")
|
|
If _Requerido = 1 Then
|
|
_rfvTxtCarcateristicaOpcion.Enabled = True
|
|
End If
|
|
Exit Select
|
|
Case 4
|
|
'Multiline
|
|
_TxtCaracteristicaOpcion.Visible = True
|
|
_TxtCaracteristicaOpcion.MaxLength = _Logitud
|
|
If _Requerido = 1 Then
|
|
_rfvTxtCarcateristicaOpcion.Enabled = True
|
|
End If
|
|
Exit Select
|
|
Case 5
|
|
'CheckBox
|
|
_chkCaracteristicaValor.Visible = True
|
|
If _CaracteristicaValor = "1" Then
|
|
_chkCaracteristicaValor.Checked = True
|
|
Else
|
|
_chkCaracteristicaValor.Checked = False
|
|
End If
|
|
|
|
Exit Select
|
|
Case 6
|
|
|
|
_TxtCaracteristicaOpcion.Visible = True
|
|
_TxtCaracteristicaOpcion.TextMode = TextBoxMode.Number
|
|
|
|
If _Requerido = 1 Then
|
|
_rfvTxtCarcateristicaOpcion.Enabled = True
|
|
End If
|
|
Exit Select
|
|
End Select
|
|
|
|
End If
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub GuardaCaracteristicas()
|
|
|
|
|
|
Dim objCarac As New ClsGenerales
|
|
|
|
For Each dRow As GridViewRow In GvCaracteristicas.Rows
|
|
Dim _CaracteristicaValor As Integer = dRow.DataKey("CaracteristicaValor").ToEntero
|
|
|
|
Dim updateCaracteristica As Boolean = False
|
|
|
|
If _CaracteristicaValor = -1 Then
|
|
updateCaracteristica = False
|
|
Else
|
|
updateCaracteristica = True
|
|
End If
|
|
|
|
Dim _CveCaracteristica As Integer = dRow.DataKey("CveCaracteristica").ToEntero
|
|
Dim _CveCaracteristicaValor As Integer = dRow.DataKey("CveCaracteristicaValor").ToEntero
|
|
Dim _CveCaracteristicaTipo As Integer = dRow.DataKey("CveCaracteristicaTipo").ToEntero
|
|
|
|
Dim _DdlCarcateristicaOpcion As DropDownList = dRow.FCDropDownList("DdlCarcateristicaOpcion")
|
|
Dim _TxtCaracteristicaOpcion As TextBox = dRow.FCTextBox("TxtCaracteristicaOpcion")
|
|
Dim _RdlCarcateristicaOpcion As RadioButtonList = dRow.FCRadioButtonList("RdlCarcateristicaOpcion")
|
|
Dim _chkCaracteristicaValor As CheckBox = dRow.FCCheckBox("chkCaracteristicaValor")
|
|
|
|
|
|
Dim CveCaracteristicaOpcion As Integer = -1
|
|
Dim CaracteristicaValor As String = ""
|
|
Dim CaracteristicaValorDate As Date = Now
|
|
Dim CaracteristicaValorInt As Integer = -1
|
|
|
|
|
|
Select Case _CveCaracteristicaTipo
|
|
Case 0
|
|
'txt
|
|
CaracteristicaValor = _TxtCaracteristicaOpcion.Text
|
|
|
|
If CaracteristicaValor.Trim.Length > 0 Then
|
|
updateCaracteristica = True
|
|
Else
|
|
updateCaracteristica = False
|
|
End If
|
|
|
|
Exit Select
|
|
Case 1
|
|
'drop
|
|
|
|
CveCaracteristicaOpcion = _DdlCarcateristicaOpcion.SelectedValue.ToEntero
|
|
|
|
If CveCaracteristicaOpcion > 0 Then
|
|
updateCaracteristica = True
|
|
Else
|
|
updateCaracteristica = False
|
|
End If
|
|
Exit Select
|
|
Case 2
|
|
'radio
|
|
CveCaracteristicaOpcion = _RdlCarcateristicaOpcion.SelectedValue.ToEntero
|
|
If CveCaracteristicaOpcion > 0 Then
|
|
updateCaracteristica = True
|
|
Else
|
|
updateCaracteristica = False
|
|
End If
|
|
Exit Select
|
|
Case 3
|
|
'Fecha txt Fecha
|
|
If _TxtCaracteristicaOpcion.Text.Trim.Length > 0 Then
|
|
CaracteristicaValorDate = _TxtCaracteristicaOpcion.Text.Trim.ToDate
|
|
CaracteristicaValor = CaracteristicaValorDate.ToString("dd/MM/yyyy")
|
|
If CaracteristicaValor.Trim.ToDate.ToString("dd/MM/yyyy").ToString.Length > 0 Then
|
|
updateCaracteristica = True
|
|
Else
|
|
updateCaracteristica = False
|
|
End If
|
|
|
|
Exit Select
|
|
Else
|
|
updateCaracteristica = False
|
|
End If
|
|
|
|
|
|
Case 4
|
|
|
|
'txt
|
|
CaracteristicaValor = _TxtCaracteristicaOpcion.Text
|
|
|
|
If CaracteristicaValor.Trim.Length > 0 Then
|
|
updateCaracteristica = True
|
|
Else
|
|
updateCaracteristica = False
|
|
End If
|
|
Exit Select
|
|
Case 5
|
|
'CheckBox
|
|
If _chkCaracteristicaValor.Checked Then
|
|
CaracteristicaValor = "1"
|
|
Else
|
|
CaracteristicaValor = "0"
|
|
End If
|
|
updateCaracteristica = True
|
|
Exit Select
|
|
Case 6
|
|
'txt numerico
|
|
'txt
|
|
CaracteristicaValor = _TxtCaracteristicaOpcion.Text.ToEntero.ToString
|
|
updateCaracteristica = True
|
|
|
|
Exit Select
|
|
End Select
|
|
|
|
If updateCaracteristica Then
|
|
If Not objCarac.AddUpdateCaracteristicasValores(_CveCaracteristica, CveCaracteristicaOpcion, CaracteristicaValor, UsuarioActual.CveUsuario, _CveCaracteristicaValor, CvePersonal) Then
|
|
Exit For
|
|
End If
|
|
End If
|
|
|
|
|
|
|
|
Next
|
|
|
|
CargaDatosCaracteristicas()
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
|
|
#End Region
|
|
|
|
#Region " R E F E R E N C I A S "
|
|
|
|
|
|
Private Sub LoadCombosReferencias(TipoEncuesta As Integer)
|
|
|
|
Dim encuesta As New ClsEncuestas
|
|
|
|
If encuesta.GetEncuestas(UsuarioActual.Empresa.CveEmpresa) Then
|
|
DDLTipoReferencia.DataSource = encuesta.DtResultados.FiltraParametros(String.Format(" CveTipoEncuesta = {0} ", TipoEncuesta))
|
|
End If
|
|
|
|
encuesta.Dispose()
|
|
|
|
DDLTipoReferencia.DataBind()
|
|
DDLTipoReferencia.Items.Insert(0, New ListItem("Seleccione una entrevista", "-1"))
|
|
|
|
|
|
UpGvReFerenciasVerificacion.Update()
|
|
UpModalReferencias.Update()
|
|
End Sub
|
|
|
|
|
|
Protected Sub DDLTipoReferencia_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DDLTipoReferencia.SelectedIndexChanged
|
|
|
|
Dim objEncuesta As New ClsEncuestas
|
|
|
|
If DDLTipoReferencia.SelectedIndex > 0 Then
|
|
|
|
If objEncuesta.GetRespuestas(DDLTipoReferencia.SelectedValue.ToEntero) Then
|
|
DTRespuestasReferencias = objEncuesta.DtResultados
|
|
End If
|
|
|
|
If objEncuesta.GetPreguntas(DDLTipoReferencia.SelectedValue.ToEntero, -1, -1, -1, UsuarioActual.Empresa.CveEmpresa) Then
|
|
GvVerificacionRefPre.DataSource = objEncuesta.DtResultados
|
|
If objEncuesta.DtResultados.Rows.Count > 0 Then
|
|
BtnModalReferenciasVerificar.Visible = True
|
|
GvVerificacionRefPre.Visible = True
|
|
End If
|
|
End If
|
|
|
|
Else
|
|
DTRespuestasReferencias = Nothing
|
|
GvVerificacionRefPre.DataSource = Nothing
|
|
GvVerificacionRefPre.Visible = False
|
|
BtnModalReferenciasVerificar.Visible = False
|
|
End If
|
|
|
|
UpModalReferenciasBtn.Update()
|
|
objEncuesta.Dispose()
|
|
|
|
GvVerificacionRefPre.DataBind()
|
|
UpModalReferenciasVerificacion.Update()
|
|
|
|
End Sub
|
|
|
|
Private Sub CargaReferenciaAValidar()
|
|
|
|
Dim objRH As New ClsRH
|
|
|
|
If objRH.PersonalReferenciasVerificacionGet(CvePersonal, UsuarioActual.Empresa.CveEmpresa) Then
|
|
GvVerificacionRef.DataSource = objRH.DtResultados
|
|
Else
|
|
GvVerificacionRef.DataSource = Nothing
|
|
End If
|
|
|
|
GvVerificacionRef.DataBind()
|
|
objRH.Dispose()
|
|
|
|
UpGvReFerenciasVerificacion.Update()
|
|
|
|
End Sub
|
|
|
|
Private Sub Referencias()
|
|
|
|
Dim objRH As New ClsRH
|
|
|
|
If Not ExistePasoHistorial(7) Then
|
|
objRH.PersonalEstatusIngresoAdd(CvePersonal, 7, UsuarioActual.CveUsuario, "")
|
|
End If
|
|
|
|
objRH.Dispose()
|
|
|
|
End Sub
|
|
|
|
|
|
Protected Sub GvVerificacionRef_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvVerificacionRef.RowDataBound
|
|
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
|
|
Dim GvVerificacionRefRes As GridView = DirectCast(e.Row.FCGridView("GvVerificacionRefRes"), GridView)
|
|
Dim _DivGvREs As Control = DirectCast(e.Row.FindControl("DvGvRes"), Control)
|
|
Dim _Tipo As Integer = e.Row.DataKey("Tipo").ToString.ToEntero
|
|
Dim _CveEncuestaAplicadaI As Integer = e.Row.DataKey("CveEncuestaAplicada").ToString.ToEntero
|
|
Dim _lnkVerificacion As LinkButton = e.Row.FCLinkButton("lnkVerificacion")
|
|
Dim _lnkVerRes As LinkButton = e.Row.FCLinkButton("lnkVerRes")
|
|
Dim _lnkEliminarVerificacionReferencia As LinkButton = e.Row.FCLinkButton("lnkEliminarVerificacionReferencia")
|
|
|
|
|
|
|
|
Dim objRH As New ClsEncuestas
|
|
|
|
Try
|
|
If objRH.GetEncuestaAplicada(_CveEncuestaAplicadaI, -1, -1, CvePersonal, -1, CveTipoEncuestaSeccionReferencias, UsuarioActual.CveEmpresa) Then
|
|
|
|
If objRH.DtResultados.Rows.Count > 0 Then
|
|
|
|
_lnkVerificacion.Visible = False
|
|
_lnkVerificacion.Visible = False
|
|
|
|
_lnkVerRes.Visible = True
|
|
_lnkVerRes.Attributes.Add("data-target", String.Format("#{0}", _DivGvREs.ClientID))
|
|
_lnkEliminarVerificacionReferencia.Visible = True
|
|
|
|
Else
|
|
|
|
_lnkVerificacion.Visible = True
|
|
_lnkVerificacion.Visible = True
|
|
_lnkVerRes.Visible = False
|
|
_lnkEliminarVerificacionReferencia.Visible = False
|
|
|
|
End If
|
|
|
|
GvVerificacionRefRes.DataSource = objRH.DtResultados
|
|
GvVerificacionRefRes.DataBind()
|
|
|
|
End If
|
|
|
|
Catch ex As Exception
|
|
|
|
End Try
|
|
|
|
objRH.Dispose()
|
|
|
|
End If
|
|
|
|
End Sub
|
|
|
|
|
|
Protected Sub BtnVerificarReferencia_Click(sender As Object, e As EventArgs)
|
|
|
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
|
|
|
Dim _CveReferencia As Integer = GvRow.DataKey("CveReferencia").ToString.ToEntero
|
|
Dim _Nombre As String = GvRow.DataKey("Nombre")
|
|
Dim _Tipo As Integer = GvRow.DataKey("Tipo").ToString.ToEntero
|
|
Dim _Telefono As String = GvRow.DataKey("Telefono")
|
|
|
|
NombreReferenciaVerificacion = _Nombre
|
|
TelefonoReferenciaVerificacion = _Telefono
|
|
CveReferenciaVerificacion = _CveReferencia
|
|
|
|
BtnModalReferenciasVerificar.Visible = False
|
|
UpModalReferenciasBtn.Update()
|
|
|
|
'Estos campos dependen de los valores en base de datos
|
|
If _Tipo = 1 Then
|
|
_Tipo = 4 'Labora
|
|
TipoReferenciaVerificacion = "laboral"
|
|
LtlNombreTelefonoReferencia.Text = "Empresa: " & NombreReferenciaVerificacion & " Tel:" & TelefonoReferenciaVerificacion
|
|
Else
|
|
_Tipo = 5 ' personal
|
|
TipoReferenciaVerificacion = "personal"
|
|
LtlNombreTelefonoReferencia.Text = "Nombre: " & NombreReferenciaVerificacion & " Tel:" & TelefonoReferenciaVerificacion
|
|
End If
|
|
|
|
GvVerificacionRefPre.DataSource = Nothing
|
|
GvVerificacionRefPre.DataBind()
|
|
|
|
|
|
LoadCombosReferencias(_Tipo)
|
|
UpModalReferenciasVerificacion.Update()
|
|
|
|
RegistraScript("$('#ModalValidacionReferencias').modal({ backdrop: 'static', keyboard: false});")
|
|
End Sub
|
|
|
|
Protected Sub BtnModalReferenciasVerificar_Click(sender As Object, e As EventArgs) Handles BtnModalReferenciasVerificar.Click
|
|
|
|
Dim objEnc As New ClsEncuestas
|
|
Dim objRH As New ClsRH
|
|
Dim hasError As Boolean = False
|
|
Dim _CveEncuestaAplicada As Integer = -1
|
|
Dim RespuestaIncompleta As Boolean = False
|
|
|
|
objEnc.IniciaTransacSQL()
|
|
|
|
Try
|
|
If objEnc.AddEncuestaAplicada(DDLTipoReferencia.SelectedValue.ToEntero, -1, CvePersonal, UsuarioActual.CveUsuario, UsuarioActual.Empresa.CveEmpresa) Then
|
|
_CveEncuestaAplicada = objEnc.DtResultados(0)(0).ToString.ToEntero
|
|
Else
|
|
hasError = True
|
|
Exit Try
|
|
End If
|
|
|
|
For Each drow As GridViewRow In GvVerificacionRefPre.Rows
|
|
Dim EsOpcion As Integer = drow.DataKey("CveTipoPregunta").ToEntero
|
|
Dim CvePregunta As Integer = drow.DataKey("CvePregunta").ToEntero
|
|
|
|
|
|
Dim valorInt As Integer = -1
|
|
Dim valorStr As String = "-1"
|
|
|
|
Dim dt As DataTable = DTRespuestas.FiltraParametros(String.Format(" CvePregunta = {0} ", CvePregunta))
|
|
|
|
|
|
Select Case EsOpcion
|
|
|
|
Case 1 'Texto, Multiline
|
|
|
|
If dt.Rows.Count = 0 Then
|
|
valorInt = -1
|
|
Else
|
|
valorInt = dt(0)("CveRespuesta").ToString.ToEntero
|
|
End If
|
|
|
|
valorStr = drow.FCTextBox("TxtResPuestaReferencias").Text
|
|
|
|
With drow.FCTextBox("TxtResPuestaReferencias")
|
|
.Visible = True
|
|
If EsOpcion = 4 Then
|
|
.Rows = 3
|
|
.TextMode = TextBoxMode.MultiLine
|
|
End If
|
|
End With
|
|
|
|
Case 2, 3, 4 'DropDownList, Radios
|
|
|
|
If EsOpcion = 3 Then
|
|
valorInt = drow.FCDropDownList("DdlRespuestaReferencias").SelectedValue.ToEntero
|
|
valorStr = drow.FCDropDownList("DdlRespuestaReferencias").SelectedItem.Text
|
|
ElseIf EsOpcion = 4 Or EsOpcion = 2 Then
|
|
valorInt = drow.FCRadioButtonList("RdlRespuestaReferencias").SelectedValue.ToEntero
|
|
valorStr = ""
|
|
End If
|
|
|
|
Case 5 'Fecha
|
|
valorStr = drow.FCTextBox("TxtResPuestaReferencias").Text
|
|
End Select
|
|
|
|
|
|
If valorInt = 0 And valorStr = "" Then
|
|
hasError = True
|
|
RespuestaIncompleta = True
|
|
Exit For
|
|
Else
|
|
If Not objEnc.AddEncuestaAplicadaDetalle(_CveEncuestaAplicada, CvePregunta, valorInt, valorStr) Then
|
|
hasError = True
|
|
Exit For
|
|
End If
|
|
End If
|
|
|
|
'If Not objEnc.AddEncuestaAplicadaDetalle(_CveEncuestaAplicada, CvePregunta, valorInt, valorStr) Then
|
|
|
|
' hasError = True
|
|
' Exit For
|
|
'End If
|
|
Next
|
|
|
|
If Not hasError Then
|
|
|
|
Try
|
|
objEnc.Commit()
|
|
If objRH.PersonalReferenciasVerificacionUpdate(TipoReferenciaVerificacion, CveReferenciaVerificacion, _CveEncuestaAplicada) Then
|
|
|
|
Else
|
|
hasError = True
|
|
End If
|
|
|
|
Catch ex As Exception
|
|
objEnc.RollBack()
|
|
OnError("Error al registrar paso", ex)
|
|
End Try
|
|
|
|
Alert("Entrevista guardada correctamente.", TipoMensaje.MsgInformacion)
|
|
CargaEntrevista()
|
|
Else
|
|
objEnc.RollBack()
|
|
|
|
|
|
If RespuestaIncompleta Then
|
|
Alert("No se a podido guardar la entrevista(Una vez iniciada la entervista todas las respuestas deben de ser conetstadas).", TipoMensaje.MsgAdvertencia)
|
|
Else
|
|
Alert("Ocurrio un error en al guardar entrevista.", TipoMensaje.MsgAdvertencia)
|
|
End If
|
|
|
|
|
|
|
|
|
|
End If
|
|
|
|
Catch ex As Exception
|
|
|
|
OnError("Error al guardar entrevista ", ex)
|
|
hasError = True
|
|
objEnc.RollBack()
|
|
objEnc.Dispose()
|
|
End Try
|
|
|
|
objRH.Dispose()
|
|
objEnc.Dispose()
|
|
If Not hasError Then
|
|
CargaReferenciaAValidar()
|
|
RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalValidacionReferencias"))
|
|
|
|
End If
|
|
CargaReferenciaAValidar()
|
|
End Sub
|
|
|
|
Protected Sub GvVerificacionRefPre_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvVerificacionRefPre.RowDataBound
|
|
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
Dim EsOpcion As Integer = e.Row.DBCampo("CveTipoPregunta").ToEntero
|
|
Dim CvePregunta As Integer = e.Row.DBCampo("CvePregunta").ToEntero
|
|
|
|
' e.Row.FCFilteredTextBoxExtender("filTxtResPuestaReferencias").Enabled = False
|
|
|
|
Select Case EsOpcion
|
|
Case 1 'Texto, Multiline
|
|
With e.Row.FCTextBox("TxtResPuestaReferencias")
|
|
.Visible = True
|
|
If EsOpcion = 4 Then
|
|
.Rows = 3
|
|
.TextMode = TextBoxMode.MultiLine
|
|
End If
|
|
End With
|
|
Case 2, 3, 4 'DropDownList, Radios
|
|
|
|
Dim dt As DataTable = DTRespuestasReferencias.FiltraParametros(String.Format(" CvePregunta = {0} ", CvePregunta))
|
|
|
|
If EsOpcion = 3 Then
|
|
With e.Row.FCDropDownList("DdlRespuestaReferencias")
|
|
.Visible = True
|
|
.DataSource = dt
|
|
.DataBind()
|
|
.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
|
|
End With
|
|
ElseIf EsOpcion = 4 Or EsOpcion = 2 Then
|
|
With e.Row.FCRadioButtonList("RdlRespuestaReferencias")
|
|
.Visible = True
|
|
.DataSource = dt
|
|
.DataBind()
|
|
End With
|
|
|
|
e.Row.FCRequiredFieldValidator("rfvRdlRespuestaReferencias").ErrorMessage = String.Format("<i><span style='color: darkred;'>Campo requerido</span></i>")
|
|
End If
|
|
|
|
Case 5 'numerico
|
|
With e.Row.FCTextBox("TxtResPuestaReferencias")
|
|
.Visible = True
|
|
.Attributes.Add("onkeypress", "validate(event)")
|
|
End With
|
|
|
|
End Select
|
|
|
|
End If
|
|
|
|
End Sub
|
|
Protected Sub LnkEliminarVerificacionReferencia_Click(sender As Object, e As EventArgs)
|
|
|
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
|
|
|
Dim _CveEncuestaAplicada As Integer
|
|
|
|
If GvRow.DataKey("CveEncuestaAplicada").ToString = "" Then
|
|
_CveEncuestaAplicada = -1
|
|
Else
|
|
_CveEncuestaAplicada = GvRow.DataKey("CveEncuestaAplicada").ToEntero
|
|
End If
|
|
|
|
If _CveEncuestaAplicada <> -1 Then
|
|
Dim Enc As New ClsEncuestas
|
|
|
|
If Enc.RemoveEncuestaAplicada(_CveEncuestaAplicada, UsuarioActual.Empresa.CveEmpresa) Then
|
|
Alert("Verificación de referencia eliminada correctamente.", TipoMensaje.MsgInformacion)
|
|
End If
|
|
|
|
Enc.Dispose()
|
|
End If
|
|
|
|
CargaReferenciaAValidar()
|
|
End Sub
|
|
|
|
#End Region
|
|
|
|
#Region "I N V E S T I G A C I O N"
|
|
|
|
Private Sub Investigacion()
|
|
|
|
Dim objRH As New ClsRH
|
|
If Not ExistePasoHistorial(5) Then
|
|
objRH.PersonalEstatusIngresoAdd(CvePersonal, 5, UsuarioActual.CveUsuario, "")
|
|
End If
|
|
objRH.Dispose()
|
|
|
|
End Sub
|
|
|
|
Private Sub GuardarDocumentosInvestigacion(Optional _CveDocumentacionExcluir As Integer = -1)
|
|
|
|
Dim hasError As Boolean = True
|
|
Dim objDocumentos As New ClsEdocumentacion
|
|
|
|
For Each dRow As GridViewRow In GvInvestigacion.Rows
|
|
|
|
Dim _CveDocumentacion As Integer = dRow.DataKey("CveDocumentacion").ToString.ToEntero
|
|
Dim _Adjunto As String = dRow.DataKey("Adjunto")
|
|
'Dim _Documentacion As String = dRow.DataKey("Documentacion")
|
|
Dim _CveDocumentacionElectronica As Integer = dRow.DataKey("CveDocumentacionElectronica").ToString.ToEntero
|
|
Dim _txtObservaciones As TextBox = dRow.FCTextBox("TxtObservaciones")
|
|
Dim _TxtFechaLimite As TextBox = dRow.FCTextBox("TxtFechaLimite")
|
|
Dim _TxtFechaVigencia As TextBox = dRow.FCTextBox("TxtFechaVigencia")
|
|
|
|
Dim _FechaVigencia As Date
|
|
Dim _FechaLimite As Date
|
|
|
|
Dim DiasLimite As Integer = dRow.DataKey("DiasLimite").ToString.ToEntero
|
|
Dim AplicaDiasLimite As Boolean = If(dRow.DataKey("AplicaDiasLimite").ToString = "1", True, False)
|
|
Dim AplicaFechaVencimiento As Boolean = If(dRow.DataKey("AplicaFechaVencimiento").ToString = "1", True, False)
|
|
|
|
|
|
|
|
Dim chkEstatus As CheckBox = dRow.FCCheckBox("chkEstatus")
|
|
Dim _estatus As Integer
|
|
|
|
If chkEstatus.Checked Then
|
|
_estatus = 1
|
|
Else
|
|
_estatus = 0
|
|
End If
|
|
|
|
If _TxtFechaVigencia.Text.Length = 10 Then
|
|
_FechaVigencia = _TxtFechaVigencia.Text.ToDate
|
|
Else
|
|
_FechaVigencia = Nothing
|
|
End If
|
|
|
|
|
|
If Not AplicaDiasLimite Then
|
|
_FechaLimite = MinFecha
|
|
Else
|
|
_FechaLimite = _TxtFechaLimite.Text.ToDate
|
|
End If
|
|
|
|
If Not AplicaFechaVencimiento Then
|
|
_FechaVigencia = MinFecha
|
|
End If
|
|
|
|
|
|
If Not _CveDocumentacionExcluir = _CveDocumentacion Then
|
|
Try
|
|
If _CveDocumentacionElectronica = -1 Then
|
|
|
|
If objDocumentos.DocumentacionElectronicaAdd(_CveDocumentacion, CvePersonal, -1, -1, _estatus, _txtObservaciones.Text.Trim, _Adjunto, UsuarioActual.CveUsuario, _FechaLimite, _FechaVigencia) > 0 Then
|
|
Else
|
|
hasError = True
|
|
Exit For
|
|
End If
|
|
|
|
Else
|
|
If objDocumentos.DocumentacionElectronicaUpdate(_CveDocumentacionElectronica, _CveDocumentacion, CvePersonal, -1, -1, _estatus, _txtObservaciones.Text.Trim, _Adjunto, UsuarioActual.CveUsuario, _FechaLimite, _FechaVigencia) Then
|
|
Else
|
|
hasError = True
|
|
Exit For
|
|
End If
|
|
End If
|
|
|
|
hasError = False
|
|
Catch ex As Exception
|
|
hasError = True
|
|
Exit For
|
|
End Try
|
|
End If
|
|
Next
|
|
|
|
|
|
CargaDocumentacionInvestigacion()
|
|
objDocumentos.Dispose()
|
|
End Sub
|
|
|
|
Private Sub ValidaGuardaInvestigacionEvento()
|
|
|
|
Dim objEdoc As New ClsEdocumentacion
|
|
Dim objRH As New ClsRH
|
|
|
|
If objEdoc.DocumentacionElectronicaGet(CvePersonal, -1, -1, UsuarioActual.Empresa.CveEmpresa, If(UsuarioActual.CveEmpresa = 138, 19, 2)) Then
|
|
Dim insertar As Boolean = True
|
|
|
|
For Each drow As DataRow In objEdoc.DtResultados.Rows
|
|
|
|
Dim documentacionS As String = drow("Documentacion").ToString
|
|
If (drow("CveDocumentacionElectronica").ToString = "-1" And Boolean.Parse(drow("Requerido").ToString) = True Or Boolean.Parse((drow("Requerido").ToString)) = True And drow("Estatus").ToString.ToEntero = 0) Then
|
|
insertar = False
|
|
Alert("Hay documentos requeridos que no han sido entregados.", TipoMensaje.MsgAdvertencia)
|
|
Exit For
|
|
Else
|
|
insertar = True
|
|
End If
|
|
Next
|
|
|
|
If insertar Then
|
|
|
|
If Not ExistePasoHistorial(5) Then
|
|
If objRH.PersonalEstatusIngresoAdd(CvePersonal, 5, UsuarioActual.CveUsuario, "") Then
|
|
PasoSiguiente()
|
|
End If
|
|
Else
|
|
PasoSiguiente()
|
|
End If
|
|
End If
|
|
End If
|
|
|
|
objEdoc.Dispose()
|
|
objRH.Dispose()
|
|
|
|
|
|
End Sub
|
|
|
|
Private Sub CargaDocumentacionInvestigacion()
|
|
|
|
Dim objRH As New ClsEdocumentacion
|
|
|
|
If objRH.DocumentacionElectronicaGet(CvePersonal, -1, -1, UsuarioActual.Empresa.CveEmpresa, -1) Then
|
|
DTDocumentacion = objRH.DtResultados
|
|
End If
|
|
|
|
If DTDocumentacion.FiltraParametros($" CveDocumentacionTipo = {If(UsuarioActual.CveEmpresa = 138, 19, 2)} ").Rows.Count > 0 Then
|
|
GvInvestigacion.DataSource = DTDocumentacion.FiltraParametros($" CveDocumentacionTipo = {If(UsuarioActual.CveEmpresa = 138, 19, 2)} ")
|
|
Else
|
|
GvInvestigacion.DataSource = Nothing
|
|
End If
|
|
objRH.Dispose()
|
|
GvInvestigacion.DataBind()
|
|
UpGvInvestigacion.Update()
|
|
|
|
End Sub
|
|
|
|
|
|
Public Sub UploadModal_ClickInvestigacion(sender As Object, e As EventArgs)
|
|
|
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
|
'Dim DDLEstatus As DropDownList
|
|
|
|
Dim chkEstatus As CheckBox
|
|
CveDocumentacionElectronica = GvRow.DataKey("CveDocumentacionElectronica").ToString.ToEntero
|
|
CveDocumentacion = GvRow.DataKey("CveDocumentacion").ToString.ToEntero
|
|
Documentacion = GvRow.DataKey("Documentacion")
|
|
AdjuntoDocumentacion = GvRow.DataKey("Adjunto").ToString
|
|
DiasVigencia = GvRow.DataKey("DiasVigencia").ToString.ToEntero
|
|
|
|
chkEstatus = GvRow.FCCheckBox("chkEstatus")
|
|
|
|
If chkEstatus.Checked Then
|
|
Estatus = 1
|
|
Else
|
|
Estatus = 0
|
|
End If
|
|
|
|
If GvRow.DataKey("FechaVigencia").ToString.Length > 0 Then
|
|
FechaVigencia = GvRow.DataKey("FechaVigencia").ToString.ToDate
|
|
Else
|
|
FechaVigencia = Nothing
|
|
End If
|
|
|
|
ObservacionDocumentacion = GvRow.FCTextBox("TxtObservaciones").Text.Trim.ToUpper
|
|
FechaLimite = GvRow.FCTextBox("TxtFechaLimite").Text.ToDate
|
|
AdjuntoDocumentacion = GvRow.DataKey("Adjunto")
|
|
|
|
Dim x As String = GvRow.DataKey("AplicaFechaVencimiento")
|
|
If GvRow.DataKey("AplicaFechaVencimiento") = "1" Then AplicaFechaVencimiento = True Else AplicaFechaVencimiento = False
|
|
|
|
LtlModalTitleUploadDocumentoInvestigacion.Text = " Subir " & Documentacion
|
|
UpModalUploadInvestigacionDocumento.Update()
|
|
|
|
RegistraScript("$('#ModalUploadInvestigacionDocumento').modal({ backdrop: 'static', keyboard: false});")
|
|
|
|
End Sub
|
|
|
|
|
|
Protected Sub BtnModalInvestigacionDocumentoUpload_Click(sender As Object, e As EventArgs) Handles BtnModalInvestigacionDocumentoUpload.Click
|
|
|
|
|
|
Dim FileExtension As String = "-1"
|
|
Dim Filesgral As List(Of Archivo) = TxtFileInvestigacion.getfiles().Archivos
|
|
Dim Filename As String = ""
|
|
|
|
If AplicaFechaVencimiento And DiasVigencia > 0 Then
|
|
FechaVigencia = DateTime.Today.AddDays(DiasVigencia)
|
|
End If
|
|
|
|
For Each fileItem As Archivo In Filesgral
|
|
Try
|
|
|
|
FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
|
|
Dim tempArray() As String
|
|
tempArray = fileItem.filename.ToString().Split("-".ToCharArray())
|
|
|
|
Dim rutaDestino As String = UsuarioActual.Empresa.Ruta & "Personal\" & CvePersonal & "\" & Documentacion & "." & FileExtension
|
|
Dim rutaAdjuntoAnterior As String = UsuarioActual.Empresa.Ruta & "Personal\" & CvePersonal & "\" & AdjuntoDocumentacion
|
|
|
|
If Not System.IO.Directory.Exists(UsuarioActual.Empresa.Ruta & "Personal\" & CvePersonal & "\") Then
|
|
System.IO.Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "Personal\" & CvePersonal & "\")
|
|
End If
|
|
|
|
If File.Exists(rutaAdjuntoAnterior) And AdjuntoDocumentacion.Trim.Length > 0 Then
|
|
File.Delete(rutaAdjuntoAnterior)
|
|
End If
|
|
|
|
If System.IO.File.Exists(rutaDestino) Then
|
|
System.IO.File.Delete(rutaDestino)
|
|
End If
|
|
|
|
System.IO.File.Move(fileItem.FileUrl, rutaDestino)
|
|
|
|
Dim objRH As New ClsEdocumentacion
|
|
|
|
If CveDocumentacionElectronica = -1 Then
|
|
If objRH.DocumentacionElectronicaAdd(CveDocumentacion, CvePersonal, -1, -1, Estatus, ObservacionDocumentacion, Documentacion & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) > 0 Then
|
|
|
|
End If
|
|
Else
|
|
If objRH.DocumentacionElectronicaUpdate(CveDocumentacionElectronica, CveDocumentacion, CvePersonal, -1, -1, Estatus, ObservacionDocumentacion, Documentacion & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) Then
|
|
|
|
End If
|
|
End If
|
|
|
|
objRH.Dispose()
|
|
|
|
GuardarDocumentosInvestigacion(CveDocumentacion)
|
|
CargaDocumentacionInvestigacion()
|
|
TxtFileInvestigacion.Text = ""
|
|
UpModalUploadInvestigacionDocumento.Update()
|
|
|
|
Catch ex As Exception
|
|
OnError("Error al cargar archivo", ex)
|
|
End Try
|
|
|
|
Next
|
|
RegistraScript("$('#ModalUploadInvestigacionDocumento').modal('hide')", "hidemodal3")
|
|
|
|
End Sub
|
|
|
|
|
|
Public Sub DownLoadFormato_Click(sender As Object, e As EventArgs)
|
|
|
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
|
Dim CveDocumentacion As Integer = GvRow.DataKey("CveDocumentacion").ToString.ToEntero
|
|
Dim DocumentacionFormato As String = CveDocumentacion & "_" & GvRow.DataKey("DocumentacionFormato")
|
|
|
|
DescarFormato(DocumentacionFormato)
|
|
|
|
End Sub
|
|
|
|
|
|
Public Sub Update_ClickDocumentacionInvestigacion(sender As Object, e As EventArgs)
|
|
|
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
|
Dim activo As Boolean = False
|
|
|
|
Dim _CveDocumentacionElectronica As Integer = GvRow.DataKey("CveDocumentacionElectronica").ToString.ToEntero
|
|
Dim _CveDocumentacion As Integer = GvRow.DataKey("CveDocumentacion").ToString.ToEntero
|
|
Dim _Adjunto As String = GvRow.DataKey("Adjunto").ToString
|
|
Dim _fechaLimite As Date = GvRow.FCTextBox("TxtFechaLimite").Text.ToDate
|
|
|
|
Dim Observaciones As String = DirectCast(GvRow.FindControl("TxtObservaciones"), TextBox).Text
|
|
Dim chkCompleto As CheckBox = DirectCast(GvRow.FindControl("chkEstatus"), CheckBox)
|
|
|
|
If chkCompleto.Checked Then
|
|
Estatus = 1
|
|
Else
|
|
Estatus = 0
|
|
End If
|
|
|
|
Dim objRH As New ClsEdocumentacion
|
|
|
|
If Not _CveDocumentacionElectronica = -1 Then
|
|
If objRH.DocumentacionElectronicaUpdate(_CveDocumentacionElectronica, _CveDocumentacion, CvePersonal, -1, -1, Estatus, Observaciones, _Adjunto, UsuarioActual.CveUsuario, _fechaLimite) Then
|
|
Alert("Documento actualizado correctamente.", TipoMensaje.MsgInformacion)
|
|
End If
|
|
Else
|
|
If objRH.DocumentacionElectronicaAdd(_CveDocumentacion, CvePersonal, -1, -1, Estatus, Observaciones, _Adjunto, UsuarioActual.CveUsuario, _fechaLimite) > 0 Then
|
|
Alert("Documento actualizado correctamente.", TipoMensaje.MsgInformacion)
|
|
End If
|
|
End If
|
|
|
|
CargaDocumentacionInvestigacion()
|
|
objRH.Dispose()
|
|
|
|
End Sub
|
|
|
|
Protected Sub GvInvestigacion_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvInvestigacion.RowDataBound
|
|
|
|
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
|
|
Dim Adjunto As String = e.Row.DBCampo("Adjunto").ToString
|
|
|
|
Dim ImgDownLoad As Literal = e.Row.FCLiteral("ImgDownLoad")
|
|
Dim ImgRequired As Literal = e.Row.FCLiteral("ImgRequired")
|
|
Dim txtFechaLimite As TextBox = e.Row.FCTextBox("TxtFechaLimite")
|
|
Dim txtFechaVigencia As TextBox = e.Row.FCTextBox("TxtFechaVigencia")
|
|
Dim requerido As Boolean = Convert.ToBoolean(e.Row.DBCampo("Requerido"))
|
|
Dim chkEstatus As CheckBox = e.Row.FCCheckBox("chkEstatus")
|
|
Dim documentacionFormato As String = e.Row.DBCampo("DocumentacionFormato").ToString
|
|
Dim Documentacion As String = e.Row.DBCampo("Documentacion").ToString
|
|
|
|
Dim DiasLimite As Integer = e.Row.DataKey("DiasLimite").ToString.ToEntero
|
|
Dim AplicaDiasLimite As Boolean = If(e.Row.DataKey("AplicaDiasLimite").ToString = "1", True, False)
|
|
Dim AplicaFechaVencimiento As Boolean = If(e.Row.DataKey("AplicaFechaVencimiento").ToString = "1", True, False)
|
|
|
|
txtFechaLimite.Visible = If(AplicaDiasLimite, True, False)
|
|
txtFechaVigencia.Visible = If(AplicaFechaVencimiento, True, False)
|
|
|
|
If AplicaFechaVencimiento And e.Row.DataKey("DiasVigencia").ToString.ToEntero > 0 Then
|
|
txtFechaVigencia.Enabled = False
|
|
End If
|
|
|
|
Dim separado As Char() = ".".ToCharArray
|
|
Dim array() As String = Adjunto.Split(separado)
|
|
Dim extencion As String = ""
|
|
|
|
If array.Length > 0 Then
|
|
extencion = array(array.Length - 1)
|
|
End If
|
|
|
|
If e.Row.DBCampo("Estatus").ToEntero = 1 Then
|
|
chkEstatus.Checked = True
|
|
Else
|
|
chkEstatus.Checked = False
|
|
End If
|
|
|
|
txtFechaLimite.Text = e.Row.DBCampo("FechaLimite").ToString.ToDate.ToString("dd/MM/yyyy")
|
|
|
|
Dim scripMascara = "$('#" & txtFechaLimite.ClientID & "').mask('00/00/0000');$('#" & txtFechaVigencia.ClientID & "').mask('00/00/0000');"
|
|
RegistraScript(scripMascara, "scriptMascara")
|
|
|
|
|
|
If e.Row.DBCampo("FechaVigencia").ToString.Length > 0 Then
|
|
txtFechaVigencia.Text = e.Row.DBCampo("FechaVigencia").ToString.ToDate.ToString("dd/MM/yyyy")
|
|
If DateTime.Today > e.Row.DBCampo("FechaVigencia").ToString.ToDateTime Then
|
|
txtFechaVigencia.ForeColor = Drawing.Color.Red
|
|
End If
|
|
End If
|
|
|
|
If Adjunto.Trim.Length > 0 Then
|
|
Dim linkDescarga = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/Personal/" & CvePersonal & "/" & Adjunto
|
|
Dim linkDescargaArchivo = UsuarioActual.Empresa.Ruta & "Personal/" & CvePersonal & "/" & Adjunto
|
|
|
|
If File.Exists(linkDescargaArchivo) Then
|
|
ImgDownLoad.Visible = True
|
|
If extencion.Length > 0 Then
|
|
ImgDownLoad.Text = String.Format(" <a class='btn btn-circle btn-sm blue' href='{0}' target='_black' download='{1}'><i class='fa fa-download' title='Descargar documento'></i></a>", linkDescarga, CvePersonal & Documentacion & "." & extencion)
|
|
Else
|
|
ImgDownLoad.Text = String.Format(" <a class='btn btn-circle btn-sm blue' href='{0}' target='_black' download='{1}'><i class='fa fa-download' title='Descargar documento'></i></a>", linkDescarga, CvePersonal & Documentacion)
|
|
End If
|
|
Else
|
|
ImgDownLoad.Visible = False
|
|
End If
|
|
|
|
Else
|
|
ImgDownLoad.Visible = False
|
|
End If
|
|
|
|
If requerido Then
|
|
ImgRequired.Text = " <a class='btn btn-circle btn-sm yelow' href='#' data-toggle='tooltip' title=' Requerido!' ><i class='fa fa-asterisk '></i></a>"
|
|
Else
|
|
' ImgRequired.Text = " <a class='btn btn-circle btn-sm grey-salt' href='#' data-toggle='tooltip' title='No obligatorio' ><i class='fa fa-asterisk '></i></a>"
|
|
End If
|
|
|
|
chkEstatus.Checked = ImgDownLoad.Visible
|
|
End If
|
|
End Sub
|
|
|
|
|
|
#End Region
|
|
|
|
|
|
#Region "A T I D O P I N G"
|
|
|
|
Private Sub CargaDocumentacionAntidoping()
|
|
|
|
Dim objRH As New ClsEdocumentacion
|
|
|
|
If objRH.DocumentacionElectronicaGet(CvePersonal, -1, -1, UsuarioActual.Empresa.CveEmpresa, -1) Then
|
|
DTDocumentacion = objRH.DtResultados
|
|
End If
|
|
|
|
If DTDocumentacion.FiltraParametros($" CveDocumentacionTipo = {If(UsuarioActual.CveEmpresa = 138, 21, 4)} ").Rows.Count > 0 Then
|
|
GvDocumentacionAntidoping.DataSource = DTDocumentacion.FiltraParametros($" CveDocumentacionTipo = {If(UsuarioActual.CveEmpresa = 138, 21, 4)} ")
|
|
Else
|
|
GvDocumentacionAntidoping.DataSource = Nothing
|
|
End If
|
|
objRH.Dispose()
|
|
GvDocumentacionAntidoping.DataBind()
|
|
UPGvDocumentosAntidoping.Update()
|
|
|
|
End Sub
|
|
|
|
Private Sub RegistraDescargaJavaScript(baseUrl As String)
|
|
|
|
RegistraScript("Download('" & baseUrl & "')")
|
|
|
|
End Sub
|
|
|
|
|
|
Public Sub UploadModal_ClickDocumentacionAntidoping(sender As Object, e As EventArgs)
|
|
|
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
|
|
|
Dim chkEstatus As CheckBox
|
|
CveDocumentacionElectronica = GvRow.DataKey("CveDocumentacionElectronica").ToString.ToEntero
|
|
CveDocumentacion = GvRow.DataKey("CveDocumentacion").ToString.ToEntero
|
|
Documentacion = GvRow.DataKey("Documentacion")
|
|
AdjuntoDocumentacion = GvRow.DataKey("Adjunto").ToString
|
|
|
|
DiasVigencia = GvRow.DataKey("DiasVigencia").ToString.ToEntero
|
|
Dim x As String = GvRow.DataKey("AplicaFechaVencimiento")
|
|
If GvRow.DataKey("AplicaFechaVencimiento") = "1" Then AplicaFechaVencimiento = True Else AplicaFechaVencimiento = False
|
|
|
|
chkEstatus = GvRow.FCCheckBox("chkEstatus")
|
|
|
|
If chkEstatus.Checked Then
|
|
Estatus = 1
|
|
Else
|
|
Estatus = 0
|
|
End If
|
|
|
|
If GvRow.DataKey("FechaVigencia").ToString.Length > 0 Then
|
|
FechaVigencia = GvRow.DataKey("FechaVigencia").ToString.ToDate
|
|
Else
|
|
FechaVigencia = Nothing
|
|
End If
|
|
|
|
ObservacionDocumentacion = GvRow.FCTextBox("TxtObservaciones").Text.Trim.ToUpper
|
|
FechaLimite = GvRow.FCTextBox("TxtFechaLimite").Text.ToDate
|
|
|
|
AdjuntoDocumentacion = GvRow.DataKey("Adjunto")
|
|
|
|
LtlModalTitleUploadDocumentoAntidoping.Text = "Subir " & Documentacion
|
|
|
|
UpModalTitleUploadDocumentoAntidoping.Update()
|
|
|
|
RegistraScript("$('#ModalUploadAntidopingDocumento').modal({ backdrop: 'static', keyboard: false});")
|
|
|
|
End Sub
|
|
|
|
Private Sub GuardarDocumentosAntidoping(Optional _CveDocumentacionExcluir As Integer = -1)
|
|
|
|
Dim hasError As Boolean = True
|
|
Dim objDocumentos As New ClsEdocumentacion
|
|
|
|
For Each dRow As GridViewRow In GvDocumentacionAntidoping.Rows
|
|
|
|
Dim _CveDocumentacion As Integer = dRow.DataKey("CveDocumentacion").ToString.ToEntero
|
|
Dim _Adjunto As String = dRow.DataKey("Adjunto")
|
|
'Dim _Documentacion As String = dRow.DataKey("Documentacion")
|
|
Dim _CveDocumentacionElectronica As Integer = dRow.DataKey("CveDocumentacionElectronica").ToString.ToEntero
|
|
Dim _txtObservaciones As TextBox = dRow.FCTextBox("TxtObservaciones")
|
|
Dim _TxtFechaLimite As TextBox = dRow.FCTextBox("TxtFechaLimite")
|
|
Dim _TxtFechaVigencia As TextBox = dRow.FCTextBox("TxtFechaVigencia")
|
|
Dim _FechaVigencia As Date
|
|
Dim _FechaLimite As Date
|
|
|
|
Dim DiasLimite As Integer = dRow.DataKey("DiasLimite").ToString.ToEntero
|
|
Dim AplicaDiasLimite As Boolean = If(dRow.DataKey("AplicaDiasLimite").ToString = "1", True, False)
|
|
Dim AplicaFechaVencimiento As Boolean = If(dRow.DataKey("AplicaFechaVencimiento").ToString = "1", True, False)
|
|
|
|
Dim chkEstatus As CheckBox = dRow.FCCheckBox("chkEstatus")
|
|
Dim _estatus As Integer
|
|
|
|
|
|
|
|
If chkEstatus.Checked Then
|
|
_estatus = 1
|
|
Else
|
|
_estatus = 0
|
|
End If
|
|
|
|
If _TxtFechaVigencia.Text.Length = 10 Then
|
|
_FechaVigencia = _TxtFechaVigencia.Text.ToDate
|
|
Else
|
|
_FechaVigencia = Nothing
|
|
End If
|
|
|
|
If Not AplicaDiasLimite Then
|
|
_FechaLimite = MinFecha
|
|
Else
|
|
_FechaLimite = _TxtFechaLimite.Text.ToDate
|
|
End If
|
|
|
|
If Not AplicaFechaVencimiento Then
|
|
_FechaVigencia = MinFecha
|
|
End If
|
|
|
|
If Not _CveDocumentacionExcluir = _CveDocumentacion Then
|
|
Try
|
|
If _CveDocumentacionElectronica = -1 Then
|
|
|
|
If objDocumentos.DocumentacionElectronicaAdd(_CveDocumentacion, CvePersonal, -1, -1, _estatus, _txtObservaciones.Text.Trim, _Adjunto, UsuarioActual.CveUsuario, _FechaLimite, _FechaVigencia) > 0 Then
|
|
Else
|
|
hasError = True
|
|
Exit For
|
|
End If
|
|
|
|
Else
|
|
If objDocumentos.DocumentacionElectronicaUpdate(_CveDocumentacionElectronica, _CveDocumentacion, CvePersonal, -1, -1, _estatus, _txtObservaciones.Text.Trim, _Adjunto, UsuarioActual.CveUsuario, _FechaLimite, _FechaVigencia) Then
|
|
Else
|
|
hasError = True
|
|
Exit For
|
|
End If
|
|
End If
|
|
|
|
hasError = False
|
|
Catch ex As Exception
|
|
hasError = True
|
|
Exit For
|
|
End Try
|
|
End If
|
|
Next
|
|
|
|
CargaDocumentacionAntidoping()
|
|
objDocumentos.Dispose()
|
|
End Sub
|
|
|
|
Protected Sub BtnModalDocumentoUpload_Click(sender As Object, e As EventArgs) Handles BtnModalAntidopingDocumentoUpload.Click
|
|
|
|
Dim FileExtension As String = "-1"
|
|
Dim Filesgral As List(Of Archivo) = TxtFileAntidoping.getfiles().Archivos
|
|
Dim Filename As String = ""
|
|
|
|
If AplicaFechaVencimiento And DiasVigencia > 0 Then
|
|
FechaVigencia = DateTime.Today.AddDays(DiasVigencia)
|
|
End If
|
|
|
|
For Each fileItem As Archivo In Filesgral
|
|
Try
|
|
|
|
FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
|
|
Dim tempArray() As String
|
|
tempArray = fileItem.filename.ToString().Split("-".ToCharArray())
|
|
|
|
Dim rutaDestino As String = UsuarioActual.Empresa.Ruta & "Personal\" & CvePersonal & "\" & Documentacion & "." & FileExtension
|
|
Dim rutaAdjuntoAnterior As String = UsuarioActual.Empresa.Ruta & "Personal\" & CvePersonal & "\" & AdjuntoDocumentacion
|
|
|
|
If Not System.IO.Directory.Exists(UsuarioActual.Empresa.Ruta & "Personal\" & CvePersonal & "\") Then
|
|
System.IO.Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "Personal\" & CvePersonal & "\")
|
|
End If
|
|
|
|
If File.Exists(rutaAdjuntoAnterior) And AdjuntoDocumentacion.Trim.Length > 0 Then
|
|
File.Delete(rutaAdjuntoAnterior)
|
|
End If
|
|
|
|
If System.IO.File.Exists(rutaDestino) Then
|
|
System.IO.File.Delete(rutaDestino)
|
|
End If
|
|
|
|
System.IO.File.Move(fileItem.FileUrl, rutaDestino)
|
|
|
|
Dim objRH As New ClsEdocumentacion
|
|
|
|
|
|
If CveDocumentacionElectronica = -1 Then
|
|
If objRH.DocumentacionElectronicaAdd(CveDocumentacion, CvePersonal, -1, -1, Estatus, ObservacionDocumentacion, Documentacion & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) > 0 Then
|
|
|
|
End If
|
|
Else
|
|
If objRH.DocumentacionElectronicaUpdate(CveDocumentacionElectronica, CveDocumentacion, CvePersonal, -1, -1, Estatus, ObservacionDocumentacion, Documentacion & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) Then
|
|
|
|
End If
|
|
End If
|
|
|
|
objRH.Dispose()
|
|
|
|
GuardarDocumentosAntidoping(CveDocumentacion)
|
|
CargaDocumentacionAntidoping()
|
|
TxtFileAntidoping.Text = ""
|
|
UpModalUploadAntidopingDocumento.Update()
|
|
|
|
Catch ex As Exception
|
|
OnError("Error al cargar archivo", ex)
|
|
End Try
|
|
|
|
Next
|
|
RegistraScript("$('#ModalUploadAntidopingDocumento').modal('hide')", "hidemodal3")
|
|
|
|
End Sub
|
|
|
|
|
|
Public Sub DownLoadFormato_ClickDocumentacion(sender As Object, e As EventArgs)
|
|
|
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
|
|
|
Dim CveDocumentacion As Integer = GvRow.DataKey("CveDocumentacion").ToString.ToEntero
|
|
Dim DocumentacionFormato As String = CveDocumentacion & "_" & GvRow.DataKey("DocumentacionFormato")
|
|
|
|
DescarFormato(DocumentacionFormato)
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub Antidoping()
|
|
Dim objRH As New ClsRH
|
|
|
|
If Not ExistePasoHistorial(8) Then
|
|
objRH.PersonalEstatusIngresoAdd(CvePersonal, 8, UsuarioActual.CveUsuario, "")
|
|
End If
|
|
|
|
objRH.Dispose()
|
|
End Sub
|
|
|
|
Public Sub Update_ClickDocumentacionAntidoping(sender As Object, e As EventArgs)
|
|
|
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
|
Dim activo As Boolean = False
|
|
|
|
Dim _CveDocumentacionElectronica As Integer = GvRow.DataKey("CveDocumentacionElectronica").ToString.ToEntero
|
|
Dim _CveDocumentacion As Integer = GvRow.DataKey("CveDocumentacion").ToEntero.ToEntero
|
|
Dim _Adjunto As String = GvRow.DataKey("Adjunto").ToString
|
|
Dim _fechaLimite As Date = GvRow.FCTextBox("TxtFechaLimite").Text.ToDate
|
|
|
|
Dim Observaciones As String = DirectCast(GvRow.FindControl("TxtObservaciones"), TextBox).Text
|
|
'Dim DDLEstatus As DropDownList = DirectCast(GvRow.FindControl("DDLEstatus"), DropDownList)
|
|
Dim chkCompleto As CheckBox = DirectCast(GvRow.FindControl("chkEstatus"), CheckBox)
|
|
|
|
If chkCompleto.Checked Then
|
|
Estatus = 1
|
|
Else
|
|
Estatus = 0
|
|
End If
|
|
|
|
Dim objRH As New ClsEdocumentacion
|
|
|
|
If Not _CveDocumentacionElectronica = -1 Then
|
|
If objRH.DocumentacionElectronicaUpdate(_CveDocumentacionElectronica, _CveDocumentacion, CvePersonal, -1, -1, Estatus, Observaciones, _Adjunto, UsuarioActual.CveUsuario, _fechaLimite) Then
|
|
Alert("Documento actualizado correctamente.", TipoMensaje.MsgInformacion)
|
|
End If
|
|
Else
|
|
If objRH.DocumentacionElectronicaAdd(_CveDocumentacion, CvePersonal, -1, -1, Estatus, Observaciones, _Adjunto, UsuarioActual.CveUsuario, _fechaLimite) > 0 Then
|
|
Alert("Documento actualizado correctamente.", TipoMensaje.MsgInformacion)
|
|
End If
|
|
End If
|
|
|
|
CargaDocumentacionAntidoping()
|
|
objRH.Dispose()
|
|
|
|
End Sub
|
|
|
|
Protected Sub GvDocumentacionAntidoping_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDocumentacionAntidoping.RowDataBound
|
|
|
|
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
|
|
Dim Adjunto As String = e.Row.DBCampo("Adjunto").ToString
|
|
Dim ImgDownLoadFormato As LinkButton = e.Row.FCLinkButton("ImgDownLoadFormato")
|
|
Dim ImgDownLoad As Literal = e.Row.FCLiteral("ImgDownLoad")
|
|
Dim ImgRequired As Literal = e.Row.FCLiteral("ImgRequired")
|
|
Dim txtFechaLimite As TextBox = e.Row.FCTextBox("TxtFechaLimite")
|
|
Dim txtFechaVigencia As TextBox = e.Row.FCTextBox("TxtFechaVigencia")
|
|
Dim requerido As Boolean = Convert.ToBoolean(e.Row.DBCampo("Requerido"))
|
|
Dim chkEstatus As CheckBox = e.Row.FCCheckBox("chkEstatus")
|
|
Dim documentacionFormato As String = e.Row.DBCampo("DocumentacionFormato").ToString
|
|
Dim Documentacion As String = e.Row.DBCampo("Documentacion").ToString
|
|
Dim _CveDocumentacion As Integer = e.Row.DBCampo("CveDocumentacion").ToString.ToEntero
|
|
Dim separado As Char() = ".".ToCharArray
|
|
Dim array() As String = Adjunto.Split(separado)
|
|
Dim extencion As String = ""
|
|
Dim existeAdjunto As Boolean = False
|
|
|
|
Dim DiasLimite As Integer = e.Row.DataKey("DiasLimite").ToString.ToEntero
|
|
Dim AplicaDiasLimite As Boolean = If(e.Row.DataKey("AplicaDiasLimite").ToString = "1", True, False)
|
|
Dim AplicaFechaVencimiento As Boolean = If(e.Row.DataKey("AplicaFechaVencimiento").ToString = "1", True, False)
|
|
|
|
txtFechaLimite.Visible = If(AplicaDiasLimite, True, False)
|
|
txtFechaVigencia.Visible = If(AplicaFechaVencimiento, True, False)
|
|
|
|
If AplicaFechaVencimiento And e.Row.DataKey("DiasVigencia").ToString.ToEntero > 0 Then
|
|
txtFechaVigencia.Enabled = False
|
|
End If
|
|
|
|
If e.Row.DBCampo("FechaVigencia").ToString.Length > 0 Then
|
|
txtFechaVigencia.Text = e.Row.DBCampo("FechaVigencia").ToString.ToDate.ToString("dd/MM/yyyy")
|
|
If DateTime.Today > e.Row.DBCampo("FechaVigencia").ToString.ToDateTime Then
|
|
txtFechaVigencia.ForeColor = Drawing.Color.Red
|
|
End If
|
|
End If
|
|
|
|
Dim scripMascara = "$('#" & txtFechaLimite.ClientID & "').mask('00/00/0000');$('#" & txtFechaVigencia.ClientID & "').mask('00/00/0000');"
|
|
RegistraScript(scripMascara, "scriptMascara")
|
|
|
|
If array.Length > 0 Then
|
|
extencion = array(array.Length - 1)
|
|
End If
|
|
|
|
If e.Row.DBCampo("Estatus").ToEntero = 1 Then
|
|
chkEstatus.Checked = True
|
|
Else
|
|
chkEstatus.Checked = False
|
|
End If
|
|
|
|
If documentacionFormato = "" Then
|
|
ImgDownLoadFormato.Visible = False
|
|
Else
|
|
Dim linkDescarga = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/Formatos/" & _CveDocumentacion & "_" & documentacionFormato
|
|
ImgDownLoadFormato.Visible = True
|
|
End If
|
|
|
|
txtFechaLimite.Text = e.Row.DBCampo("FechaLimite").ToString.ToDate.ToString("dd/MM/yyyy")
|
|
|
|
If e.Row.DBCampo("FechaVigencia").ToString.Length > 0 Then
|
|
txtFechaVigencia.Text = e.Row.DBCampo("FechaVigencia").ToString.ToDate.ToString("dd/MM/yyyy")
|
|
End If
|
|
|
|
If Adjunto.Trim.Length > 0 Then
|
|
|
|
Dim linkDescarga = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/Personal/" & CvePersonal & "/" & Adjunto
|
|
Dim linkDescargaArchivo = UsuarioActual.Empresa.Ruta & "Personal/" & CvePersonal & "/" & Adjunto
|
|
|
|
If File.Exists(linkDescargaArchivo) Then
|
|
|
|
ImgDownLoad.Visible = True
|
|
If extencion.Length > 0 Then
|
|
ImgDownLoad.Text = String.Format(" <a class='btn btn-circle btn-sm blue' href='{0}' target='_black' download='{1}'><i class='fa fa-download' title='Descargar documento'></i></a>", linkDescarga, CvePersonal & Documentacion & "." & extencion)
|
|
Else
|
|
ImgDownLoad.Text = String.Format(" <a class='btn btn-circle btn-sm blue' href='{0}' target='_black' download='{1}'><i class='fa fa-download' title='Descargar documento'></i></a>", linkDescarga, CvePersonal & Documentacion)
|
|
End If
|
|
Else
|
|
ImgDownLoad.Visible = False
|
|
End If
|
|
Else
|
|
ImgDownLoad.Visible = False
|
|
End If
|
|
|
|
If requerido Then
|
|
ImgRequired.Text = " <a class='btn btn-circle btn-sm yelow' href='#' data-toggle='tooltip' title='Requerido!' ><i class='fa fa-asterisk '></i></a>"
|
|
|
|
Else
|
|
' ImgRequired.Text = " <a class='btn btn-circle btn-sm grey-salt' href='#' data-toggle='tooltip' title='No obligatorio' ><i class='fa fa-asterisk '></i></a>"
|
|
End If
|
|
chkEstatus.Checked = ImgDownLoad.Visible
|
|
End If
|
|
|
|
End Sub
|
|
|
|
Private Sub ValidaGuardaAntidopingEvento()
|
|
|
|
Dim objEdoc As New ClsEdocumentacion
|
|
Dim objRH As New ClsRH
|
|
|
|
If objEdoc.DocumentacionElectronicaGet(CvePersonal, -1, -1, UsuarioActual.Empresa.CveEmpresa, If(UsuarioActual.CveEmpresa = 138, 21, 4)) Then
|
|
Dim insertar As Boolean = True
|
|
|
|
For Each drow As DataRow In objEdoc.DtResultados.Rows
|
|
|
|
Dim documentacionS As String = drow("Documentacion").ToString
|
|
If (drow("CveDocumentacionElectronica").ToString = "-1" And Boolean.Parse(drow("Requerido").ToString) = True Or Boolean.Parse((drow("Requerido").ToString)) = True And drow("Estatus").ToString.ToEntero = 0) Then
|
|
insertar = False
|
|
Alert("Hay documentos de antidoping requeridos que no han sido entregados.", TipoMensaje.MsgAdvertencia)
|
|
Exit For
|
|
Else
|
|
insertar = True
|
|
End If
|
|
Next
|
|
|
|
If insertar Then
|
|
|
|
If Not ExistePasoHistorial(5) Then
|
|
If objRH.PersonalEstatusIngresoAdd(CvePersonal, 5, UsuarioActual.CveUsuario, "") Then
|
|
PasoSiguiente()
|
|
End If
|
|
Else
|
|
PasoSiguiente()
|
|
End If
|
|
End If
|
|
End If
|
|
|
|
objEdoc.Dispose()
|
|
objRH.Dispose()
|
|
|
|
End Sub
|
|
|
|
|
|
#End Region
|
|
|
|
|
|
#Region "DOCUMENTOS FIRMA DE CONTRATOS"
|
|
|
|
Private Sub CargaDocumentacionFirmaDecontratos()
|
|
|
|
Dim objRH As New ClsEdocumentacion
|
|
|
|
If objRH.DocumentacionElectronicaGet(CvePersonal, -1, -1, UsuarioActual.Empresa.CveEmpresa, -1) Then
|
|
DTDocumentacion = objRH.DtResultados
|
|
End If
|
|
|
|
If DTDocumentacion.FiltraParametros($" CveDocumentacionTipo = {If(UsuarioActual.CveEmpresa = 138, 22, 7)} ").Rows.Count > 0 Then
|
|
GvDocumentosFirma.DataSource = DTDocumentacion.FiltraParametros($" CveDocumentacionTipo = {If(UsuarioActual.CveEmpresa = 138, 22, 7)} ")
|
|
Else
|
|
GvDocumentosFirma.DataSource = Nothing
|
|
End If
|
|
|
|
GvDocumentosFirma.DataBind()
|
|
objRH.Dispose()
|
|
UPGvDocumentosFirma.Update()
|
|
UpGvDocumentosFirma2.Update()
|
|
|
|
End Sub
|
|
|
|
|
|
Public Sub UploadModal_ClickDocumentacionFirmaContrato(sender As Object, e As EventArgs)
|
|
|
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
|
|
|
Dim chkEstatus As CheckBox
|
|
CveDocumentacionElectronica = GvRow.DataKey("CveDocumentacionElectronica").ToString.ToEntero
|
|
CveDocumentacion = GvRow.DataKey("CveDocumentacion").ToString.ToEntero
|
|
Documentacion = GvRow.DataKey("Documentacion")
|
|
AdjuntoDocumentacion = GvRow.DataKey("Adjunto").ToString
|
|
|
|
chkEstatus = GvRow.FCCheckBox("chkEstatus")
|
|
|
|
If GvRow.DataKey("FechaVigencia").ToString.Length > 0 Then
|
|
FechaVigencia = GvRow.DataKey("FechaVigencia").ToString.ToDate
|
|
Else
|
|
FechaVigencia = Nothing
|
|
End If
|
|
|
|
ObservacionDocumentacion = GvRow.FCTextBox("TxtObservaciones").Text.Trim.ToUpper
|
|
FechaLimite = GvRow.FCTextBox("TxtFechaLimite").Text.ToDate
|
|
|
|
AdjuntoDocumentacion = GvRow.DataKey("Adjunto")
|
|
|
|
LtlModalTitleUploadDocumentoAntidoping.Text = "Subir " & Documentacion
|
|
|
|
UpModalTitleUploadDocumentoAntidoping.Update()
|
|
|
|
RegistraScript("$('#ModalUploadFirmaContratoDocumento').modal({ backdrop: 'static', keyboard: false});")
|
|
|
|
|
|
End Sub
|
|
|
|
Private Sub GuardarDocumentosFirmaContrato(Optional _CveDocumentacionExcluir As Integer = -1)
|
|
|
|
Dim hasError As Boolean = True
|
|
Dim objDocumentos As New ClsEdocumentacion
|
|
|
|
For Each dRow As GridViewRow In GvDocumentosFirma.Rows
|
|
|
|
Dim _CveDocumentacion As Integer = dRow.DataKey("CveDocumentacion").ToString.ToEntero
|
|
Dim _Adjunto As String = dRow.DataKey("Adjunto")
|
|
'Dim _Documentacion As String = dRow.DataKey("Documentacion")
|
|
Dim _CveDocumentacionElectronica As Integer = dRow.DataKey("CveDocumentacionElectronica").ToString.ToEntero
|
|
Dim _txtObservaciones As TextBox = dRow.FCTextBox("TxtObservaciones")
|
|
Dim _TxtFechaLimite As TextBox = dRow.FCTextBox("TxtFechaLimite")
|
|
Dim _TxtFechaVigencia As TextBox = dRow.FCTextBox("TxtFechaVigencia")
|
|
|
|
Dim _FechaVigencia As Date
|
|
Dim _FechaLimite As Date
|
|
|
|
Dim DiasLimite As Integer = dRow.DataKey("DiasLimite").ToString.ToEntero
|
|
Dim AplicaDiasLimite As Boolean = If(dRow.DataKey("AplicaDiasLimite").ToString = "1", True, False)
|
|
Dim AplicaFechaVencimiento As Boolean = If(dRow.DataKey("AplicaFechaVencimiento").ToString = "1", True, False)
|
|
|
|
|
|
Dim chkEstatus As CheckBox = dRow.FCCheckBox("chkEstatus")
|
|
Dim _estatus As Integer
|
|
|
|
_estatus = If(chkEstatus.Checked, 1, 0)
|
|
|
|
If _TxtFechaVigencia.Text.Length = 10 Then
|
|
_FechaVigencia = _TxtFechaVigencia.Text.ToDate
|
|
Else
|
|
_FechaVigencia = Nothing
|
|
End If
|
|
|
|
If Not AplicaDiasLimite Then
|
|
_FechaLimite = MinFecha
|
|
Else
|
|
_FechaLimite = _TxtFechaLimite.Text.ToDate
|
|
End If
|
|
|
|
If Not AplicaFechaVencimiento Then
|
|
_FechaVigencia = MinFecha
|
|
End If
|
|
|
|
If Not _CveDocumentacionExcluir = _CveDocumentacion Then
|
|
Try
|
|
If _CveDocumentacionElectronica = -1 Then
|
|
If Not objDocumentos.DocumentacionElectronicaAdd(_CveDocumentacion, CvePersonal, -1, -1, _estatus, _txtObservaciones.Text.Trim, _Adjunto, UsuarioActual.CveUsuario, _FechaLimite, _FechaVigencia) > 0 Then
|
|
hasError = True
|
|
Exit For
|
|
End If
|
|
Else
|
|
If Not objDocumentos.DocumentacionElectronicaUpdate(_CveDocumentacionElectronica, _CveDocumentacion, CvePersonal, -1, -1, _estatus, _txtObservaciones.Text.Trim, _Adjunto, UsuarioActual.CveUsuario, _FechaLimite, _FechaVigencia) Then
|
|
hasError = True
|
|
Exit For
|
|
End If
|
|
End If
|
|
|
|
hasError = False
|
|
Catch ex As Exception
|
|
hasError = True
|
|
Exit For
|
|
End Try
|
|
End If
|
|
Next
|
|
|
|
CargaDocumentacionFirmaDecontratos()
|
|
objDocumentos.Dispose()
|
|
End Sub
|
|
|
|
Protected Sub BtnModalFirmaContratoDocumentoUpload_Click(sender As Object, e As EventArgs) Handles BtnModalFirmaContratoDocumentoUpload.Click
|
|
|
|
Dim FileExtension As String = "-1"
|
|
Dim Filesgral As List(Of Archivo) = TxtFileFirmaContrato.getfiles().Archivos
|
|
Dim Filename As String = ""
|
|
|
|
|
|
For Each fileItem As Archivo In Filesgral
|
|
Try
|
|
|
|
FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
|
|
Dim tempArray() As String
|
|
tempArray = fileItem.filename.ToString().Split("-".ToCharArray())
|
|
|
|
Dim rutaDestino As String = UsuarioActual.Empresa.Ruta & "Personal\" & CvePersonal & "\" & Documentacion & "." & FileExtension
|
|
Dim rutaAdjuntoAnterior As String = UsuarioActual.Empresa.Ruta & "Personal\" & CvePersonal & "\" & AdjuntoDocumentacion
|
|
|
|
If Not System.IO.Directory.Exists(UsuarioActual.Empresa.Ruta & "Personal\" & CvePersonal & "\") Then
|
|
System.IO.Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "Personal\" & CvePersonal & "\")
|
|
End If
|
|
|
|
If File.Exists(rutaAdjuntoAnterior) And AdjuntoDocumentacion.Trim.Length > 0 Then
|
|
File.Delete(rutaAdjuntoAnterior)
|
|
End If
|
|
|
|
If System.IO.File.Exists(rutaDestino) Then
|
|
System.IO.File.Delete(rutaDestino)
|
|
End If
|
|
|
|
System.IO.File.Move(fileItem.FileUrl, rutaDestino)
|
|
|
|
Dim objRH As New ClsEdocumentacion
|
|
|
|
If CveDocumentacionElectronica = -1 Then
|
|
If objRH.DocumentacionElectronicaAdd(CveDocumentacion, CvePersonal, -1, -1, 1, ObservacionDocumentacion, Documentacion & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) > 0 Then
|
|
|
|
End If
|
|
Else
|
|
If objRH.DocumentacionElectronicaUpdate(CveDocumentacionElectronica, CveDocumentacion, CvePersonal, -1, -1, 1, ObservacionDocumentacion, Documentacion & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) Then
|
|
|
|
End If
|
|
End If
|
|
|
|
objRH.Dispose()
|
|
|
|
GuardarDocumentosFirmaContrato(CveDocumentacion)
|
|
CargaDocumentacionFirmaDecontratos()
|
|
|
|
TxtFileDocumentacion.Text = ""
|
|
UpModalFirmaContratoDocumento.Update()
|
|
|
|
Catch ex As Exception
|
|
OnError("Error al cargar archivo", ex)
|
|
End Try
|
|
|
|
Next
|
|
RegistraScript("$('#ModalUploadFirmaContratoDocumento').modal('hide')", "hidemodal7")
|
|
|
|
End Sub
|
|
|
|
Private Sub FirmaContrato()
|
|
Dim objRH As New ClsRH
|
|
|
|
If Not ExistePasoHistorial(9) Then
|
|
objRH.PersonalEstatusIngresoAdd(CvePersonal, 9, UsuarioActual.CveUsuario, "")
|
|
End If
|
|
|
|
objRH.Dispose()
|
|
End Sub
|
|
|
|
Public Sub Update_ClickDocumentacionFirmaContrato(sender As Object, e As EventArgs)
|
|
|
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
|
Dim activo As Boolean = False
|
|
|
|
Dim _CveDocumentacionElectronica As Integer = GvRow.DataKey("CveDocumentacionElectronica").ToString.ToEntero
|
|
Dim _CveDocumentacion As Integer = GvRow.DataKey("CveDocumentacion").ToString.ToEntero
|
|
Dim _Adjunto As String = GvRow.DataKey("Adjunto").ToString
|
|
Dim _fechaLimite As Date = GvRow.FCTextBox("TxtFechaLimite").Text.ToDate
|
|
|
|
Dim Observaciones As String = DirectCast(GvRow.FindControl("TxtObservaciones"), TextBox).Text
|
|
'Dim DDLEstatus As DropDownList = DirectCast(GvRow.FindControl("DDLEstatus"), DropDownList)
|
|
Dim chkCompleto As CheckBox = DirectCast(GvRow.FindControl("chkEstatus"), CheckBox)
|
|
|
|
If chkCompleto.Checked Then
|
|
Estatus = 1
|
|
Else
|
|
Estatus = 0
|
|
End If
|
|
|
|
Dim objRH As New ClsEdocumentacion
|
|
|
|
If Not _CveDocumentacionElectronica = -1 Then
|
|
If objRH.DocumentacionElectronicaUpdate(_CveDocumentacionElectronica, _CveDocumentacion, CvePersonal, -1, -1, 1, Observaciones, _Adjunto, UsuarioActual.CveUsuario, _fechaLimite) Then
|
|
Alert("Documento actualizado correctamente.", TipoMensaje.MsgInformacion)
|
|
End If
|
|
Else
|
|
If objRH.DocumentacionElectronicaAdd(_CveDocumentacion, CvePersonal, -1, -1, 1, Observaciones, _Adjunto, UsuarioActual.CveUsuario, _fechaLimite) > 0 Then
|
|
Alert("Documento actualizado correctamente.", TipoMensaje.MsgInformacion)
|
|
End If
|
|
End If
|
|
|
|
CargaDocumentacionFirmaDecontratos()
|
|
objRH.Dispose()
|
|
|
|
End Sub
|
|
|
|
Protected Sub GvDocumentosFirma_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDocumentosFirma.RowDataBound
|
|
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
|
|
Dim Adjunto As String = e.Row.DBCampo("Adjunto").ToString
|
|
Dim ImgDownLoadFormato As LinkButton = e.Row.FCLinkButton("ImgDownLoadFormato")
|
|
Dim ImgDownLoad As Literal = e.Row.FCLiteral("ImgDownLoad")
|
|
Dim ImgRequired As Literal = e.Row.FCLiteral("ImgRequired")
|
|
Dim txtFechaLimite As TextBox = e.Row.FCTextBox("TxtFechaLimite")
|
|
Dim txtFechaVigencia As TextBox = e.Row.FCTextBox("TxtFechaVigencia")
|
|
Dim requerido As Boolean = Convert.ToBoolean(e.Row.DBCampo("Requerido"))
|
|
Dim chkEstatus As CheckBox = e.Row.FCCheckBox("chkEstatus")
|
|
Dim documentacionFormato As String = e.Row.DBCampo("DocumentacionFormato").ToString
|
|
Dim Documentacion As String = e.Row.DBCampo("Documentacion").ToString
|
|
Dim _CveDocumentacion As Integer = e.Row.DBCampo("CveDocumentacion").ToString.ToEntero
|
|
Dim separado As Char() = ".".ToCharArray
|
|
Dim array() As String = Adjunto.Split(separado)
|
|
Dim extencion As String = ""
|
|
Dim existeAdjunto As Boolean = False
|
|
|
|
Dim DiasLimite As Integer = e.Row.DataKey("DiasLimite").ToString.ToEntero
|
|
Dim AplicaDiasLimite As Boolean = If(e.Row.DataKey("AplicaDiasLimite").ToString = "1", True, False)
|
|
Dim AplicaFechaVencimiento As Boolean = If(e.Row.DataKey("AplicaFechaVencimiento").ToString = "1", True, False)
|
|
|
|
txtFechaLimite.Visible = If(AplicaDiasLimite, True, False)
|
|
txtFechaVigencia.Visible = If(AplicaFechaVencimiento, True, False)
|
|
|
|
'If _CveDocumentacion = 27 Then
|
|
' e.Row.Visible = False
|
|
'End If
|
|
|
|
|
|
Dim scripMascara = "$('#" & txtFechaLimite.ClientID & "').mask('00/00/0000');$('#" & txtFechaVigencia.ClientID & "').mask('00/00/0000');"
|
|
RegistraScript(scripMascara, "scriptMascara")
|
|
|
|
If array.Length > 0 Then
|
|
extencion = array(array.Length - 1)
|
|
End If
|
|
|
|
chkEstatus.Checked = If(e.Row.DBCampo("Estatus").ToEntero = 1, True, False)
|
|
|
|
If documentacionFormato = "" Then
|
|
ImgDownLoadFormato.Visible = False
|
|
Else
|
|
Dim linkDescarga = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/Formatos/" & _CveDocumentacion & "_" & documentacionFormato
|
|
ImgDownLoadFormato.Visible = True
|
|
End If
|
|
|
|
txtFechaLimite.Text = e.Row.DBCampo("FechaLimite").ToString.ToDate.ToString("dd/MM/yyyy")
|
|
|
|
If e.Row.DBCampo("FechaVigencia").ToString.Length > 0 Then
|
|
txtFechaVigencia.Text = e.Row.DBCampo("FechaVigencia").ToString.ToDate.ToString("dd/MM/yyyy")
|
|
End If
|
|
|
|
If Adjunto.Trim.Length > 0 Then
|
|
|
|
Dim linkDescarga = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/Personal/" & CvePersonal & "/" & Adjunto
|
|
Dim linkDescargaArchivo = UsuarioActual.Empresa.Ruta & "Personal/" & CvePersonal & "/" & Adjunto
|
|
|
|
If File.Exists(linkDescargaArchivo) Then
|
|
|
|
ImgDownLoad.Visible = True
|
|
If extencion.Length > 0 Then
|
|
ImgDownLoad.Text = String.Format(" <a class='btn btn-circle btn-sm blue' href='{0}' target='_black' download='{1}'><i class='fa fa-download' title='Descargar documento'></i></a>", linkDescarga, CvePersonal & Documentacion & "." & extencion)
|
|
Else
|
|
ImgDownLoad.Text = String.Format(" <a class='btn btn-circle btn-sm blue' href='{0}' target='_black' download='{1}'><i class='fa fa-download' title='Descargar documento'></i></a>", linkDescarga, CvePersonal & Documentacion)
|
|
End If
|
|
Else
|
|
ImgDownLoad.Visible = False
|
|
End If
|
|
Else
|
|
ImgDownLoad.Visible = False
|
|
End If
|
|
|
|
If requerido Then
|
|
ImgRequired.Text = " <a class='btn btn-circle btn-sm yelow' href='#' data-toggle='tooltip' title=' Requerido!' ><i class='fa fa-asterisk '></i></a>"
|
|
End If
|
|
|
|
'chkEstatus.Checked = ImgDownLoad.Visible
|
|
|
|
End If
|
|
|
|
End Sub
|
|
|
|
Private Function ValidaGuardaFirmaContratoEvento() As Boolean
|
|
Dim respuesta As Boolean
|
|
Dim objEdoc As New ClsEdocumentacion
|
|
Dim objRH As New ClsRH
|
|
|
|
If objEdoc.DocumentacionElectronicaGet(CvePersonal, -1, -1, UsuarioActual.CveEmpresa, If(UsuarioActual.CveEmpresa = 138, 22, 7)) Then
|
|
For Each drow As DataRow In objEdoc.DtResultados.Rows
|
|
Dim documentacionS As String = drow("Documentacion").ToString
|
|
If (drow("CveDocumentacionElectronica").ToString = "-1" And Boolean.Parse(drow("Requerido").ToString) = True Or Boolean.Parse((drow("Requerido").ToString)) = True And drow("Estatus").ToString.ToEntero = 0) Then
|
|
respuesta = False
|
|
Exit For
|
|
Else
|
|
respuesta = True
|
|
End If
|
|
Next
|
|
End If
|
|
objEdoc.Dispose()
|
|
objRH.Dispose()
|
|
Return respuesta
|
|
End Function
|
|
|
|
Protected Sub BtnFinalizar_Click(sender As Object, e As EventArgs) Handles BtnFinalizar.Click
|
|
|
|
GuardarDocumentosFirmaContrato()
|
|
|
|
|
|
Dim objRh As New ClsRH
|
|
|
|
Dim fechafinContrato As Date
|
|
|
|
If TxtFechaFin.Text.Length = 10 Then
|
|
fechafinContrato = TxtFechaFin.Text.ToDate
|
|
Else
|
|
fechafinContrato = Nothing
|
|
End If
|
|
Dim CveCaptacion As Integer = If(DdlCaptacion.SelectedValue.ToEntero = 0, -1, DdlCaptacion.SelectedValue.ToEntero)
|
|
|
|
Edad = Now.Year - TxtFechaN4.Text.ToDate.Year
|
|
|
|
If ValidaGuardaFirmaContratoEvento() Then
|
|
If objRh.PersonalReclutamientoUpdate(CvePersonal, TxtNombres4.Text, TxtAPaterno4.Text, TxtAmaterno4.Text, TxtEstatura4.Text.ToDecimal, TxtPeso4.Text.ToDecimal,
|
|
TxtLugarnacimiento4.Text, TxtContactoEmergencia4.Text, TxtTipoSangre4.Text, TxtViveCon4.Text, txtCasaDondevive4.Text, DDLEstadoCivil4.Text.ToEntero,
|
|
Convert.ToInt32(chkInfonavid4.Checked), TxtAbonomensual4.Text.ToDecimal, TxtCamimones4.Text, Convert.ToInt32(chkTrabajoAnterior4.Checked),
|
|
TxtTrbajoDetalle4.Text, Convert.ToInt32(chkParientesempresa4.Checked), Convert.ToInt32(chkDelito4.Checked), TxtObserbacion4.Text, TxtDomicilio4.Text,
|
|
TxtCalleNumero4.Text, TxtColonia4.Text, TxtCodigoPostal4.Text, TxtTelLocal4.Text, TxtCell4.Text, TxtEmail4.Text,
|
|
TxtSeguroSocial4.Text, TxtLicencia4.Text, DDLTipoLicencia4.SelectedValue.ToEntero, TxtCartilla4.Text, TxtCurp4.Text.Trim.ToUpper,
|
|
Convert.ToInt32(ChkAceptaAntidiping4.Checked), TxtObservaciones4.Text, 1, Edad,
|
|
TxtFechaN4.Text.ToDate, TxtCredencialElector4.Text, txtLt.Text, txtLg.Text, UsuarioActual.CveUsuario, DdlEmpresaAsiganada.SelectedValue.ToEntero, 1,
|
|
DdlEmpresaAsiganada.SelectedValue.ToEntero, TxtFechaInicio.Text.ToDate, URL, "-1", DDLUsuarioNomina.SelectedValue.ToEntero, TxtRFC4.Text.Trim.ToUpper,
|
|
CveCaptacion, TxtMedioCaptacion.Text, ddlPuesto.SelectedValue.ToEntero, DdlCliente.SelectedValue.ToEntero, CveSubProyectoZona, fechafinContrato,
|
|
CveGenero:=DdlSexo.SelectedValue.ToEntero, CveSubProyecto:=CveSubProyecto, CveUniforme:=DdlUniforme.SelectedValue.ToEntero,
|
|
CveEscolaridad:=DdlEscolaridad.SelectedValue.ToEntero, CveRuta:=DdlRuta.SelectedValue.ToEntero) Then
|
|
|
|
|
|
If Not ExistePasoHistorial(9) Then
|
|
objRh.PersonalEstatusIngresoAdd(CvePersonal, 9, UsuarioActual.CveUsuario, "")
|
|
End If
|
|
|
|
EviarCorreoNomista()
|
|
|
|
Alert("El personal concluyó el proceso de reclutamiento. <br />Se envió un correo al departamento de nóminas para continuar con el proceso", TipoMensaje.MsgInformacion, "document.location.href=""/RH/CatPersonal.aspx""")
|
|
|
|
End If
|
|
FirmaContrato()
|
|
Else
|
|
Alert("Existen documentos de firma de contratos requeridos que estan pendientes de entregar.", TipoMensaje.MsgAdvertencia)
|
|
End If
|
|
|
|
CargaDocumentacionFirmaDecontratos()
|
|
|
|
objRh.Dispose()
|
|
End Sub
|
|
|
|
Private Sub CargaCobosFirma()
|
|
ddlPuesto.Items.Clear()
|
|
DdlCliente.Items.Clear()
|
|
DdlRuta.Items.Clear()
|
|
|
|
|
|
If Not UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122) Then
|
|
DDLUsuarioNomina.Items.Clear()
|
|
End If
|
|
|
|
|
|
DdlUniforme.Items.Clear()
|
|
|
|
|
|
If DdlEmpresaAsiganada.SelectedIndex > 0 Then
|
|
ddlPuesto.DataSource = GlobalDTRHPuestos(DdlEmpresaAsiganada.SelectedValue.ToEntero)
|
|
|
|
'If GlobalDTSubProyectos(-1, CveEmpresa:=DdlEmpresaAsiganada.SelectedValue.ToEntero).FiltraParametros($"SubProyecto = '{DdlSubproyecto.SelectedItem.Text}'").Rows.Count > 0 Then
|
|
' CveSubProyecto = GlobalDTSubProyectos(-1, CveEmpresa:=DdlEmpresaAsiganada.SelectedValue.ToEntero).FiltraParametros($"SubProyecto = '{DdlSubproyecto.SelectedItem.Text}'").Rows(0)("CveSubProyecto").ToString.ToEntero
|
|
' DdlCliente.DataSource = GlobalDTCliente(DdlEmpresaAsiganada.SelectedValue.ToEntero).FiltraParametros($"CveSucursal = {CveSubProyecto}")
|
|
|
|
'If UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122) Then
|
|
DdlCliente.DataSource = GlobalDTCliente(7)
|
|
'End If
|
|
|
|
'End If
|
|
|
|
DdlRuta.DataSource = GlobalDTRutas(DdlEmpresaAsiganada.SelectedValue.ToEntero)
|
|
|
|
If Not UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122) Then
|
|
DDLUsuarioNomina.DataSource = GlobalDTUsuarios(-1, DdlEmpresaAsiganada.SelectedValue.ToEntero)
|
|
End If
|
|
|
|
Dim objRH As New ClsRH
|
|
If objRH.UniformeGet(-1, 1, DdlEmpresaAsiganada.SelectedValue.ToEntero) Then
|
|
DdlUniforme.DataSource = objRH.DtResultados
|
|
End If
|
|
|
|
If DdlSubproyectoZona.SelectedValue.ToEntero > 0 And CveSubProyecto > 0 Then
|
|
If objRH.SubproyectoZonaGet(-1, CveSubProyecto, DdlEmpresaAsiganada.SelectedValue.ToEntero) Then
|
|
If objRH.DtResultados.FiltraParametros($"SubProyectoZona = '{DdlSubproyectoZona.SelectedItem.Text}'").Rows.Count > 0 Then
|
|
CveSubProyectoZona = objRH.DtResultados.FiltraParametros($"SubProyectoZona = '{DdlSubproyectoZona.SelectedItem.Text}'").Rows(0)("CveSubProyectoZona").ToString.ToEntero
|
|
End If
|
|
End If
|
|
End If
|
|
|
|
objRH.Dispose()
|
|
|
|
End If
|
|
|
|
ddlPuesto.DataBind()
|
|
ddlPuesto.Items.Insert(0, New ListItem("Seleccione un puesto", "-1"))
|
|
|
|
DdlCliente.DataBind()
|
|
DdlCliente.Items.Insert(0, New ListItem("Seleccione un cliente", "-1"))
|
|
|
|
DdlRuta.DataBind()
|
|
DdlRuta.Items.Insert(0, New ListItem("Seleccione una ruta", "-1"))
|
|
|
|
DDLUsuarioNomina.DataBind()
|
|
|
|
If Not UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122) Then
|
|
DDLUsuarioNomina.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
|
|
End If
|
|
|
|
DdlUniforme.DataBind()
|
|
DdlUniforme.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
|
|
|
|
UpAsignaciones.Update()
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
#End Region
|
|
|
|
#Region "DESCARTAR CANDIDATO"
|
|
|
|
'Private Sub btnDescartarCandidato_Click(sender As Object, e As EventArgs) Handles btnDescartarCandidato.Click
|
|
' RegistraScript("$('#ModalDescartar').modal({ backdrop: 'static', keyboard: false});")
|
|
'End Sub
|
|
|
|
Private Sub LnkDescartarCandidato_Click(sender As Object, e As EventArgs) Handles LnkDescartarCandidato.Click
|
|
RegistraScript("$('#ModalDescartar').modal({ backdrop: 'static', keyboard: false});")
|
|
End Sub
|
|
|
|
Private Sub BtnModalDescartarCandidato_Click(sender As Object, e As EventArgs) Handles BtnModalDescartarCandidato.Click
|
|
|
|
|
|
Dim objRH As New ClsRH
|
|
|
|
If objRH.DescartarCandidato(TxtModalCveCandidato.Text.ToEntero, TxtModalDescartaCandidato.Text.Trim, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
|
Response.Redirect("Reclutamiento.aspx?CvePersonal=" & TxtModalCveCandidato.Text)
|
|
End If
|
|
|
|
' RegistraScript("$('#ModalDescartar').modal('hide');")
|
|
|
|
objRH.Dispose()
|
|
|
|
End Sub
|
|
|
|
|
|
<WebMethod()>
|
|
Public Shared Function Descartados(RFC As String, CURP As String, CveEmpresa As Integer, CvePersonalCliente As Integer) As String
|
|
|
|
Dim objRH As New ClsRH
|
|
|
|
Dim respuesta As String = "|||"
|
|
|
|
If objRH.DescartarCandidatoGet(RFC, CURP, CveEmpresa, CvePersonalCliente) Then
|
|
|
|
If objRH.DtResultados.Rows.Count > 0 Then
|
|
respuesta = String.Format("{0}|{1}|{2}|{3}|{4}|{5}|{6}", objRH.DtResultados(0)("RFC").ToString, objRH.DtResultados(0)("MotivoDescartado").ToString, objRH.DtResultados(0)("FechaDescartado").ToString, objRH.DtResultados(0)("CvePersonal").ToString, objRH.DtResultados(0)("CveEstatusPersonal"), objRH.DtResultados(0)("NombreCompleto"), objRH.DtResultados(0)("CURP").ToString)
|
|
End If
|
|
|
|
End If
|
|
|
|
' RegistraScript("$('#ModalDescartar').modal('hide');")
|
|
|
|
objRH.Dispose()
|
|
|
|
|
|
|
|
Return respuesta
|
|
|
|
End Function
|
|
|
|
Private Sub BtnModalActivarCandidato_Click(sender As Object, e As EventArgs) Handles BtnModalActivarCandidato.Click
|
|
Dim objRH As New ClsRH
|
|
|
|
If objRH.DescartarCandidato(TxtModalCveCandidato.Text.ToEntero, TxtModalDescartaCandidato.Text.Trim, 0, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
|
|
|
Response.Redirect("Reclutamiento.aspx?CvePersonal=" & TxtModalCveCandidato.Text)
|
|
|
|
End If
|
|
|
|
' RegistraScript("$('#ModalDescartar').modal('hide');")
|
|
|
|
objRH.Dispose()
|
|
End Sub
|
|
|
|
Private Sub DdlEmpresaAsiganada_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlEmpresaAsiganada.SelectedIndexChanged
|
|
|
|
CargaCobosFirma()
|
|
|
|
UPBtnFirmaContrato.Update()
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
Private Sub OcultarMostarControlesCreditoInfonavit()
|
|
If chkInfonavid4.Checked Then
|
|
DvAbonomensual.Visible = True
|
|
DvInfonavitNo.Visible = True
|
|
If CvePersonal > 0 Then
|
|
DivRetencionInfonavit.Visible = True
|
|
End If
|
|
Else
|
|
DvAbonomensual.Visible = False
|
|
DvInfonavitNo.Visible = False
|
|
DivRetencionInfonavit.Visible = False
|
|
End If
|
|
UpCredito.Update()
|
|
UPRetencionInfonavit.Update()
|
|
End Sub
|
|
|
|
Private Sub chkInfonavid4_CheckedChanged(sender As Object, e As EventArgs) Handles chkInfonavid4.CheckedChanged
|
|
OcultarMostarControlesCreditoInfonavit()
|
|
End Sub
|
|
'Private Sub CargaPuestoClienteCombos()
|
|
' If DdlEmpresaAsiganada.SelectedIndex > 0 Then
|
|
' ddlPuesto.DataSource = GlobalDTRHPuestos(DdlEmpresaAsiganada.SelectedValue.ToEntero)
|
|
' ddlPuesto.DataBind()
|
|
' ddlPuesto.Items.Insert(0, New ListItem("Seleccione un puesto", "-1"))
|
|
|
|
|
|
' DdlCliente.DataSource = GlobalDTCliente(DdlEmpresaAsiganada.SelectedValue.ToEntero)
|
|
' DdlCliente.DataBind()
|
|
|
|
' DdlCliente.Items.Insert(0, New ListItem("Seleccione un cliente", "-1"))
|
|
|
|
|
|
' End If
|
|
'End Sub
|
|
'Public Shared Function DataSetToJSON(ds As DataSet) As String
|
|
|
|
' Dim dict As New Dictionary(Of String, Object)()
|
|
' For Each dt As DataTable In ds.Tables
|
|
' Dim arr As Object() = New Object(dt.Rows.Count) {}
|
|
|
|
' For i As Integer = 0 To dt.Rows.Count - 1
|
|
' arr(i) = dt.Rows(i).ItemArray
|
|
' Next
|
|
|
|
' dict.Add(dt.TableName, arr)
|
|
' Next
|
|
|
|
' Dim json As New JavaScriptSerializer()
|
|
' Return json.Serialize(dict)
|
|
'End Function
|
|
|
|
#End Region
|
|
|
|
|
|
Private Sub DdlSubproyecto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlSubproyecto.SelectedIndexChanged
|
|
CargaSubProyectosZona()
|
|
End Sub
|
|
|
|
Private Sub CargaSubProyectosZona()
|
|
DdlSubproyectoZona.Items.Clear()
|
|
|
|
If DdlSubproyecto.SelectedIndex > 0 Then
|
|
DdlSubproyectoZona.DataSource = DTSubproyectoZona.FiltraParametros($"CveSubProyecto ={DdlSubproyecto.SelectedValue.ToEntero}")
|
|
Else
|
|
DdlSubproyectoZona.DataSource = Nothing
|
|
End If
|
|
|
|
DdlSubproyectoZona.DataBind()
|
|
DdlSubproyectoZona.Items.Add(New ListItem("Seleccione uno", "-1"))
|
|
UpRowDos.Update()
|
|
End Sub
|
|
|
|
Private Sub chkTrabajoAnterior4_CheckedChanged(sender As Object, e As EventArgs) Handles chkTrabajoAnterior4.CheckedChanged
|
|
|
|
If chkTrabajoAnterior4.Checked Then
|
|
TxtTrbajoDetalle4.Enabled = True
|
|
Else
|
|
TxtTrbajoDetalle4.Enabled = False
|
|
TxtTrbajoDetalle4.Text = ""
|
|
End If
|
|
UpDvTrabajoAnterior.Update()
|
|
End Sub
|
|
|
|
Private Sub chkDelito4_CheckedChanged(sender As Object, e As EventArgs) Handles chkDelito4.CheckedChanged
|
|
If chkDelito4.Checked Then
|
|
TxtObserbacion4.Enabled = True
|
|
Else
|
|
TxtObserbacion4.Enabled =
|
|
TxtObserbacion4.Text = ""
|
|
End If
|
|
UpDvDelito.Update()
|
|
End Sub
|
|
|
|
Private Sub chkParientesempresa4_CheckedChanged(sender As Object, e As EventArgs) Handles chkParientesempresa4.CheckedChanged
|
|
|
|
If chkParientesempresa4.Checked Then
|
|
TxtParientesEmpresaDetalle.Enabled = True
|
|
Else
|
|
TxtParientesEmpresaDetalle.Enabled = False
|
|
TxtParientesEmpresaDetalle.Text = ""
|
|
End If
|
|
UpDvParientesEmpresa.Update()
|
|
End Sub
|
|
|
|
|
|
#Region "Correo nominista"
|
|
|
|
Private Sub EviarCorreoNomista()
|
|
|
|
|
|
Dim CorreoNominista As String = GlobalDTUsuarios(CveUsuario:=DDLUsuarioNomina.SelectedValue.ToEntero).Rows(0)("Correo").ToString
|
|
Dim correo As New ClsSisMail
|
|
Dim Cuerpo As New StringBuilder
|
|
'CorreoNominista = "pruebaad@outlook.com"
|
|
|
|
If CorreoNominista = "" Then
|
|
Alert("No se envio el correo de notificación a nominas, el nominista no tiene correo electronico", TipoMensaje.MsgAdvertencia)
|
|
Exit Sub
|
|
|
|
End If
|
|
|
|
Dim Puesto As String = ""
|
|
Dim Padre As String = ""
|
|
Dim Madre As String = ""
|
|
Dim FechaIngreso As String = ""
|
|
|
|
Dim objRH As New ClsRH
|
|
|
|
If objRH.PersonalFamiliaresGet(-1, CvePersonal) Then
|
|
|
|
Dim DtFamiliares As DataTable = objRH.DtResultados.FiltraParametros(" CveParentesco = 1 ")
|
|
|
|
If DtFamiliares.Rows.Count > 0 Then
|
|
Padre = DtFamiliares.Rows(0)("Nombre").ToString
|
|
End If
|
|
|
|
DtFamiliares = objRH.DtResultados.FiltraParametros(" CveParentesco = 2 ")
|
|
|
|
If DtFamiliares.Rows.Count > 0 Then
|
|
Madre = DtFamiliares.Rows(0)("Nombre").ToString
|
|
End If
|
|
|
|
End If
|
|
|
|
objRH.Dispose()
|
|
Cuerpo.AppendLine("<table border='0' style='width:100%'>")
|
|
Cuerpo.AppendLine($"<tr><td style=' font-size:large;'>{ UsuarioActual.Empresa.Empresa }<br/></td><td style='width:20%'> </td><td style='text-align: right;'>{ Now.ToShortDateString } { Now.ToShortTimeString } <br/></td> </tr>")
|
|
Cuerpo.AppendLine("<tr><td style=' font-size:large; text-align: left;' colspan='3'>Notificacion por Alta de Nomina</td></tr>")
|
|
Cuerpo.AppendLine("</table>")
|
|
|
|
Cuerpo.AppendLine("<br/>")
|
|
Cuerpo.AppendLine("<br/>")
|
|
|
|
Cuerpo.AppendLine("<table border='0'>")
|
|
Cuerpo.AppendLine($"<tr><td style='text-align: center; font-weight:bold; font-size:medium;' colspan='2'>Datos del Candidato</td></tr>")
|
|
Cuerpo.AppendLine($"<tr><td style='text-align: right;'>Puesto:</td><td style=' text-align: left; font-weight:bold;'>{IIf(ddlPuesto.SelectedIndex > 0, ddlPuesto.SelectedItem.Text, "") }</td></tr>")
|
|
Cuerpo.AppendLine($"<tr><td style='text-align: right;'>Ruta/Servicio:</td><td style=' text-align: left; font-weight:bold;'>{ DdlRuta.SelectedItem.Text }</td></tr>")
|
|
Cuerpo.AppendLine($"<tr><td style='text-align: right;'>Fecha de ingreso:</td><td style=' text-align: left; font-weight:bold;'>{TxtFechaInicio.Text}</td></tr>")
|
|
Cuerpo.AppendLine($"<tr><td style='text-align: right;'>Nombre:</td><td style=' text-align: left; font-weight:bold;'>{ NombreCompleto }</td></tr>")
|
|
Cuerpo.AppendLine($"<tr><td style='text-align: right;'>Fecha y Lugar de Nacimiento:</td><td style=' text-align: left; font-weight:bold;'>{TxtFechaN4.Text} {TxtLugarnacimiento4.Text}</td></tr>")
|
|
Cuerpo.AppendLine($"<tr><td style='text-align: right;'>Numero IMSS:</td><td style=' text-align: left; font-weight:bold;'>{ TxtSeguroSocial4.Text }</td></tr>")
|
|
Cuerpo.AppendLine($"<tr><td style='text-align: right;'>Numero Infonavit:</td><td style=' text-align: left; font-weight:bold;'>{ If(TxtInfonavitNo.Text.Trim = "", "NO CUENTA CON CREDITO", TxtInfonavitNo.Text) }</td></tr>")
|
|
Cuerpo.AppendLine($"<tr><td style='text-align: right;'>Sexo:</td><td style=' text-align: left; font-weight:bold;'>{ IIf(DdlSexo.SelectedValue = "1", "Masculino", "Femenino") }</td></tr>")
|
|
Cuerpo.AppendLine($"<tr><td style='text-align: right;'>R.F.C.:</td><td style=' text-align: left; font-weight:bold;'>{ TxtRFC4.Text }</td></tr>")
|
|
Cuerpo.AppendLine($"<tr><td style='text-align: right;'>CURP:</td><td style=' text-align: left; font-weight:bold;'>{ TxtCurp4.Text }</td></tr>")
|
|
Cuerpo.AppendLine($"<tr><td style='text-align: right;'>Nombre del Padre:</td><td style=' text-align: left; font-weight:bold;'>{ Padre }</td></tr>")
|
|
Cuerpo.AppendLine($"<tr><td style='text-align: right;'>Nombre de la Madre:</td><td style=' text-align: left; font-weight:bold;'>{ Madre }</td></tr>")
|
|
Cuerpo.AppendLine($"<tr><td style='text-align: right;'>Dirección:</td><td style=' text-align: left; font-weight:bold;'>{ TxtDomicilio4.Text }</td></tr>")
|
|
Cuerpo.AppendLine($"<tr><td style='text-align: right;'>Escolaridad:</td><td style=' text-align: left; font-weight:bold;'>{ IIf(DdlEscolaridad.SelectedIndex > 0, DdlEscolaridad.SelectedItem.Text, "") }</td></tr>")
|
|
Cuerpo.AppendLine($"<tr><td style='text-align: right;'>Telefono:</td><td style=' text-align: left; font-weight:bold;'>{ TxtCell4.Text},{TxtTelLocal4.Text}</td></tr>")
|
|
Cuerpo.AppendLine($"<tr><td style='text-align: right;'>Tel en Caso de Emergencia:</td><td style=' text-align: left; font-weight:bold;'>{ TxtContactoEmergencia4.Text }</td></tr>")
|
|
Cuerpo.AppendLine($"<tr><td style='text-align: right;'>Correo:</td><td style=' text-align: left; font-weight:bold;'>{ TxtEmail4.Text }</td></tr>")
|
|
Cuerpo.AppendLine("</table>")
|
|
|
|
correo.SendMail(EmpresaNotificaciones, CorreoNominista, "Notificacion por Alta de Nomina: " & NombreCompleto, Cuerpo.ToString)
|
|
|
|
End Sub
|
|
Protected Sub LnkPruebaEnviarCorreo_Click(sender As Object, e As EventArgs)
|
|
EviarCorreoNomista()
|
|
End Sub
|
|
#End Region
|
|
|
|
#Region "PASO 1 - HOJA RETENCION INFONAVIT"
|
|
Protected Sub CargaGVHojaRetencion()
|
|
|
|
Dim dt As New DataTable()
|
|
dt.Columns.Add("Documentacion")
|
|
dt.Columns.Add("Estatus")
|
|
|
|
Dim row As DataRow = dt.NewRow()
|
|
row("Documentacion") = "Hoja de Retención"
|
|
row("Estatus") = "False"
|
|
|
|
dt.Rows.Add(row)
|
|
|
|
GVRetencionInfonavit.DataSource = dt
|
|
GVRetencionInfonavit.DataBind()
|
|
|
|
UPRetencionInfonavit.Update()
|
|
|
|
End Sub
|
|
|
|
Protected Sub ImgUploadRetencionInfonavit_Click(sender As Object, e As EventArgs)
|
|
AplicaDocumentacion = False
|
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
|
|
|
Dim chkEstatus As CheckBox
|
|
|
|
Documentacion = "Hoja de Retencion"
|
|
|
|
chkEstatus = GvRow.FCCheckBox("chkEstatus")
|
|
|
|
If chkEstatus.Checked Then
|
|
Estatus = 1
|
|
Else
|
|
Estatus = 0
|
|
End If
|
|
|
|
LtlModalUploadTitulo.Text = "Subir " & Documentacion
|
|
|
|
UpModalTitleUploadDocumento.Update()
|
|
|
|
RegistraScript("$('#ModalUploadDoc').modal({ backdrop: 'static', keyboard: false});")
|
|
End Sub
|
|
|
|
Private Function DescargarArchivo(NombreDocumento As String) As String
|
|
Dim path As String = UsuarioActual.Empresa.Ruta & "Personal\" & CvePersonal & "\"
|
|
Dim file As System.IO.FileInfo = New System.IO.FileInfo(path)
|
|
Dim Directorio As String = String.Format("{0}{1}{2}\", UsuarioActual.Empresa.Ruta, "Personal\", CvePersonal)
|
|
|
|
If Directory.Exists(Directorio) Then
|
|
Dim fileEntries As String() = Directory.GetFiles(Directorio)
|
|
|
|
For Each fileName As String In fileEntries
|
|
Dim fileActual As System.IO.FileInfo = New System.IO.FileInfo(fileName)
|
|
Dim separado As Char() = ".".ToCharArray
|
|
Dim array() As String = fileActual.Name.Split(separado)
|
|
Dim nombreSinExtencion As String = fileActual.Name.Split(".".ToCharArray)(0)
|
|
If NombreDocumento = nombreSinExtencion Then
|
|
file = fileActual
|
|
End If
|
|
Next
|
|
|
|
If file.Exists Then
|
|
Return UsuarioActual.Empresa.Ruta & "Personal/" & CvePersonal & "/" & file.Name
|
|
End If
|
|
End If
|
|
|
|
Return ""
|
|
End Function
|
|
|
|
Protected Sub GVRetencionInfonavit_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
|
|
Dim ImgDownLoad As Literal = e.Row.FCLiteral("ImgDownLoad")
|
|
|
|
If CvePersonal > 0 Then
|
|
Dim RutaArchivo As String = DescargarArchivo("Hoja de Retencion")
|
|
|
|
If RutaArchivo.Trim.Length > 0 Then
|
|
|
|
If File.Exists(RutaArchivo) Then
|
|
Dim file As System.IO.FileInfo = New System.IO.FileInfo(RutaArchivo)
|
|
Dim RutaDescarga As String = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/Personal/" & CvePersonal & "/" & file.Name
|
|
|
|
If file.Extension.Length > 0 Then
|
|
ImgDownLoad.Text = String.Format(" <a class='btn btn-circle btn-sm blue' href='{0}' target='_black' download='{1}'><i class='fa fa-download' title='Descargar documento'></i></a>", RutaDescarga, CvePersonal & file.Name & "." & file.Extension)
|
|
ImgDownLoad.Visible = True
|
|
e.Row.FCCheckBox("chkEstatus").Checked = True
|
|
End If
|
|
Else
|
|
ImgDownLoad.Visible = False
|
|
e.Row.FCCheckBox("chkEstatus").Checked = False
|
|
End If
|
|
|
|
Else
|
|
ImgDownLoad.Visible = False
|
|
End If
|
|
End If
|
|
e.Row.FCCheckBox("chkEstatus").Enabled = False
|
|
|
|
End If
|
|
End Sub
|
|
|
|
#End Region
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
End Class |