From b2b6b3d0ec8d0eb357792f82ce053218b1b90eb6 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Thu, 3 Mar 2022 20:23:27 -0700 Subject: [PATCH] rh --- App_Code/ClsPaginas.vb | 1 + App_Code/ClsRH.vb | 105 +++++++++++++++++++++- RH/CatRegistroPatronal.aspx | 106 +++++++++++++++++++++++ RH/CatRegistroPatronal.aspx.vb | 154 +++++++++++++++++++++++++++++++++ RH/Personal.aspx | 9 ++ RH/Personal.aspx.vb | 26 +++++- 6 files changed, 396 insertions(+), 5 deletions(-) create mode 100644 RH/CatRegistroPatronal.aspx create mode 100644 RH/CatRegistroPatronal.aspx.vb diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 5f01455d4..0726f8f60 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -5381,6 +5381,7 @@ Public Class ClsPaginas PaginaDict.Add("/RH/ReporteViaticos.aspx".ToUpper(), 664) PaginaDict.Add("/RH/MiPerfil.aspx".ToUpper(), -1) ' se dejará libre el módulo para que cualquier que tenga cvepersonal, pueda acceder PaginaDict.Add("/RH/CatChecadores.aspx".ToUpper(), 694) + PaginaDict.Add("/RH/CatRegistroPatronal.aspx".ToUpper(), 1324) #End Region #Region "Sistema" 'Cargo las páginas que deben tener restricción diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb index 3e3bce08c..945a70ac8 100644 --- a/App_Code/ClsRH.vb +++ b/App_Code/ClsRH.vb @@ -1870,7 +1870,8 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo Calle As String, NumExt As String, NumInt As String, Colonia As String, CP As String, Ciudad As String, CveEstado As Integer, Telefono As String, Celular As String, RFC As String, CURP As String, NombrePadre As String, NombreMadre As String, CveSATBanco As Integer, CveSATRiesgoPuesto As Integer, CveSATRegimenContratacion As Integer, CveClienteAsignado As Integer, CveSubProyecto As Integer, URL As String, CveSupervisor As Integer, CLABE As String, BancoNumCuenta As String, CveJornada As Integer, IdCtaContPersonal As Integer, CtaContPersonal As String, IdCtaContPrestamos As Integer, CtaContPrestamos As String, CveUsuario As Integer, CveEmpresa As Integer, CveUsuarioNomina As Integer, Optional CveSubProyectoZona As Integer = Nothing, Optional CveUniforme As Integer = -1, - Optional TelefonoExtension As String = "-1", Optional CelularPersonal As String = "-1", Optional TelefonoMarcadoRapido As String = "-1", Optional ContactoAlterno As String = "-1", Optional CveTipodeSalario As Integer = 1, Optional Sindicalizado As Boolean = False, Optional CvePais As Integer = -1, Optional Pensionado As Boolean = False, Optional CveMedioTransporte As Integer = -1) As Boolean + Optional TelefonoExtension As String = "-1", Optional CelularPersonal As String = "-1", Optional TelefonoMarcadoRapido As String = "-1", Optional ContactoAlterno As String = "-1", Optional CveTipodeSalario As Integer = 1, Optional Sindicalizado As Boolean = False, Optional CvePais As Integer = -1, + Optional Pensionado As Boolean = False, Optional CveMedioTransporte As Integer = -1, Optional CveRegistroPatronal As Integer = -1) As Boolean Dim Retorno As Boolean = False @@ -1955,6 +1956,9 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo .Add("@Pensionado", SqlDbType.Bit).Value = Pensionado .Add("@CvePais", SqlDbType.Int).Value = CvePais .Add("@CveMedioTransporte", SqlDbType.Int).Value = CveMedioTransporte + .Add("@CveRegistroPatronal", SqlDbType.Int).Value = CveRegistroPatronal + + .Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue @@ -1994,7 +1998,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo NombrePadre As String, NombreMadre As String, CveSATBanco As Integer, CveSATRiesgoPuesto As Integer, CveSATRegimenContratacion As Integer, CveClienteAsignado As Integer, CveSubProyecto As Integer, CvePersonal As Integer, URL As String, CveSupervisor As Integer, CLABE As String, BancoNumCuenta As String, CveJornada As Integer, IdCtaContPersonal As Integer, CtaContPersonal As String, IdCtaContPrestamos As Integer, CtaContPrestamos As String, CveEmpresa As Integer, CveUsuarioNomina As Integer, Optional CveSubProyectoZona As Integer = Nothing, Optional CveUniforme As Integer = -1, Optional TelefonoExtension As String = "-1", Optional CelularPersonal As String = "-1", Optional TelefonoMarcadoRapido As String = "-1", Optional ContactoAlterno As String = "-1", Optional CveUsuarioModifico As Integer = -1, - Optional FechaActivo As Date = MinFecha, Optional FechaReingreso As Date = MinFecha, Optional CveTipodeSalario As Integer = 1, Optional Sindicalizado As Integer = -1, Optional CvePais As Integer = -1, Optional Pensionado As Boolean = False) As Boolean + Optional FechaActivo As Date = MinFecha, Optional FechaReingreso As Date = MinFecha, Optional CveTipodeSalario As Integer = 1, Optional Sindicalizado As Integer = -1, Optional CvePais As Integer = -1, Optional Pensionado As Boolean = False, Optional CveRegistroPatronal As Integer = -1) As Boolean Dim Retorno As Boolean = False @@ -2082,6 +2086,9 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo .Add("@Sindicalizado", SqlDbType.Int).Value = Sindicalizado .Add("@Pensionado", SqlDbType.Bit).Value = Pensionado .Add("@CvePais", SqlDbType.Int).Value = CvePais + .Add("@CveRegistroPatronal", SqlDbType.Int).Value = CveRegistroPatronal + + End With @@ -7200,6 +7207,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo End Try Return Retorno End Function + Public Function UpPersonalSupervisorMasiva(CveEmpresa As Integer, CveUsuario As Integer, registros As List(Of RequestUpSupervisorMasiva)) As Boolean Dim Retorno As Boolean = False Dim xmlProductos As System.Xml.Linq.XDocument = Nothing @@ -7224,6 +7232,99 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo Return Retorno End Function + + + Public Function GetRegistrosPatronales(CveRegistroPatronal As Integer, CveEmpresa As Integer, Estatus As Integer) As Boolean + + + Dim Retorno As Boolean = False + DataAdapter("PA_RH_RegistrosPatronalesGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveRegistroPatronal", SqlDbType.Int).Value = CveRegistroPatronal + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Estatus", SqlDbType.Int).Value = Estatus + End With + Try + + SqlAdapter.Fill(Data) + Retorno = True + + Catch ex As Exception + OnError("Ocurrió un error al consultar los registros patronales ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + + Public Function AddRegistrosPatronales(RegistroPatronal As String, Estatus As Boolean, CveEmpresa As Integer, CveUsuario As Integer) As Boolean + + + Dim Retorno As Boolean = False + DataAdapter("PA_RH_RegistrosPatronalesAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@RegistroPatronal", SqlDbType.VarChar).Value = RegistroPatronal + .Add("@Estatus", SqlDbType.Bit).Value = Estatus + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + End With + Try + + SqlAdapter.Fill(Data) + Retorno = True + + Catch ex As Exception + OnError("Ocurrió un error al agregar el registro patronal ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + + Public Function UpdateRegistrosPatronales(CveRegistroPatronal As Integer, RegistroPatronal As String, Estatus As Boolean, CveEmpresa As Integer, CveUsuario As Integer) As Boolean + + + Dim Retorno As Boolean = False + DataAdapter("PA_RH_RegistrosPatronalesUpdate") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveRegistroPatronal", SqlDbType.Int).Value = CveRegistroPatronal + .Add("@RegistroPatronal", SqlDbType.VarChar).Value = RegistroPatronal + .Add("@Estatus", SqlDbType.Bit).Value = Estatus + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + End With + Try + + SqlAdapter.Fill(Data) + Retorno = True + + Catch ex As Exception + OnError("Ocurrió un error al actualizar el registro patronal ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + + Public Function RemoveRegistrosPatronales(CveRegistroPatronal As Integer, CveEmpresa As Integer) As Boolean + + + Dim Retorno As Boolean = False + DataAdapter("PA_RH_RegistrosPatronalesRemove") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveRegistroPatronal", SqlDbType.Int).Value = CveRegistroPatronal + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + + SqlAdapter.Fill(Data) + Retorno = True + + Catch ex As Exception + OnError("Ocurrió un error al eliminar el registro patronal ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + + 'Public msgsError As New StringBuilder() 'Public Sub OnError(Mensaje As String, Exeption As Exception, Optional InfoAdicional As String = "") ' GuardaLog(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", Mensaje, Exeption.ToString, vbCrLf, InfoAdicional)) diff --git a/RH/CatRegistroPatronal.aspx b/RH/CatRegistroPatronal.aspx new file mode 100644 index 000000000..c54c38ed0 --- /dev/null +++ b/RH/CatRegistroPatronal.aspx @@ -0,0 +1,106 @@ +<%@ Page Title="RH - Catálogo Registro Patronal" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatRegistroPatronal.aspx.vb" Inherits="RH_CatRegistroPatronal" %> + +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + + + + + + + + Catálogo Registro Patronal + + + + +
  • + +
  • + +
    +
    +
    + + + + + + + + + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + +
    +
    +
    + + diff --git a/RH/CatRegistroPatronal.aspx.vb b/RH/CatRegistroPatronal.aspx.vb new file mode 100644 index 000000000..b75b427fd --- /dev/null +++ b/RH/CatRegistroPatronal.aspx.vb @@ -0,0 +1,154 @@ +Option Explicit On +Option Strict On + +Imports System.Data +Imports System.Linq +Imports Extensiones + +Partial Class RH_CatRegistroPatronal + Inherits ClsPaginas + + Private Property CveRegistroPatronal() As Integer + Get + If ViewState("CveRegistroPatronal") Is Nothing Then + ViewState("CveRegistroPatronal") = -1 + End If + Return ViewState("CveRegistroPatronal").ToString.ToEntero + End Get + Set + ViewState("CveRegistroPatronal") = Value + End Set + End Property + + + + Protected Sub CatRegistroPatronal_Load(sender As Object, e As System.EventArgs) Handles Me.Load + If Not Page.IsPostBack Then + + + CargaDatos() + + End If + End Sub + + Public Sub CargaDatos() + + Dim ObjRH As New ClsRH + + If ObjRH.GetRegistrosPatronales(-1, UsuarioActual.CveEmpresa, -1) Then + GvDatos.DataSource = ObjRH.DtResultados + + Else + GvDatos.DataSource = Nothing + End If + + ObjRH.Dispose() + GvDatos.DataBind() + UpDatos.Update() + + End Sub + + + + Protected Sub BtnAgregarPuestoModal_Click(sender As Object, e As EventArgs) Handles BtnModalAgregarRegistroPatronal.Click + + Dim ObjRH As New ClsRH + Dim ErrorProceso As Boolean = True + + If CveRegistroPatronal = -1 Then + If ObjRH.AddRegistrosPatronales(TxtRegistroPatronal.Text, ChkModalEstatus.Checked, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then + Alert("Registro Patronal correctamente.") + ErrorProceso = False + End If + Else + If ObjRH.UpdateRegistrosPatronales(CveRegistroPatronal, TxtRegistroPatronal.Text, ChkModalEstatus.Checked, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then + Alert("Registro Patronal actualizado correctamente.") + ErrorProceso = False + End If + End If + + + CveRegistroPatronal = -1 + ObjRH.Dispose() + + + If Not ErrorProceso Then + CargaDatos() + RegistraScript(String.Format("$('#{0}').modal('hide');", "DVModalRegistroPatronal")) + End If + + + End Sub + + Public Sub Remove_ClickRegistroPatronal(sender As Object, e As EventArgs) + + Dim Errorelimiancion As Boolean = True + Dim objRH As New ClsRH + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + + Dim CveRegistroPatronalEliminar As Integer = GvRow.DataKey("CveRegistroPatronal").ToEntero + + If objRH.RemoveRegistrosPatronales(CveRegistroPatronalEliminar, UsuarioActual.CveEmpresa) Then + Alert("Registro Patronal Eliminado correctamente.") + Errorelimiancion = False + End If + + objRH.Dispose() + + If Not Errorelimiancion Then + CargaDatos() + End If + + + End Sub + + Public Sub Edit_ClickRegistroPAtronal(sender As Object, e As EventArgs) + + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + + + + CveRegistroPatronal = GvRow.DataKey("CveRegistroPatronal").ToEntero + TxtRegistroPatronal.Text = GvRow.DataKey("RegistroPatronal") + + LtlTituloModalAgregaRegsitroPatronal.Text = "Editar Registro Patronal" + + + ChkModalEstatus.Checked = Boolean.Parse(GvRow.DataKey("Estatus").ToString) + + BtnModalAgregarRegistroPatronal.Text = "Actualizar" + + UpModalRegistroPAtronal.Update() + RegistraScript(String.Format("$('#{0}').modal();", "DVModalRegistroPatronal")) + + End Sub + + Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound + If e.Row.RowType = DataControlRowType.DataRow Then + + End If + End Sub + + Protected Sub LnkAgregarRegistroPatronal_Click(sender As Object, e As EventArgs) Handles LnkAgregarRegistroPatronal.Click + + + CveRegistroPatronal = -1 + TxtRegistroPatronal.Text = "" + LtlTituloModalAgregaRegsitroPatronal.Text = "Agregar Registro Patronal" + ChkModalEstatus.Checked = True + + + BtnModalAgregarRegistroPatronal.Text = "Agregar" + + 'Combos + + UpModalRegistroPAtronal.Update() + + RegistraScript(String.Format("$('#{0}').modal();", "DVModalRegistroPatronal")) + End Sub + + + + + +End Class diff --git a/RH/Personal.aspx b/RH/Personal.aspx index 3bab66c3f..4ef0c960f 100644 --- a/RH/Personal.aspx +++ b/RH/Personal.aspx @@ -1457,6 +1457,15 @@ + +
    + + + + + <%----%> +
    +
    diff --git a/RH/Personal.aspx.vb b/RH/Personal.aspx.vb index 15d228cca..49f5b7e99 100644 --- a/RH/Personal.aspx.vb +++ b/RH/Personal.aspx.vb @@ -856,6 +856,7 @@ Partial Class RH_Personal CargaCombosBuzon() CargaPermisosReemplazos() CargaPaises() + CargaRegistroPatronal() If Request("CvePersonal") IsNot Nothing AndAlso IsNumeric(Request("CvePersonal")) AndAlso Request("CvePersonal").ToEntero() > 0 Then ViewState("CvePersonal") = Request("CvePersonal") @@ -1354,6 +1355,24 @@ Partial Class RH_Personal End Sub + + Private Sub CargaRegistroPatronal() + + Dim ObjRH As New ClsRH + + If ObjRH.GetRegistrosPatronales(-1, UsuarioActual.CveEmpresa, 1) Then + DdlRegistroPatronal.DataSource = ObjRH.DtResultados + Else + DdlRegistroPatronal.DataSource = Nothing + End If + + ObjRH.Dispose() + + DdlRegistroPatronal.DataBind() + DdlRegistroPatronal.Items.Insert(0, New ListItem("Seleccione uno", "-1")) + + End Sub + #End Region #Region "Asistencias" @@ -1654,7 +1673,7 @@ Partial Class RH_Personal DdlPais.SelectedValueExist(ObjPersonal.DtResultados.Rows(0)("CvePais").ToString) - + DdlRegistroPatronal.SelectedValueExist(ObjPersonal.DtResultados.Rows(0)("CveRegistroPatronal").ToString) 'Carga Incidencias BtnConsultarAsistencia_Click(Me, New System.EventArgs) @@ -1828,7 +1847,8 @@ Partial Class RH_Personal DdlClienteAsignado.SelectedValue.ToEntero(), DdlSubProyectoAsignado.SelectedValue.ToEntero(), 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.CveUsuario, UsuarioActual.CveEmpresa, DDLUsuarioNomina.SelectedValue.ToEntero(), DdlSubproyectoZona.SelectedValue.ToEntero(), CveUniforme:=DdlUniforme.SelectedValue.ToEntero(), - TelefonoExtension:=TxtTelefonoExtension.Text, CelularPersonal:=TxtCelularPersonal.Text, TelefonoMarcadoRapido:=TxtTelefonoMarcadoRapido.Text, ContactoAlterno:="", CveTipodeSalario:=DDlTipoSalario.SelectedValue.ToEntero(), Sindicalizado:=ChkSindicalizado.Checked, Pensionado:=ChkPensionado.Checked, CvePais:=DdlPais.SelectedValue.ToEntero()) Then + TelefonoExtension:=TxtTelefonoExtension.Text, CelularPersonal:=TxtCelularPersonal.Text, TelefonoMarcadoRapido:=TxtTelefonoMarcadoRapido.Text, ContactoAlterno:="", CveTipodeSalario:=DDlTipoSalario.SelectedValue.ToEntero(), + Sindicalizado:=ChkSindicalizado.Checked, Pensionado:=ChkPensionado.Checked, CvePais:=DdlPais.SelectedValue.ToEntero(), CveRegistroPatronal:=DdlRegistroPatronal.SelectedValue.ToEntero()) Then If Archivo.Exists Then @@ -1903,7 +1923,7 @@ 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, - CveTipodeSalario:=DDlTipoSalario.SelectedValue.ToEntero(), Sindicalizado:=If(ChkSindicalizado.Checked, 1, 0), Pensionado:=ChkPensionado.Checked, CvePais:=DdlPais.SelectedValue.ToEntero()) Then + CveTipodeSalario:=DDlTipoSalario.SelectedValue.ToEntero(), Sindicalizado:=If(ChkSindicalizado.Checked, 1, 0), Pensionado:=ChkPensionado.Checked, CvePais:=DdlPais.SelectedValue.ToEntero(), CveRegistroPatronal:=DdlRegistroPatronal.SelectedValue.ToEntero()) Then 'Funsion usa RH Familiares If UsuarioActual.Empresa.Funcionalidad(568) = "1" Then