Reloj Checador 2024.04.15
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
Option Strict On
|
||||
|
||||
|
||||
Imports Extensiones
|
||||
Imports System
|
||||
Imports System.Data
|
||||
|
||||
|
||||
|
||||
Partial Class RH_RepChecadorPreAsistencia
|
||||
Inherits ClsPaginas
|
||||
#Region "Propiedades"
|
||||
@@ -543,20 +547,20 @@ Partial Class RH_RepChecadorPreAsistencia
|
||||
DTPreAsistenciasInasistencias = objRH.DtResultados
|
||||
End If
|
||||
|
||||
'If objRH.ChecadorPreAsistenciaRegistrosAsistenciasGet(CveTipoPeriodo, FechaInicioPeriodo, FechaFinPeriodo, UsuarioActual.Empresa.CveEmpresa) Then
|
||||
' DTAsistenciasInasistenciasReg = objRH.DtResultados
|
||||
If objRH.ChecadorPreAsistenciaRegistrosAsistenciasGet(CveTipoPeriodo, FechaInicioPeriodo, FechaFinPeriodo, UsuarioActual.Empresa.CveEmpresa) Then
|
||||
DTAsistenciasInasistenciasReg = objRH.DtResultados
|
||||
|
||||
' If DTAsistenciasInasistenciasReg.Rows.Count > 0 Then
|
||||
' BtnAgregar.Visible = False
|
||||
' BtnEstusAsistenciaModal.Visible = False
|
||||
' 'DdlAsistenciaInacistencia.Enabled = False
|
||||
' Else
|
||||
' BtnAgregar.Visible = True
|
||||
' BtnEstusAsistenciaModal.Visible = True
|
||||
' 'DdlAsistenciaInacistencia.Enabled = True
|
||||
' End If
|
||||
' UpAgregar.Update()
|
||||
'End If
|
||||
'If DTAsistenciasInasistenciasReg.Rows.Count > 0 Then
|
||||
' 'BtnAgregar.Visible = False
|
||||
' 'BtnEstusAsistenciaModal.Visible = False
|
||||
' 'DdlAsistenciaInacistencia.Enabled = False
|
||||
'Else
|
||||
' 'BtnAgregar.Visible = True
|
||||
' 'BtnEstusAsistenciaModal.Visible = True
|
||||
' 'DdlAsistenciaInacistencia.Enabled = True
|
||||
'End If
|
||||
'UpAcciones.Update()
|
||||
End If
|
||||
|
||||
objRH.Dispose()
|
||||
|
||||
@@ -1165,10 +1169,12 @@ Partial Class RH_RepChecadorPreAsistencia
|
||||
End Sub
|
||||
|
||||
Private Sub GvBind()
|
||||
|
||||
LnkEnviarAsistencia.Visible = False
|
||||
If DtDatosTabla.Rows.Count > 0 Then
|
||||
'BtnAgregar.Visible = True
|
||||
GVRegDatos.DataSource = DtDatosTabla
|
||||
LnkEnviarAsistencia.Visible = True
|
||||
|
||||
Else
|
||||
'BtnAgregar.Visible = False
|
||||
GVRegDatos.DataSource = Nothing
|
||||
@@ -1176,6 +1182,7 @@ Partial Class RH_RepChecadorPreAsistencia
|
||||
|
||||
GVRegDatos.DataBind()
|
||||
UpDatos.Update()
|
||||
UpAcciones.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -2100,7 +2107,7 @@ Partial Class RH_RepChecadorPreAsistencia
|
||||
Else
|
||||
objRh.Commit()
|
||||
BtnAgregar.Visible = False
|
||||
UpAgregar.Update()
|
||||
UpAcciones.Update()
|
||||
Alert("Proceso realizado correctamente.")
|
||||
End If
|
||||
objRh.Dispose()
|
||||
@@ -2191,6 +2198,7 @@ Partial Class RH_RepChecadorPreAsistencia
|
||||
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
|
||||
If DdlAsistenciaInacistencia.SelectedValue.ToEntero > 0 Then
|
||||
Dim ObjPersonal As New ClsRH
|
||||
|
||||
'If ObjPersonal.AddAsistencia(CvePersonalSeleccionado, -1, DdlSubProyecto.SelectedValue.ToEntero, FechaSeleccionada, DdlAsistenciaInacistencia.SelectedValue.ToEntero, 100, 0, 0, -1, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "C") Then
|
||||
|
||||
If ObjPersonal.AddPreAsistencia(CvePersonalSeleccionado, FechaSeleccionada, DdlAsistenciaInacistencia.SelectedValue.ToEntero, 100, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
@@ -2198,11 +2206,157 @@ Partial Class RH_RepChecadorPreAsistencia
|
||||
RegistraScript("$('#divDetallesDia').modal('hide');")
|
||||
CargaDatos()
|
||||
|
||||
|
||||
End If
|
||||
|
||||
ObjPersonal.Dispose()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkEnviarAsistencia_Click(sender As Object, e As EventArgs)
|
||||
|
||||
'ValidaEnvioAsistencia
|
||||
'EnviarAsistencia
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub ValidaEnvioAsistencia()
|
||||
|
||||
'Dim DTChecadorRegistros As New DataTable
|
||||
|
||||
Dim ObjPersonal As New ClsRH
|
||||
|
||||
'If ObjPersonal.PreAsistenciaRegistrosGet(FechaInicioPeriodo, FechaFinPeriodo, DdlTurno.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
' DTChecadorRegistros = ObjPersonal.DtResultados
|
||||
'End If
|
||||
|
||||
ObjPersonal.IniciaTransacSQL()
|
||||
Dim TieneError As Boolean = False
|
||||
|
||||
Dim separador() As Char = {"|"c}
|
||||
|
||||
Try
|
||||
For Each GvRow As GridViewRow In GVRegDatos.Rows
|
||||
|
||||
Dim CvePersonal As Integer = GvRow.DataKey("CvePersonal").ToEntero
|
||||
Dim NombreCompleto As String = GvRow.DataKey("NombreCompleto")
|
||||
|
||||
Dim Fecha As Date = FechaInicioPeriodo
|
||||
For x = 3 To GVRegDatos.Columns.Count - 1
|
||||
|
||||
If GVRegDatos.Columns(x).Visible Then
|
||||
|
||||
Dim lnkLinkSender As LinkButton = TryCast(GvRow.Cells(x).Controls(1), LinkButton)
|
||||
|
||||
If lnkLinkSender IsNot Nothing Then
|
||||
Dim arrayComands As String() = lnkLinkSender.CommandArgument.Split(separador)
|
||||
Dim TipoCorto = arrayComands(0)
|
||||
Dim Filtro = arrayComands(1)
|
||||
|
||||
If TipoCorto.Contiene("_ND", "") Then
|
||||
TieneError = True
|
||||
Exit For
|
||||
Else
|
||||
'ok
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Fecha = Fecha.AddDays(1)
|
||||
Next
|
||||
If TieneError Then
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
Catch ex As Exception
|
||||
TieneError = True
|
||||
End Try
|
||||
|
||||
|
||||
If TieneError Then
|
||||
ObjPersonal.RollBack()
|
||||
Alert("Se presento un error al enviar asistencia.", TipoMensaje.MsgAdvertencia)
|
||||
Else
|
||||
ObjPersonal.Commit()
|
||||
Alert("Asistencia enviada correctamente.")
|
||||
End If
|
||||
|
||||
ObjPersonal.Dispose()
|
||||
|
||||
End Sub
|
||||
Private Sub EnviarAsistencia()
|
||||
'Dim DTChecadorRegistros As New DataTable
|
||||
|
||||
Dim ObjPersonal As New ClsRH
|
||||
|
||||
'If ObjPersonal.PreAsistenciaRegistrosGet(FechaInicioPeriodo, FechaFinPeriodo, DdlTurno.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
' DTChecadorRegistros = ObjPersonal.DtResultados
|
||||
'End If
|
||||
|
||||
ObjPersonal.IniciaTransacSQL()
|
||||
Dim TieneError As Boolean = False
|
||||
|
||||
Dim separador() As Char = {"|"c}
|
||||
|
||||
Try
|
||||
For Each GvRow As GridViewRow In GVRegDatos.Rows
|
||||
|
||||
Dim CvePersonal As Integer = GvRow.DataKey("CvePersonal").ToEntero
|
||||
Dim NombreCompleto As String = GvRow.DataKey("NombreCompleto")
|
||||
|
||||
Dim Fecha As Date = FechaInicioPeriodo
|
||||
For x = 3 To GVRegDatos.Columns.Count - 1
|
||||
|
||||
If GVRegDatos.Columns(x).Visible Then
|
||||
|
||||
Dim lnkLinkSender As LinkButton = TryCast(GvRow.Cells(x).Controls(1), LinkButton)
|
||||
|
||||
If lnkLinkSender IsNot Nothing Then
|
||||
Dim arrayComands As String() = lnkLinkSender.CommandArgument.Split(separador)
|
||||
Dim TipoCorto = arrayComands(0)
|
||||
Dim Filtro = arrayComands(1)
|
||||
|
||||
If TipoCorto.Contiene("_ND", "") Then
|
||||
TieneError = True
|
||||
Exit For
|
||||
Else
|
||||
Dim DTTipoAsistenciaInasistencia As DataTable = GlobalDTAsistenciasInasistencias(UsuarioActual.CveEmpresa).FiltraParametros(" TipoCorto = '" & TipoCorto & "' ")
|
||||
|
||||
Dim CveAsistenciasInasistencias As Integer = DTTipoAsistenciaInasistencia(0)("CveAsistenciasInasistencias").ToString.ToEntero
|
||||
Dim PorcentajePago As Integer = If(DTTipoAsistenciaInasistencia(0)("AplicaPago").ToString = "Aplica", 100, 0)
|
||||
|
||||
'If CveAsistenciasInasistencias > 0 Then
|
||||
' If Not ObjPersonal.AddAsistencia(CvePersonal, -1, DdlSubProyecto.SelectedValue.ToEntero, Fecha, CveAsistenciasInasistencias, PorcentajePago, 0, 0, -1, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "C") Then
|
||||
' TieneError = True
|
||||
' Exit For
|
||||
' End If
|
||||
'Else
|
||||
' TieneError = True
|
||||
' Exit For
|
||||
'End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Fecha = Fecha.AddDays(1)
|
||||
Next
|
||||
If TieneError Then
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
Catch ex As Exception
|
||||
TieneError = True
|
||||
End Try
|
||||
|
||||
|
||||
If TieneError Then
|
||||
ObjPersonal.RollBack()
|
||||
Alert("Se presento un error al enviar asistencia.", TipoMensaje.MsgAdvertencia)
|
||||
Else
|
||||
ObjPersonal.Commit()
|
||||
Alert("Asistencia enviada correctamente.")
|
||||
End If
|
||||
|
||||
ObjPersonal.Dispose()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user