RH Familiares grid y personal requeriemientos
This commit is contained in:
@@ -528,12 +528,94 @@ Partial Class RH_Personal
|
||||
Set(value As Integer)
|
||||
ViewState("CvePermiso") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "PROPIEDADES FAMILIARES"
|
||||
|
||||
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 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
|
||||
|
||||
Property DTFamiliares As DataTable
|
||||
Get
|
||||
Return DirectCast(ViewState("DTFamiliares"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTFamiliares") = 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
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
|
||||
Const wdPageBreak As Integer = 7
|
||||
Const wdCharacter As Integer = 1
|
||||
'Configuración
|
||||
@@ -581,9 +663,9 @@ Partial Class RH_Personal
|
||||
CargaComboUniformes()
|
||||
CargaPermisos()
|
||||
CargaCombosBuzon()
|
||||
CargaPermisosReemplazos()
|
||||
|
||||
|
||||
CargaPermisosReemplazos()
|
||||
|
||||
|
||||
If Request("CvePersonal") IsNot Nothing AndAlso IsNumeric(Request("CvePersonal")) AndAlso Request("CvePersonal").ToEntero > 0 Then
|
||||
ViewState("CvePersonal") = Request("CvePersonal")
|
||||
'CvePersonal = ViewState("CvePersonal").ToString.ToEntero
|
||||
@@ -634,14 +716,29 @@ Partial Class RH_Personal
|
||||
'Inicia Permisos
|
||||
'Fin Permisos
|
||||
End If
|
||||
CargaCuentasBancarias()
|
||||
|
||||
'If UsuarioActual.TienePermisoProceso(84) Then 'abonar pago
|
||||
' HplAbonarMasivo.Visible = True
|
||||
' GvGxC.Columns(7).Visible = True
|
||||
'End If
|
||||
|
||||
|
||||
CargaCuentasBancarias()
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(568) = "1" Then
|
||||
|
||||
CrearEstructuraFamiliares()
|
||||
CargaFamiliares()
|
||||
|
||||
LIFamiliaresAcciones.Visible = True
|
||||
DivFamiliares.Visible = True
|
||||
DivPadres.Visible = False
|
||||
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
'If UsuarioActual.TienePermisoProceso(84) Then 'abonar pago
|
||||
' HplAbonarMasivo.Visible = True
|
||||
' GvGxC.Columns(7).Visible = True
|
||||
'End If
|
||||
|
||||
|
||||
If Not CvePersonal > 0 Then
|
||||
DivSuperiorInmediato.Visible = False
|
||||
End If
|
||||
@@ -1381,6 +1478,11 @@ Partial Class RH_Personal
|
||||
'Agregar Cuentas Bancarias
|
||||
ViewState("CvePersonal") = ObjPersonal.CvePersonal
|
||||
|
||||
'Funsion usa RH Familiares
|
||||
If UsuarioActual.Empresa.Funcionalidad(568) = "1" Then
|
||||
ProcesaDTFamiliares(ObjPersonal)
|
||||
End If
|
||||
|
||||
If TempDTCuentasBancos.Rows.Count > 0 Then
|
||||
For Each row As DataRow In TempDTCuentasBancos.Rows
|
||||
If Not ObjCuentasDeposito.AddCuentasDepositos(row("BancoNombre").ToString, row("Plaza").ToString, row("Sucursal").ToString, row("Cuenta").ToString, row("CLABE").ToString, row("CIE").ToString, row("SWIFT").ToString, row("Referencia").ToString, "", UsuarioActual.CveUsuario, row("CveMoneda").ToString.ToEntero, CvePersonal:=CvePersonal, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
@@ -1435,7 +1537,12 @@ Partial Class RH_Personal
|
||||
URL, DdlSupervisor.SelectedValue.ToEntero, TxtCLABE.Text.Trim, TxtBancoNumCuenta.Text.Trim, DdlJornada.SelectedValue.ToEntero, DdlViaticos.SelectedValue.ToEntero, DdlViaticos.SelectedItem.Text,
|
||||
DdlPrestamos.SelectedValue.ToEntero, DdlPrestamos.SelectedItem.Text, UsuarioActual.CveEmpresa, DDLUsuarioNomina.SelectedValue.ToEntero, DdlSubproyectoZona.SelectedValue.ToEntero, CveUniforme:=DdlUniforme.SelectedValue.ToEntero,
|
||||
TelefonoExtension:=TxtTelefonoExtension.Text, CelularPersonal:=TxtCelularPersonal.Text, TelefonoMarcadoRapido:=TxtTelefonoMarcadoRapido.Text, ContactoAlterno:="", CveUsuarioModifico:=UsuarioActual.CveUsuario,
|
||||
FechaActivo:=FechaActivo, FechaReingreso:=FechaReingreso) Then
|
||||
FechaActivo:=FechaActivo, FechaReingreso:=FechaReingreso) Then
|
||||
|
||||
'Funsion usa RH Familiares
|
||||
If UsuarioActual.Empresa.Funcionalidad(568) = "1" Then
|
||||
ProcesaDTFamiliares(ObjPersonal)
|
||||
End If
|
||||
|
||||
|
||||
If Archivo.Exists Then
|
||||
@@ -5506,5 +5613,265 @@ Partial Class RH_Personal
|
||||
Alert("No se encontraron registros .", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
End Sub
|
||||
|
||||
|
||||
#Region "FAMILIARES"
|
||||
|
||||
|
||||
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()
|
||||
GvFamiliares.DataSource = DTFamiliares
|
||||
Else
|
||||
DTFamiliares.Rows.Clear()
|
||||
GvFamiliares.DataSource = DTFamiliares
|
||||
End If
|
||||
|
||||
Else
|
||||
GvFamiliares.DataSource = Nothing
|
||||
End If
|
||||
|
||||
objRH.Dispose()
|
||||
GvFamiliares.DataBind()
|
||||
UPTabFamiliares.Update()
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CrearEstructuraFamiliares()
|
||||
|
||||
Dim Familiares 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"))
|
||||
Familiares.Columns.Add("Beneficiario", Type.GetType("System.Boolean"))
|
||||
|
||||
DTFamiliares = Familiares
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub BtnAgregarFamiliar_Click(sender As Object, e As EventArgs) Handles BtnAgregarFamiliar.Click
|
||||
resetFormFamiliares()
|
||||
RegistraScript("$('#divAgregarFamiliar').modal({ backdrop: 'static', keyboard: false});")
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub ResetFormFamiliares()
|
||||
|
||||
ActualizarFamiliar = False
|
||||
CveFamiliar = -1
|
||||
|
||||
LtlTituloModalFamiliar.Text = "Agregar Familiar"
|
||||
BtnAgregarFamiliarModal.Text = "Agregar Familiar"
|
||||
TxtNombreFamiliar4.Text = ""
|
||||
TxtDomicilioFamiliar4.Text = ""
|
||||
TxtEdadFamiliar4.Text = ""
|
||||
TxtOcupacionFamiliar4.Text = ""
|
||||
TxtTelefonoFamiliar.Text = ""
|
||||
TxtObservacionesFamiliar.Text = ""
|
||||
DDLParentescoFamiliar4.SelectedIndex = 0
|
||||
ChkBeneficiario.Checked = False
|
||||
|
||||
UpModalFamiliar.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnAgregarFamiliarModal_Click(sender As Object, e As EventArgs) Handles BtnAgregarFamiliarModal.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
|
||||
DTFamiliares(IndexActual)("Beneficiario") = ChkBeneficiario.Checked
|
||||
|
||||
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("Beneficiario") = ChkBeneficiario.Checked
|
||||
|
||||
DtRowFamiliar("Accion") = "2"
|
||||
|
||||
DTFamiliares.Rows.Add(DtRowFamiliar)
|
||||
DTFamiliares.AcceptChanges()
|
||||
|
||||
End If
|
||||
|
||||
IndexActual = -1
|
||||
|
||||
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAgregarFamiliar"))
|
||||
'CargaFamiliares()
|
||||
|
||||
GvFamiliares.DataSource = DTFamiliares
|
||||
GvFamiliares.DataBind()
|
||||
UPTabFamiliares.Update()
|
||||
|
||||
CveFamiliar = -1
|
||||
ActualizarFamiliar = False
|
||||
|
||||
End Sub
|
||||
|
||||
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
|
||||
|
||||
LtlTituloModalFamiliar.Text = "Editar Familiar"
|
||||
BtnAgregarFamiliarModal.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")
|
||||
ChkBeneficiario.Checked = Boolean.Parse(GvRow.DataKey("Beneficiario").ToString)
|
||||
|
||||
UpModalFamiliar.Update()
|
||||
RegistraScript("$('#divAgregarFamiliar').modal({ backdrop: 'static', keyboard: false});")
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
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"
|
||||
Dim objRH As New ClsRH
|
||||
ProcesaDTFamiliares(objRH)
|
||||
objRH.Dispose()
|
||||
|
||||
CargaFamiliares()
|
||||
|
||||
|
||||
|
||||
Else
|
||||
DTFamiliares.Rows(IndexActual).Delete()
|
||||
DTFamiliares.AcceptChanges()
|
||||
GvFamiliares.DataSource = DTFamiliares
|
||||
GvFamiliares.DataBind()
|
||||
UPTabFamiliares.Update()
|
||||
End If
|
||||
IndexActual = -1
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub ProcesaDTFamiliares(ByRef objRH As ClsRH)
|
||||
|
||||
'Dim objRH As New ClsRH
|
||||
|
||||
ValPadre = False
|
||||
ValMadre = False
|
||||
|
||||
For Each dRow As DataRow In DTFamiliares.Rows
|
||||
|
||||
|
||||
|
||||
If dRow("Accion").ToString = "1" Then 'Actualiza
|
||||
|
||||
Dim Beneficiario As Integer = -1
|
||||
|
||||
If Boolean.Parse(dRow("Beneficiario").ToString) Then
|
||||
Beneficiario = 1
|
||||
Else
|
||||
Beneficiario = 0
|
||||
End If
|
||||
|
||||
|
||||
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), Beneficiario)
|
||||
|
||||
End If
|
||||
If dRow("Accion").ToString = "2" Then 'Inserta
|
||||
|
||||
|
||||
Dim Beneficiario As Boolean = Boolean.Parse(dRow("Beneficiario").ToString)
|
||||
|
||||
|
||||
|
||||
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), Beneficiario)
|
||||
|
||||
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
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user