-- cambio en globaldt nominas

This commit is contained in:
2023-03-18 09:49:43 -07:00
parent d25cad300e
commit 70a38dfa29
3 changed files with 90 additions and 50 deletions

View File

@@ -542,10 +542,17 @@ Public Class ClsPaginas
End Property End Property
Property GlobalDTNomConceptosFunciones() As DataTable Property GlobalDTNomConceptosFunciones() As DataTable
Get Get
GlobalDTNomConceptosFunciones = DirectCast(Application("GlobalDTNomConceptosFunciones"), DataTable) Dim AppNombre As String = "GlobalDTNomConceptosFunciones"
If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then
Using ObjNom As New ClsNominas()
If ObjNom.GetConceptosFunciones() Then Application(AppNombre) = ObjNom.DtResultados
End Using
End If
GlobalDTNomConceptosFunciones = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End Get End Get
Set(value As DataTable) Set(value As DataTable)
Application("GlobalDTNomConceptosFunciones") = value Dim AppNombre As String = "GlobalDTNomConceptosFunciones"
HttpContext.Current.Application(AppNombre) = value
End Set End Set
End Property End Property
Property GlobalDTUsuarioResponsable(CveEmpresa As Integer) As DataTable Property GlobalDTUsuarioResponsable(CveEmpresa As Integer) As DataTable
@@ -697,18 +704,32 @@ Public Class ClsPaginas
End Property End Property
Property GlobalDTNomSatBancos() As DataTable Property GlobalDTNomSatBancos() As DataTable
Get Get
GlobalDTNomSatBancos = DirectCast(Application("GlobalDTNomSatBancos"), DataTable) Dim AppNombre As String = "GlobalDTNomSatBancos"
If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then
Using ObjNom As New ClsNominas()
If ObjNom.GetBancos() Then Application(AppNombre) = ObjNom.DtResultados
End Using
End If
GlobalDTNomSatBancos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End Get End Get
Set(ByVal value As DataTable) Set(value As DataTable)
Application("GlobalDTNomSatBancos") = value Dim AppNombre As String = "GlobalDTNomSatBancos"
HttpContext.Current.Application(AppNombre) = value
End Set End Set
End Property End Property
Property GlobalDTNomSatConceptos() As DataTable Property GlobalDTNomSatConceptos() As DataTable
Get Get
GlobalDTNomSatConceptos = DirectCast(Application("GlobalDTNomSatConceptos"), DataTable) Dim AppNombre As String = "GlobalDTNomSatConceptos"
If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then
Using ObjNom As New ClsNominas()
If ObjNom.GetConceptos() Then Application(AppNombre) = ObjNom.DtResultados
End Using
End If
GlobalDTNomSatConceptos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End Get End Get
Set(ByVal value As DataTable) Set(value As DataTable)
Application("GlobalDTNomSatConceptos") = value Dim AppNombre As String = "GlobalDTNomSatConceptos"
HttpContext.Current.Application(AppNombre) = value
End Set End Set
End Property End Property
Property GlobalDTNomSatRegimenContratacion() As DataTable Property GlobalDTNomSatRegimenContratacion() As DataTable
@@ -753,18 +774,32 @@ Public Class ClsPaginas
End Property End Property
Property GlobalDTNomSatRiesgoPuesto() As DataTable Property GlobalDTNomSatRiesgoPuesto() As DataTable
Get Get
GlobalDTNomSatRiesgoPuesto = DirectCast(Application("GlobalDTNomSatRiesgoPuesto"), DataTable) Dim AppNombre As String = "GlobalDTNomSatRiesgoPuesto"
If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then
Using ObjNom As New ClsNominas()
If ObjNom.GetRiesgoPuesto() Then Application(AppNombre) = ObjNom.DtResultados
End Using
End If
GlobalDTNomSatRiesgoPuesto = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End Get End Get
Set(ByVal value As DataTable) Set(value As DataTable)
Application("GlobalDTNomSatRiesgoPuesto") = value Dim AppNombre As String = "GlobalDTNomSatRiesgoPuesto"
HttpContext.Current.Application(AppNombre) = value
End Set End Set
End Property End Property
Property GlobalDTNomSatTipoIncapacidad() As DataTable Property GlobalDTNomSatTipoIncapacidad() As DataTable
Get Get
GlobalDTNomSatTipoIncapacidad = DirectCast(Application("GlobalDTNomSatTipoIncapacidad"), DataTable) Dim AppNombre As String = "GlobalDTNomSatTipoIncapacidad"
If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then
Using ObjNom As New ClsNominas()
If ObjNom.GetTipoIncapacidad() Then Application(AppNombre) = ObjNom.DtResultados
End Using
End If
GlobalDTNomSatTipoIncapacidad = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End Get End Get
Set(ByVal value As DataTable) Set(value As DataTable)
Application("GlobalDTNomSatTipoIncapacidad") = value Dim AppNombre As String = "GlobalDTNomSatTipoIncapacidad"
HttpContext.Current.Application(AppNombre) = value
End Set End Set
End Property End Property
'Este GlobalDT no debe segmentarse por empresas, puesto que es para todas las empresas 'Este GlobalDT no debe segmentarse por empresas, puesto que es para todas las empresas
@@ -1904,7 +1939,7 @@ Public Class ClsPaginas
Public Shared Property GlobalDTTipoCuenta() As DataTable Public Shared Property GlobalDTTipoCuenta() As DataTable
Get Get
Dim AppNombre As String = "GlobalDTTipoCuenta" Dim AppNombre As String = "GlobalDTTipoCuenta"
If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then If HttpContext.Current.Application(AppNombre) Is Nothing Then
Dim ObjBancos As New ClsBancos Dim ObjBancos As New ClsBancos
If ObjBancos.GetBancos_TiposCuenta() Then HttpContext.Current.Application(AppNombre) = ObjBancos.DtResultados If ObjBancos.GetBancos_TiposCuenta() Then HttpContext.Current.Application(AppNombre) = ObjBancos.DtResultados
ObjBancos.Dispose() ObjBancos.Dispose()
@@ -1921,30 +1956,43 @@ Public Class ClsPaginas
'TipoPerioso 'TipoPerioso
Property GlobalDTTipoPeriodo() As DataTable Property GlobalDTTipoPeriodo() As DataTable
Get Get
GlobalDTTipoPeriodo = DirectCast(Application("GlobalDTTipoPeriodo"), DataTable) Dim AppNombre As String = "GlobalDTTipoPeriodo"
If HttpContext.Current.Application(AppNombre) Is Nothing Then
Using ObjNom As New ClsNominas()
If ObjNom.GetTiposPeriodos() Then Application(AppNombre) = ObjNom.DtResultados
End Using
End If
GlobalDTTipoPeriodo = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End Get End Get
Set(value As DataTable) Set(value As DataTable)
Application("GlobalDTTipoPeriodo") = value Dim AppNombre As String = "GlobalDTTipoPeriodo"
HttpContext.Current.Application(AppNombre) = value
End Set End Set
End Property End Property
'Fin TipoPeriodo 'Fin TipoPeriodo
'Periodos 'Periodos
Property GlobalDTNominasPeriodos(CveTipoPeriodo As Integer, CvePeriodo As Integer, CveEmpresa As Integer) As DataTable Property GlobalDTNominasPeriodos(CveTipoPeriodo As Integer, CvePeriodo As Integer, CveEmpresa As Integer) As DataTable
Get Get
Dim Str As New StringBuilder Dim AppNombre As String = $"GlobalDTNominasPeriodos-{CveEmpresa}"
If CveEmpresa <> -1 Then Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) If HttpContext.Current.Application(AppNombre) Is Nothing Then
If CveTipoPeriodo <> -1 Then Str.AppendFormat(" {0} CveTipoPeriodo = {1}", If(Str.Length > 0, "AND", ""), CveTipoPeriodo) Using ObjNom As New ClsNominas()
If CvePeriodo <> -1 Then Str.AppendFormat(" {0} CvePeriodo = {1}", If(Str.Length > 0, "AND", ""), CvePeriodo) If ObjNom.GetPeriodos(-1, CveEmpresa, -1, -1, -1, -1) Then Application(AppNombre) = ObjNom.DtResultados
If Str.Length > 0 Then End Using
Dim Dv As New DataView(DirectCast(Application("GlobalDTNominasPeriodos"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) End If
Dim filtros As New List(Of String)
If CveTipoPeriodo >= 0 Then filtros.Add($"CveTipoPeriodo = {CveTipoPeriodo}")
If CvePeriodo >= 0 Then filtros.Add($"CvePeriodo = {CvePeriodo}")
If filtros.Count > 0 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows)
GlobalDTNominasPeriodos = Dv.ToTable GlobalDTNominasPeriodos = Dv.ToTable
Dv.Dispose() Dv.Dispose()
Else Else
GlobalDTNominasPeriodos = DirectCast(Application("GlobalDTNominasPeriodos"), DataTable) GlobalDTNominasPeriodos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End If End If
End Get End Get
Set(value As DataTable) Set(value As DataTable)
Application("GlobalDTNominasPeriodos") = value Dim AppNombre As String = $"GlobalDTNominasPeriodos-{CveEmpresa}"
HttpContext.Current.Application(AppNombre) = value
End Set End Set
End Property End Property
'Fin Periodos 'Fin Periodos
@@ -2274,14 +2322,7 @@ Public Class ClsPaginas
Application(AppNombre) = value Application(AppNombre) = value
End Set End Set
End Property End Property
Property GlobalDTNom_Periodos() As DataTable
Get
GlobalDTNom_Periodos = DirectCast(Application("GlobalDTNom_Periodos"), DataTable)
End Get
Set(value As DataTable)
Application("GlobalDTNom_Periodos") = value
End Set
End Property
Public Shared Property GlobalDTVtaFormaPago() As DataTable Public Shared Property GlobalDTVtaFormaPago() As DataTable
Get Get
Dim AppNombre As String = "GlobalDTVtaFormaPago" Dim AppNombre As String = "GlobalDTVtaFormaPago"

View File

@@ -82,23 +82,23 @@
End Using End Using
GuardaLogAsax(String.Format("Globalasax 7:{0}", DateTime.Now)) 'GuardaLogAsax(String.Format("Globalasax 7:{0}", DateTime.Now))
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'C A R G A - N O M 'C A R G A - N O M
Using ObjNom As New ClsNominas() 'Using ObjNom As New ClsNominas()
'If ObjNom.GetConceptos(-1) Then Application("GlobalDTNomConceptos") = ObjNom.DtResultados Else Application("GlobalDTNomConceptos") = Nothing ' 'If ObjNom.GetConceptos(-1) Then Application("GlobalDTNomConceptos") = ObjNom.DtResultados Else Application("GlobalDTNomConceptos") = Nothing
If ObjNom.GetConceptosFunciones() Then Application("GlobalDTNomConceptosFunciones") = ObjNom.DtResultados Else Application("GlobalDTNomConceptosFunciones") = Nothing ' 'If ObjNom.GetConceptosFunciones() Then Application("GlobalDTNomConceptosFunciones") = ObjNom.DtResultados Else Application("GlobalDTNomConceptosFunciones") = Nothing
If ObjNom.GetTiposPeriodos() Then Application("GlobalDTTipoPeriodo") = ObjNom.DtResultados Else Application("GlobalDTTipoPeriodo") = Nothing ' 'If ObjNom.GetTiposPeriodos() Then Application("GlobalDTTipoPeriodo") = ObjNom.DtResultados Else Application("GlobalDTTipoPeriodo") = Nothing
If ObjNom.GetPeriodos(-1, -1, -1, -1, -1) Then Application("GlobalDTNominasPeriodos") = ObjNom.DtResultados Else Application("GlobalDTNominasPeriodos") = Nothing ' 'If ObjNom.GetPeriodos(-1, -1, -1, -1, -1) Then Application("GlobalDTNominasPeriodos") = ObjNom.DtResultados Else Application("GlobalDTNominasPeriodos") = Nothing
If ObjNom.GetBancos Then Application("GlobalDTNomSatBancos") = ObjNom.DtResultados Else Application("GlobalDTNomSatBancos") = Nothing ' 'If ObjNom.GetBancos Then Application("GlobalDTNomSatBancos") = ObjNom.DtResultados Else Application("GlobalDTNomSatBancos") = Nothing
If ObjNom.GetConceptos Then Application("GlobalDTNomSatConceptos") = ObjNom.DtResultados Else Application("GlobalDTNomSatConceptos") = Nothing ' 'If ObjNom.GetConceptos Then Application("GlobalDTNomSatConceptos") = ObjNom.DtResultados Else Application("GlobalDTNomSatConceptos") = Nothing
'If ObjNom.GetRegimenContratacion Then Application("GlobalDTNomSatRegimenContratacion") = ObjNom.DtResultados Else Application("GlobalDTNomSatRegimenContratacion") = Nothing ' 'If ObjNom.GetRegimenContratacion Then Application("GlobalDTNomSatRegimenContratacion") = ObjNom.DtResultados Else Application("GlobalDTNomSatRegimenContratacion") = Nothing
If ObjNom.GetRiesgoPuesto Then Application("GlobalDTNomSatRiesgoPuesto") = ObjNom.DtResultados Else Application("GlobalDTNomSatRiesgoPuesto") = Nothing ' 'If ObjNom.GetRiesgoPuesto Then Application("GlobalDTNomSatRiesgoPuesto") = ObjNom.DtResultados Else Application("GlobalDTNomSatRiesgoPuesto") = Nothing
If ObjNom.GetTipoIncapacidad Then Application("GlobalDTNomSatTipoIncapacidad") = ObjNom.DtResultados Else Application("GlobalDTNomSatTipoIncapacidad") = Nothing ' 'If ObjNom.GetTipoIncapacidad Then Application("GlobalDTNomSatTipoIncapacidad") = ObjNom.DtResultados Else Application("GlobalDTNomSatTipoIncapacidad") = Nothing
End Using 'End Using
GuardaLogAsax(String.Format("Globalasax 9:{0}", DateTime.Now)) ' GuardaLogAsax(String.Format("Globalasax 9:{0}", DateTime.Now))
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'------------------------------------------------------------------------------S I S T E M A ---------------------------------------------------------------------------------- '------------------------------------------------------------------------------S I S T E M A ----------------------------------------------------------------------------------
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

View File

@@ -41,7 +41,6 @@ Partial Class Nomina_CatPeriodos
Dim ObjNom_Periodos As New ClsNominas Dim ObjNom_Periodos As New ClsNominas
If ObjNom_Periodos.GetPeriodos(DdlTipoPeriodo.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa, DdlEjercicio.SelectedValue.ToEntero(), -1, -1, DdlEstatus.SelectedValue.ToEntero()) Then If ObjNom_Periodos.GetPeriodos(DdlTipoPeriodo.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa, DdlEjercicio.SelectedValue.ToEntero(), -1, -1, DdlEstatus.SelectedValue.ToEntero()) Then
ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTNom_Periodos = ObjNom_Periodos.DtResultados
Else Else
Me.GvDatos.DataSource = Nothing Me.GvDatos.DataSource = Nothing
@@ -153,7 +152,7 @@ Partial Class Nomina_CatPeriodos
If ObjNom_Periodos.RemovePeriodo(GvDatos.DataKeys(e.RowIndex).Value.ToString().ToEntero()) Then If ObjNom_Periodos.RemovePeriodo(GvDatos.DataKeys(e.RowIndex).Value.ToString().ToEntero()) Then
GvDatos.EditIndex = -1 GvDatos.EditIndex = -1
ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTNom_Periodos = ObjNom_Periodos.DtResultados GlobalDTNominasPeriodos(-1, -1, UsuarioActual.CveEmpresa) = Nothing
Alert("El Periodo se eliminó correctamente.", TipoMensaje.MsgInformacion) Alert("El Periodo se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If End If
@@ -265,7 +264,7 @@ Partial Class Nomina_CatPeriodos
Alert("El nuevo Periodo se guardó correctamente.", TipoMensaje.MsgInformacion) Alert("El nuevo Periodo se guardó correctamente.", TipoMensaje.MsgInformacion)
UpDatos.Update() UpDatos.Update()
ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTNom_Periodos = ObjNom_Periodos.DtResultados GlobalDTNominasPeriodos(-1, -1, UsuarioActual.CveEmpresa) = Nothing
CargaDatos() CargaDatos()
If String.IsNullOrEmpty(ViewState("Orden").ToString()) Then If String.IsNullOrEmpty(ViewState("Orden").ToString()) Then
CargaGrid(ViewState("Orden").ToString()) CargaGrid(ViewState("Orden").ToString())
@@ -281,7 +280,7 @@ Partial Class Nomina_CatPeriodos
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
UpDatos.Update() UpDatos.Update()
ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTNom_Periodos = ObjNom_Periodos.DtResultados GlobalDTNominasPeriodos(-1, -1, UsuarioActual.CveEmpresa) = Nothing
CargaDatos() CargaDatos()
If String.IsNullOrEmpty(ViewState("Orden").ToString()) Then If String.IsNullOrEmpty(ViewState("Orden").ToString()) Then
CargaGrid(ViewState("Orden").ToString()) CargaGrid(ViewState("Orden").ToString())