From 242ef3e3bf1788687efdde493ce79e9335f0a819 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 29 May 2025 09:34:02 -0700 Subject: [PATCH] -- ajustes EMD --- RH/Personal.aspx | 107 +++++++++++- RH/Personal.aspx.vb | 402 ++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 493 insertions(+), 16 deletions(-) diff --git a/RH/Personal.aspx b/RH/Personal.aspx index 6b892cc1b..52063f1c9 100644 --- a/RH/Personal.aspx +++ b/RH/Personal.aspx @@ -537,6 +537,9 @@ +
+
+ @@ -640,8 +643,32 @@ + +
+ + + + + + + + + +
- +
+ + + + + + + + + + + +
@@ -921,6 +948,80 @@
+ +
+
+
+ + - +
+
+
+
+
+
+
+ + + + + + + + + + + + + + + <%-- --%> + + + + <%----%> + + + + + + + + + + + + + + + + + + + + + + + > + + + + + + > + + + + + + + +
+
+ +
@@ -4167,7 +4268,7 @@
- Documentos Firma de contratos + Documentos
@@ -4912,7 +5013,7 @@ diff --git a/RH/Personal.aspx.vb b/RH/Personal.aspx.vb index bd787ed99..f463dc5bc 100644 --- a/RH/Personal.aspx.vb +++ b/RH/Personal.aspx.vb @@ -69,6 +69,44 @@ Partial Class RH_Personal ViewState("DTCuentasBancos") = 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 Private Property DTLicencias As DataTable Get Return CType(ViewState("DTLicencias"), DataTable) @@ -972,6 +1010,12 @@ Partial Class RH_Personal CargaRegistroPatronal() CargaOutSourcing() CargaDDlPersonalRefsReference() + + If UsuarioActual.CveEmpresa = 13 AndAlso UsuarioActual.CveRol = 1 Then + CargaDTSCaracteristicas() + CargaDatosCaracteristicas() + End If + If Request("CvePersonal") IsNot Nothing AndAlso IsNumeric(Request("CvePersonal")) AndAlso Request("CvePersonal").ToEntero() > 0 Then ViewState("CvePersonal") = Request("CvePersonal") DdlFormapagovacaciones_SelectedIndexChanged(Nothing, Nothing) @@ -1571,23 +1615,20 @@ Partial Class RH_Personal Private Sub CargaOutSourcing() - Dim DtModulosEmpresa As New DataTable - Dim ObjEmpresas As New ClsSisEmpresas - If ObjEmpresas.GetEmpresas(-1, "-1", "-1", "-1", "-1") Then - DtModulosEmpresa = ObjEmpresas.DtResultados - Else - DtModulosEmpresa = Nothing - End If - ObjEmpresas.Dispose() - - If UsuarioActual.CveEmpresa = 7 Then + Dim DtModulosEmpresa As New DataTable + Dim ObjEmpresas As New ClsSisEmpresas + If ObjEmpresas.GetEmpresas(-1, "-1", "-1", "-1", "-1") Then + DtModulosEmpresa = ObjEmpresas.DtResultados + Else + DtModulosEmpresa = Nothing + End If + ObjEmpresas.Dispose() + DdlEmpresaAsignada.DataSource = DtModulosEmpresa.FiltraParametros("CveEmpresa in (7,11,12,122,145,113)") DdlEmpresaAsignada.DataBind() DvOutsourcing.Visible = True End If - - DdlEmpresaAsignada.Items.Insert(0, New ListItem("Seleccione uno", "-1")) End Sub @@ -4199,7 +4240,7 @@ Partial Class RH_Personal If CvePersonal > 0 Then Dim objRH As New ClsEdocumentacion() - If objRH.DocumentacionElectronicaGet(CvePersonal, -1, -1, UsuarioActual.Empresa.CveEmpresa, -1) Then + If objRH.DocumentacionElectronicaGet(CvePersonal, -1, -1, UsuarioActual.Empresa.CveEmpresa, 7) Then DTDocumentacion = objRH.DtResultados End If @@ -8398,5 +8439,340 @@ Partial Class RH_Personal 'End Sub +#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 + _TxtCaracteristicaOpcion.Width = 120 + 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 = NowADS() + 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 + End Class