-- 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
Property GlobalDTNomConceptosFunciones() As DataTable
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
Set(value As DataTable)
Application("GlobalDTNomConceptosFunciones") = value
Dim AppNombre As String = "GlobalDTNomConceptosFunciones"
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
Property GlobalDTUsuarioResponsable(CveEmpresa As Integer) As DataTable
@@ -697,18 +704,32 @@ Public Class ClsPaginas
End Property
Property GlobalDTNomSatBancos() As DataTable
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
Set(ByVal value As DataTable)
Application("GlobalDTNomSatBancos") = value
Set(value As DataTable)
Dim AppNombre As String = "GlobalDTNomSatBancos"
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
Property GlobalDTNomSatConceptos() As DataTable
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
Set(ByVal value As DataTable)
Application("GlobalDTNomSatConceptos") = value
Set(value As DataTable)
Dim AppNombre As String = "GlobalDTNomSatConceptos"
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
Property GlobalDTNomSatRegimenContratacion() As DataTable
@@ -753,18 +774,32 @@ Public Class ClsPaginas
End Property
Property GlobalDTNomSatRiesgoPuesto() As DataTable
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
Set(ByVal value As DataTable)
Application("GlobalDTNomSatRiesgoPuesto") = value
Set(value As DataTable)
Dim AppNombre As String = "GlobalDTNomSatRiesgoPuesto"
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
Property GlobalDTNomSatTipoIncapacidad() As DataTable
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
Set(ByVal value As DataTable)
Application("GlobalDTNomSatTipoIncapacidad") = value
Set(value As DataTable)
Dim AppNombre As String = "GlobalDTNomSatTipoIncapacidad"
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
'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
Get
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
If ObjBancos.GetBancos_TiposCuenta() Then HttpContext.Current.Application(AppNombre) = ObjBancos.DtResultados
ObjBancos.Dispose()
@@ -1921,30 +1956,43 @@ Public Class ClsPaginas
'TipoPerioso
Property GlobalDTTipoPeriodo() As DataTable
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
Set(value As DataTable)
Application("GlobalDTTipoPeriodo") = value
Dim AppNombre As String = "GlobalDTTipoPeriodo"
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
'Fin TipoPeriodo
'Periodos
Property GlobalDTNominasPeriodos(CveTipoPeriodo As Integer, CvePeriodo As Integer, CveEmpresa As Integer) As DataTable
Get
Dim Str As New StringBuilder
If CveEmpresa <> -1 Then Str.AppendFormat("CveEmpresa = {0}", CveEmpresa)
If CveTipoPeriodo <> -1 Then Str.AppendFormat(" {0} CveTipoPeriodo = {1}", If(Str.Length > 0, "AND", ""), CveTipoPeriodo)
If CvePeriodo <> -1 Then Str.AppendFormat(" {0} CvePeriodo = {1}", If(Str.Length > 0, "AND", ""), CvePeriodo)
If Str.Length > 0 Then
Dim Dv As New DataView(DirectCast(Application("GlobalDTNominasPeriodos"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
Dim AppNombre As String = $"GlobalDTNominasPeriodos-{CveEmpresa}"
If HttpContext.Current.Application(AppNombre) Is Nothing Then
Using ObjNom As New ClsNominas()
If ObjNom.GetPeriodos(-1, CveEmpresa, -1, -1, -1, -1) Then Application(AppNombre) = ObjNom.DtResultados
End Using
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
Dv.Dispose()
Else
GlobalDTNominasPeriodos = DirectCast(Application("GlobalDTNominasPeriodos"), DataTable)
GlobalDTNominasPeriodos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End If
End Get
Set(value As DataTable)
Application("GlobalDTNominasPeriodos") = value
Dim AppNombre As String = $"GlobalDTNominasPeriodos-{CveEmpresa}"
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
'Fin Periodos
@@ -2274,14 +2322,7 @@ Public Class ClsPaginas
Application(AppNombre) = value
End Set
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
Get
Dim AppNombre As String = "GlobalDTVtaFormaPago"

View File

@@ -82,23 +82,23 @@
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
Using ObjNom As New ClsNominas()
'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.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.GetBancos Then Application("GlobalDTNomSatBancos") = ObjNom.DtResultados Else Application("GlobalDTNomSatBancos") = 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.GetRiesgoPuesto Then Application("GlobalDTNomSatRiesgoPuesto") = ObjNom.DtResultados Else Application("GlobalDTNomSatRiesgoPuesto") = Nothing
If ObjNom.GetTipoIncapacidad Then Application("GlobalDTNomSatTipoIncapacidad") = ObjNom.DtResultados Else Application("GlobalDTNomSatTipoIncapacidad") = Nothing
End Using
'Using ObjNom As New ClsNominas()
' '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.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.GetBancos Then Application("GlobalDTNomSatBancos") = ObjNom.DtResultados Else Application("GlobalDTNomSatBancos") = 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.GetRiesgoPuesto Then Application("GlobalDTNomSatRiesgoPuesto") = ObjNom.DtResultados Else Application("GlobalDTNomSatRiesgoPuesto") = Nothing
' 'If ObjNom.GetTipoIncapacidad Then Application("GlobalDTNomSatTipoIncapacidad") = ObjNom.DtResultados Else Application("GlobalDTNomSatTipoIncapacidad") = Nothing
'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 ----------------------------------------------------------------------------------
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

View File

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