Merge branch 'master' of http://jperez@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -2722,6 +2722,27 @@ Public Class ClsRH
|
|||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
Public Function GetPersonalPreAsistenciaRegistros(InicioPeriodo As Date, FinPeriodo As Date, CveEmpresa As Integer) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
|
||||||
|
SqlDataAdapter("PA_RH_PersonalPreAsistenciaRegistrosGet")
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@InicioPeriodo", SqlDbType.Date).Value = InicioPeriodo
|
||||||
|
.Add("@FinPeriodo", SqlDbType.Date).Value = FinPeriodo
|
||||||
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
|
End With
|
||||||
|
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As SqlException
|
||||||
|
OnError("Ocurrió un error al consultar las Asistencias del Personal.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
Public Function AddAsistencia(CvePersonal As Integer, CveCliente As Integer, CveSubProyecto As Integer, Fecha As Date, CveAsistenciasInasistencias As Integer, PorcentajePago As Double,
|
Public Function AddAsistencia(CvePersonal As Integer, CveCliente As Integer, CveSubProyecto As Integer, Fecha As Date, CveAsistenciasInasistencias As Integer, PorcentajePago As Double,
|
||||||
HorasDobles As Double, HorasTriples As Double, CveMotivoHoraExtra As Integer, Observacion As String, CveUsuario As Integer, CveEmpresa As Integer, Modulo As String) As Boolean
|
HorasDobles As Double, HorasTriples As Double, CveMotivoHoraExtra As Integer, Observacion As String, CveUsuario As Integer, CveEmpresa As Integer, Modulo As String) As Boolean
|
||||||
|
|
||||||
@@ -2768,6 +2789,44 @@ Public Class ClsRH
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
Public Function AddPreAsistencia(CvePersonal As Integer, Fecha As Date, CveAsistenciasInasistencias As Integer, PorcentajePago As Double, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
|
||||||
|
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
Data = New DataTable
|
||||||
|
'SqlAdapter = New SqlDataAdapter("PA_RH_PersonalAsistenciasAddUpd", SqlConexion)
|
||||||
|
'SqlAdapter.SelectCommand.CommandType = CommandType.StoredProcedure
|
||||||
|
SqlDataAdapter("PA_RH_PersonalPreAsistenciasAddUpd")
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal
|
||||||
|
.Add("@Fecha", SqlDbType.Date).Value = Fecha
|
||||||
|
.Add("@CveAsistenciasInasistencias", SqlDbType.Int).Value = CveAsistenciasInasistencias
|
||||||
|
.Add("@PorcentajePago", SqlDbType.Float).Value = PorcentajePago
|
||||||
|
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||||
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
|
.Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue
|
||||||
|
End With
|
||||||
|
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
CveAsistencia = SqlAdapter.SelectCommand.Parameters("@RETURN_VALUE").Value.ToString.ToEntero
|
||||||
|
Retorno = True
|
||||||
|
Catch Ex1 As SqlException
|
||||||
|
If Ex1.Message.Contains("Número: 2627;") Then
|
||||||
|
Alert("Ya se registró la Asistencia del día " & Fecha & " para el empleado.", TipoMensaje.MsgAdvertencia)
|
||||||
|
ElseIf Ex1.Message.Contains("x50102;") Then
|
||||||
|
Alert("No se puede editar o agregar la asistencia ya que se encuentra vinculada a un periodo autorizado.", TipoMensaje.MsgAdvertencia)
|
||||||
|
GuardaLog(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", "Ocurrió un error al editar o agregar la asistencia ", Ex1.ToString, vbCrLf, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()))
|
||||||
|
Else
|
||||||
|
Me.OnError("Ocurrió un error al guardar la Asistencia.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al guardar la Pre Asistencia.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
Public Function UpAsistenciaDetalle(CveEmpresa As Integer, CveUsuario As Integer, registros As List(Of RequestUpAsistenciaDetalle)) As Boolean
|
Public Function UpAsistenciaDetalle(CveEmpresa As Integer, CveUsuario As Integer, registros As List(Of RequestUpAsistenciaDetalle)) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
Dim xmlProductos As System.Xml.Linq.XDocument = Nothing
|
Dim xmlProductos As System.Xml.Linq.XDocument = Nothing
|
||||||
|
|||||||
@@ -20743,7 +20743,7 @@ Partial Class Compras_Compras
|
|||||||
Dim Diferencia As Decimal = saldoTotal - TotalAcumuladoTabla - ValImporte
|
Dim Diferencia As Decimal = saldoTotal - TotalAcumuladoTabla - ValImporte
|
||||||
|
|
||||||
If (Diferencia) < 0 Then
|
If (Diferencia) < 0 Then
|
||||||
Alert($"No hay presupuesto disponible en el subproyecto <b>{ValSubProyecto}</b> con la clasificación <b>{ValClasificacion}</b>, Tipo de gasto <b>{ValTipoGasto}</b>. Se excede por <b>{Math.Abs(Diferencia).FormatoNumero}</b>", TipoMensaje.MsgAdvertencia)
|
Alert($"No hay presupuesto disponible. <br>SubProyecto: <b>{ValSubProyecto}</b> <br>Clasificación: <b>{ValClasificacion}</b> <br>Tipo de gasto: <b>{ValTipoGasto}</b>. Se excede por <b>{Math.Abs(Diferencia).FormatoNumero}.</b>", TipoMensaje.MsgAdvertencia)
|
||||||
respuesta = False
|
respuesta = False
|
||||||
|
|
||||||
Else
|
Else
|
||||||
@@ -20751,7 +20751,7 @@ Partial Class Compras_Compras
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Else
|
Else
|
||||||
Alert($"No hay presupuesto disponible en el subproyecto <b>{ValSubProyecto}</b> con la clasificación <b>{ValClasificacion}</b>, Tipo de gasto <b>{ValTipoGasto}</b> ", TipoMensaje.MsgAdvertencia)
|
Alert($"No hay presupuesto disponible. <br>SubProyecto: <b>{ValSubProyecto}</b> <br>Clasificación: <b>{ValClasificacion}</b> <br>Tipo de gasto: <b>{ValTipoGasto}</b>.", TipoMensaje.MsgAdvertencia)
|
||||||
respuesta = False
|
respuesta = False
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
@@ -20808,16 +20808,24 @@ Partial Class Compras_Compras
|
|||||||
Dim tieneRegistrosConCveSubProyecto As Boolean = resultadosFiltrados.Any(Function(row) CType(row("CveSubProyecto"), Integer) = item.CveSubProyecto)
|
Dim tieneRegistrosConCveSubProyecto As Boolean = resultadosFiltrados.Any(Function(row) CType(row("CveSubProyecto"), Integer) = item.CveSubProyecto)
|
||||||
|
|
||||||
If tieneRegistrosConCveSubProyecto Then
|
If tieneRegistrosConCveSubProyecto Then
|
||||||
Dim saldoTotal As Decimal = (From row In resultadosFiltrados
|
'Dim saldoTotal As Decimal = (From row In resultadosFiltrados
|
||||||
|
' Where row.Field(Of Integer)("CveSubProyecto") = item.CveSubProyecto AndAlso
|
||||||
|
' row.Field(Of Integer)("CveClasificacion") = item.CveClasificacion
|
||||||
|
' Select row.Field(Of Decimal)("Saldo")).Sum()
|
||||||
|
|
||||||
|
Dim saldoTotal As Decimal = (From row In resultadosFiltrados.AsEnumerable()
|
||||||
Where row.Field(Of Integer)("CveSubProyecto") = item.CveSubProyecto AndAlso
|
Where row.Field(Of Integer)("CveSubProyecto") = item.CveSubProyecto AndAlso
|
||||||
row.Field(Of Integer)("CveClasificacion") = item.CveClasificacion
|
If(row.IsNull("CveClasificacion"),
|
||||||
|
0,
|
||||||
|
row.Field(Of Integer?)("CveClasificacion").GetValueOrDefault()) = item.CveClasificacion
|
||||||
Select row.Field(Of Decimal)("Saldo")).Sum()
|
Select row.Field(Of Decimal)("Saldo")).Sum()
|
||||||
|
|
||||||
If saldoTotal > 0 Then
|
If saldoTotal > 0 Then
|
||||||
|
|
||||||
Dim Diferencia As Decimal = saldoTotal - item.TotalSum
|
Dim Diferencia As Decimal = saldoTotal - item.TotalSum
|
||||||
|
|
||||||
If (Diferencia) < 0 Then
|
If (Diferencia) < 0 Then
|
||||||
Alert($"No hay presupuesto disponible en el subproyecto <b>{item.SubProyecto}</b> con la clasificación <b>{item.Clasificacion}</b>, Tipo de gasto <b>{item.TipoGasto}</b>. Se excede por <b>{Math.Abs(Diferencia).FormatoNumero}</b>", TipoMensaje.MsgAdvertencia)
|
Alert($"No hay presupuesto disponible. <br>SubProyecto: <b>{item.SubProyecto}</b> <br>Clasificación: <b>{item.Clasificacion}</b> <br>Tipo de gasto: <b>{item.TipoGasto}</b>. Se excede por <b>{Math.Abs(Diferencia).FormatoNumero}.</b>", TipoMensaje.MsgAdvertencia)
|
||||||
respuesta = False
|
respuesta = False
|
||||||
Exit For
|
Exit For
|
||||||
Else
|
Else
|
||||||
@@ -20825,7 +20833,7 @@ Partial Class Compras_Compras
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Else
|
Else
|
||||||
Alert($"No hay presupuesto disponible en el subproyecto <b>{item.SubProyecto}</b> con la clasificación <b>{item.Clasificacion}</b>, Tipo de gasto <b>{item.TipoGasto}</b>", TipoMensaje.MsgAdvertencia)
|
Alert($"No hay presupuesto disponible. <br>SubProyecto: <b>{item.SubProyecto}</b> <br>Clasificación: <b>{item.Clasificacion}</b> <br>Tipo de gasto: <b>{item.TipoGasto}</b>.", TipoMensaje.MsgAdvertencia)
|
||||||
respuesta = False
|
respuesta = False
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -3252,7 +3252,7 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
Msg.AppendFormat("<br/><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Consola</a> ", Encripta(String.Format("OP=Alm&CveMovimiento={0}&Consola={1}", CveMovimiento, Consola)))
|
Msg.AppendFormat("<br/><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Consola</a> ", Encripta(String.Format("OP=Alm&CveMovimiento={0}&Consola={1}", CveMovimiento, Consola)))
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If CveMovimientoEntrada > 0 Then
|
If CveMovimientoEntrada > 0 AndAlso Not UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then
|
||||||
Msg.AppendFormat("<br/><br/> Movimiento Entrada (Traspaso): <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a></b>", CveMovimientoEntrada, FolioEntrada)
|
Msg.AppendFormat("<br/><br/> Movimiento Entrada (Traspaso): <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a></b>", CveMovimientoEntrada, FolioEntrada)
|
||||||
Msg.AppendFormat("<br/> <a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Movimiento</a> ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoEntrada)))
|
Msg.AppendFormat("<br/> <a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Movimiento</a> ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoEntrada)))
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -16,11 +16,15 @@
|
|||||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||||
<asp:UpdatePanel runat="server" ID="UpAgregar" UpdateMode="Conditional" >
|
<asp:UpdatePanel runat="server" ID="UpAcciones" UpdateMode="Conditional" >
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<li>
|
<li>
|
||||||
<asp:LinkButton runat="server" ID="BtnAgregar" Visible="false" data-toggle="tooltip" data-placement="left" title="Procesar" Text="<i class='fa fa-plus'></i> Procesar"></asp:LinkButton>
|
<asp:LinkButton runat="server" ID="BtnAgregar" Visible="false" data-toggle="tooltip" data-placement="left" title="Procesar" Text="<i class='fa fa-plus'></i> Procesar"></asp:LinkButton>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<asp:LinkButton runat="server" ID="LnkEnviarAsistencia" Visible="false" data-toggle="tooltip" data-placement="left" title="Enviar Asistencia" Text="<i class='fa fa-arrow-right'></i> Enviar Asistencia"
|
||||||
|
OnClick="LnkEnviarAsistencia_Click"></asp:LinkButton>
|
||||||
|
</li>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
@@ -33,45 +37,27 @@
|
|||||||
<div class="portlet solid grey-cascade portlet-filter" style="">
|
<div class="portlet solid grey-cascade portlet-filter" style="">
|
||||||
<div class="portlet-title portlet-filterT" style="">
|
<div class="portlet-title portlet-filterT" style="">
|
||||||
<div class="titlefiltros caption ">
|
<div class="titlefiltros caption ">
|
||||||
|
|
||||||
|
|
||||||
<ul class="list-inline text-size-12">
|
<ul class="list-inline text-size-12">
|
||||||
|
<li>Ejercicio:
|
||||||
|
|
||||||
|
<asp:DropDownList ID="DdlEjercicios" runat="server" OnSelectedIndexChanged="DdlEjercicios_SelectedIndexChanged" AutoPostBack="true"
|
||||||
|
style="width: 120px !important;" CssClass="select2me" DataValueField="Ejercicio" DataTextField="Ejercicio"></asp:DropDownList>
|
||||||
|
|
||||||
|
</li>
|
||||||
<li>Tipo Periodo:
|
<li>Tipo Periodo:
|
||||||
<asp:DropDownList ID="DdlTipoPeriodo" AutoPostBack="true" runat="server" CssClass="form-control input-sm select2me" Style="width: 120px !important;" ValidationGroup="GrpGuardar" DataTextField="TipoPeriodo" DataValueField="CveTipoPeriodo">
|
<asp:DropDownList ID="DdlTipoPeriodo" AutoPostBack="true" runat="server" CssClass="form-control input-sm select2me" Style="width: 120px !important;" ValidationGroup="GrpGuardar" DataTextField="TipoPeriodo" DataValueField="CveTipoPeriodo">
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
</li>
|
</li>
|
||||||
<li><asp:label ID="LblPeriodo" runat="server" Visible="true" >Periodo:</asp:label>
|
<li>
|
||||||
<asp:DropDownList ID="DdlRango" Visible="true" AutoPostBack="true" runat="server" CssClass="form-control input-sm select2me" Style="width: 275px !important;" DataTextField="NominaEstatus" DataValueField="CvePeriodo" ValidationGroup="GrpGuardar">
|
Período:
|
||||||
|
<asp:DropDownList ID="DdlPeriodo" runat="server" CssClass="select2me"
|
||||||
|
DataTextField="NominaEstatus" DataValueField="CvePeriodo" style="width: 120px !important;" >
|
||||||
|
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
</li>
|
</li>
|
||||||
<%--<li>Fecha Inicio:
|
|
||||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;">
|
|
||||||
<asp:TextBox ID="TxtInicio" runat="server" CssClass="form-control input-sm" CausesValidation="true" MaxLength="10" Width="82px "></asp:TextBox>
|
|
||||||
<span class="input-group-btn ">
|
|
||||||
<asp:LinkButton ID="ImgFechaInicio" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<ajax:MaskedEditExtender ID="MEEFecha" runat="server" TargetControlID="TxtInicio" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
|
||||||
<ajax:CalendarExtender runat="server" ID="CEFecha" TargetControlID="TxtInicio" PopupButtonID="ImgFechaInicio" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
|
||||||
<asp:RequiredFieldValidator ID="RFVFecha" runat="server" ControlToValidate="TxtInicio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha inicio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEmitirImprimir"></asp:RequiredFieldValidator>
|
|
||||||
<asp:CompareValidator ID="CVFecha" runat="server" ControlToValidate="TxtInicio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpEmitirImprimir"></asp:CompareValidator>
|
|
||||||
<ajax:ValidatorCalloutExtender ID="VCOFecha1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFecha" Width="350px"></ajax:ValidatorCalloutExtender>
|
|
||||||
<ajax:ValidatorCalloutExtender ID="VCOFecha2" runat="server" HighlightCssClass="vco" TargetControlID="CVFecha" Width="350px"></ajax:ValidatorCalloutExtender>
|
|
||||||
</li>
|
|
||||||
<li>Fecha Fin:
|
|
||||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;">
|
|
||||||
<asp:TextBox ID="TxtFechaFin" runat="server" CssClass="form-control input-sm" CausesValidation="true" MaxLength="10" Width="82px "></asp:TextBox>
|
|
||||||
<span class="input-group-btn ">
|
|
||||||
<asp:LinkButton ID="ImgFechaFin" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<ajax:MaskedEditExtender ID="MEETxtFechaFin" runat="server" TargetControlID="TxtFechaFin" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
|
||||||
<ajax:CalendarExtender runat="server" ID="CETxtFechaFin" TargetControlID="TxtFechaFin" PopupButtonID="ImgFechaFin" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
|
||||||
|
|
||||||
<asp:RequiredFieldValidator ID="RfvTxtFechaFin" runat="server" ControlToValidate="TxtFechaFin" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Fin''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEmitirImprimir"></asp:RequiredFieldValidator>
|
|
||||||
<asp:CompareValidator ID="CvTxtFechaFin" runat="server" ControlToValidate="TxtFechaFin" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpEmitirImprimir"></asp:CompareValidator>
|
|
||||||
|
|
||||||
<ajax:ValidatorCalloutExtender ID="RfvcTxtFechaFin" runat="server" HighlightCssClass="vco" TargetControlID="RfvTxtFechaFin" Width="350px"></ajax:ValidatorCalloutExtender>
|
|
||||||
<ajax:ValidatorCalloutExtender ID="CvcTxtFechaFin" runat="server" HighlightCssClass="vco" TargetControlID="CvTxtFechaFin" Width="350px"></ajax:ValidatorCalloutExtender>
|
|
||||||
</li>--%>
|
|
||||||
<li>SubProyecto:
|
<li>SubProyecto:
|
||||||
<asp:DropDownList ID="DdlSubProyecto" runat="server" CssClass="form-control input-sm select2me" Style="width: 135px; !important;" DataTextField="SubProyecto" DataValueField="CveSubproyecto">
|
<asp:DropDownList ID="DdlSubProyecto" runat="server" CssClass="form-control input-sm select2me" Style="width: 135px; !important;" DataTextField="SubProyecto" DataValueField="CveSubproyecto">
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
@@ -340,7 +326,7 @@
|
|||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<asp:Button ID="BtnGuardar" Visible="true" runat="server" Text="Guardar" class="btn btn-primary" OnClick="BtnGuardar_Click" />
|
<asp:Button ID="BtnGuardar" Visible="true" runat="server" Text="Guardar" class="btn btn-primary" OnClick="BtnGuardar_Click" />
|
||||||
<asp:Button ID="BtnEstusAsistenciaModal" Visible="false" runat="server" class="btn btn-success" Text="Aceptar" />
|
<%--<asp:Button ID="BtnEstusAsistenciaModal" Visible="false" runat="server" class="btn btn-success" Text="Aceptar" />--%>
|
||||||
<button id="Button4" runat="server" type="button" class="btn default" data-dismiss="modal">Cerrar</button>
|
<button id="Button4" runat="server" type="button" class="btn default" data-dismiss="modal">Cerrar</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
Option Strict On
|
Option Strict On
|
||||||
|
|
||||||
|
|
||||||
Imports Extensiones
|
Imports Extensiones
|
||||||
|
Imports System
|
||||||
Imports System.Data
|
Imports System.Data
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Partial Class RH_RepChecadorPreAsistencia
|
Partial Class RH_RepChecadorPreAsistencia
|
||||||
Inherits ClsPaginas
|
Inherits ClsPaginas
|
||||||
#Region "Propiedades"
|
#Region "Propiedades"
|
||||||
@@ -60,16 +65,16 @@ Partial Class RH_RepChecadorPreAsistencia
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Private Property DTPeridos As DataTable
|
Private Property DTPeriodos As DataTable
|
||||||
Get
|
Get
|
||||||
If ViewState("DTPeridoso") Is Nothing Then
|
If ViewState("DTPeriodos") Is Nothing Then
|
||||||
Return New DataTable
|
Return New DataTable
|
||||||
Else
|
Else
|
||||||
Return DirectCast(ViewState("DTPeridoso"), DataTable)
|
Return DirectCast(ViewState("DTPeriodos"), DataTable)
|
||||||
End If
|
End If
|
||||||
End Get
|
End Get
|
||||||
Set(value As DataTable)
|
Set(value As DataTable)
|
||||||
ViewState("DTPeridoso") = value
|
ViewState("DTPeriodos") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
@@ -153,11 +158,26 @@ Partial Class RH_RepChecadorPreAsistencia
|
|||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
|
||||||
|
'Private Property dtPeriodos As DataTable
|
||||||
|
' Get
|
||||||
|
' If ViewState("dtPeriodos") Is Nothing Then
|
||||||
|
' Return Nothing
|
||||||
|
' Else
|
||||||
|
' Return DirectCast(ViewState("dtPeriodos"), DataTable)
|
||||||
|
' End If
|
||||||
|
' End Get
|
||||||
|
' Set(value As DataTable)
|
||||||
|
' ViewState("dtPeriodos") = value
|
||||||
|
' End Set
|
||||||
|
'End Property
|
||||||
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
Private Sub RH_RepChecadorIncidencias_Load(sender As Object, e As EventArgs) Handles Me.Load
|
Private Sub RH_RepChecadorIncidencias_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||||
|
|
||||||
If Not Page.IsPostBack Then
|
If Not Page.IsPostBack Then
|
||||||
|
cargaEjercicios()
|
||||||
CargaCombos()
|
CargaCombos()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -165,6 +185,81 @@ Partial Class RH_RepChecadorPreAsistencia
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Private Sub cargaEjercicios()
|
||||||
|
Dim EjercicioActual As Integer = UsuarioActual.Empresa.EjercicioActual
|
||||||
|
If EjercicioActual = 0 Then
|
||||||
|
EjercicioActual = Now.Year
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim dtejercicio As DataTable = Nothing
|
||||||
|
Using objnom As New ClsNominas()
|
||||||
|
If objnom.GetEjercicios(UsuarioActual.CveEmpresa) Then
|
||||||
|
dtejercicio = objnom.DtResultados
|
||||||
|
End If
|
||||||
|
End Using
|
||||||
|
|
||||||
|
DdlEjercicios.DataSource = dtejercicio
|
||||||
|
DdlEjercicios.DataBind()
|
||||||
|
|
||||||
|
Dim litem As ListItem = Nothing
|
||||||
|
If dtejercicio IsNot Nothing AndAlso dtejercicio.Rows.Count > 0 Then
|
||||||
|
If dtejercicio.Compute("COUNT(Ejercicio)", String.Format("Ejercicio={0}", EjercicioActual)).ToString.ToEntero = 0 Then
|
||||||
|
litem = New ListItem(EjercicioActual.ToString(), EjercicioActual.ToString())
|
||||||
|
DdlEjercicios.Items.Insert(0, litem)
|
||||||
|
End If
|
||||||
|
If dtejercicio.Compute("COUNT(Ejercicio)", String.Format("Ejercicio={0}", EjercicioActual - 1)).ToString.ToEntero = 0 Then
|
||||||
|
litem = New ListItem((EjercicioActual - 1).ToString(), (EjercicioActual - 1).ToString())
|
||||||
|
DdlEjercicios.Items.Insert(1, litem)
|
||||||
|
' DdlEjerciciosCM.Items.Insert(1, litem)
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
litem = New ListItem(EjercicioActual.ToString(), EjercicioActual.ToString())
|
||||||
|
DdlEjercicios.Items.Insert(0, litem)
|
||||||
|
'DdlEjerciciosCM.Items.Insert(0, litem)
|
||||||
|
litem = New ListItem((EjercicioActual - 1).ToString(), (EjercicioActual - 1).ToString())
|
||||||
|
DdlEjercicios.Items.Insert(1, litem)
|
||||||
|
'DdlEjerciciosCM.Items.Insert(1, litem)
|
||||||
|
End If
|
||||||
|
|
||||||
|
If DdlEjercicios.Items.Count > 0 Then
|
||||||
|
DdlEjercicios.SelectedIndex = 0
|
||||||
|
End If
|
||||||
|
|
||||||
|
' Additional method to check if selected value exists, and set it if it does
|
||||||
|
DdlEjercicios.SelectedValueExist(Now.Year.ToString())
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub DdlEjercicios_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||||
|
cargaPeriodos()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub cargaPeriodos()
|
||||||
|
BtnConsultar.Enabled = False
|
||||||
|
Dim tipoPeriodo As Integer = DdlTipoPeriodo.SelectedValue.ToEntero()
|
||||||
|
Dim ejercicio As Integer = DdlEjercicios.SelectedValue.ToEntero()
|
||||||
|
DTPeriodos = Nothing
|
||||||
|
|
||||||
|
If DdlTipoPeriodo.SelectedValue.ToEntero() > 0 Then
|
||||||
|
Using objPeriodos As New ClsNominas()
|
||||||
|
If objPeriodos.GetPeriodos(tipoPeriodo, UsuarioActual.CveEmpresa, ejercicio, -1, -1) Then
|
||||||
|
If objPeriodos.DtResultados.Rows.Count = 0 Then
|
||||||
|
Alert("No existen periodos registrados en este año y tipo de periodo, ¿desea registrarlos masivamente?", TipoMensaje.MsgConfirmacion, "$(""#divCargaMasiva"").modal(""show"");", TextoConfirmacion:="Aceptar", TextoSegundoBoton:="No")
|
||||||
|
End If
|
||||||
|
DTPeriodos = objPeriodos.DtResultados.FiltraParametros("Estatus IN (1,2,3,4,5)")
|
||||||
|
End If
|
||||||
|
End Using
|
||||||
|
|
||||||
|
BtnConsultar.Enabled = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
DdlPeriodo.DataSource = DTPeriodos
|
||||||
|
DdlPeriodo.DataBind()
|
||||||
|
DdlPeriodo.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||||
|
UPFiltros.Update()
|
||||||
|
'muestraPeriodo()
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private Sub CargaCombos()
|
Private Sub CargaCombos()
|
||||||
|
|
||||||
|
|
||||||
@@ -198,10 +293,10 @@ Partial Class RH_RepChecadorPreAsistencia
|
|||||||
|
|
||||||
lblTituloPagina.Text = ""
|
lblTituloPagina.Text = ""
|
||||||
|
|
||||||
If DdlRango.SelectedIndex > 0 Then
|
If DdlPeriodo.SelectedIndex > 0 Then
|
||||||
lblTituloPagina.Text = DdlRango.SelectedItem.Text
|
lblTituloPagina.Text = DdlPeriodo.SelectedItem.Text
|
||||||
|
|
||||||
Dim DtTemp As DataTable = DTPeridos.FiltraParametros("CvePeriodo = " & DdlRango.SelectedValue.ToEntero)
|
Dim DtTemp As DataTable = DTPeriodos.FiltraParametros("CvePeriodo = " & DdlPeriodo.SelectedValue.ToEntero)
|
||||||
FechaInicioPeriodo = DtTemp(0)("FechaInicio").ToString().ToDate
|
FechaInicioPeriodo = DtTemp(0)("FechaInicio").ToString().ToDate
|
||||||
FechaFinPeriodo = DtTemp(0)("FechaFin").ToString().ToDate
|
FechaFinPeriodo = DtTemp(0)("FechaFin").ToString().ToDate
|
||||||
End If
|
End If
|
||||||
@@ -212,8 +307,8 @@ Partial Class RH_RepChecadorPreAsistencia
|
|||||||
|
|
||||||
Protected Sub DdlTipoPeriodo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoPeriodo.SelectedIndexChanged
|
Protected Sub DdlTipoPeriodo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoPeriodo.SelectedIndexChanged
|
||||||
|
|
||||||
DdlRango.Items.Clear()
|
DdlPeriodo.Items.Clear()
|
||||||
DTPeridos = Nothing
|
DTPeriodos = Nothing
|
||||||
|
|
||||||
Dim objRh As New ClsRH
|
Dim objRh As New ClsRH
|
||||||
|
|
||||||
@@ -222,53 +317,57 @@ Partial Class RH_RepChecadorPreAsistencia
|
|||||||
CveTipoPeriodo = DdlTipoPeriodo.SelectedValue.ToEntero
|
CveTipoPeriodo = DdlTipoPeriodo.SelectedValue.ToEntero
|
||||||
DiasPeriodo = DTTipoPeriodoDatos.FiltraParametros(" CveTipoPeriodo = " & DdlTipoPeriodo.SelectedValue)(0)("DiasPeriodo").ToString().ToEntero
|
DiasPeriodo = DTTipoPeriodoDatos.FiltraParametros(" CveTipoPeriodo = " & DdlTipoPeriodo.SelectedValue)(0)("DiasPeriodo").ToString().ToEntero
|
||||||
|
|
||||||
Dim objNomina As New ClsNominas
|
|
||||||
|
|
||||||
If objNomina.GetPeriodos(DdlTipoPeriodo.SelectedValue.ToEntero, UsuarioActual.Empresa.CveEmpresa, -1, -1, -1) Then
|
cargaPeriodos()
|
||||||
|
|
||||||
TxtFechaModal.Text = ""
|
'Dim objNomina As New ClsNominas
|
||||||
lblTituloPagina.Text = ""
|
|
||||||
UpTituloPagina.Update()
|
|
||||||
UpModalFechaBody.Update()
|
|
||||||
|
|
||||||
If objNomina.DtResultados.Rows.Count > 0 Then
|
'If objNomina.GetPeriodos(DdlTipoPeriodo.SelectedValue.ToEntero, UsuarioActual.Empresa.CveEmpresa, -1, -1, -1) Then
|
||||||
BtnConsultar.Enabled = True
|
|
||||||
DTPeridos = objNomina.DtResultados
|
|
||||||
Dim DTPeridosView As DataView = DTPeridos.DefaultView
|
|
||||||
DTPeridosView.Sort = " FechaInicio desc "
|
|
||||||
DTPeridos = DTPeridosView.ToTable
|
|
||||||
DdlRango.DataSource = objNomina.DtResultados
|
|
||||||
|
|
||||||
' LblPeriodo.Visible = True
|
' TxtFechaModal.Text = ""
|
||||||
'DdlRango.Visible = True
|
' lblTituloPagina.Text = ""
|
||||||
Else
|
' UpTituloPagina.Update()
|
||||||
' RegistraScript("$('#ModalModalFecha').modal({ backdrop: 'static', keyboard: false});")
|
' UpModalFechaBody.Update()
|
||||||
Alert("No se encontraron periodos disponibles.", TipoMensaje.MsgAdvertencia)
|
|
||||||
DTPeridos = Nothing
|
|
||||||
DdlRango.DataSource = Nothing
|
|
||||||
End If
|
|
||||||
Else
|
|
||||||
DTPeridos = Nothing
|
|
||||||
DdlRango.DataSource = Nothing
|
|
||||||
End If
|
|
||||||
|
|
||||||
Dim DtTempFechaInicial As DataTable = DTPeridos.FiltraParametros("Estatus = 1")
|
' If objNomina.DtResultados.Rows.Count > 0 Then
|
||||||
|
' BtnConsultar.Enabled = True
|
||||||
|
' DTPeriodos = objNomina.DtResultados
|
||||||
|
' Dim DTPeridosView As DataView = DTPeriodos.DefaultView
|
||||||
|
' DTPeridosView.Sort = " FechaInicio desc "
|
||||||
|
' DTPeriodos = DTPeridosView.ToTable
|
||||||
|
' DdlPeriodo.DataSource = objNomina.DtResultados
|
||||||
|
|
||||||
objNomina.Dispose()
|
' ' LblPeriodo.Visible = True
|
||||||
DdlRango.DataBind()
|
' 'DdlRango.Visible = True
|
||||||
|
' Else
|
||||||
|
' ' RegistraScript("$('#ModalModalFecha').modal({ backdrop: 'static', keyboard: false});")
|
||||||
|
' Alert("No se encontraron periodos disponibles.", TipoMensaje.MsgAdvertencia)
|
||||||
|
' DTPeriodos = Nothing
|
||||||
|
' DdlPeriodo.DataSource = Nothing
|
||||||
|
' End If
|
||||||
|
'Else
|
||||||
|
' DTPeriodos = Nothing
|
||||||
|
' DdlPeriodo.DataSource = Nothing
|
||||||
|
'End If
|
||||||
|
'objNomina.Dispose()
|
||||||
|
|
||||||
|
Dim DtTempFechaInicial As DataTable = DTPeriodos.FiltraParametros("Estatus = 1")
|
||||||
|
|
||||||
|
|
||||||
|
DdlPeriodo.DataBind()
|
||||||
|
|
||||||
If DtTempFechaInicial.Rows.Count > 0 Then
|
If DtTempFechaInicial.Rows.Count > 0 Then
|
||||||
Dim temCvePeriodoNomi As Integer = DtTempFechaInicial(0)("CvePeriodo").ToString().ToEntero
|
Dim temCvePeriodoNomi As Integer = DtTempFechaInicial(0)("CvePeriodo").ToString().ToEntero
|
||||||
DdlRango.SelectedValueExist(temCvePeriodoNomi)
|
DdlPeriodo.SelectedValueExist(temCvePeriodoNomi)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
DdlRango.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
|
DdlPeriodo.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
|
||||||
UPFiltros.Update()
|
UPFiltros.Update()
|
||||||
' BtnConsultar.Enabled = True
|
' BtnConsultar.Enabled = True
|
||||||
Else
|
Else
|
||||||
|
|
||||||
DTPeridos = Nothing
|
DTPeriodos = Nothing
|
||||||
DdlRango.DataSource = Nothing
|
DdlPeriodo.DataSource = Nothing
|
||||||
|
|
||||||
'DdlRango.Visible = False
|
'DdlRango.Visible = False
|
||||||
' LblPeriodo.Visible = Fale
|
' LblPeriodo.Visible = Fale
|
||||||
@@ -281,7 +380,7 @@ Partial Class RH_RepChecadorPreAsistencia
|
|||||||
GeneraFechasInicioFinPerdiodo()
|
GeneraFechasInicioFinPerdiodo()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub DdlRango_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlRango.SelectedIndexChanged
|
Private Sub DdlRango_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPeriodo.SelectedIndexChanged
|
||||||
|
|
||||||
GeneraFechasInicioFinPerdiodo()
|
GeneraFechasInicioFinPerdiodo()
|
||||||
UpTituloPagina.Update()
|
UpTituloPagina.Update()
|
||||||
@@ -302,7 +401,8 @@ Partial Class RH_RepChecadorPreAsistencia
|
|||||||
Dim dt As New DataTable
|
Dim dt As New DataTable
|
||||||
|
|
||||||
Dim Retardos As Integer = 0
|
Dim Retardos As Integer = 0
|
||||||
Dim DTAsistenciasInasistencias As New DataTable
|
'Dim DTAsistenciasInasistencias As New DataTable
|
||||||
|
Dim DTPreAsistenciasInasistencias As New DataTable
|
||||||
Dim DTChecadorRegistros As New DataTable
|
Dim DTChecadorRegistros As New DataTable
|
||||||
Dim DTHorarios As New DataTable
|
Dim DTHorarios As New DataTable
|
||||||
Dim DTDiasInhabiles As New DataTable
|
Dim DTDiasInhabiles As New DataTable
|
||||||
@@ -376,7 +476,7 @@ Partial Class RH_RepChecadorPreAsistencia
|
|||||||
Resultados.Columns.Add("TipoCorto")
|
Resultados.Columns.Add("TipoCorto")
|
||||||
Resultados.Columns.Add("Sancion")
|
Resultados.Columns.Add("Sancion")
|
||||||
|
|
||||||
If DdlTipoPeriodo.SelectedValue.ToEntero > 0 And DdlRango.SelectedValue.ToEntero > 0 Then
|
If DdlTipoPeriodo.SelectedValue.ToEntero > 0 And DdlPeriodo.SelectedValue.ToEntero > 0 Then
|
||||||
|
|
||||||
Dim FiltroSubProyecto As String = ""
|
Dim FiltroSubProyecto As String = ""
|
||||||
Dim filtroturno = If(DdlTurno.SelectedValue = "-1", "", $"AND CveTurno = { DdlTurno.SelectedValue}")
|
Dim filtroturno = If(DdlTurno.SelectedValue = "-1", "", $"AND CveTurno = { DdlTurno.SelectedValue}")
|
||||||
@@ -388,7 +488,7 @@ Partial Class RH_RepChecadorPreAsistencia
|
|||||||
|
|
||||||
'DtPersonal = GlobalDTRHPersonal(UsuarioActual.Empresa.CveEmpresa).FiltraParametros(FiltroSubProyecto)
|
'DtPersonal = GlobalDTRHPersonal(UsuarioActual.Empresa.CveEmpresa).FiltraParametros(FiltroSubProyecto)
|
||||||
|
|
||||||
Dim DtTempPeriodo As DataTable = DTPeridos.FiltraParametros("CvePeriodo = " & DdlRango.SelectedValue.ToEntero)
|
Dim DtTempPeriodo As DataTable = DTPeriodos.FiltraParametros("CvePeriodo = " & DdlPeriodo.SelectedValue.ToEntero)
|
||||||
Dim FechaInicioPeriodoFiltro = DtTempPeriodo(0)("FechaInicio").ToString().ToDate
|
Dim FechaInicioPeriodoFiltro = DtTempPeriodo(0)("FechaInicio").ToString().ToDate
|
||||||
|
|
||||||
Dim FilasFiltradas = From fila In GlobalDTRHPersonal(UsuarioActual.Empresa.CveEmpresa).FiltraParametros(FiltroSubProyecto).AsEnumerable()
|
Dim FilasFiltradas = From fila In GlobalDTRHPersonal(UsuarioActual.Empresa.CveEmpresa).FiltraParametros(FiltroSubProyecto).AsEnumerable()
|
||||||
@@ -439,24 +539,28 @@ Partial Class RH_RepChecadorPreAsistencia
|
|||||||
DtVacaciones = objRH.DtResultados
|
DtVacaciones = objRH.DtResultados
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If objRH.GetPersonalAsistenciaRegistros(FechaInicioPeriodo, FechaFinPeriodo, UsuarioActual.CveEmpresa) Then
|
'If objRH.GetPersonalAsistenciaRegistros(FechaInicioPeriodo, FechaFinPeriodo, UsuarioActual.CveEmpresa) Then
|
||||||
DTAsistenciasInasistencias = objRH.DtResultados
|
' DTAsistenciasInasistencias = objRH.DtResultados
|
||||||
|
'End If
|
||||||
|
|
||||||
|
If objRH.GetPersonalPreAsistenciaRegistros(FechaInicioPeriodo, FechaFinPeriodo, UsuarioActual.CveEmpresa) Then
|
||||||
|
DTPreAsistenciasInasistencias = objRH.DtResultados
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'If objRH.ChecadorPreAsistenciaRegistrosAsistenciasGet(CveTipoPeriodo, FechaInicioPeriodo, FechaFinPeriodo, UsuarioActual.Empresa.CveEmpresa) Then
|
If objRH.ChecadorPreAsistenciaRegistrosAsistenciasGet(CveTipoPeriodo, FechaInicioPeriodo, FechaFinPeriodo, UsuarioActual.Empresa.CveEmpresa) Then
|
||||||
' DTAsistenciasInasistenciasReg = objRH.DtResultados
|
DTAsistenciasInasistenciasReg = objRH.DtResultados
|
||||||
|
|
||||||
'If DTAsistenciasInasistenciasReg.Rows.Count > 0 Then
|
'If DTAsistenciasInasistenciasReg.Rows.Count > 0 Then
|
||||||
' BtnAgregar.Visible = False
|
' 'BtnAgregar.Visible = False
|
||||||
' BtnEstusAsistenciaModal.Visible = False
|
' 'BtnEstusAsistenciaModal.Visible = False
|
||||||
' 'DdlAsistenciaInacistencia.Enabled = False
|
' 'DdlAsistenciaInacistencia.Enabled = False
|
||||||
'Else
|
'Else
|
||||||
' BtnAgregar.Visible = True
|
' 'BtnAgregar.Visible = True
|
||||||
' BtnEstusAsistenciaModal.Visible = True
|
' 'BtnEstusAsistenciaModal.Visible = True
|
||||||
' 'DdlAsistenciaInacistencia.Enabled = True
|
' 'DdlAsistenciaInacistencia.Enabled = True
|
||||||
'End If
|
'End If
|
||||||
' UpAgregar.Update()
|
'UpAcciones.Update()
|
||||||
'End If
|
End If
|
||||||
|
|
||||||
objRH.Dispose()
|
objRH.Dispose()
|
||||||
|
|
||||||
@@ -536,12 +640,46 @@ Partial Class RH_RepChecadorPreAsistencia
|
|||||||
|
|
||||||
Dim tabladelDia As DataTable = registrosPersonal.FiltraParametros(" CvePersonal = " & dRow(0).ToString() & " AND FechaRegistro >= '" & tempDatetime1.ToShortDateString & "' AND FechaRegistro <= '" & tempDatetime2.ToString() & "'")
|
Dim tabladelDia As DataTable = registrosPersonal.FiltraParametros(" CvePersonal = " & dRow(0).ToString() & " AND FechaRegistro >= '" & tempDatetime1.ToShortDateString & "' AND FechaRegistro <= '" & tempDatetime2.ToString() & "'")
|
||||||
|
|
||||||
If DTAsistenciasInasistencias.FiltraParametros(" CvePersonal = " & dRow(0).ToString() & " AND Fecha >= '" & Fecha & "'").Rows.Count > 0 Then
|
|
||||||
ReRow("CveAsistenciasInasistencias") = DTAsistenciasInasistencias(0)("CveAsistenciasInasistencias").ToString()
|
|
||||||
|
|
||||||
|
If DTPreAsistenciasInasistencias.FiltraParametros(" CvePersonal = " & dRow(0).ToString() & " AND Fecha = '" & Fecha & "'").Rows.Count > 0 Then
|
||||||
|
ReRow("CveAsistenciasInasistencias") = DTPreAsistenciasInasistencias.FiltraParametros(" CvePersonal = " & dRow(0).ToString() & " AND Fecha = '" & Fecha & "'")(0)("CveAsistenciasInasistencias").ToString()
|
||||||
|
|
||||||
|
If ReRow("CveAsistenciasInasistencias").ToString.ToEntero > 0 Then
|
||||||
|
|
||||||
|
Dim drowAsistenciaInasistencia As DataRow = GlobalDTAsistenciasInasistencias(UsuarioActual.CveEmpresa).FiltroPrimero($"CveAsistenciasInasistencias={ReRow("CveAsistenciasInasistencias").ToString.ToEntero}")
|
||||||
|
|
||||||
|
ReRow("Asistio") = drowAsistenciaInasistencia("AplicaAsistencia").ToString = "Aplica"
|
||||||
|
ReRow("PorcentajePago") = DTPreAsistenciasInasistencias(0)("PorcentajePago").ToString.ToDecimal
|
||||||
|
ReRow("Descanso") = drowAsistenciaInasistencia("AplicaVacacion").ToString = "Aplica"
|
||||||
|
ReRow("DiaInhabil") = "False"
|
||||||
|
ReRow("DiaVacacion") = drowAsistenciaInasistencia("AplicaVacacion").ToString = "Aplica"
|
||||||
|
ReRow("FaltaRetardosAcumulados") = drowAsistenciaInasistencia("AplicaFalta").ToString = "Aplica"
|
||||||
|
ReRow("Retraso") = drowAsistenciaInasistencia("AplicaRetardo").ToString = "Aplica"
|
||||||
|
ReRow("FaltaRetraso") = False 'Not drowAsistenciaInasistencia("AplicaAsistencia").ToString = "Aplica"
|
||||||
|
ReRow("TipoCorto") = drowAsistenciaInasistencia("TipoCorto").ToString
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim CountRegistros As Integer = tabladelDia.Rows.Count
|
If Not ReRow("CveAsistenciasInasistencias").ToString.ToEntero > 0 Then
|
||||||
|
|
||||||
|
'If tabladelDia.Rows.Count > 0 AndAlso tabladelDia.Rows.Count <> 4 And DiaLaboral = False Then
|
||||||
|
If tabladelDia.Rows.Count > 0 AndAlso tabladelDia.Rows.Count <> 4 Then
|
||||||
|
'Dim drowAsistenciaInasistencia As DataRow = GlobalDTAsistenciasInasistencias(UsuarioActual.CveEmpresa).FiltroPrimero($"CveAsistenciasInasistencias={ReRow("CveAsistenciasInasistencias").ToString.ToEntero}")
|
||||||
|
|
||||||
|
ReRow("Asistio") = False
|
||||||
|
ReRow("PorcentajePago") = 0
|
||||||
|
ReRow("Descanso") = False
|
||||||
|
ReRow("DiaInhabil") = False
|
||||||
|
ReRow("DiaVacacion") = False
|
||||||
|
ReRow("FaltaRetardosAcumulados") = False
|
||||||
|
ReRow("Retraso") = False
|
||||||
|
ReRow("FaltaRetraso") = False
|
||||||
|
ReRow("TipoCorto") = "_ND"
|
||||||
|
|
||||||
|
Else
|
||||||
|
Dim CountRegistros As Integer = tabladelDia.Rows.Count
|
||||||
Dim Inconsistencia As Boolean = False
|
Dim Inconsistencia As Boolean = False
|
||||||
|
|
||||||
If Not DiaLaboral Then
|
If Not DiaLaboral Then
|
||||||
@@ -652,6 +790,16 @@ Partial Class RH_RepChecadorPreAsistencia
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If ReRow("Asistio").ToString() = "True" Then ReRow("PorcentajePago") = "100" Else ReRow("PorcentajePago") = "0"
|
If ReRow("Asistio").ToString() = "True" Then ReRow("PorcentajePago") = "100" Else ReRow("PorcentajePago") = "0"
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
'adasdasd
|
||||||
|
|
||||||
|
|
||||||
Resultados.Rows.Add(ReRow)
|
Resultados.Rows.Add(ReRow)
|
||||||
@@ -940,10 +1088,17 @@ Partial Class RH_RepChecadorPreAsistencia
|
|||||||
|
|
||||||
RRow(ColumN) = "-"
|
RRow(ColumN) = "-"
|
||||||
|
|
||||||
|
If ResumenDia(0)("TipoCorto").ToString().Length > 0 Then
|
||||||
|
|
||||||
|
RRow(ColumN) = $"{ResumenDia(0)("TipoCorto").ToString()}|" & filtro
|
||||||
|
|
||||||
|
Else
|
||||||
|
|
||||||
If ResumenDia(0)("Asistio").ToString() = "True" Or ResumenDia(0)("TipoCorto").ToString() = "A" Then
|
If ResumenDia(0)("Asistio").ToString() = "True" Or ResumenDia(0)("TipoCorto").ToString() = "A" Then
|
||||||
RRow(ColumN) = "A|" & filtro
|
RRow(ColumN) = "A|" & filtro
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
If ResumenDia(0)("DiaVacacion").ToString() = "True" Or ResumenDia(0)("TipoCorto").ToString() = "V" Then
|
If ResumenDia(0)("DiaVacacion").ToString() = "True" Or ResumenDia(0)("TipoCorto").ToString() = "V" Then
|
||||||
RRow(ColumN) = "V|" & filtro
|
RRow(ColumN) = "V|" & filtro
|
||||||
End If
|
End If
|
||||||
@@ -970,6 +1125,11 @@ Partial Class RH_RepChecadorPreAsistencia
|
|||||||
RRow(ColumN) = "IND|" & filtro
|
RRow(ColumN) = "IND|" & filtro
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
Else
|
Else
|
||||||
|
|
||||||
DTTempAsistencias = DTAsistenciasInasistenciasReg.FiltraParametros(filtro)
|
DTTempAsistencias = DTAsistenciasInasistenciasReg.FiltraParametros(filtro)
|
||||||
@@ -1009,10 +1169,12 @@ Partial Class RH_RepChecadorPreAsistencia
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub GvBind()
|
Private Sub GvBind()
|
||||||
|
LnkEnviarAsistencia.Visible = False
|
||||||
If DtDatosTabla.Rows.Count > 0 Then
|
If DtDatosTabla.Rows.Count > 0 Then
|
||||||
'BtnAgregar.Visible = True
|
'BtnAgregar.Visible = True
|
||||||
GVRegDatos.DataSource = DtDatosTabla
|
GVRegDatos.DataSource = DtDatosTabla
|
||||||
|
LnkEnviarAsistencia.Visible = True
|
||||||
|
|
||||||
Else
|
Else
|
||||||
'BtnAgregar.Visible = False
|
'BtnAgregar.Visible = False
|
||||||
GVRegDatos.DataSource = Nothing
|
GVRegDatos.DataSource = Nothing
|
||||||
@@ -1020,6 +1182,7 @@ Partial Class RH_RepChecadorPreAsistencia
|
|||||||
|
|
||||||
GVRegDatos.DataBind()
|
GVRegDatos.DataBind()
|
||||||
UpDatos.Update()
|
UpDatos.Update()
|
||||||
|
UpAcciones.Update()
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -1027,7 +1190,7 @@ Partial Class RH_RepChecadorPreAsistencia
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
If DdlTipoPeriodo.SelectedValue.ToEntero > 0 And DdlRango.SelectedValue.ToEntero > 0 Then
|
If DdlTipoPeriodo.SelectedValue.ToEntero > 0 And DdlPeriodo.SelectedValue.ToEntero > 0 Then
|
||||||
|
|
||||||
Dim dt As New DataTable
|
Dim dt As New DataTable
|
||||||
Dim DtPersonal As New DataTable
|
Dim DtPersonal As New DataTable
|
||||||
@@ -1039,7 +1202,7 @@ Partial Class RH_RepChecadorPreAsistencia
|
|||||||
DTAsistenciasInasistencias = objRH.DtResultados
|
DTAsistenciasInasistencias = objRH.DtResultados
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim DtTempPeriodo As DataTable = DTPeridos.FiltraParametros("CvePeriodo = " & DdlRango.SelectedValue.ToEntero)
|
Dim DtTempPeriodo As DataTable = DTPeriodos.FiltraParametros("CvePeriodo = " & DdlPeriodo.SelectedValue.ToEntero)
|
||||||
Dim FechaInicioPeriodoFiltro = DtTempPeriodo(0)("FechaInicio").ToString().ToDate
|
Dim FechaInicioPeriodoFiltro = DtTempPeriodo(0)("FechaInicio").ToString().ToDate
|
||||||
|
|
||||||
Dim FilasFiltradas = From fila In GlobalDTRHPersonal(UsuarioActual.Empresa.CveEmpresa).FiltraParametros($" CveTipoPeriodo = { DdlTipoPeriodo.SelectedValue} AND CveEstado = 1 " & If(DdlTurno.SelectedValue = "-1", "", $" AND CveTurno = {DdlTurno.SelectedValue}")).AsEnumerable()
|
Dim FilasFiltradas = From fila In GlobalDTRHPersonal(UsuarioActual.Empresa.CveEmpresa).FiltraParametros($" CveTipoPeriodo = { DdlTipoPeriodo.SelectedValue} AND CveEstado = 1 " & If(DdlTurno.SelectedValue = "-1", "", $" AND CveTurno = {DdlTurno.SelectedValue}")).AsEnumerable()
|
||||||
@@ -1496,9 +1659,9 @@ Partial Class RH_RepChecadorPreAsistencia
|
|||||||
|
|
||||||
DTRespuesta = DtRespuestaView.ToTable
|
DTRespuesta = DtRespuestaView.ToTable
|
||||||
|
|
||||||
DdlRango.DataSource = DTRespuesta
|
DdlPeriodo.DataSource = DTRespuesta
|
||||||
DdlRango.DataBind()
|
DdlPeriodo.DataBind()
|
||||||
DdlRango.Items.Insert(0, New ListItem("Seleccionar uno", "-1"))
|
DdlPeriodo.Items.Insert(0, New ListItem("Seleccionar uno", "-1"))
|
||||||
'DdlRango.Visible = True
|
'DdlRango.Visible = True
|
||||||
'LblPeriodo.Visible = True
|
'LblPeriodo.Visible = True
|
||||||
UPFiltros.Update()
|
UPFiltros.Update()
|
||||||
@@ -1536,6 +1699,14 @@ Partial Class RH_RepChecadorPreAsistencia
|
|||||||
|
|
||||||
lnkLink.CommandArgument = $"{lnkLink.Text}|{e.Row.DataKey("CvePersonal")}|{e.Row.DataKey("NombreCompleto")}"
|
lnkLink.CommandArgument = $"{lnkLink.Text}|{e.Row.DataKey("CvePersonal")}|{e.Row.DataKey("NombreCompleto")}"
|
||||||
|
|
||||||
|
If Instruccion = "_ND" Then
|
||||||
|
lnkLink.Text = "<i class='fa fa-question' aria-hidden='True'></i>"
|
||||||
|
lnkLink.ForeColor = Drawing.Color.DarkOrange
|
||||||
|
lnkLink.ToolTip = "Inconsistencia"
|
||||||
|
lnkLink.Font.Bold = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
If Instruccion = "-" Then
|
If Instruccion = "-" Then
|
||||||
lnkLink.Text = "<i class='fa fa-check-square' aria-hidden='true'></i>"
|
lnkLink.Text = "<i class='fa fa-check-square' aria-hidden='true'></i>"
|
||||||
lnkLink.ForeColor = Drawing.Color.Green
|
lnkLink.ForeColor = Drawing.Color.Green
|
||||||
@@ -1565,6 +1736,12 @@ Partial Class RH_RepChecadorPreAsistencia
|
|||||||
ContadorFaltas = ContadorFaltas + 1
|
ContadorFaltas = ContadorFaltas + 1
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If Instruccion = "DDV" Then
|
||||||
|
lnkLink.Text = "<i Class='fa fa-sun-o' aria-hidden='true'></i>"
|
||||||
|
lnkLink.ToolTip = "Dia de descanso."
|
||||||
|
lnkLink.ForeColor = Drawing.Color.Green
|
||||||
|
End If
|
||||||
|
|
||||||
If Instruccion = "D" Or Instruccion = "V" Then
|
If Instruccion = "D" Or Instruccion = "V" Then
|
||||||
lnkLink.Text = "<i Class='fa fa-sun-o' aria-hidden='true'></i>"
|
lnkLink.Text = "<i Class='fa fa-sun-o' aria-hidden='true'></i>"
|
||||||
lnkLink.ToolTip = "Dia de descanso/no laboral/Vacación"
|
lnkLink.ToolTip = "Dia de descanso/no laboral/Vacación"
|
||||||
@@ -1639,6 +1816,13 @@ Partial Class RH_RepChecadorPreAsistencia
|
|||||||
lnkLink.Font.Bold = True
|
lnkLink.Font.Bold = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If Instruccion = "P" Then
|
||||||
|
lnkLink.Text = "<i class='fa fa-exclamation-triangle' aria-hidden='true'></i>"
|
||||||
|
lnkLink.ToolTip = "Permiso."
|
||||||
|
lnkLink.ForeColor = Drawing.Color.DarkOrange
|
||||||
|
lnkLink.Font.Bold = True
|
||||||
|
End If
|
||||||
|
|
||||||
If Filtro.Length > 0 Then
|
If Filtro.Length > 0 Then
|
||||||
AddHandler lnkLink.Click, AddressOf Me.DetalleDia_Click
|
AddHandler lnkLink.Click, AddressOf Me.DetalleDia_Click
|
||||||
End If
|
End If
|
||||||
@@ -1707,6 +1891,14 @@ Partial Class RH_RepChecadorPreAsistencia
|
|||||||
|
|
||||||
lnkModalImg.Text = ""
|
lnkModalImg.Text = ""
|
||||||
|
|
||||||
|
If Instruccion = "_ND" Then
|
||||||
|
lnkModalImg.Text = "<i class='fa fa-question' aria-hidden='True'></i>"
|
||||||
|
lnkModalImg.ForeColor = Drawing.Color.DarkOrange
|
||||||
|
lnkModalImg.ToolTip = "Inconsistencia"
|
||||||
|
lnkModalImg.Font.Bold = True
|
||||||
|
lblModalMensaje.Text = "Inconsistencia"
|
||||||
|
End If
|
||||||
|
|
||||||
If Instruccion = "-" Or Instruccion = "A" Then
|
If Instruccion = "-" Or Instruccion = "A" Then
|
||||||
lnkModalImg.Text = "<i class='fa fa-check-square fa-3x' aria-hidden='true'></i>"
|
lnkModalImg.Text = "<i class='fa fa-check-square fa-3x' aria-hidden='true'></i>"
|
||||||
lnkModalImg.ForeColor = Drawing.Color.Green
|
lnkModalImg.ForeColor = Drawing.Color.Green
|
||||||
@@ -1741,6 +1933,15 @@ Partial Class RH_RepChecadorPreAsistencia
|
|||||||
'CveEstado = CveDescanso
|
'CveEstado = CveDescanso
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
If Instruccion = "DDV" Then
|
||||||
|
lnkModalImg.Text = "<i Class='fa fa-sun-o fa-3x' aria-hidden='true'></i>"
|
||||||
|
lnkModalImg.ToolTip = "Dia de descanso."
|
||||||
|
lnkModalImg.ForeColor = Drawing.Color.Green
|
||||||
|
lblModalMensaje.Text = "Dia de descanso."
|
||||||
|
'CveEstado = CveDescanso
|
||||||
|
End If
|
||||||
|
|
||||||
If Instruccion = "DI" Or Instruccion = "V" Then
|
If Instruccion = "DI" Or Instruccion = "V" Then
|
||||||
lnkModalImg.Text = "<i Class='fa fa-sun-o' aria-hidden='true'></i>"
|
lnkModalImg.Text = "<i Class='fa fa-sun-o' aria-hidden='true'></i>"
|
||||||
lnkModalImg.ToolTip = "Dia de descanso/no laboral/Vacación"
|
lnkModalImg.ToolTip = "Dia de descanso/no laboral/Vacación"
|
||||||
@@ -1828,39 +2029,39 @@ Partial Class RH_RepChecadorPreAsistencia
|
|||||||
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Sub BtnEstusAsistenciaModal_Click(sender As Object, e As EventArgs) Handles BtnEstusAsistenciaModal.Click
|
'Private Sub BtnEstusAsistenciaModal_Click(sender As Object, e As EventArgs) Handles BtnEstusAsistenciaModal.Click
|
||||||
|
|
||||||
Dim myRow As DataRow() ' = DtResultados.NewRow
|
' Dim myRow As DataRow() ' = DtResultados.NewRow
|
||||||
Dim temtDt As New DataTable
|
' Dim temtDt As New DataTable
|
||||||
temtDt = DtResultados.FiltraParametros(FiltroAplicado)
|
' temtDt = DtResultados.FiltraParametros(FiltroAplicado)
|
||||||
|
|
||||||
Dim fecha As String = temtDt(0)("Fecha").ToString()
|
' Dim fecha As String = temtDt(0)("Fecha").ToString()
|
||||||
Dim CvePersonal As Integer = temtDt(0)("CvePersonal").ToString().ToEntero
|
' Dim CvePersonal As Integer = temtDt(0)("CvePersonal").ToString().ToEntero
|
||||||
Dim filtro As String = String.Format(" CvePersonal = '{0}' AND Fecha = '{1}'", CvePersonal, fecha)
|
' Dim filtro As String = String.Format(" CvePersonal = '{0}' AND Fecha = '{1}'", CvePersonal, fecha)
|
||||||
|
|
||||||
Dim AplicaFalta As String = GlobalDTAsistenciasInasistencias(UsuarioActual.CveEmpresa).FiltraParametros(String.Format(" CveAsistenciasInasistencias = {0} ", DdlAsistenciaInacistencia.SelectedValue))(0)("AplicaFalta").ToString()
|
' Dim AplicaFalta As String = GlobalDTAsistenciasInasistencias(UsuarioActual.CveEmpresa).FiltraParametros(String.Format(" CveAsistenciasInasistencias = {0} ", DdlAsistenciaInacistencia.SelectedValue))(0)("AplicaFalta").ToString()
|
||||||
|
|
||||||
|
|
||||||
myRow = DtResultados.Select(filtro)
|
' myRow = DtResultados.Select(filtro)
|
||||||
|
|
||||||
If AplicaFalta = "Aplica" Then
|
' If AplicaFalta = "Aplica" Then
|
||||||
myRow(0)("Asistio") = "False"
|
' myRow(0)("Asistio") = "False"
|
||||||
myRow(0)("SalarioDiario") = "0"
|
' myRow(0)("SalarioDiario") = "0"
|
||||||
Else
|
' Else
|
||||||
myRow(0)("Asistio") = "True"
|
' myRow(0)("Asistio") = "True"
|
||||||
myRow(0)("SalarioDiario") = "100"
|
' myRow(0)("SalarioDiario") = "100"
|
||||||
End If
|
' End If
|
||||||
|
|
||||||
myRow(0)("CveAsistenciasInasistencias") = DdlAsistenciaInacistencia.SelectedValue
|
' myRow(0)("CveAsistenciasInasistencias") = DdlAsistenciaInacistencia.SelectedValue
|
||||||
|
|
||||||
myRow(0)("TipoCorto") = GlobalDTAsistenciasInasistencias(UsuarioActual.CveEmpresa).FiltraParametros(String.Format(" CveAsistenciasInasistencias = {0} ", DdlAsistenciaInacistencia.SelectedValue))(0)("TipoCorto").ToString()
|
' myRow(0)("TipoCorto") = GlobalDTAsistenciasInasistencias(UsuarioActual.CveEmpresa).FiltraParametros(String.Format(" CveAsistenciasInasistencias = {0} ", DdlAsistenciaInacistencia.SelectedValue))(0)("TipoCorto").ToString()
|
||||||
|
|
||||||
RegistraScript("$('#divDetallesDia').modal('hide');")
|
' RegistraScript("$('#divDetallesDia').modal('hide');")
|
||||||
Alert("Actualizado correctamente.")
|
' Alert("Actualizado correctamente.")
|
||||||
ReprocesarTabla()
|
' ReprocesarTabla()
|
||||||
GvBind()
|
' GvBind()
|
||||||
|
|
||||||
End Sub
|
'End Sub
|
||||||
|
|
||||||
Protected Sub BtnAgregar_Click(sender As Object, e As EventArgs) Handles BtnAgregar.Click
|
Protected Sub BtnAgregar_Click(sender As Object, e As EventArgs) Handles BtnAgregar.Click
|
||||||
|
|
||||||
@@ -1906,7 +2107,7 @@ Partial Class RH_RepChecadorPreAsistencia
|
|||||||
Else
|
Else
|
||||||
objRh.Commit()
|
objRh.Commit()
|
||||||
BtnAgregar.Visible = False
|
BtnAgregar.Visible = False
|
||||||
UpAgregar.Update()
|
UpAcciones.Update()
|
||||||
Alert("Proceso realizado correctamente.")
|
Alert("Proceso realizado correctamente.")
|
||||||
End If
|
End If
|
||||||
objRh.Dispose()
|
objRh.Dispose()
|
||||||
@@ -1997,12 +2198,165 @@ Partial Class RH_RepChecadorPreAsistencia
|
|||||||
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
|
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
|
||||||
If DdlAsistenciaInacistencia.SelectedValue.ToEntero > 0 Then
|
If DdlAsistenciaInacistencia.SelectedValue.ToEntero > 0 Then
|
||||||
Dim ObjPersonal As New ClsRH
|
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.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
|
||||||
Alert("Registro Actualizado Correctamente.")
|
Alert("Registro Actualizado Correctamente.")
|
||||||
|
RegistraScript("$('#divDetallesDia').modal('hide');")
|
||||||
|
CargaDatos()
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
ObjPersonal.Dispose()
|
ObjPersonal.Dispose()
|
||||||
End If
|
End If
|
||||||
End Sub
|
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
|
End Class
|
||||||
Reference in New Issue
Block a user