This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2022-02-16 06:03:02 -07:00
parent 35571275d7
commit 906d1b3895
7 changed files with 549 additions and 121 deletions

View File

@@ -1927,46 +1927,46 @@
<table class="table table-striped table-hover Widthall" id="GvAsistenciaHeader">
<%--<thead>--%>
<tr class="Titulos">
<th width="120px">
<asp:LinkButton ID="LbFechaAsistencia" runat="server" CausesValidation="false" Text="Fecha" CommandArgument="" OnClick="LbOrden_Click">
</asp:LinkButton></th>
<th width="180px">
<th style="width:120px">
<asp:LinkButton ID="LbFechaAsistencia" runat="server" CausesValidation="false" Text="Fecha" CommandArgument="" OnClick="LbOrden_Click"></asp:LinkButton>
</th>
<th style="width:180px">
<asp:LinkButton ID="LbClienteAsistencia" runat="server" CausesValidation="false" Text="Cliente" CommandArgument="Cliente1;1" OnClick="LbOrden_Click">
<asp:Literal ID="ImgCliente1" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton></th>
<th width="110px">
</asp:LinkButton>
</th>
<th style="width:110px">
<asp:LinkButton ID="LbProyectoAsistencia" runat="server" CausesValidation="false" Text="Proyecto" CommandArgument="Proyecto1;1" OnClick="LbOrden_Click">
<asp:Literal ID="ImgProyecto1" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton></th>
<th width="110px">
<th style="width:110px">
<asp:LinkButton ID="LbSubProyectoAsistencia" runat="server" CausesValidation="false" Text="Sub Proyecto" CommandArgument="SubProyecto1;1" OnClick="LbOrden_Click">
<asp:Literal ID="ImgSubProyecto1" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton></th>
<th width="70px">
<th style="width:70px;">
<asp:LinkButton ID="LbTipoAsistencia" runat="server" CausesValidation="false" Text="Asistencia" CommandArgument="" OnClick="LbOrden_Click">
</asp:LinkButton></th>
<th width="50px">
</asp:LinkButton>
</th>
<th style="width:50px;">
<asp:LinkButton ID="LbPorPagoAsistencia" runat="server" CausesValidation="false" Text="% Pago" CommandArgument="" OnClick="LbOrden_Click">
</asp:LinkButton></th>
<th width="56px">
</asp:LinkButton>
</th>
<th style="width:56px;">
<asp:LinkButton ID="LbHorasDoblesAsistencia" runat="server" CausesValidation="false" Text="Hrs Dob." CommandArgument="" OnClick="LbOrden_Click">
</asp:LinkButton></th>
<th width="56px">
</asp:LinkButton>
</th>
<th style="width:56px;">
<asp:LinkButton ID="LbHorasTriplesAsistencia" runat="server" CausesValidation="false" Text="Hrs Trip." CommandArgument="" OnClick="LbOrden_Click">
</asp:LinkButton></th>
<th width="110px">
</asp:LinkButton>
</th>
<th style="width:110px;">
<asp:LinkButton ID="LbMotivosHorasExtrasAsistencia" runat="server" CausesValidation="false" Text="Motivos H. Extras" CommandArgument="" OnClick="LbOrden_Click">
</asp:LinkButton></th>
<th width="30px">
</asp:LinkButton>
</th>
<th style="width:30px;">
<asp:LinkButton ID="LbObservacionesAsistencia" runat="server" CausesValidation="false" Text="Obs." CommandArgument="" OnClick="LbOrden_Click">
</asp:LinkButton></th>
</asp:LinkButton>
</th>
<th style="text-align: center;" width="8px">Comandos</th>
</tr>
<%--</thead>--%>
@@ -1986,11 +1986,8 @@
<ajax:ValidatorCalloutExtender ID="VCOFechaAsistencia2" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaAsistencia" Width="350px"></ajax:ValidatorCalloutExtender>
</td>
<td>
<ADS:Dropdownlost CssClassDdl="form-control input-sm select2me" ID="DdlClienteAsistenciaA" Width="100%" data-metodo="getcliente" runat="server" DataTextField="Nombre" DataValueField="CveCliente" CssStyle="width: 100%;"></ADS:Dropdownlost>
<ADS:Dropdownlost CssClassDdl="form-control input-sm select2me" ID="DdlClienteAsistenciaA" Width="100%" data-metodo="getcliente" runat="server" DataTextField="Nombre" DataValueField="CveCliente" UsaWebService="true" CssStyle="width: 100%;"></ADS:Dropdownlost>
<%--<asp:DropDownList Width="100%" ID="DdlClienteAsistenciaA" runat="server" AppendDataBoundItems="true" DataTextField="Nombre" DataValueField="CveCliente" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 180px !important;" ValidationGroup="GrpGuardarAsistencia">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>--%>
</td>
<td>
<asp:DropDownList Width="100%" ID="DdlProyectoAsistenciaA" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Proyecto" DataValueField="CveProyecto" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;" ValidationGroup="GrpGuardarAsistencia">
@@ -2022,7 +2019,8 @@
<td>
<asp:TextBox CssClass="form-control input-sm" ID="TxtObservaciones" runat="server" Width="84px" MaxLength="150"></asp:TextBox></td>
<td>
<asp:LinkButton ID="LbGuardarAsistencia" runat="server" CausesValidation="true" CssClass=" btn btn-primary" Text="Agregar" ValidationGroup="GrpGuardarAsistencia" /></td>
<asp:LinkButton ID="LbGuardarAsistencia" runat="server" CausesValidation="true" CssClass=" btn btn-primary" Text="Agregar" ValidationGroup="GrpGuardarAsistencia" />
</td>
</tr>
</table>
<asp:GridView ID="GVAsistencia" runat="server" AutoGenerateColumns="false" DataKeyNames="CvePersonal,CveAsistencia" ShowHeader="false"

