This commit is contained in:
2022-02-16 09:05:54 -07:00
7 changed files with 549 additions and 121 deletions

View File

@@ -2527,7 +2527,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@xmlRegistros", SqlDbType.Xml).Value = xmlProductos.ToString()
.Add("@xmlRegistros", SqlDbType.Xml).Value = If(xmlProductos Is Nothing, DBNull.Value, DirectCast(xmlProductos.ToString(), Object))
End With
Try
SqlAdapter.Fill(Data)
@@ -2549,7 +2549,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
SqlDataAdapter("PA_RH_ChecadorAsistenciaAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@xmlRegistros", SqlDbType.Xml).Value = xmlProductos.ToString()
.Add("@xmlRegistros", SqlDbType.Xml).Value = If(xmlProductos Is Nothing, DBNull.Value, DirectCast(xmlProductos.ToString(), Object))
End With
Try
SqlAdapter.Fill(Data)
@@ -7181,6 +7181,25 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
Public Function UpPersonalAsistenciasMasiva(CveEmpresa As Integer, CveUsuario As Integer, xmlProductos As String) As Boolean
Dim Retorno As Boolean = False
Data = New DataTable
SqlDataAdapter("PA_RH_PersonalAsistenciasMasivaUP")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@xmlRegistros", SqlDbType.Xml).Value = If(String.IsNullOrEmpty(xmlProductos), DBNull.Value, DirectCast(xmlProductos.ToString(), Object))
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch Ex1 As SqlException
Me.OnError("Ocurrió un error al guardar la asistencia masiva", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Catch ex As Exception
OnError("Ocurrió un error al guardar la asistencia masiva.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function UpPersonalSupervisorMasiva(CveEmpresa As Integer, CveUsuario As Integer, registros As List(Of RequestUpSupervisorMasiva)) As Boolean
Dim Retorno As Boolean = False
Dim xmlProductos As System.Xml.Linq.XDocument = Nothing
@@ -7192,7 +7211,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@xmlRegistros", SqlDbType.Xml).Value = xmlProductos.ToString()
.Add("@xmlRegistros", SqlDbType.Xml).Value = If(xmlProductos Is Nothing, DBNull.Value, DirectCast(xmlProductos.ToString(), Object))
End With
Try
SqlAdapter.Fill(Data)

View File

@@ -15,6 +15,18 @@
.spanfoliofiscal {
white-space: nowrap;
}
th.Modulo5{
color:#fff;
background-color:darksalmon;
}
th.Modulo6{
color:#fff;
background-color:#67809f;
}
th.Modulo7{
color:#fff;
background-color:purple;
}
th:not(.Modulo5) + th.Modulo5,
th:not(.Modulo6) + th.Modulo6,
th:not(.Modulo7) + th.Modulo7{

View File

@@ -4,6 +4,10 @@
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.GvAsistenciaDiv .ADScroller-header {
overflow: visible;
}
.fa-ad-pdf.fa::before {
background: #999;
content: "\f1c1";
@@ -119,9 +123,11 @@
table.GvConceptos td {
white-space: nowrap;
}
.Gvbitacora tr td:nth-child(1) {
white-space: nowrap;
}
.GvConceptos td, .Gvbitacora td {
font-size: 11px;
padding-top: 2px;
@@ -734,6 +740,11 @@
<div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
</div>
<div class="actions">
<div class="btn-group">
<asp:LinkButton ID="LnkRecalcular" OnClick="LnkRecalcular_Click" CssClass="btn yellow-gold" runat="server">Recalcular</asp:LinkButton>
</div>
</div>
</div>
<div class="portlet-body " style="padding: 0px;">
<div class="row">
@@ -1766,6 +1777,207 @@
</div>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabAsistenciasr" runat="server" HeaderText="Asistencia">
<ContentTemplate>
<div class="portlet light xspadding bordered " id="pnlasistencia">
<div class="portlet-title">
<div class="caption ">
<i class="icon-pin font-yellow-gold"></i>
<span class="caption-subject font-yellow-gold bold uppercase">Registros de asistencias</span>
</div>
<div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
<a href="javascript:;" class="fullscreen" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body GvAsistenciaDiv" style="padding: 0px;">
<table class="table table-striped table-hover Widthall" id="GvAsistenciaHeader">
<tr class="Titulos">
<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 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 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 style="width: 70px;">
<asp:LinkButton ID="LbTipoAsistencia" runat="server" CausesValidation="false" Text="Asistencia" CommandArgument="" OnClick="LbOrden_Click">
</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 style="width: 56px;">
<asp:LinkButton ID="LbHorasDoblesAsistencia" runat="server" CausesValidation="false" Text="Hrs Dob." CommandArgument="" OnClick="LbOrden_Click">
</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 style="width: 110px;">
<asp:LinkButton ID="LbMotivosHorasExtrasAsistencia" runat="server" CausesValidation="false" Text="Motivos H. Extras" CommandArgument="" OnClick="LbOrden_Click">
</asp:LinkButton>
</th>
<th style="width: 30px;">
<asp:LinkButton ID="LbObservacionesAsistencia" runat="server" CausesValidation="false" Text="Obs." CommandArgument="" OnClick="LbOrden_Click">
</asp:LinkButton>
</th>
<th style="text-align: center;" width="8px">Comandos</th>
</tr>
<tr>
<td>
<div class="input-group input-sm date date-picker" data-date-format="dd/mm/yyyy" style="min-width: 100px; max-width: 200px;">
<asp:TextBox ID="TxtFechaAsistencia" runat="server" CausesValidation="true" CssClass="form-control input-sm"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgCalendarioAsistencia" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaAsistencia" runat="server" TargetControlID="TxtFechaAsistencia" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CalendarioAsistencia" TargetControlID="TxtFechaAsistencia" PopupButtonID="ImgCalendarioAsistencia" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaAsistencia" runat="server" ControlToValidate="TxtFechaAsistencia" Display="None" ErrorMessage="El campo <b>''Fecha Asistencia''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GuardaAsistencia"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVFechaAsistencia" runat="server" ControlToValidate="TxtFechaAsistencia" Display="None" ErrorMessage="El campo <b>''Fecha Asistencia''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GuardaAsistencia"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOFechaAsistencia1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaAsistencia" Width="350px"></ajax:ValidatorCalloutExtender>
<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" UsaWebService="true" CssStyle="width: 100%;"></ADS:Dropdownlost>
</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">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
<td>
<asp:DropDownList Width="100%" ID="DdlSubProyectoAsistenciasA" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 80px !important;" ValidationGroup="GrpGuardarAsistencia">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
<td>
<asp:DropDownList Width="100%" ID="DdlTipoAsistenciasB" runat="server" DataTextField="Tipo" DataValueField="CveAsistenciasInasistencias" CssClass="table-group-action-input form-control input-inline input-small input-sm" Style="width: 70px !important;" ValidationGroup="GrpGuardarAsistencia"
AutoPostBack="true" OnSelectedIndexChanged="DdlTipoAsistencias_SelectedIndexChanged">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
<td>
<asp:TextBox CssClass="form-control input-sm" ID="TextBox1" runat="server" MaxLength="3" Text="100" Width="44px"></asp:TextBox></td>
<td>
<asp:TextBox CssClass="form-control input-sm" ID="TextBox2" runat="server" MaxLength="3" Text="0" Width="50px"></asp:TextBox></td>
<td>
<asp:TextBox CssClass="form-control input-sm" ID="TextBox3" runat="server" MaxLength="3" Text="0" Width="50px"></asp:TextBox></td>
<td>
<asp:DropDownList Width="100%" ID="DropDownList2" runat="server" AppendDataBoundItems="true" DataTextField="MotivoHoraExtra" DataValueField="CveMotivoHoraExtra" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 110px !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
<td>
<asp:TextBox CssClass="form-control input-sm" ID="TextBox4" runat="server" Width="84px" MaxLength="150"></asp:TextBox></td>
<td>
<asp:LinkButton ID="LbGuardarAsistencia" OnClick="LbGuardarAsistencia_Click" 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"
data-heighterror="550" OnRowDataBound="GVAsistencia_RowDataBound"
EmptyDataText="No se encontraron registros de Asistencias con los filtros seleccionados" ToolTip="Listado de Asistencias" data-rows="0"
CssClass="table table-striped table-advance table-hover Widthall mysmallbtn ScrollAD" data-tableheader="#GvAsistenciaHeader" GridLines="None">
<Columns>
<asp:TemplateField>
<HeaderTemplate>Fecha</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server"></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Cliente</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCliente" runat="server" Text='<%# Eval("Cliente") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Proyecto</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlProyecto" runat="server" Text='<%# Eval("Proyecto") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Sub Proyecto</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlSubProyecto" runat="server" Text='<%# Eval("SubProyecto") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Asistencia</HeaderTemplate>
<ItemTemplate>
<asp:DropDownList ID="DdlTipoAsistencias" runat="server" TabIndex="2" DataTextField="Tipo" DataValueField="CveAsistenciasInasistencias" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 70px !important;"></asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>% Pago</HeaderTemplate>
<ItemTemplate>
<asp:TextBox CssClass="form-control" ID="TxtPorPago" TabIndex="1" runat="server" MaxLength="3" Text="100" Width="44px"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Hrs Dob.</HeaderTemplate>
<ItemTemplate>
<asp:TextBox CssClass="form-control" ID="TxtHorasDobles" TabIndex="1" runat="server" MaxLength="3" Text="0" Width="50px"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Hrs Trip.</HeaderTemplate>
<ItemTemplate>
<asp:TextBox CssClass="form-control" ID="TxtHorasTriples" TabIndex="1" runat="server" MaxLength="3" Text="0" Width="50px"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Motivo H. Extras</HeaderTemplate>
<ItemTemplate>
<asp:DropDownList ID="DdlMotivoHoraExtra" runat="server" TabIndex="2" AppendDataBoundItems="true" DataTextField="MotivoHoraExtra" DataValueField="CveMotivoHoraExtra" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 110px !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Obs.</HeaderTemplate>
<ItemTemplate>
<asp:TextBox CssClass="form-control" ID="TxtObservaciones" TabIndex="3" runat="server" Width="84px" MaxLength="150"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Left" Visible="false">
<ItemTemplate>
<%--<asp:LinkButton ID="LnkEliminarAsistencia" OnClick="LnkEliminarAsistencia_Click" runat="server" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar la asistencia?" data-btn-ok-label="si" />--%>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
<div class="text-right">
<asp:Button ID="BtnGuardarAsistenciaCambios" OnClick="BtnGuardarAsistenciaCambios_Click" runat="server" Text="Guardar Cambios" class="btn btn-success pull-right" /><br />
</div>
<br />
<br />
</div>
</div>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
</div>
<div class="modal-footer">

View File

@@ -460,8 +460,8 @@ public partial class Nomina_Nomina2 : ClsPaginas
int CvePrePolizaProrrateo = drow["CvePrePolizaProrrateo"].ToString().ToEntero();
FechaInicioPeriodo = (DateTime)dtPeriodo.Rows[0]["FechaInicio"];
FechaFinPeriodo = (DateTime)dtPeriodo.Rows[0]["FechaFin"];
FechaInicioPeriodo = drow["FechaInicio"].ToString().ToDateTime();
FechaFinPeriodo = drow["FechaFin"].ToString().ToDateTime();
//LnkConceptoEmpleado.Visible = (Estatus == 1);
LnkRegistrarProvision.Visible = (Estatus >= 2);//&& (CvePrePolizaProvision <= 0 || UsuarioActual.CveUsuario == 100);
@@ -1811,6 +1811,9 @@ public partial class Nomina_Nomina2 : ClsPaginas
LblEmpleado.Text = Nombre;
LblEmpleado.NavigateUrl = string.Format("/RH/Personal.aspx?CvePersonal={0}", SRCvePersonal);
TabPersonal.ActiveTabIndex = 0;
DdlTipoAsistenciasB.DataSource = GlobalDTAsistenciasInasistencias.FiltraParametros("CveEmpresa = " + UsuarioActual.CveEmpresa);
DdlTipoAsistenciasB.DataBind();
cargaasistenciaSR();
mostrarConceptos();
CargaVacaciones();
pnlAddupMovto.Visible = false;
@@ -1818,6 +1821,179 @@ public partial class Nomina_Nomina2 : ClsPaginas
CargaPersonalIncapacidad();
RegistraScript("$('#ModalConceptos').modal();");
}
#region Asistencias
protected void LnkRecalcular_Click(object sender, EventArgs e)
{
cargaDatos();
cargaBitacora();
cargasobrericiboconceptos();
UpModalConceptos.Update();
}
protected void cargaasistenciaSR(string orden = "")
{
using (ClsRH objpersonal = new ClsRH())
{
if (objpersonal.GetAsistencias(SRCvePersonal, -1, -1, -1, -1,-1, FechaInicioPeriodo, FechaFinPeriodo, UsuarioActual.CveEmpresa))
{ GVAsistencia.DataSource = objpersonal.DtResultados.FiltraParametros("Fecha IS NOT NULL"); }
else{
GVAsistencia.DataSource = null;
}
}
GVAsistencia.DataBind();
}
protected void LbOrden_Click(object sender, EventArgs e)
{
string Orden = "";
string Campo = "";
int gvi = 0;
Literal Literal = null/* TODO Change to default(_) if this is not a reference type */;
const string OrdenInicial = "";
string[] Arg = new string[3];
Arg = ((LinkButton)sender).CommandArgument.Split(';');
Campo = Arg[0];
gvi = Arg[1].ToEntero();
Literal = (Literal)((LinkButton)sender).NamingContainer.FindControl("Img" + Campo.Replace(",", "_"));
Campo = Campo.Substring(0, Campo.Length - 1);
if (ViewState[string.Format("O{0}", Campo, gvi)] != null && ViewState[string.Format("O{0}", Campo, gvi)].ToString() == string.Format("{0} DESC", Campo))
{
ViewState[string.Format("O{0}", Campo)] = string.Format("{0} ASC", Campo);
Literal.Text = string.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>");
}
else
{
ViewState[string.Format("O{0}", Campo, gvi)] = string.Format("{0} DESC", Campo);
Literal.Text = string.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>");
}
Orden = OrdenInicial + ViewState[string.Format("O{0}", Campo, gvi)].ToString();
ViewState["Orden"] = Orden;
cargaasistenciaSR(Orden);
}
protected void DdlTipoAsistencias_SelectedIndexChanged(object sender, EventArgs e)
{
DropDownList ddl = (DropDownList)sender;
GridViewRow gvrow = (GridViewRow)ddl.NamingContainer;
if (ddl.SelectedItem.Text == "Retardo")
gvrow.FCTextBox("TxtPorPago").Text = "87.5";
}
protected void LbGuardarAsistencia_Click(object sender, EventArgs e)
{
bool continuar = false;
using (ClsRH ObjPersonal = new ClsRH())
{
if (ObjPersonal.AddAsistencia(SRCvePersonal, -2, -2, TxtFechaAsistencia.Text.Trim().ToDate(),
DdlTipoAsistenciasB.SelectedValue.ToEntero(), TxtPorPago.Text.Trim().ToDouble(), TxtHorasDobles.Text.Trim().ToDouble(),
TxtHorasTriples.Text.Trim().ToDouble(), DdlMotivoHoraExtra.SelectedValue.ToEntero(), TxtObservaciones.Text.Trim(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
{
Alert("La Asistencia se guardó correctamente.", TipoMensaje.MsgInformacion);
continuar = true;
}
}
if (continuar)
{
cargaasistenciaSR();
LnkRecalcular_Click(null, null);
}
}
protected void BtnGuardarAsistenciaCambios_Click(object sender, EventArgs e)
{
bool continuar = false;
using (ClsRH ObjPersonal = new ClsRH())
{
ObjPersonal.IniciaTransacSQL();
bool OcurrioError = false;
foreach (GridViewRow Row in GVAsistencia.Rows)
{
if (!ObjPersonal.AddAsistencia(SRCvePersonal, -2,-2, 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))
{
OcurrioError = true;
break;
}
}
if (OcurrioError)
{
ObjPersonal.RollBack();
Alert("Ocurrió un error al guardar las Asistencias.", TipoMensaje.MsgError);
}
else
{
ObjPersonal.Commit();
continuar = true;
Alert("Las Asistencias se guardaron correctamente.", TipoMensaje.MsgInformacion);
}
}
if (continuar)
{
cargaasistenciaSR();
LnkRecalcular_Click(null, null);
}
}
protected void GVAsistencia_RowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[1].HorizontalAlign = HorizontalAlign.Left;
e.Row.Cells[2].HorizontalAlign = HorizontalAlign.Left;
e.Row.Cells[3].HorizontalAlign = HorizontalAlign.Left;
//if ((e.Row.DBCampo("Fecha")))
e.Row.FCLiteral("LtlFecha").Text = e.Row.DBCampo("Fecha").ToDate().ToShortDateString();
if (e.Row.FCLiteral("LtlCliente").Text != "N/A")
e.Row.FCLiteral("LtlCliente").Text = "<a class=\"Texto\" href=\"/Ventas/Clientes.aspx?CveCliente=" + e.Row.DBCampo("CveCliente") + "\">" + e.Row.DBCampo("Cliente") + "</a>";
e.Row.FCTextBox("TxtPorPago").Text = e.Row.DBCampo("PorcentajePago");
e.Row.FCTextBox("TxtHorasDobles").Text = e.Row.DBCampo("HorasDobles");
e.Row.FCTextBox("TxtHorasTriples").Text = e.Row.DBCampo("HorasTriples");
// Carga Tipos de Asistencia
e.Row.FCDropDownList("DdlTipoAsistencias").DataSource = GlobalDTAsistenciasInasistencias.FiltraParametros("CveEmpresa = " + UsuarioActual.CveEmpresa);
e.Row.FCDropDownList("DdlTipoAsistencias").DataBind();
if (e.Row.DBCampo("CveAsistenciasInasistencias") != "-1")
e.Row.FCDropDownList("DdlTipoAsistencias").SelectedValue = e.Row.DBCampo("CveAsistenciasInasistencias");
// Carga Motivos Horas Extras
e.Row.FCDropDownList("DdlMotivoHoraExtra").DataSource = GlobalDTMotivosHorasExtras.FiltraParametros("CveEmpresa = " + UsuarioActual.CveEmpresa);
e.Row.FCDropDownList("DdlMotivoHoraExtra").DataBind();
if (e.Row.DBCampo("CveMotivoHoraExtra") != "-1")
e.Row.FCDropDownList("DdlMotivoHoraExtra").SelectedValue = e.Row.DBCampo("CveMotivoHoraExtra");
e.Row.FCTextBox("TxtObservaciones").Text = e.Row.DBCampo("Observacion");
if (e.Row.DBCampo("SeModifico") == "0")
{
e.Row.Cells[0].BackColor = System.Drawing.Color.LightBlue;
e.Row.Cells[1].BackColor = System.Drawing.Color.LightBlue;
e.Row.Cells[2].BackColor = System.Drawing.Color.LightBlue;
e.Row.Cells[3].BackColor = System.Drawing.Color.LightBlue;
}
else if (e.Row.DBCampo("SeModifico") == "1")
{
e.Row.Cells[0].ForeColor = System.Drawing.Color.Red;
e.Row.Cells[1].ForeColor = System.Drawing.Color.Red;
e.Row.Cells[2].ForeColor = System.Drawing.Color.Red;
e.Row.Cells[3].ForeColor = System.Drawing.Color.Red;
}
}
}
#endregion
#region "CalculosSistema"
private void showModalCalculo()
{
@@ -7780,4 +7956,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
UpModalProrrateo.Update();
}
}

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,7 +1375,8 @@ Partial Class RH_Personal
End Sub
Protected Sub CargaGvAsistencias(Optional Orden As String = "")
Dim objpersonal As New ClsRH
Using objpersonal As New ClsRH
Dim CveCliente As Integer = DdlClienteAsistenciaC.SelectedValue.ToEntero()
If CveCliente <= 0 Then
CveCliente = -1
@@ -1385,12 +1386,12 @@ Partial Class RH_Personal
Else
GVAsistencia.DataSource = Nothing
End If
objpersonal.Dispose()
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()
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,
@@ -1400,7 +1401,7 @@ Partial Class RH_Personal
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,7 +1446,8 @@ 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()
Using ObjPersonal As New ClsRH()
ObjPersonal.IniciaTransacSQL()
Dim OcurrioError As Boolean = False
@@ -1467,7 +1469,7 @@ Partial Class RH_Personal
Alert("Las Asistencias se guardaron correctamente.", TipoMensaje.MsgInformacion)
End If
ObjPersonal.Dispose()
End Using
BtnConsultarAsistencia_Click(sender, e)
End Sub

View File

@@ -410,6 +410,12 @@