View File

@@ -1375,32 +1375,33 @@ Partial Class RH_Personal
End Sub
Protected Sub CargaGvAsistencias(Optional Orden As String = "")
Dim objpersonal As New ClsRH
Dim CveCliente As Integer = DdlClienteAsistenciaC.SelectedValue.ToEntero()
If CveCliente <= 0 Then
CveCliente = -1
End If
If objpersonal.GetAsistencias(CvePersonal, CveCliente, -1, DdlSubProyectoAsistenciasC.SelectedValue.ToEntero(), DdlTurno.SelectedValue.ToEntero(), -1, txtFechaI.Text.Trim.ToDate, txtFechaF.Text.Trim.ToDate, UsuarioActual.CveEmpresa) Then
GVAsistencia.DataSource = objpersonal.DtResultados.FiltraParametros("Fecha IS NOT NULL")
Else
GVAsistencia.DataSource = Nothing
End If
objpersonal.Dispose()
Using objpersonal As New ClsRH
Dim CveCliente As Integer = DdlClienteAsistenciaC.SelectedValue.ToEntero()
If CveCliente <= 0 Then
CveCliente = -1
End If
If objpersonal.GetAsistencias(CvePersonal, CveCliente, -1, DdlSubProyectoAsistenciasC.SelectedValue.ToEntero(), DdlTurno.SelectedValue.ToEntero(), -1, txtFechaI.Text.Trim.ToDate, txtFechaF.Text.Trim.ToDate, UsuarioActual.CveEmpresa) Then
GVAsistencia.DataSource = objpersonal.DtResultados.FiltraParametros("Fecha IS NOT NULL")
Else
GVAsistencia.DataSource = Nothing
End If
End Using
GVAsistencia.DataBind()
UpDatos.Update()
End Sub
Protected Sub LbGuardarAsistencia_Click(sender As Object, e As System.EventArgs) Handles LbGuardarAsistencia.Click
Dim ObjPersonal As New ClsRH()
If ObjPersonal.AddAsistencia(CvePersonal, DdlClienteAsistenciaA.SelectedValue.ToEntero(), DdlSubProyectoAsistenciasA.SelectedValue.ToEntero(), TxtFechaAsistencia.Text.Trim.ToDate,
Using ObjPersonal As New ClsRH()
If ObjPersonal.AddAsistencia(CvePersonal, DdlClienteAsistenciaA.SelectedValue.ToEntero(), DdlSubProyectoAsistenciasA.SelectedValue.ToEntero(), TxtFechaAsistencia.Text.Trim.ToDate,
DdlTipoAsistencias.SelectedValue.ToEntero(), TxtPorPago.Text.Trim.ToDouble, TxtHorasDobles.Text.Trim.ToDouble,
TxtHorasTriples.Text.Trim.ToDouble, DdlMotivoHoraExtra.SelectedValue.ToEntero(), TxtObservaciones.Text.Trim,
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
Alert("Las Asistencias se guardaron correctamente.", TipoMensaje.MsgInformacion)
BtnConsultarAsistencia_Click(sender, e)
End If
Alert("Las Asistencias se guardaron correctamente.", TipoMensaje.MsgInformacion)
BtnConsultarAsistencia_Click(sender, e)
End If
ObjPersonal.Dispose()
End Using
End Sub
Protected Sub GVAsistencia_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVAsistencia.RowDataBound
@@ -1445,29 +1446,30 @@ Partial Class RH_Personal
End Sub
Protected Sub BtnGuardarAsistenciaCambios_Click(sender As Object, e As System.EventArgs) Handles BtnGuardarAsistenciaCambios.Click
Dim ObjPersonal As New ClsRH()
ObjPersonal.IniciaTransacSQL()
Dim OcurrioError As Boolean = False
Using ObjPersonal As New ClsRH()
For Each Row As GridViewRow In GVAsistencia.Rows
If Not ObjPersonal.AddAsistencia(Row.DataKey("CvePersonal").ToEntero(), DdlClienteAsistenciaC.SelectedValue.ToEntero(), DdlSubProyectoAsistenciasC.SelectedValue.ToEntero(), Row.FCLiteral("LtlFecha").Text.Trim.ToDate,
Row.FCDropDownList("DdlTipoAsistencias").SelectedValue.ToEntero(), Row.FCTextBox("TxtPorPago").Text.Trim.ToDouble, Row.FCTextBox("TxtHorasDobles").Text.Trim.ToDouble,
Row.FCTextBox("TxtHorasTriples").Text.Trim.ToDouble, Row.FCDropDownList("DdlMotivoHoraExtra").SelectedValue.ToEntero(), Row.FCTextBox("TxtObservaciones").Text.Trim,
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
OcurrioError = True
Exit For
ObjPersonal.IniciaTransacSQL()
Dim OcurrioError As Boolean = False
For Each Row As GridViewRow In GVAsistencia.Rows
If Not ObjPersonal.AddAsistencia(Row.DataKey("CvePersonal").ToEntero(), DdlClienteAsistenciaC.SelectedValue.ToEntero(), DdlSubProyectoAsistenciasC.SelectedValue.ToEntero(), Row.FCLiteral("LtlFecha").Text.Trim.ToDate,
Row.FCDropDownList("DdlTipoAsistencias").SelectedValue.ToEntero(), Row.FCTextBox("TxtPorPago").Text.Trim.ToDouble, Row.FCTextBox("TxtHorasDobles").Text.Trim.ToDouble,
Row.FCTextBox("TxtHorasTriples").Text.Trim.ToDouble, Row.FCDropDownList("DdlMotivoHoraExtra").SelectedValue.ToEntero(), Row.FCTextBox("TxtObservaciones").Text.Trim,
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
OcurrioError = True
Exit For
End If
Next
If OcurrioError Then
ObjPersonal.RollBack()
Alert("Ocurrió un error al guardar las Asistencias.", TipoMensaje.MsgError)
Else
ObjPersonal.Commit()
Alert("Las Asistencias se guardaron correctamente.", TipoMensaje.MsgInformacion)
End If
Next
If OcurrioError Then
ObjPersonal.RollBack()
Alert("Ocurrió un error al guardar las Asistencias.", TipoMensaje.MsgError)
Else
ObjPersonal.Commit()
Alert("Las Asistencias se guardaron correctamente.", TipoMensaje.MsgInformacion)
End If
ObjPersonal.Dispose()
End Using
BtnConsultarAsistencia_Click(sender, e)
End Sub