Commit inicial Ventas Productivo

This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2019-08-14 16:40:54 -07:00
commit c35cf91883
13328 changed files with 3711549 additions and 0 deletions

19
Nomina/Aguinaldo.aspx Normal file
View File

@@ -0,0 +1,19 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Aguinaldo.aspx.vb" Inherits="Nomina_Aguinaldo" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
</asp:Content>

5
Nomina/Aguinaldo.aspx.vb Normal file
View File

@@ -0,0 +1,5 @@

Partial Class Nomina_Aguinaldo
Inherits ClsPaginas
End Class

97
Nomina/CatConceptos.aspx Normal file
View File

@@ -0,0 +1,97 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="CatConceptos.aspx.cs" Inherits="Nomina_CatConceptos" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
Catálogo de Conceptos de Nómina
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
<asp:UpdatePanel ID="UpLnkAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkAgregarConcepto" PostBackUrl="/Nomina/ConceptoNomina.aspx" CommandArgument="-1" runat="server" ><i class="fa fa-plus"></i><span style="padding: 10px">Agregar concepto </span></asp:LinkButton>
</li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
<div class="row"></div>
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div id="PFiltro" class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" Text="Consultar" class="btn btn-primary" ValidationGroup="Valida" />
<%--<a href="javascript:;" class="expand"></a>--%>
</div>
<div class="titlefiltros caption">
<div class="row" style="margin-left: 10px;">
<label class="col-md-1 " id="LblDdlTipo" runat="server" style="margin-top: 5px; font-size:14px;">Tipo:</label>
<div class="col-md-2" id="DivDdlConcepto" runat="server">
<asp:DropDownList ID="DdlTipo" runat="server" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%"></asp:DropDownList>
</div>
<label class="col-md-1 " id="LblDdlEstado" runat="server" style="margin-top: 5px; font-size:14px;">Estado:</label>
<div class="col-md-2" id="Div1" runat="server">
<asp:DropDownList ID="DdlEstado" runat="server" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%"></asp:DropDownList>
</div>
<label class="col-md-2 " id="LblDdTiposGastos" runat="server" style="margin-top: 5px; font-size:14px;">Tipo de gasto:</label>
<div class="col-md-2" id="Div2" runat="server">
<asp:DropDownList ID="DdlTiposGastos" runat="server" AppendDataBoundItems="true" DataTextField="TipoGasto" DataValueField="CveTipoGasto" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
</asp:DropDownList>
</div>
</div>
</div>
</div>
<div class="portlet-body" style="display: none;">
<div class="row" style="margin-left: 10px;">
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right" align="left">
<div style="margin-right: 15px">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvConceptos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvConceptos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
<asp:GridView ID="GvConceptos" runat="server" GridLines="None" DataKeyNames="Codigo, Concepto, TipoD, Estado"
CssClass="table table-striped table-advance table-hover Widthall mysmallbtn ScrollAD" data-sort="true" data-footer="0" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False"
EmptyDataText="No se encontraron registros">
<Columns>
<asp:TemplateField HeaderText="Código" ItemStyle-Width="10%">
<ItemTemplate>
<asp:HyperLink ID="HplNum" runat="server" CssClass="Texto" NavigateUrl='<%# Eval("CveConcepto", "/Nomina/ConceptoNomina.aspx?CveConcepto={0}")%>' Text='<%# Eval("Codigo") %>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Concepto" HeaderText="Concepto" ItemStyle-Width="25%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="TipoD" HeaderText="Tipo" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Estado" HeaderText="Estado" ItemStyle-Width="7%" ItemStyle-HorizontalAlign="Left" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<%-- <asp:UpdatePanel ID="UPModal" runat="server" UpdateMode="Conditional">
<ContentTemplate>
</ContentTemplate>
</asp:UpdatePanel>--%>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
</asp:Content>

132
Nomina/CatConceptos.aspx.cs Normal file
View File

@@ -0,0 +1,132 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Extensiones;
public partial class Nomina_CatConceptos : ClsPaginas
{
#region "Propiedades"
private int Codigo
{
get
{
return ViewState["Codigo"].ToEntero();
}
set
{
ViewState["Codigo"] = value;
}
}
private String Tipo
{
get
{
return ViewState["Tipo"].ToString();
}
set
{
ViewState["Tipo"] = value;
}
}
private int Estado
{
get
{
return ViewState["Estado"].ToEntero();
}
set
{
ViewState["Estado"] = value;
}
}
private int TipoGasto
{
get
{
return ViewState["TipoGasto"].ToEntero();
}
set
{
ViewState["TipoGasto"] = value;
}
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
InicializaDatos();
}
}
protected void InicializaDatos()
{
Codigo = -1;
Tipo = "-1";
Estado = -1;
TipoGasto = -1;
CargaTipo();
CargaEstado();
CargaTiposGastos();
CargaDatos();
//CargaModal();
}
protected void CargaDatos()
{
ClsNominas ObjNomina = new ClsNominas();
Tipo = DdlTipo.SelectedValue;
Estado = Convert.ToInt32(DdlEstado.SelectedValue);
TipoGasto = Convert.ToInt32(DdlTiposGastos.SelectedValue);
if (ObjNomina.GetConceptos(UsuarioActual.CveEmpresa, Tipo, Estado, TipoGasto))
{
GvConceptos.DataSource = ObjNomina.DtResultados.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa}");
}
ObjNomina.Dispose();
GvConceptos.DataBind();
UPDatos.Update();
}
protected void CargaTipo()
{
DdlTipo.Items.Insert(0, new ListItem("Todos", "-1"));
DdlTipo.Items.Insert(1, new ListItem("Percepciones", "P"));
DdlTipo.Items.Insert(2, new ListItem("Deducciones", "D"));
DdlTipo.Items.Insert(3, new ListItem("Obligaciones", "O"));
DdlTipo.SelectedValue = "-1";
}
protected void CargaEstado()
{
DdlEstado.Items.Insert(0, new ListItem("Todos", "-1"));
DdlEstado.Items.Insert(1, new ListItem("Activo", "1"));
DdlEstado.Items.Insert(2, new ListItem("Inactivo", "0"));
DdlEstado.SelectedValue = "-1";
}
protected void CargaTiposGastos()
{
DdlTiposGastos.DataSource = get_GlobalDTTiposGastos(UsuarioActual.CveEmpresa);
DdlTiposGastos.DataBind();
DdlTiposGastos.Items.Insert(0, new ListItem("Todos", "-1"));
DdlTiposGastos.SelectedValue = "-1";
}
protected void BtnConsultar_Click(object sender, EventArgs e)
{
CargaDatos();
}
}

383
Nomina/CatConceptos.aspx.vb Normal file
View File

@@ -0,0 +1,383 @@
Imports System.Data
Imports Extensiones
Partial Class Nomina_CatConceptos
Inherits ClsPaginas
Private Property DTCuentas As DataTable
Get
Return CType(ViewState("DTCuentas"), DataTable)
End Get
Set(value As DataTable)
ViewState("DTCuentas") = value
End Set
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("Orden") = ""
CargaDdls()
CargaDatos()
CargaPadres()
End If
End Sub
Public Sub CargaDatos()
Dim ObjNomina As New ClsNominas
If ObjNomina.GetConceptos(UsuarioActual.CveEmpresa) Then
ViewState("DTNomConceptos") = ObjNomina.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTNomConceptos(-1) = ObjNomina.DtResultados
Else
Me.GvDatos.DataSource = Nothing
End If
ObjNomina.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Private Sub CargaDdls()
Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
If ObjConta.GetCuentas(-1, "-1", 1) Then
DTCuentas = ObjConta.DtResultados
End If
DdlContaConceptos.DataSource = GlobalDTContaConceptosContables(-1)
DdlContaConceptos.DataBind()
DdlContaConceptos.Items.Add(New ListItem("Sin Asignar", "-1"))
DdlContaConceptos.SelectedValue = "-1"
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
DdlClasificacion.DataBind()
DdlClasificacion.Items.Add(New ListItem("Sin Asignar", "-1"))
DdlClasificacion.SelectedValue = "-1"
DdlCtaContable.Items.Add(New ListItem("Sin Asignar", "-1"))
End Sub
Public Sub CargaPadres()
DdlPadre.DataSource = CType(ViewState("DTNomConceptos"), DataTable)
DdlPadre.DataBind()
DdlPadre.Items.Insert(0, New ListItem("", "-1"))
UpDatos.Update()
End Sub
Protected Sub LbAgregar_Click(sender As Object, e As EventArgs) Handles LbAgregar.Click
Dim ObjNomina As New ClsNominas
If ObjNomina.AddConcepto(TxtCodigo.Text.Trim, TxtConcepto.Text.Trim, DdlTipo.SelectedValue, TxtFormula.Text.Trim, ChkSistema.Checked, If(DdlTipoCalculo.SelectedValue.ToString = "0", False, True), True, DdlPadre.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlContaConceptos.SelectedValue, ChkRetencion.Checked, DdlClasificacion.SelectedValue.ToEntero, DdlCtaContable.SelectedValue.ToEntero) Then
TxtCodigo.Text = ""
TxtConcepto.Text = ""
DdlTipo.SelectedValue = "-1"
TxtFormula.Text = ""
Alert("El nuevo Concepto de Nómina se guardó correctamente.", TipoMensaje.MsgInformacion)
'UpTitulos.Update()
ViewState("DTNomConceptos") = ObjNomina.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTNomConceptos(-1) = ObjNomina.DtResultados
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
UpDatos.Update()
End If
ObjNomina.Dispose()
End Sub
Private Function ValidaFormula(Formula As String) As String
Dim Retorno As String = "Error en Fórmula"
Try
'tengo que cargar la definición de las variables, vienen del globaldt
Dim exp As FormulaEvaluator.Expression
For Each dr As DataRow In GlobalDTNomConceptosFunciones.Rows
exp = New FormulaEvaluator.Expression(String.Format("{0}:=1", dr("Funcion")))
exp.Eval()
Next
'Dim expr As String = Script.ToString
exp = New FormulaEvaluator.Expression(Formula)
If (exp.Errors.Count > 0) Then
Retorno = exp.Errors(0).Message
End If
Dim val As Object = exp.Eval()
If (exp.Errors.Count = 0) Then
Retorno = ""
Else
Retorno = exp.Errors(0).Message
End If
Catch ex As Exception
End Try
Return Retorno
End Function
Protected Sub BtnFormula_Click(sender As Object, e As EventArgs) Handles BtnFormula.Click
Alert(ValidaFormula(TxtFormula.Text), TipoMensaje.MsgInformacion)
End Sub
Protected Sub btnIngresarPredeterminados_Click(sender As Object, e As EventArgs) Handles btnIngresarPredeterminados.Click
Dim ObjNomina As New ClsNominas
If ObjNomina.GetConceptos(UsuarioActual.CveEmpresa) Then
For Each Row As DataRow In ObjNomina.DtResultados.FiltraParametros("CveEmpresa is null").Rows
Dim Codigo As String = Row("Codigo").ToString
Dim Concepto As String = Row("Concepto").ToString
Dim Tipo As String = Row("Tipo").ToString
Dim Formula As String = Row("Formula").ToString
Dim CveConceptoPadre As Integer = If(Not Row("Formula") Is Nothing, Row("CveConceptoPadre").ToString.ToEntero, -1)
Dim Sistema As Boolean = CType(Row("Sistema").ToString, Boolean)
Dim TipoCalculo As Boolean = CType(Row("TipoCalculo").ToString, Boolean)
ObjNomina.AddConcepto(Codigo, Concepto, Tipo, Formula, Sistema, TipoCalculo, True, CveConceptoPadre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, False, -1, -1)
Next
End If
ObjNomina.Dispose()
CargaDatos()
End Sub
#Region "G V D A T O S"
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.Cells(0).Width = Unit.Pixel(80)
e.Row.Cells(1).Width = Unit.Pixel(80)
e.Row.Cells(2).Width = Unit.Pixel(181)
e.Row.Cells(3).Width = Unit.Pixel(120)
e.Row.Cells(4).Width = Unit.Pixel(100)
e.Row.Cells(5).Width = Unit.Pixel(85)
e.Row.Cells(6).Width = Unit.Pixel(100)
e.Row.Cells(7).Width = Unit.Pixel(100)
e.Row.Cells(8).Width = Unit.Pixel(100)
e.Row.Cells(9).Width = Unit.Pixel(59)
e.Row.Cells(10).Width = Unit.Pixel(111)
e.Row.Cells(11).Width = Unit.Pixel(80)
e.Row.Cells(12).Width = Unit.Pixel(81)
e.Row.Cells(13).Width = Unit.Pixel(81)
e.Row.Cells(14).Width = Unit.Pixel(89)
e.Row.Cells(15).Width = Unit.Pixel(61)
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(8).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(9).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(10).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(11).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(12).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(13).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(14).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(15).HorizontalAlign = HorizontalAlign.Center
If IsNumeric(e.Row.DBCampo("CveConceptoPadre")) Then
e.Row.BackColor = Drawing.Color.Silver
End If
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
e.Row.FCDropDownList("DdlPadreGV").DataSource = CType(ViewState("DTNomConceptos"), DataTable)
e.Row.FCDropDownList("DdlPadreGV").DataBind()
e.Row.FCDropDownList("DdlPadreGV").Items.Insert(0, New ListItem("", "-1"))
e.Row.FCDropDownList("DdlPadreGV").SelectedValue = e.Row.DBCampo("CveConceptoPadre")
e.Row.FCDropDownList("DdlTipoGV").SelectedValue = e.Row.DBCampo("Tipo")
e.Row.FCDropDownList("DdlTipoCalculoGV").SelectedValue = e.Row.DBCampo("TipoCalculo")
e.Row.FCDropDownList("DdlClasificacion").DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
e.Row.FCDropDownList("DdlClasificacion").DataBind()
e.Row.FCDropDownList("DdlClasificacion").Items.Add(New ListItem("Sin Asignar", "-1"))
e.Row.FCDropDownList("DdlClasificacion").SelectedValue = If(e.Row.DataKey("CveClasificacion") = "", "-1", e.Row.DataKey("CveClasificacion"))
e.Row.FCDropDownList("DdlConceptoContable").DataSource = GlobalDTContaConceptosContables(-1)
e.Row.FCDropDownList("DdlConceptoContable").DataBind()
e.Row.FCDropDownList("DdlConceptoContable").Items.Add(New ListItem("Sin Asignar", "-1"))
e.Row.FCDropDownList("DdlConceptoContable").SelectedValue = If(e.Row.DataKey("CveConceptoContable") = "", "-1", e.Row.DataKey("CveConceptoContable"))
e.Row.FCCheckBox("ChkRetencion").Checked = e.Row.DataKey("EsRetencion")
If e.Row.FCCheckBox("ChkRetencion").Checked Then
e.Row.FCDropDownList("DdlClasificacion").Enabled = False
e.Row.FCDropDownList("DdlCtaContable").Enabled = True
e.Row.FCDropDownList("DdlCtaContable").DataSource = DTCuentas
e.Row.FCDropDownList("DdlCtaContable").DataBind()
e.Row.FCDropDownList("DdlCtaContable").Items.Add(New ListItem("Sin Asignar", "-1"))
e.Row.FCDropDownList("DdlCtaContable").SelectedValue = If(e.Row.DataKey("IdCtaContable") = "", "-1", e.Row.DataKey("IdCtaContable"))
Else
e.Row.FCDropDownList("DdlClasificacion").Enabled = True
e.Row.FCDropDownList("DdlCtaContable").Enabled = False
e.Row.FCDropDownList("DdlCtaContable").Items.Clear()
e.Row.FCDropDownList("DdlCtaContable").Items.Add(New ListItem("Sin Asignar", "-1"))
End If
Else
e.Row.FCLiteral("LtlCuentaContable").Text = If(e.Row.DataKey("IdCtaContable") = "", "Sin Asignar", DTCuentas.FiltroPrimeroValor("CtaCodigo", $"Id={e.Row.DataKey("IdCtaContable")}"))
End If
End If
End Sub
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
Dim ObjNomina As New ClsNominas
If ObjNomina.RemoveConcepto(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero, UsuarioActual.CveEmpresa) Then
GvDatos.EditIndex = -1
ViewState("DTNomConceptos") = ObjNomina.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTNomConceptos(-1) = ObjNomina.DtResultados
Alert("El Concepto de Nómina se eliminó correctamente.", TipoMensaje.MsgInformacion)
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
UpDatos.Update()
End If
ObjNomina.Dispose()
End Sub
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
GvDatos.EditIndex = -1
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
Dim ObjNomina As New ClsNominas
Dim Codigo As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtCodigoGV"), TextBox).Text.Trim
Dim Concepto As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtConceptoGV"), TextBox).Text.Trim
Dim Tipo As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("DdlTipoGV"), DropDownList).SelectedValue
Dim Formula As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtFormulaGV"), TextBox).Text.Trim
Dim Sistema As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkSistemaGV").Checked
Dim TipoCalculo As Boolean = If(DirectCast(GvDatos.Rows(e.RowIndex).FindControl("DdlTipoCalculoGV"), DropDownList).SelectedValue = "0", False, True)
Dim Estado As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstadoGV").Checked
Dim CveConceptoPadre As Integer = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("DdlPadreGV"), DropDownList).SelectedValue.ToEntero
Dim CveConcepto As Integer = GvDatos.Rows(e.RowIndex).DataKey("CveConcepto").ToEntero
Dim CveConceptoContable As Integer = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("DdlConceptoContable"), DropDownList).SelectedValue
Dim EsRetencion As Boolean = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("ChkRetencion"), CheckBox).Checked
Dim CveClasificacion As Integer = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("DdlClasificacion"), DropDownList).SelectedValue
Dim IdCtaContable As Integer = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("DdlCtaContable"), DropDownList).SelectedValue
If ObjNomina.UpdateConcepto(Codigo, Concepto, Tipo, Formula, Sistema, TipoCalculo, Estado, CveConceptoPadre, CveConcepto, UsuarioActual.CveEmpresa, CveConceptoContable, EsRetencion, CveClasificacion, IdCtaContable) Then
GvDatos.EditIndex = -1
ViewState("DTNomConceptos") = ObjNomina.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTNomConceptos(-1) = ObjNomina.DtResultados
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
UpDatos.Update()
End If
ObjNomina.Dispose()
End Sub
Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing
GvDatos.EditIndex = e.NewEditIndex
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
#End Region
#Region "O R D E N A M I E N T O"
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim Orden As String = ""
Dim Campo As String = ""
Dim Literal As Literal = Nothing
Const OrdenInicial As String = ""
Dim Arg(2) As String
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
Campo = Arg(0)
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
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)) = String.Format("{0} DESC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
End If
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
ViewState("Orden") = Orden
CargaGrid(Orden)
End Sub
Private Sub CargaGrid(Orden As String)
If Orden <> String.Empty Then
Dim DV As New DataView(CType(ViewState("DTNomConceptos"), DataTable), "", Orden, DataViewRowState.CurrentRows)
GvDatos.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatos.DataSource = CType(ViewState("DTNomConceptos"), DataTable)
End If
GvDatos.DataBind()
UpDatos.Update()
End Sub
Private Sub ChkRetencion_CheckedChanged(sender As Object, e As EventArgs) Handles ChkRetencion.CheckedChanged
If ChkRetencion.Checked Then
DdlClasificacion.SelectedValue = "-1"
DdlClasificacion.Enabled = False
DdlCtaContable.Enabled = True
DdlCtaContable.DataSource = DTCuentas
DdlCtaContable.DataBind()
DdlCtaContable.Items.Add(New ListItem("Sin Asignar", "-1"))
Else
DdlClasificacion.Enabled = True
DdlCtaContable.Enabled = False
DdlCtaContable.Items.Clear()
DdlCtaContable.Items.Add(New ListItem("Sin Asignar", "-1"))
End If
UpTitulos.Update()
End Sub
Protected Sub ChkRetencion_CheckedChanged1(sender As Object, e As EventArgs)
Dim chk As CheckBox = DirectCast(sender, CheckBox)
Dim gr As GridViewRow = DirectCast(chk.Parent.Parent, GridViewRow)
If chk.Checked Then
gr.FCDropDownList("DdlClasificacion").SelectedValue = "-1"
gr.FCDropDownList("DdlClasificacion").Enabled = False
gr.FCDropDownList("DdlCtaContable").Enabled = True
gr.FCDropDownList("DdlCtaContable").DataSource = DTCuentas
gr.FCDropDownList("DdlCtaContable").DataBind()
gr.FCDropDownList("DdlCtaContable").Items.Add(New ListItem("Sin Asignar", "-1"))
Else
gr.FCDropDownList("DdlClasificacion").Enabled = True
gr.FCDropDownList("DdlCtaContable").Enabled = False
gr.FCDropDownList("DdlCtaContable").Items.Clear()
gr.FCDropDownList("DdlCtaContable").Items.Add(New ListItem("Sin Asignar", "-1"))
End If
UpTitulos.Update()
End Sub
End Class
#End Region

357
Nomina/CatPeriodos.aspx Normal file
View File

@@ -0,0 +1,357 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatPeriodos.aspx.vb" Inherits="Nomina_CatPeriodos" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Catálogo de Periodos
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table class="table table-striped table-advance table-hover">
<thead>
<tr class="Titulos">
<th width="110px">
<asp:LinkButton ID="LbTipoPeriodo" runat="server" CausesValidation="false" Text="" CommandArgument="TipoPeriodo" OnClick="LbOrden_Click">
Tipo
<asp:Literal ID="ImgTipoPeriodo" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="80px">
<asp:LinkButton ID="LbEjercicio" runat="server" CausesValidation="false" Text="" CommandArgument="Ejercicio" OnClick="LbOrden_Click">
Ej.
<asp:Literal ID="ImgEjercicio" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="80px">
<asp:LinkButton ID="LbMes" runat="server" CausesValidation="false" Text="" CommandArgument="Mes" OnClick="LbOrden_Click">
Mes
<asp:Literal ID="ImgMes" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="80px">
<asp:LinkButton ID="LbNumero" runat="server" CausesValidation="false" Text="" CommandArgument="Numero" OnClick="LbOrden_Click">
No.
<asp:Literal ID="ImgNumero" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbFechaInicio" runat="server" CausesValidation="false" Text="" CommandArgument="FechaInicio" OnClick="LbOrden_Click">
Fecha Ini
<asp:Literal ID="ImgFechaInicio" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbFechaFin" runat="server" CausesValidation="false" Text="" CommandArgument="FechaFin" OnClick="LbOrden_Click">
Fecha Fin
<asp:Literal ID="ImgFechaFin" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="80px">
<asp:LinkButton ID="LbEsInicioMes" runat="server" CausesValidation="false" Text="" CommandArgument="EsInicioMes" OnClick="LbOrden_Click">
Ini. Mes
<asp:Literal ID="ImgEsInicioMes" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="80px">
<asp:LinkButton ID="LbEsFinMes" runat="server" CausesValidation="false" Text="" CommandArgument="EsFinMes" OnClick="LbOrden_Click">
Fin Mes
<asp:Literal ID="ImgEsFinMes" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="80px">
<asp:LinkButton ID="LbEsInicioSS" runat="server" CausesValidation="false" Text="" CommandArgument="EsInicioSS" OnClick="LbOrden_Click">
Ini. SS
<asp:Literal ID="ImgEsInicioSS" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="80px">
<asp:LinkButton ID="LbEsFinSS" runat="server" CausesValidation="false" Text="" CommandArgument="EsFinSS" OnClick="LbOrden_Click">
Fin SS
<asp:Literal ID="ImgEsFinSS" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="80px">
<asp:LinkButton ID="LbEsInicioAño" runat="server" CausesValidation="false" Text="" CommandArgument="EsInicioAño" OnClick="LbOrden_Click">
Ini. Año
<asp:Literal ID="ImgEsInicioAño" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="80px">
<asp:LinkButton ID="LbEsFinAño" runat="server" CausesValidation="false" Text="" CommandArgument="EsFinAño" OnClick="LbOrden_Click">
Fin Año
<asp:Literal ID="ImgEsFinAño" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbFueCalculado" runat="server" CausesValidation="false" Text="" CommandArgument="FueCalculado" OnClick="LbOrden_Click">
Calculado
<asp:Literal ID="ImgFueCalculado" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbEstatus" runat="server" CausesValidation="false" Text="" CommandArgument="Estatus" OnClick="LbOrden_Click">
Estatus
<asp:Literal ID="ImgEstatus" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<%--<td width="100px"><asp:LinkButton ID="LbFechaIng" runat="server" CausesValidation="false" Text="Fecha Ing."></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgFechaIng" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>--%>
<%-- <td width="100px"><asp:LinkButton ID="LbUsuario" runat="server" CausesValidation="false" Text="Usuario"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgUsuario" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>--%>
<th width="119">Comandos</th>
</tr>
</thead>
<tr>
<td>
<asp:DropDownList ID="DdlTipoPeriodo" runat="server" AppendDataBoundItems="true" AutoPostBack="True" DataTextField="TipoPeriodo" DataValueField="CveTipoPeriodo" Width="90px" ValidationGroup="GrpGuardar">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVTipoPeriodo" runat="server" ControlToValidate="DdlTipoPeriodo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Período''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOTipoPeriodo" runat="server" HighlightCssClass="vco" TargetControlID="RFVTipoPeriodo" Width="100px"></ajax:ValidatorCalloutExtender>
</td>
<td>
<asp:TextBox ID="TxtEjercicio" runat="server" CausesValidation="true" MaxLength="70" ValidationGroup="GrpGuardar" Width="70px" Enabled="false"></asp:TextBox>
<%--<asp:RequiredFieldValidator ID="RFVEjercicio" runat="server" ControlToValidate="TxtEjercicio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Período''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEjercicio" runat="server" HighlightCssClass="vco" TargetControlID="RFVEjercicio" Width="300px"></ajax:ValidatorCalloutExtender>--%>
</td>
<td>
<asp:TextBox ID="TxtMes" runat="server" CausesValidation="true" MaxLength="70" ValidationGroup="GrpGuardar" Width="70px" Enabled="false"></asp:TextBox>
<%--<asp:RequiredFieldValidator ID="RFVMes" runat="server" ControlToValidate="TxtMes" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Período''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCMes" runat="server" HighlightCssClass="vco" TargetControlID="RFVMes" Width="300px"></ajax:ValidatorCalloutExtender>--%>
</td>
<td>
<asp:TextBox ID="TxtNumero" runat="server" CausesValidation="true" MaxLength="70" ValidationGroup="GrpGuardar" Width="70px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVNumero" runat="server" ControlToValidate="TxtNumero" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Período''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCNumero" runat="server" HighlightCssClass="vco" TargetControlID="RFVNumero" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>
<asp:TextBox ID="TxtFechaInicio" runat="server" MaxLength="10" Width="70px"></asp:TextBox>
&nbsp;<asp:ImageButton runat="server" ID="ImgFechaInicio2" ImageUrl="/Imagenes/calendar.png" ImageAlign="AbsMiddle" Width="13px" Height="13px" AlternateText="Click para ver el Calendario" />
<ajax:MaskedEditExtender ID="MEEFechaInicio" runat="server" TargetControlID="TxtFechaInicio" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaInicio" TargetControlID="TxtFechaInicio" PopupButtonID="ImgFechaInicio2" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaInicio" runat="server" ControlToValidate="TxtFechaInicio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''FechaInicio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVFechaInicio" runat="server" ControlToValidate="TxtFechaInicio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''FechaInicio''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOFechaInicio1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaInicio" Width="3100px"></ajax:ValidatorCalloutExtender>
&nbsp;
<ajax:ValidatorCalloutExtender ID="VCOFechaInicio2" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaInicio" Width="3100px"></ajax:ValidatorCalloutExtender>
&nbsp;
</td>
<td>
<asp:TextBox ID="TxtFechaFin" runat="server" MaxLength="10" Width="70px"></asp:TextBox>
&nbsp;<asp:ImageButton runat="server" ID="ImgFechaFin2" ImageUrl="/Imagenes/calendar.png" ImageAlign="AbsMiddle" Width="13px" Height="13px" AlternateText="Click para ver el Calendario" />
<ajax:MaskedEditExtender ID="MEEFechaFin" runat="server" TargetControlID="TxtFechaFin" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaFin" TargetControlID="TxtFechaFin" PopupButtonID="ImgFechaFin2" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaFin" runat="server" ControlToValidate="TxtFechaFin" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''FechaFin''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVFechaFin" runat="server" ControlToValidate="TxtFechaFin" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''FechaFin''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOFechaFin1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaFin" Width="3100px"></ajax:ValidatorCalloutExtender>
&nbsp;
<ajax:ValidatorCalloutExtender ID="VCOFechaFin2" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaFin" Width="3100px"></ajax:ValidatorCalloutExtender>
&nbsp;
</td>
<td style="text-align: center">
<asp:CheckBox ID="ChkEsInicioMes" runat="server" />
</td>
<td style="text-align: center">
<asp:CheckBox ID="ChkEsFinMes" runat="server" />
</td>
<td style="text-align: center">
<asp:CheckBox ID="ChkEsInicioSS" runat="server" />
</td>
<td style="text-align: center">
<asp:CheckBox ID="ChkEsFinSS" runat="server" />
</td>
<td style="text-align: center">
<asp:CheckBox ID="ChkEsInicioAño" runat="server" />
</td>
<td style="text-align: center">
<asp:CheckBox ID="ChkEsFinAño" runat="server" />
</td>
<td style="text-align: center">
<asp:CheckBox ID="ChkFueCalculado" runat="server" />
</td>
<td>
<asp:DropDownList ID="DdlEstatus" runat="server" AppendDataBoundItems="true" AutoPostBack="True" DataTextField="Estatus" DataValueField="CveEstatus" Width="90px" ValidationGroup="GrpGuardar">
<asp:ListItem Selected="True" Text="" Value="0"></asp:ListItem>
<asp:ListItem Text="Actual" Value="1"></asp:ListItem>
<asp:ListItem Text="Cerrado" Value="2"></asp:ListItem>
</asp:DropDownList>
</td>
<td style="text-align: center">
<asp:LinkButton ID="LbAgregar" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CvePeriodo" EmptyDataText="No se encontraron Tipo de Periodo Registrados" ToolTip="Listado de Tipo de Periodo" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px;" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlTipoPeriodo" runat="server" Text='<%# Eval("TipoPeriodo", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DdlTipoPeriodo" runat="server" DataValueField="CveTipoPeriodo" DataTextField="TipoPeriodo" Width="80px"></asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEjercicio" runat="server" Text='<%# Eval("Ejercicio", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtEjercicio" runat="server" CausesValidation="true" MaxLength="80" Text='<%# Eval("Ejercicio") %>' ValidationGroup="GrpGV" Width="70px" Enabled="false"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVEjercicio" runat="server" ControlToValidate="TxtEjercicio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Días de Período''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEjercicio" runat="server" HighlightCssClass="vco" TargetControlID="RFVEjercicio" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlMes" runat="server" Text='<%# Eval("Mes", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtMes" runat="server" CausesValidation="true" MaxLength="80" Text='<%# Eval("Mes") %>' ValidationGroup="GrpGV" Width="70px" Enabled="false"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVMes" runat="server" ControlToValidate="TxtMes" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Días de Período''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCMes" runat="server" HighlightCssClass="vco" TargetControlID="RFVMes" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlNumero" runat="server" Text='<%# Eval("Numero", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtNumero" runat="server" CausesValidation="true" MaxLength="80" Text='<%# Eval("Numero") %>' ValidationGroup="GrpGV" Width="70px" Enabled="false"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVNumero" runat="server" ControlToValidate="TxtNumero" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Días de Período''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCNumero" runat="server" HighlightCssClass="vco" TargetControlID="RFVNumero" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFechaInicio" runat="server" Text='<%# Eval("FechaInicio", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtFechaInicio" runat="server" CausesValidation="true" Text='<%# Eval("FechaInicio") %>' ValidationGroup="GrpGV" MaxLength="10" Width="70px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVFechaInicio" runat="server" ControlToValidate="TxtFechaInicio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Días de Período''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCFechaInicio" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaInicio" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFechaFin" runat="server" Text='<%# Eval("FechaFin", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtFechaFin" runat="server" CausesValidation="true" Text='<%# Eval("FechaFin") %>' ValidationGroup="GrpGV" MaxLength="10" Width="70px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVFechaFin" runat="server" ControlToValidate="TxtFechaFin" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Días de Período''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCFechaFin" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaFin" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="ChkEsInicioMes" runat="server" Checked='<%# If (Eval("EsInicioMes").ToString = "Si", True, False) %>' />
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkEsInicioMes" runat="server" Checked='<%# If (Eval("EsInicioMes").ToString = "Si", True, False) %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="ChkEsFinMes" runat="server" Checked='<%# If (Eval("EsFinMes").ToString = "Si", True, False) %>' />
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkEsFinMes" runat="server" Checked='<%# If (Eval("EsFinMes").ToString = "Si", True, False) %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="ChkEsInicioSS" runat="server" Checked='<%# If (Eval("EsInicioSS").ToString = "Si", True, False) %>' />
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkEsInicioSS" runat="server" Checked='<%# If (Eval("EsInicioSS").ToString = "Si", True, False) %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="ChkEsFinSS" runat="server" Checked='<%# If (Eval("EsFinSS").ToString = "Si", True, False) %>' />
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkEsFinSS" runat="server" Checked='<%# If (Eval("EsFinSS").ToString = "Si", True, False) %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="ChkEsInicioAño" runat="server" Checked='<%# If (Eval("EsInicioAño").ToString = "Si", True, False) %>' />
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkEsInicioAño" runat="server" Checked='<%# If (Eval("EsInicioAño").ToString = "Si", True, False) %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="ChkEsFinAño" runat="server" Checked='<%# If (Eval("EsFinAño").ToString = "Si", True, False) %>' />
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkEsFinAño" runat="server" Checked='<%# If (Eval("EsFinAño").ToString = "Si", True, False) %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="ChkFueCalculado" runat="server" Checked='<%# If (Eval("FueCalculado").ToString = "Si", True, False) %>' />
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkFueCalculado" runat="server" Checked='<%# If (Eval("FueCalculado").ToString = "Si", True, False) %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DdlEstatus" runat="server" AppendDataBoundItems="true" AutoPostBack="True" DataTextField="Estatus" Width="90px" ValidationGroup="GrpGuardar">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Text="" Value="0"></asp:ListItem>
<asp:ListItem Text="Actual" Value="1"></asp:ListItem>
<asp:ListItem Text="Cerrado" Value="2"></asp:ListItem>
</asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<%--<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>--%>
<%-- <asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>--%>
<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<center>
<asp:ImageButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" ImageUrl="/Imagenes/Btn_Update.png" ValidationGroup="GrpGV" />
&nbsp;<asp:ImageButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" ImageUrl="/Imagenes/Btn_Cancel.png" />
</center>
</EditItemTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" ImageUrl="/Imagenes/Btn_Edit.png" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:ImageButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" ImageUrl="/Imagenes/Btn_Delete.png" OnClientClick="javascript:return C();" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

242
Nomina/CatPeriodos.aspx.vb Normal file
View File

@@ -0,0 +1,242 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports System.Linq
Imports Extensiones
Partial Class Nomina_CatPeriodos
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("Orden") = ""
CargaDatos()
CargaTipoPeriodo()
''Permiso Registro
'If PermisoRegistro Then
' LbAgregar.Enabled = True
'Else
' LbAgregar.Enabled = False
'End If
End If
End Sub
Public Sub CargaDatos()
Dim ObjNom_Periodos As New ClsNominas
If ObjNom_Periodos.GetPeriodos(-1, UsuarioActual.CveEmpresa, Now.Year, -1, -1) Then
ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTNom_Periodos = ObjNom_Periodos.DtResultados
Else
Me.GvDatos.DataSource = Nothing
End If
ObjNom_Periodos.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
Dim ObjNom_Periodos As New ClsNominas
Dim Numero As Integer = TxtNumero.Text.Trim.ToEntero
Dim EsInicioMes As Boolean = ChkEsInicioMes.Checked
Dim EsFinMes As Boolean = ChkEsFinMes.Checked
Dim EsInicioSS As Boolean = CBool(ChkEsInicioSS.Checked)
Dim EsFinSS As Boolean = ChkEsFinSS.Checked
Dim EsInicioAño As Boolean = ChkEsInicioAño.Checked
Dim EsFinAño As Boolean = ChkEsFinAño.Checked
Dim FueCalculado As Boolean = ChkFueCalculado.Checked
Dim FechaInicio As Date = TxtFechaInicio.Text.Trim.ToDate
Dim FechaFin As Date = TxtFechaFin.Text.Trim.ToDate
Dim Mes As Integer = FechaFin.Month
Dim Ejercicio As Integer = FechaFin.Year
Dim CveTipoPeriodo As Integer = DdlTipoPeriodo.SelectedValue.ToEntero
Dim Estatus As Integer = DdlEstatus.SelectedValue.ToEntero
If ObjNom_Periodos.AddPeriodo(CveTipoPeriodo, Ejercicio, Mes, Numero, FechaInicio, FechaFin, EsInicioMes, EsFinMes, ChkEsInicioSS.Checked, ChkEsFinAño.Checked, ChkEsInicioAño.Checked, ChkEsFinAño.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
Alert("El nuevo Periodo se guardó correctamente.", TipoMensaje.MsgInformacion)
UpTitulos.Update()
ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTNom_Periodos = ObjNom_Periodos.DtResultados
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End If
'ObjNom_Periodos.Dispose()
End Sub
#Region " C O M B O S"
Private Sub CargaTipoPeriodo()
DdlTipoPeriodo.DataSource = GlobalDTTipoPeriodo
DdlTipoPeriodo.DataBind()
End Sub
#End Region
#Region "G V D A T O S"
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowIndex = 0 Then
e.Row.Cells(0).Width = Unit.Pixel(100)
e.Row.Cells(1).Width = Unit.Pixel(80)
e.Row.Cells(2).Width = Unit.Pixel(80)
e.Row.Cells(3).Width = Unit.Pixel(80)
e.Row.Cells(4).Width = Unit.Pixel(100)
e.Row.Cells(5).Width = Unit.Pixel(100)
e.Row.Cells(6).Width = Unit.Pixel(80)
e.Row.Cells(7).Width = Unit.Pixel(80)
e.Row.Cells(8).Width = Unit.Pixel(80)
e.Row.Cells(9).Width = Unit.Pixel(80)
e.Row.Cells(10).Width = Unit.Pixel(80)
e.Row.Cells(11).Width = Unit.Pixel(80)
e.Row.Cells(12).Width = Unit.Pixel(80)
e.Row.Cells(13).Width = Unit.Pixel(100)
e.Row.Cells(14).Width = Unit.Pixel(53)
e.Row.Cells(15).Width = Unit.Pixel(68)
'e.Row.Cells(15).Width = Unit.Pixel(100)
End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(8).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(9).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(10).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(11).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(12).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(13).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(14).HorizontalAlign = HorizontalAlign.Center
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
e.Row.FCDropDownList("DdlTipoPeriodo").DataSource = GlobalDTTipoPeriodo
e.Row.FCDropDownList("DdlTipoPeriodo").DataBind()
e.Row.FCDropDownList("DdlTipoPeriodo").SelectedValue = e.Row.DBCampo("CveTipoPeriodo")
e.Row.FCDropDownList("DdlEstatus").SelectedItem.Text = e.Row.DBCampo("Estatus")
End If
End If
End Sub
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
Dim ObjNom_Periodos As New ClsNominas
If ObjNom_Periodos.RemovePeriodo(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatos.EditIndex = -1
ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTNom_Periodos = ObjNom_Periodos.DtResultados
Alert("El Periodo se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
ObjNom_Periodos.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
GvDatos.EditIndex = -1
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
Dim ObjNom_Periodos As New ClsNominas
Dim Numero As Integer = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtNumero"), TextBox).Text.Trim.ToEntero
Dim EsInicioMes As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEsInicioMes").Checked
Dim EsFinMes As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEsFinMes").Checked
Dim EsInicioSS As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEsInicioSS").Checked
Dim EsFinSS As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEsFinSS").Checked
Dim EsInicioAño As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEsInicioAño").Checked
Dim EsFinAño As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEsFinAño").Checked
Dim FueCalculado As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkFueCalculado").Checked
Dim FechaInicio As Date = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtFechaInicio"), TextBox).Text.Trim.ToDateTime
Dim FechaFin As Date = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtFechaFin"), TextBox).Text.Trim.ToDateTime
Dim Mes As Integer = FechaFin.Month
Dim Ejercicio As Integer = FechaFin.Year
Dim CveTipoPeriodo As Integer = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("DdlTipoPeriodo"), DropDownList).SelectedValue.ToEntero
Dim Estatus As Integer = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("DdlEstatus"), DropDownList).SelectedValue.ToEntero
Dim CvePeriodo As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
If ObjNom_Periodos.UpdatePeriodo(FechaInicio, FechaFin, EsInicioMes, EsFinMes, EsInicioSS, EsFinSS, EsInicioAño, EsFinAño, FueCalculado,
CveTipoPeriodo, Ejercicio, Mes, Numero, Estatus, CvePeriodo, UsuarioActual.CveEmpresa) Then
GvDatos.EditIndex = -1
ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTNom_Periodos = ObjNom_Periodos.DtResultados
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
End If
ObjNom_Periodos.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing
GvDatos.EditIndex = e.NewEditIndex
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
#End Region
#Region "O R D E N A M I E N T O"
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim Orden As String = ""
Dim Campo As String = ""
Dim Literal As Literal = Nothing
Const OrdenInicial As String = ""
Dim Arg(2) As String
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
Campo = Arg(0)
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
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)) = String.Format("{0} DESC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
End If
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
ViewState("Orden") = Orden
CargaGrid(Orden)
End Sub
Private Sub CargaGrid(Orden As String)
If Orden <> String.Empty Then
Dim DV As New DataView(CType(ViewState("DTNom_Periodos"), DataTable), "", Orden, DataViewRowState.CurrentRows)
GvDatos.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatos.DataSource = CType(ViewState("DTNom_Periodos"), DataTable)
End If
GvDatos.DataBind()
UpDatos.Update()
End Sub
#End Region
End Class

156
Nomina/CatSatBancos.aspx Normal file
View File

@@ -0,0 +1,156 @@
<%@ Page Title="Catálogo de Bancos" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatSatBancos.aspx.vb" Inherits="Nom_CatSatBancos" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Catálogo de Bancos
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table class="table table-striped table-advance table-hover">
<thead>
<tr class="Titulos">
<th width="80px">
<asp:LinkButton ID="LbCveBanco" runat="server" CausesValidation="false" Text="" CommandArgument="CveBanco" OnClick="LbOrden_Click">
Clave
<asp:Literal ID="ImgCveBanco" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="160px">
<asp:LinkButton ID="LbBanco" runat="server" CausesValidation="false" Text="" CommandArgument="Banco" OnClick="LbOrden_Click">
Banco
<asp:Literal ID="ImgBanco" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="315px">
<asp:LinkButton ID="LbRazonSocial" runat="server" CausesValidation="false" Text="" CommandArgument="RazonSocial" OnClick="LbOrden_Click">
Razón Social
<asp:Literal ID="ImgRazonSocial" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbEstatus" runat="server" CausesValidation="false" Text="" CommandArgument="Estatus" OnClick="LbOrden_Click">
Estatus
<asp:Literal ID="ImgEstatus" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbFechaIng" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng" OnClick="LbOrden_Click">
Fecha
<asp:Literal ID="ImgFechaIng" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbUsuario" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario" OnClick="LbOrden_Click">
Usuario
<asp:Literal ID="ImgUsuario" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="161px">Comandos</th>
</tr>
</thead>
<tr>
<td>
<asp:TextBox ID="TxtCveBanco" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="64px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtBanco" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clave Banco''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RFVBanco" Width="94px"></ajax:ValidatorCalloutExtender>
</td>
<td>
<asp:TextBox ID="TxtBanco" runat="server" CausesValidation="true" MaxLength="150" ValidationGroup="GrpGuardar" Width="144px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVBanco" runat="server" ControlToValidate="TxtBanco" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Banco''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCBanco" runat="server" HighlightCssClass="vco" TargetControlID="RFVBanco" Width="154px"></ajax:ValidatorCalloutExtender>
</td>
<td>
<asp:TextBox ID="TxtRazonSocial" runat="server" CausesValidation="true" MaxLength="300" ValidationGroup="GrpGuardar" Width="299px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="TxtRazonSocial" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Razon Social''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="RFVBanco" Width="299px"></ajax:ValidatorCalloutExtender>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td style="text-align: center">
<asp:LinkButton ID="LbAgregar" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveSATBanco" EmptyDataText="No se encontraron Bancos Registrados" ToolTip="Listado de Banco" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px;" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlCveBanco" runat="server" Text='<%# Eval("CveBanco", "{0}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlBanco" runat="server" Text='<%# Eval("Banco", "{0}")%>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtBanco" runat="server" CausesValidation="true" MaxLength="150" Text='<%# Eval("Banco")%>' ValidationGroup="GrpGV" Width="144px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVBanco" runat="server" ControlToValidate="TxtBanco" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Banco''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCBanco" runat="server" HighlightCssClass="vco" TargetControlID="RFVBanco" Width="200px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField >
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlRazonSocial" runat="server" Text='<%# Eval("RazonSocial", "{0}")%>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtRazonSocial" runat="server" CausesValidation="true" MaxLength="300" Text='<%# Eval("RazonSocial")%>' ValidationGroup="GrpGV" Width="299px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVRazonSocial" runat="server" ControlToValidate="TxtRazonSocial" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Razon Social''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCRazonSocial" runat="server" HighlightCssClass="vco" TargetControlID="RFVRazonSocial" Width="350px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus")%>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If(Eval("Estatus").ToString = "Activo", True, False)%>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<center>
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
&nbsp;<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
</center>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

172
Nomina/CatSatBancos.aspx.vb Normal file
View File

@@ -0,0 +1,172 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports System.Linq
Imports Extensiones
Partial Class Nom_CatSatBancos
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("Orden") = ""
CargaDatos()
End If
End Sub
Public Sub CargaDatos()
Dim ObjBancos As New ClsNominas
If ObjBancos.GetBancos() Then
ViewState("DTBancos") = ObjBancos.DtResultados
GlobalDTNomSatBancos = ObjBancos.DtResultados
Else
Me.GvDatos.DataSource = Nothing
End If
ObjBancos.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
Dim ObjBancos As New ClsNominas
If ObjBancos.AddBancos(TxtBanco.Text.Trim, TxtRazonSocial.Text.Trim, UsuarioActual.CveUsuario, TxtCveBanco.Text.Trim) Then
TxtCveBanco.Text = ""
TxtBanco.Text = ""
TxtRazonSocial.Text = ""
Alert("El nuevo Banco se guardó correctamente.", TipoMensaje.MsgInformacion)
UpTitulos.Update()
ViewState("DTBancos") = ObjBancos.DtResultados
GlobalDTNomSatBancos = ObjBancos.DtResultados
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End If
ObjBancos.Dispose()
End Sub
#Region "G V D A T O S"
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.Cells(0).Width = Unit.Pixel(80)
e.Row.Cells(1).Width = Unit.Pixel(160)
e.Row.Cells(2).Width = Unit.Pixel(315)
e.Row.Cells(3).Width = Unit.Pixel(100)
e.Row.Cells(4).Width = Unit.Pixel(100)
e.Row.Cells(5).Width = Unit.Pixel(100)
e.Row.Cells(6).Width = Unit.Pixel(100)
e.Row.Cells(7).Width = Unit.Pixel(61)
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Center
End If
End Sub
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
Dim ObjBancos As New ClsNominas
If ObjBancos.RemoveBancos(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatos.EditIndex = -1
ViewState("DTBancos") = ObjBancos.DtResultados
GlobalDTNomSatBancos = ObjBancos.DtResultados
Alert("El Banco se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
ObjBancos.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
GvDatos.EditIndex = -1
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
Dim ObjBancos As New ClsNominas
Dim Banco As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtBanco"), TextBox).Text.Trim
Dim RazonSocial As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtRazonSocial"), TextBox).Text.Trim
Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
Dim CveBanco As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
If ObjBancos.UpdateBancos(CveBanco, Banco, RazonSocial, Estatus) Then
GvDatos.EditIndex = -1
ViewState("DTBancos") = ObjBancos.DtResultados
GlobalDTNomSatBancos = ObjBancos.DtResultados
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
End If
ObjBancos.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing
GvDatos.EditIndex = e.NewEditIndex
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
#End Region
#Region "O R D E N A M I E N T O"
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim Orden As String = ""
Dim Campo As String = ""
Dim Literal As Literal = Nothing
Const OrdenInicial As String = ""
Dim Arg(2) As String
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
Campo = Arg(0)
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
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)) = String.Format("{0} DESC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
End If
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
ViewState("Orden") = Orden
CargaGrid(Orden)
End Sub
Private Sub CargaGrid(Orden As String)
If Orden <> String.Empty Then
Dim DV As New DataView(CType(ViewState("DTBancos"), DataTable), "", Orden, DataViewRowState.CurrentRows)
GvDatos.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatos.DataSource = CType(ViewState("DTBancos"), DataTable)
End If
GvDatos.DataBind()
UpDatos.Update()
End Sub
#End Region
End Class

156
Nomina/CatSatConceptos.aspx Normal file
View File

@@ -0,0 +1,156 @@
<%@ Page Title="Catálogo de Conceptos" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatSatConceptos.aspx.vb" Inherits="Nom_CatSatConceptos" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Catálogo de Conceptos
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table class="table table-striped table-advance table-hover">
<thead>
<tr class="Titulos">
<th width="100px">
<asp:LinkButton ID="LbCveConcepto" runat="server" CausesValidation="false" Text="" CommandArgument="CveConcepto" OnClick="LbOrden_Click">
Clave
<asp:Literal ID="ImgCveConcepto" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="300px">
<asp:LinkButton ID="LbConcepto" runat="server" CausesValidation="false" Text="" CommandArgument="Concepto" OnClick="LbOrden_Click">
Concepto
<asp:Literal ID="ImgConcepto" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbTipoConcepto" runat="server" CausesValidation="false" Text="" CommandArgument="TipoConcepto" OnClick="LbOrden_Click">
Tipo Concepto
<asp:Literal ID="ImgTipoConcepto" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbEstatus" runat="server" CausesValidation="false" Text="" CommandArgument="Estatus" OnClick="LbOrden_Click">
Estatus
<asp:Literal ID="ImgEstatus" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbFechaIng" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng" OnClick="LbOrden_Click">
Fecha
<asp:Literal ID="ImgFechaIng" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbUsuario" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario" OnClick="LbOrden_Click">
Usuario
<asp:Literal ID="ImgUsuario" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="161">Comandos</th>
</tr>
</thead>
<tr>
<td>
<asp:TextBox ID="TxtCveConcepto" runat="server" CausesValidation="true" MaxLength="3" ValidationGroup="GrpGuardar" Width="84px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtConcepto" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clave Concepto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RFVConcepto" Width="94px"></ajax:ValidatorCalloutExtender>
</td>
<td>
<asp:TextBox ID="TxtConcepto" runat="server" CausesValidation="true" MaxLength="150" ValidationGroup="GrpGuardar" Width="284px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVConcepto" runat="server" ControlToValidate="TxtConcepto" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Concepto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCConcepto" runat="server" HighlightCssClass="vco" TargetControlID="RFVConcepto" Width="294px"></ajax:ValidatorCalloutExtender>
</td>
<td>
<asp:TextBox ID="TxtTipoConcepto" runat="server" CausesValidation="true" MaxLength="300" ValidationGroup="GrpGuardar" Width="84px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="TxtTipoConcepto" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Concepto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="RFVConcepto" Width="94px"></ajax:ValidatorCalloutExtender>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td style="text-align: center">
<asp:LinkButton ID="LbAgregar" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveSATConcepto" EmptyDataText="No se encontraron Conceptos Registrados" ToolTip="Listado de Concepto" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px;" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlCveConcepto" runat="server" Text='<%# Eval("CveConcepto", "{0}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlConcepto" runat="server" Text='<%# Eval("Concepto", "{0}")%>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtConcepto" runat="server" CausesValidation="true" MaxLength="150" Text='<%# Eval("Concepto")%>' ValidationGroup="GrpGV" Width="284px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVConcepto" runat="server" ControlToValidate="TxtConcepto" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Concepto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCConcepto" runat="server" HighlightCssClass="vco" TargetControlID="RFVConcepto" Width="294px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlTipoConcepto" runat="server" Text='<%# Eval("TipoConcepto", "{0}")%>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtTipoConcepto" runat="server" CausesValidation="true" MaxLength="1" Text='<%# Eval("TipoConcepto")%>' ValidationGroup="GrpGV" Width="84px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVTipoConcepto" runat="server" ControlToValidate="TxtTipoConcepto" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Concepto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCTipoConcepto" runat="server" HighlightCssClass="vco" TargetControlID="RFVTipoConcepto" Width="94px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus")%>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If(Eval("Estatus").ToString = "Activo", True, False)%>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<center>
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
&nbsp;<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
</center>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,182 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports System.Linq
Imports Extensiones
Partial Class Nom_CatSatConceptos
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("Orden") = ""
CargaDatos()
End If
End Sub
Public Sub CargaDatos()
Dim ObjConceptos As New ClsNominas
If ObjConceptos.GetConceptos() Then
ViewState("DTConceptos") = ObjConceptos.DtResultados
GlobalDTNomSatConceptos = ObjConceptos.DtResultados
Else
Me.GvDatos.DataSource = Nothing
End If
ObjConceptos.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
Dim ObjConceptos As New ClsNominas
If ObjConceptos.AddConceptos(TxtConcepto.Text.Trim, TxtTipoConcepto.Text.Trim, UsuarioActual.CveUsuario, TxtCveConcepto.Text.Trim) Then
TxtCveConcepto.Text = ""
TxtConcepto.Text = ""
TxtTipoConcepto.Text = ""
Alert("El nuevo Concepto se guardó correctamente.", TipoMensaje.MsgInformacion)
UpTitulos.Update()
ViewState("DTConceptos") = ObjConceptos.DtResultados
GlobalDTNomSatConceptos = ObjConceptos.DtResultados
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End If
ObjConceptos.Dispose()
End Sub
#Region "G V D A T O S"
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.Cells(0).Width = Unit.Pixel(100)
e.Row.Cells(1).Width = Unit.Pixel(300)
e.Row.Cells(2).Width = Unit.Pixel(100)
e.Row.Cells(3).Width = Unit.Pixel(100)
e.Row.Cells(4).Width = Unit.Pixel(100)
e.Row.Cells(5).Width = Unit.Pixel(100)
e.Row.Cells(6).Width = Unit.Pixel(100)
e.Row.Cells(7).Width = Unit.Pixel(61)
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Center
End If
End Sub
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
Dim ObjConceptos As New ClsNominas
If ObjConceptos.RemoveConceptos(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatos.EditIndex = -1
ViewState("DTConceptos") = ObjConceptos.DtResultados
GlobalDTNomSatConceptos = ObjConceptos.DtResultados
Alert("El Concepto se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
ObjConceptos.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
GvDatos.EditIndex = -1
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
Dim ObjConceptos As New ClsNominas
Dim Concepto As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtConcepto"), TextBox).Text.Trim
Dim TipoConcepto As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtTipoConcepto"), TextBox).Text.Trim
Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
Dim CveConcepto As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
If ObjConceptos.UpdateConceptos(CveConcepto, Concepto, TipoConcepto, Estatus) Then
GvDatos.EditIndex = -1
ViewState("DTConceptos") = ObjConceptos.DtResultados
GlobalDTNomSatConceptos = ObjConceptos.DtResultados
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
End If
ObjConceptos.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing
GvDatos.EditIndex = e.NewEditIndex
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
#End Region
#Region "O R D E N A M I E N T O"
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim Orden As String = ""
Dim Campo As String = ""
Dim Literal As Literal = Nothing
Const OrdenInicial As String = ""
Dim Arg(2) As String
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
Campo = Arg(0)
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
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)) = String.Format("{0} DESC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
End If
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
ViewState("Orden") = Orden
CargaGrid(Orden)
End Sub
Private Sub CargaGrid(Orden As String)
If Orden <> String.Empty Then
Dim DV As New DataView(CType(ViewState("DTConceptos"), DataTable), "", Orden, DataViewRowState.CurrentRows)
GvDatos.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatos.DataSource = CType(ViewState("DTConceptos"), DataTable)
End If
GvDatos.DataBind()
UpDatos.Update()
End Sub
#End Region
End Class

View File

@@ -0,0 +1,135 @@
<%@ Page Title="Catálogo Regimen Contratación" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatSatRegimenContratacion.aspx.vb" Inherits="Nom_CatSatRegimenContratacion" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Catálogo Régimen Contratación
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table class="table table-striped table-advance table-hover">
<thead>
<tr class="Titulos">
<th width="100px">
<asp:LinkButton ID="LbCveRegimenContratacion" runat="server" CausesValidation="false" Text="" CommandArgument="CveRegimenContratacion" OnClick="LbOrden_Click">
Clave
<asp:Literal ID="ImgCveRegimenContratacion" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="300px">
<asp:LinkButton ID="LbRegimenContratacion" runat="server" CausesValidation="false" Text="" CommandArgument="RegimenContratacion" OnClick="LbOrden_Click">
Régimen Contratación
<asp:Literal ID="ImgRegimenContratacion" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbEstatus" runat="server" CausesValidation="false" Text="" CommandArgument="Estatus" OnClick="LbOrden_Click">
Estatus
<asp:Literal ID="ImgEstatus" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbFechaIng" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng" OnClick="LbOrden_Click">
Fecha
<asp:Literal ID="ImgFechaIng" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbUsuario" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario" OnClick="LbOrden_Click">
Usuario
<asp:Literal ID="ImgUsuario" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="161px">Comandos</th>
</tr>
</thead>
<tr>
<td>
<asp:TextBox ID="TxtCveRegimenContratacion" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="84px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtRegimenContratacion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clave RegimenContratacion''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RFVRegimenContratacion" Width="94px"></ajax:ValidatorCalloutExtender>
</td>
<td>
<asp:TextBox ID="TxtRegimenContratacion" runat="server" CausesValidation="true" MaxLength="300" ValidationGroup="GrpGuardar" Width="284px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVRegimenContratacion" runat="server" ControlToValidate="TxtRegimenContratacion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''RegimenContratacion''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCRegimenContratacion" runat="server" HighlightCssClass="vco" TargetControlID="RFVRegimenContratacion" Width="294px"></ajax:ValidatorCalloutExtender>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td style="text-align: center">
<asp:LinkButton ID="LbAgregar" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveSATRegimenContratacion" EmptyDataText="No se encontraron RegimenContratacions Registradas" ToolTip="Listado de RegimenContratacion" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px;" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlCveRegimenContratacion" runat="server" Text='<%# Eval("CveRegimenContratacion", "{0}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlRegimenContratacion" runat="server" Text='<%# Eval("RegimenContratacion", "{0}")%>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtRegimenContratacion" runat="server" CausesValidation="true" MaxLength="300" Text='<%# Eval("RegimenContratacion")%>' ValidationGroup="GrpGV" Width="284px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVRegimenContratacion" runat="server" ControlToValidate="TxtRegimenContratacion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''RegimenContratacion''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCRegimenContratacion" runat="server" HighlightCssClass="vco" TargetControlID="RFVRegimenContratacion" Width="294px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus")%>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If(Eval("Estatus").ToString = "Activo", True, False)%>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<center>
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
&nbsp;<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
</center>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,175 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports System.Linq
Imports Extensiones
Partial Class Nom_CatSatRegimenContratacion
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("Orden") = ""
CargaDatos()
End If
End Sub
Public Sub CargaDatos()
Dim ObjRegimenContratacion As New ClsNominas
If ObjRegimenContratacion.GetRegimenContratacion() Then
ViewState("DTRegimenContratacion") = ObjRegimenContratacion.DtResultados
GlobalDTNomSatRegimenContratacion = ObjRegimenContratacion.DtResultados
Else
Me.GvDatos.DataSource = Nothing
End If
ObjRegimenContratacion.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
Dim ObjRegimenContratacion As New ClsNominas
If ObjRegimenContratacion.AddRegimenContratacion(TxtRegimenContratacion.Text.Trim, UsuarioActual.CveUsuario, TxtCveRegimenContratacion.Text.Trim.ToEntero) Then
TxtCveRegimenContratacion.Text = ""
TxtRegimenContratacion.Text = ""
Alert("El nuevo RegimenContratacion se guardó correctamente.", TipoMensaje.MsgInformacion)
UpTitulos.Update()
ViewState("DTRegimenContratacion") = ObjRegimenContratacion.DtResultados
GlobalDTNomSatRegimenContratacion = ObjRegimenContratacion.DtResultados
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End If
ObjRegimenContratacion.Dispose()
End Sub
#Region "G V D A T O S"
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.Cells(0).Width = Unit.Pixel(100)
e.Row.Cells(1).Width = Unit.Pixel(300)
e.Row.Cells(2).Width = Unit.Pixel(100)
e.Row.Cells(3).Width = Unit.Pixel(100)
e.Row.Cells(4).Width = Unit.Pixel(100)
e.Row.Cells(5).Width = Unit.Pixel(100)
e.Row.Cells(6).Width = Unit.Pixel(61)
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Center
End If
End Sub
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
Dim ObjRegimenContratacion As New ClsNominas
If ObjRegimenContratacion.RemoveRegimenContratacion(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatos.EditIndex = -1
ViewState("DTRegimenContratacion") = ObjRegimenContratacion.DtResultados
GlobalDTNomSatRegimenContratacion = ObjRegimenContratacion.DtResultados
Alert("El RegimenContratacion se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
ObjRegimenContratacion.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
GvDatos.EditIndex = -1
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
Dim ObjRegimenContratacion As New ClsNominas
Dim RegimenContratacion As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtRegimenContratacion"), TextBox).Text.Trim
Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
Dim CveRegimenContratacion As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
If ObjRegimenContratacion.UpdateRegimenContratacion(CveRegimenContratacion, RegimenContratacion, Estatus) Then
GvDatos.EditIndex = -1
ViewState("DTRegimenContratacion") = ObjRegimenContratacion.DtResultados
GlobalDTNomSatRegimenContratacion = ObjRegimenContratacion.DtResultados
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
End If
ObjRegimenContratacion.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing
GvDatos.EditIndex = e.NewEditIndex
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
#End Region
#Region "O R D E N A M I E N T O"
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim Orden As String = ""
Dim Campo As String = ""
Dim Literal As Literal = Nothing
Const OrdenInicial As String = ""
Dim Arg(2) As String
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
Campo = Arg(0)
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
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)) = String.Format("{0} DESC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
End If
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
ViewState("Orden") = Orden
CargaGrid(Orden)
End Sub
Private Sub CargaGrid(Orden As String)
If Orden <> String.Empty Then
Dim DV As New DataView(CType(ViewState("DTRegimenContratacion"), DataTable), "", Orden, DataViewRowState.CurrentRows)
GvDatos.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatos.DataSource = CType(ViewState("DTRegimenContratacion"), DataTable)
End If
GvDatos.DataBind()
UpDatos.Update()
End Sub
#End Region
End Class

View File

@@ -0,0 +1,160 @@
<%@ Page Title="RH - Catálogo de Riesgo Puesto" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatSatRiesgoPuesto.aspx.vb" Inherits="Nom_CatSatRiesgoPuesto" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Catálogo de Riesgo Puesto
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table class="table table-striped table-advance table-hover">
<thead>
<tr class="Titulos">
<th width="100px">
<asp:LinkButton ID="LbCveRiesgoPuesto" runat="server" CausesValidation="false" Text="" CommandArgument="CveRiesgoPuesto" OnClick="LbOrden_Click">
Clave
<asp:Literal ID="ImgCveRiesgoPuesto" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="300px">
<asp:LinkButton ID="LbRiesgoPuesto" runat="server" CausesValidation="false" Text="" CommandArgument="RiesgoPuesto" OnClick="LbOrden_Click">
Riesgo Puesto
<asp:Literal ID="ImgRiesgoPuesto" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbFactor" runat="server" CausesValidation="false" Text="" CommandArgument="Factor" OnClick="LbOrden_Click">
Factor
<asp:Literal ID="ImgFactor" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbEstatus" runat="server" CausesValidation="false" Text="" CommandArgument="Estatus" OnClick="LbOrden_Click">
Estatus
<asp:Literal ID="ImgEstatus" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbFechaIng" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng" OnClick="LbOrden_Click">
Fecha
<asp:Literal ID="ImgFechaIng" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbUsuario" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario" OnClick="LbOrden_Click">
Usuario
<asp:Literal ID="ImgUsuario" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="161px">Comandos</th>
</tr>
</thead>
<tr>
<td>
<asp:TextBox ID="TxtCveRiesgoPuesto" runat="server" CausesValidation="true" MaxLength="3" ValidationGroup="GrpGuardar" Width="84px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtRiesgoPuesto" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clave RiesgoPuesto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RFVRiesgoPuesto" Width="94px"></ajax:ValidatorCalloutExtender>
</td>
<td>
<asp:TextBox ID="TxtRiesgoPuesto" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="283px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVRiesgoPuesto" runat="server" ControlToValidate="TxtRiesgoPuesto" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''RiesgoPuesto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCRiesgoPuesto" runat="server" HighlightCssClass="vco" TargetControlID="RFVRiesgoPuesto" Width="294px"></ajax:ValidatorCalloutExtender>
</td>
<td>
<asp:TextBox ID="TxtFactor" runat="server" CausesValidation="true" MaxLength="9" ValidationGroup="GrpGuardar" Width="84px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="TxtFactor" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo RiesgoPuesto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCFactor1" runat="server" HighlightCssClass="vco" TargetControlID="RFVRiesgoPuesto" Width="94px"></ajax:ValidatorCalloutExtender>
<asp:CompareValidator ID="CVFactor" runat="server" ControlToValidate="TxtFactor" Display="None" ErrorMessage="El campo <b>Factor</b> no tiene el formato correcto, por favor corrija e intente de nuevo (solo formato numerico como el siguiente 0.1234567)." Operator="DataTypeCheck" Type="Double" ValidationGroup="GrpGV"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCFactor2" runat="server" HighlightCssClass="vco" TargetControlID="CVFactor" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td style="text-align: center">
<asp:LinkButton ID="LbAgregar" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveSATRiesgoPuesto" EmptyDataText="No se encontraron RiesgoPuesto Registrados" ToolTip="Listado de RiesgoPuesto" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px;" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlCveRiesgoPuesto" runat="server" Text='<%# Eval("CveRiesgoPuesto", "{0}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlRiesgoPuesto" runat="server" Text='<%# Eval("RiesgoPuesto", "{0}")%>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtRiesgoPuesto" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("RiesgoPuesto")%>' ValidationGroup="GrpGV" Width="283px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVRiesgoPuesto" runat="server" ControlToValidate="TxtRiesgoPuesto" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''RiesgoPuesto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCRiesgoPuesto" runat="server" HighlightCssClass="vco" TargetControlID="RFVRiesgoPuesto" Width="294px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlFactor" runat="server" Text='<%# Eval("Factor", "{0}")%>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtFactor" runat="server" CausesValidation="true" MaxLength="9" Text='<%# Eval("Factor")%>' ValidationGroup="GrpGV" Width="84px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVFactor" runat="server" ControlToValidate="TxtFactor" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo RiesgoPuesto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCFactor1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFactor" Width="300px"></ajax:ValidatorCalloutExtender>
<asp:CompareValidator ID="CVFactor" runat="server" ControlToValidate="TxtFactor" Display="None" ErrorMessage="El campo <b>Factor</b> no tiene el formato correcto, por favor corrija e intente de nuevo (solo formato numerico como el siguiente 0.1234567)." Operator="DataTypeCheck" Type="Double" ValidationGroup="GrpGV"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCFactor2" runat="server" HighlightCssClass="vco" TargetControlID="CVFactor" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus")%>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If(Eval("Estatus").ToString = "Activo", True, False)%>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<center>
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
&nbsp;<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
</center>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,176 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports System.Linq
Imports Extensiones
Partial Class Nom_CatSatRiesgoPuesto
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("Orden") = ""
CargaDatos()
End If
End Sub
Public Sub CargaDatos()
Dim ObjRiesgoPuesto As New ClsNominas
If ObjRiesgoPuesto.GetRiesgoPuesto() Then
ViewState("DTRiesgoPuesto") = ObjRiesgoPuesto.DtResultados
GlobalDTNomSatRiesgoPuesto = ObjRiesgoPuesto.DtResultados
Else
Me.GvDatos.DataSource = Nothing
End If
ObjRiesgoPuesto.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
Dim ObjRiesgoPuesto As New ClsNominas
If ObjRiesgoPuesto.AddRiesgoPuesto(TxtCveRiesgoPuesto.Text.Trim.ToEntero, TxtRiesgoPuesto.Text.Trim, UsuarioActual.CveUsuario, TxtFactor.Text.Trim.ToDouble) Then
TxtCveRiesgoPuesto.Text = ""
TxtRiesgoPuesto.Text = ""
TxtFactor.Text = ""
Alert("El nuevo RiesgoPuesto se guardó correctamente.", TipoMensaje.MsgInformacion)
UpTitulos.Update()
ViewState("DTRiesgoPuesto") = ObjRiesgoPuesto.DtResultados
GlobalDTNomSatRiesgoPuesto = ObjRiesgoPuesto.DtResultados
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End If
ObjRiesgoPuesto.Dispose()
End Sub
#Region "G V D A T O S"
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowIndex = 0 Then
e.Row.Cells(0).Width = Unit.Pixel(100)
e.Row.Cells(1).Width = Unit.Pixel(300)
e.Row.Cells(2).Width = Unit.Pixel(100)
e.Row.Cells(3).Width = Unit.Pixel(100)
e.Row.Cells(4).Width = Unit.Pixel(100)
e.Row.Cells(5).Width = Unit.Pixel(100)
e.Row.Cells(6).Width = Unit.Pixel(100)
e.Row.Cells(7).Width = Unit.Pixel(61)
End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Center
End If
End Sub
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
Dim ObjRiesgoPuesto As New ClsNominas
If ObjRiesgoPuesto.RemoveRiesgoPuesto(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatos.EditIndex = -1
ViewState("DTRiesgoPuesto") = ObjRiesgoPuesto.DtResultados
GlobalDTNomSatRiesgoPuesto = ObjRiesgoPuesto.DtResultados
Alert("El RiesgoPuesto se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
ObjRiesgoPuesto.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
GvDatos.EditIndex = -1
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
Dim ObjRiesgoPuesto As New ClsNominas
Dim RiesgoPuesto As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtRiesgoPuesto"), TextBox).Text.Trim
Dim Factor As Double = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtFactor"), TextBox).Text.Trim.ToDouble
Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
Dim CveSatRiesgoPuesto As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
If ObjRiesgoPuesto.UpdateRiesgoPuesto(CveSatRiesgoPuesto, RiesgoPuesto, Estatus, Factor) Then
GvDatos.EditIndex = -1
ViewState("DTRiesgoPuesto") = ObjRiesgoPuesto.DtResultados
GlobalDTNomSatRiesgoPuesto = ObjRiesgoPuesto.DtResultados
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
End If
ObjRiesgoPuesto.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing
GvDatos.EditIndex = e.NewEditIndex
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
#End Region
#Region "O R D E N A M I E N T O"
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim Orden As String = ""
Dim Campo As String = ""
Dim Literal As Literal = Nothing
Const OrdenInicial As String = ""
Dim Arg(2) As String
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
Campo = Arg(0)
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
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)) = String.Format("{0} DESC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
End If
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
ViewState("Orden") = Orden
CargaGrid(Orden)
End Sub
Private Sub CargaGrid(Orden As String)
If Orden <> String.Empty Then
Dim DV As New DataView(CType(ViewState("DTRiesgoPuesto"), DataTable), "", Orden, DataViewRowState.CurrentRows)
GvDatos.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatos.DataSource = CType(ViewState("DTRiesgoPuesto"), DataTable)
End If
GvDatos.DataBind()
UpDatos.Update()
End Sub
#End Region
End Class

View File

@@ -0,0 +1,134 @@
<%@ Page Title="Nómina - Catálogo Tipo de Incapacidad" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatSatTipoIncapacidad.aspx.vb" Inherits="CatSatTipoIncapacidad" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Catálogo de Tipo Incapacidad
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table class="table table-striped table-advance table-hover">
<thead>
<tr class="Titulos">
<th width="100px">
<asp:LinkButton ID="LbCveTipoIncapacidad" runat="server" CausesValidation="false" Text="" CommandArgument="CveTipoIncapacidad" OnClick="LbOrden_Click">
Clave
<asp:Literal ID="ImgCveTipoIncapacidad" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="250px">
<asp:LinkButton ID="LbTipoIncapacidad" runat="server" CausesValidation="false" Text="" CommandArgument="TipoIncapacidad" OnClick="LbOrden_Click">
Tipo Incapacidad
<asp:Literal ID="ImgTipoIncapacidad" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbEstatus" runat="server" CausesValidation="false" Text="" CommandArgument="Estatus" OnClick="LbOrden_Click">
Estado
<asp:Literal ID="ImgEstatus" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbFechaIng" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng" OnClick="LbOrden_Click">
Fecha
<asp:Literal ID="ImgFechaIng" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbUsuario" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario" OnClick="LbOrden_Click">
Usuario
<asp:Literal ID="ImgUsuario" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="161px">Comandos</th>
</tr>
</thead>
<tr>
<td>
<asp:TextBox ID="TxtCveTipoIncapacidad" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="84px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVCveTipoIncapacidad" runat="server" ControlToValidate="TxtCveTipoIncapacidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clave''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCCveTipoIncapacidad" runat="server" HighlightCssClass="vco" TargetControlID="RFVCveTipoIncapacidad" Width="94px"></ajax:ValidatorCalloutExtender>
</td>
<td>
<asp:TextBox ID="TxtTipoIncapacidad" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="234px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVTipoIncapacidad" runat="server" ControlToValidate="TxtTipoIncapacidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Incapacidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCTipoIncapacidad" runat="server" HighlightCssClass="vco" TargetControlID="RFVTipoIncapacidad" Width="244px"></ajax:ValidatorCalloutExtender>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td style="text-align: center">
<asp:LinkButton ID="LbAgregar" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveTipoIncapacidad" EmptyDataText="No se encontraron TipoIncapacidad Registrados" ToolTip="Listado de Tipo de Incapacidad" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px;" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlCveTipoIncapacidad" runat="server" Text='<%# Eval("CveTipoIncapacidad", "{0}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlTipoIncapacidad" runat="server" Text='<%# Eval("TipoIncapacidad", "{0}")%>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtTipoIncapacidad" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("TipoIncapacidad")%>' ValidationGroup="GrpGV" Width="234px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVTipoIncapacidad" runat="server" ControlToValidate="TxtTipoIncapacidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''TipoIncapacidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCTipoIncapacidad" runat="server" HighlightCssClass="vco" TargetControlID="RFVTipoIncapacidad" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus")%>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If(Eval("Estatus").ToString = "Activo", True, False)%>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<center>
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
&nbsp;<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
</center>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,172 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports System.Linq
Imports Extensiones
Partial Class CatSatTipoIncapacidad
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("Orden") = ""
CargaDatos()
End If
End Sub
Public Sub CargaDatos()
Dim ObjTipoIncapacidad As New ClsNominas
If ObjTipoIncapacidad.GetTipoIncapacidad() Then
ViewState("DTNomSatTipoIncapacidad") = ObjTipoIncapacidad.DtResultados
GlobalDTNomSatTipoIncapacidad = ObjTipoIncapacidad.DtResultados
Else
Me.GvDatos.DataSource = Nothing
End If
ObjTipoIncapacidad.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
Dim ObjTipoIncapacidad As New ClsNominas
If ObjTipoIncapacidad.AddTipoIncapacidad(TxtTipoIncapacidad.Text.Trim, UsuarioActual.CveUsuario, TxtCveTipoIncapacidad.Text.Trim.ToEntero) Then
TxtTipoIncapacidad.Text = ""
Alert("El nuevo Tipo de Incapacidad se guardó correctamente.", TipoMensaje.MsgInformacion)
UpTitulos.Update()
ViewState("DTNomSatTipoIncapacidad") = ObjTipoIncapacidad.DtResultados
GlobalDTNomSatTipoIncapacidad = ObjTipoIncapacidad.DtResultados
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End If
ObjTipoIncapacidad.Dispose()
End Sub
#Region "G V D A T O S"
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowIndex = 0 Then
e.Row.Cells(0).Width = Unit.Pixel(100)
e.Row.Cells(1).Width = Unit.Pixel(250)
e.Row.Cells(2).Width = Unit.Pixel(100)
e.Row.Cells(3).Width = Unit.Pixel(100)
e.Row.Cells(4).Width = Unit.Pixel(100)
e.Row.Cells(5).Width = Unit.Pixel(100)
e.Row.Cells(6).Width = Unit.Pixel(61)
End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Center
End If
End Sub
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
Dim ObjTipoIncapacidad As New ClsNominas
If ObjTipoIncapacidad.RemoveTipoIncapacidad(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatos.EditIndex = -1
ViewState("DTNomSatTipoIncapacidad") = ObjTipoIncapacidad.DtResultados
GlobalDTNomSatTipoIncapacidad = ObjTipoIncapacidad.DtResultados
Alert("El Tipo de Incapacidad se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
ObjTipoIncapacidad.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
GvDatos.EditIndex = -1
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
Dim ObjTipoIncapacidad As New ClsNominas
Dim TipoIncapacidad As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtTipoIncapacidad"), TextBox).Text.Trim
Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
Dim CveTipoIncapacidad As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
If ObjTipoIncapacidad.UpdateTipoIncapacidad(CveTipoIncapacidad, TipoIncapacidad, Estatus) Then
GvDatos.EditIndex = -1
ViewState("DTNomSatTipoIncapacidad") = ObjTipoIncapacidad.DtResultados
GlobalDTNomSatTipoIncapacidad = ObjTipoIncapacidad.DtResultados
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
End If
ObjTipoIncapacidad.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing
GvDatos.EditIndex = e.NewEditIndex
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
#End Region
#Region "O R D E N A M I E N T O"
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim Orden As String = ""
Dim Campo As String = ""
Dim Literal As Literal = Nothing
Const OrdenInicial As String = ""
Dim Arg(2) As String
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
Campo = Arg(0)
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
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)) = String.Format("{0} DESC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
End If
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
ViewState("Orden") = Orden
CargaGrid(Orden)
End Sub
Private Sub CargaGrid(Orden As String)
If Orden <> String.Empty Then
Dim DV As New DataView(CType(ViewState("DTNomSatTipoIncapacidad"), DataTable), "", Orden, DataViewRowState.CurrentRows)
GvDatos.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatos.DataSource = CType(ViewState("DTNomSatTipoIncapacidad"), DataTable)
End If
GvDatos.DataBind()
UpDatos.Update()
End Sub
#End Region
End Class

View File

@@ -0,0 +1,140 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatTiposPeriodos.aspx.vb" Inherits="Nomina_CatTiposPeriodos" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Catálogo de Tipo de Periodo
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table class="table table-striped table-advance table-hover">
<thead>
<tr class="Titulos">
<th width="250px">
<asp:LinkButton ID="LbTipoPeriodo" runat="server" CausesValidation="false" Text="" CommandArgument="TipoPeriodo" OnClick="LbOrden_Click">
Tipo de Periodo
<asp:Literal ID="ImgTipoPeriodo" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="250px">
<asp:LinkButton ID="LbDiasPeriodo" runat="server" CausesValidation="false" Text="" CommandArgument="DiasPeriodo" OnClick="LbOrden_Click">
Días de Periodo
<asp:Literal ID="ImgDiasPeriodo" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbEstatus" runat="server" CausesValidation="false" Text="" CommandArgument="Estatus" OnClick="LbOrden_Click">
Estado
<asp:Literal ID="ImgEstatus" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbFechaIng" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng" OnClick="LbOrden_Click">
Fecha
<asp:Literal ID="ImgFechaIng" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbUsuario" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario" OnClick="LbOrden_Click">
Usuario
<asp:Literal ID="ImgUsuario" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="161px">Comandos</th>
</tr>
</thead>
<tr>
<td>
<asp:TextBox ID="TxtTipoPeriodo" runat="server" CausesValidation="true" MaxLength="250" ValidationGroup="GrpGuardar" Width="234px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVTipoPeriodo" runat="server" ControlToValidate="TxtTipoPeriodo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Período''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCTipoPeriodo" runat="server" HighlightCssClass="vco" TargetControlID="RFVTipoPeriodo" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>
<asp:TextBox ID="TxtDiasPeriodo" runat="server" CausesValidation="true" MaxLength="250" ValidationGroup="GrpGuardar" Width="234px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVDiasPeriodo" runat="server" ControlToValidate="TxtDiasPeriodo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Período''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCDiasPeriodo" runat="server" HighlightCssClass="vco" TargetControlID="RFVDiasPeriodo" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>&nbsp;</td>
<td>&nbsp</td>
<td>&nbsp;</td>
<td style="text-align: center">
<asp:LinkButton ID="LbAgregar" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveTipoPeriodo" EmptyDataText="No se encontraron Tipo de Período Registrados" ToolTip="Listado de Tipo de Período" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px;" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlTipoPeriodo" runat="server" Text='<%# Eval("TipoPeriodo", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtTipoPeriodo" runat="server" CausesValidation="true" MaxLength="250" Text='<%# Eval("TipoPeriodo") %>' ValidationGroup="GrpGV" Width="234px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVTipoPeriodo" runat="server" ControlToValidate="TxtTipoPeriodo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Período''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCTipoPeriodo" runat="server" HighlightCssClass="vco" TargetControlID="RFVTipoPeriodo" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlDiasPeriodo" runat="server" Text='<%# Eval("DiasPeriodo", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtDiasPeriodo" runat="server" CausesValidation="true" MaxLength="250" Text='<%# Eval("DiasPeriodo") %>' ValidationGroup="GrpGV" Width="234px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVDiasPeriodo" runat="server" ControlToValidate="TxtDiasPeriodo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Días de Período''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCDiasPeriodo" runat="server" HighlightCssClass="vco" TargetControlID="RFVDiasPeriodo" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEstado" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkEstado" runat="server" Checked='<%# If (Eval("Estatus").ToString = "Activo", True, False) %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<center>
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
&nbsp;<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
</center>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,194 @@
Imports System.Data
Imports System.Linq
Imports Extensiones
Partial Class Nomina_CatTiposPeriodos
Inherits ClsPaginas
Public Property PuedeEditar As Boolean
Get
Return CBool(ViewState("PuedeEditar"))
End Get
Set(value As Boolean)
ViewState("PuedeEditar") = value
End Set
End Property
Public Property PuedeEliminar As Boolean
Get
Return CBool(ViewState("PuedeEditar"))
End Get
Set(value As Boolean)
ViewState("PuedeEditar") = value
End Set
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("Orden") = ""
CargaDatos()
''Permiso Registro
'If PermisoRegistro Then
' LbAgregar.Enabled = True
'Else
' LbAgregar.Enabled = False
'End If
End If
End Sub
Public Sub CargaDatos()
Dim ObjTipoPeriodo As New ClsNominas
If ObjTipoPeriodo.GetTiposPeriodos() Then
ViewState("DTTipoPeriodo") = ObjTipoPeriodo.DtResultados
GlobalDTTipoPeriodo = ObjTipoPeriodo.DtResultados
Else
Me.GvDatos.DataSource = Nothing
End If
ObjTipoPeriodo.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
Dim ObjTipoPeriodo As New ClsNominas
If ObjTipoPeriodo.AddTipoPeriodo(TxtTipoPeriodo.Text.Trim, TxtDiasPeriodo.Text.Trim.ToEntero, UsuarioActual.CveUsuario) Then
TxtTipoPeriodo.Text = ""
Alert("El nuevo Tipo de Período se guardó correctamente.", TipoMensaje.MsgInformacion)
UpTitulos.Update()
ViewState("DTTipoPeriodo") = ObjTipoPeriodo.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTTipoPeriodo = ObjTipoPeriodo.DtResultados
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End If
ObjTipoPeriodo.Dispose()
End Sub
#Region "G V D A T O S"
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.Cells(0).Width = Unit.Pixel(250)
e.Row.Cells(1).Width = Unit.Pixel(250)
e.Row.Cells(2).Width = Unit.Pixel(100)
e.Row.Cells(3).Width = Unit.Pixel(100)
e.Row.Cells(4).Width = Unit.Pixel(100)
e.Row.Cells(5).Width = Unit.Pixel(100)
e.Row.Cells(6).Width = Unit.Pixel(61)
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Center
End If
End Sub
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
Dim ObjTipoPeriodo As New ClsNominas
If ObjTipoPeriodo.RemoveTipoPeriodo(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatos.EditIndex = -1
ViewState("DTTipoPeriodo") = ObjTipoPeriodo.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTTipoPeriodo = ObjTipoPeriodo.DtResultados
Alert("El TipoPeriodo se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
ObjTipoPeriodo.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
GvDatos.EditIndex = -1
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
Dim ObjTipoPeriodo As New ClsNominas
Dim TipoPeriodo As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtTipoPeriodo"), TextBox).Text.Trim
Dim DiasPeriodo As Integer = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtDiasPeriodo"), TextBox).Text.Trim.ToEntero
Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstado").Checked
Dim CveTipoPeriodo = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
If ObjTipoPeriodo.UpdateTipoPeriodo(TipoPeriodo, DiasPeriodo, Estatus, CveTipoPeriodo) Then
GvDatos.EditIndex = -1
ViewState("DTTipoPeriodo") = ObjTipoPeriodo.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTTipoPeriodo = ObjTipoPeriodo.DtResultados
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
End If
ObjTipoPeriodo.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing
GvDatos.EditIndex = e.NewEditIndex
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
#End Region
#Region "O R D E N A M I E N T O"
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim Orden As String = ""
Dim Campo As String = ""
Dim Literal As Literal = Nothing
Const OrdenInicial As String = ""
Dim Arg(2) As String
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
Campo = Arg(0)
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
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)) = String.Format("{0} DESC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
End If
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
ViewState("Orden") = Orden
CargaGrid(Orden)
End Sub
Private Sub CargaGrid(Orden As String)
If Orden <> String.Empty Then
Dim DV As New DataView(CType(ViewState("DTTipoPeriodo"), DataTable), "", Orden, DataViewRowState.CurrentRows)
GvDatos.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatos.DataSource = CType(ViewState("DTTipoPeriodo"), DataTable)
End If
GvDatos.DataBind()
UpDatos.Update()
End Sub
#End Region
End Class

179
Nomina/ConceptoNomina.aspx Normal file
View File

@@ -0,0 +1,179 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="ConceptoNomina.aspx.cs" Inherits="Nomina_CatConcepto" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
<asp:Literal ID="LtlTitulo" runat="server" Text="Conceptos de Nómina"></asp:Literal>&nbsp;<asp:Literal ID="LtlContrato" runat="server"></asp:Literal>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
<asp:UpdatePanel UpdateMode="Conditional" ID="UpGral" runat="server">
<ContentTemplate>
<div runat="server" id="DivContent" visible="True" style="min-height: 500px">
<ajax:TabContainer ID="Tab" runat="server" Width="100%" CssClass="tabBodyOverride" ActiveTabIndex="0">
<ajax:TabPanel ID="TabInformacionGeneral" runat="server" HeaderText="Información General">
<ContentTemplate>
<div class="row">
<div class="col-md-7">
<div class="portlet smmallpadding light bordered">
<div class="portlet-title">
<div class="caption uppercase" style="position: relative;"><i class="fa fa-info-circle"></i>Datos del Concepto</div>
</div>
<div class="portlet-body rowpadding" >
<div class="row">
<label class="col-md-2 truncate" style="width: 130px;">Código:</label>
<div class="col-md-6">
<asp:TextBox ID="TxtCodigo" runat="server" Width="100%"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVCodigo" runat="server" ControlToValidate="TxtCodigo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Código''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCECodigo" runat="server" HighlightCssClass="vco" TargetControlID="RFVCodigo" Width="300px" BehaviorID="VCECodigo"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row">
<label class="col-md-2 truncate" style="width: 130px;">Concepto:</label>
<div class="col-md-6">
<asp:TextBox ID="TxtConcepto" runat="server" MaxLength="70" Width="100%"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVConcepto" runat="server" ControlToValidate="TxtConcepto" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Concepto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEConcepto" runat="server" HighlightCssClass="vco" TargetControlID="RFVConcepto" Width="300px" BehaviorID="VCEConcepto"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row">
<label class="col-md-2 truncate" style="width: 130px;">Tipo:</label>
<div class="col-md-6">
<asp:DropDownList ID="DdlTipo" runat="server" AppendDataBoundItems="True" DataTextField="TipoGasto" DataValueField="TipoGasto" Class="form-control input-sm select2me" Width="200px" ValidationGroup="GrpGuardar"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVTipo" runat="server" ControlToValidate="DdlTipo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo''</b> es necesario, por favor ingréselo." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCETipo" runat="server" HighlightCssClass="vco" TargetControlID="RFVTipo" Width="300px" BehaviorID="VCETipo"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row">
<label class="col-md-2 truncate" style="width: 130px;">Fórmula:</label>
<div class="col-md-6">
<asp:TextBox ID="TxtFormula" runat="server" MaxLength="70" Width="100%"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVFormula" runat="server" ControlToValidate="TxtFormula" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fórmula''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEFormula" runat="server" HighlightCssClass="vco" TargetControlID="RFVFormula" Width="300px" BehaviorID="VCEFormula"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row">
<label class="col-md-2 truncate " style="width: 130px;">Retención:</label>
<div class="col-md-6">
<asp:CheckBox ID="ChkRetencion" runat="server" />
</div>
</div>
<div class="row">
<label class="col-md-2 truncate " style="width: 130px;">Tipo de cálculo:</label>
<div class="col-md-6">
<asp:CheckBox ID="ChkTipoCalculo" runat="server" checked ="true"/>
</div>
</div>
<div class="row">
<label class="col-md-2 truncate" style="width: 130px;">Concepto padre:</label>
<div class="col-md-6">
<asp:DropDownList ID="DdlConceptoPadre" runat="server" AppendDataBoundItems="True" DataTextField="CodigoConcepto" DataValueField="CveConcepto" Class="form-control input-sm select2me" Width="200px" ValidationGroup="GrpGuardar"></asp:DropDownList>
</div>
</div>
<div class="row">
<label class="col-md-2 truncate" style="width: 130px;">Concepto contable:</label>
<div class="col-md-6">
<asp:DropDownList ID="DdlConceptoContable" runat="server" AppendDataBoundItems="True" DataTextField="ConceptoContable" DataValueField="CveConceptoContable" Class="form-control input-sm select2me" Width="200px" ValidationGroup="GrpGuardar"></asp:DropDownList>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-5">
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpProyecto">
<ContentTemplate>
<div class="portlet smmallpadding light bordered">
<div class="portlet-title">
<div class="caption uppercase" style="position: relative;"><i class="fa fa-info-circle"></i>ESTATUS</div>
</div>
<div class="portlet-body rowpadding">
<div class="row">
<label class="col-md-4 truncate">Estado:</label>
<div class="col-md-8">
<asp:CheckBox ID="ChkEstado" runat="server"/>
</div>
</div>
<div class="row">
<label class="col-md-4 truncate">Sistema:</label>
<div class="col-md-8">
<asp:CheckBox ID="ChkSistema" runat="server"/>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div class="row">
<div class="col-md-7">
<div class="portlet smmallpadding light bordered">
<div class="portlet-title">
<div class="caption uppercase" style="position: relative;"><i class="fa fa-info-circle"></i>INFORMACIÓN</div>
</div>
<div class="row">
<label class="col-md-2 truncate" style="width: 130px;">Clasificación:</label>
<div class="col-md-6">
<asp:DropDownList ID="DdlClasificacion" runat="server" AppendDataBoundItems="True" DataTextField="Clasificacion" DataValueField="CveClasificacion" Class="form-control input-sm select2me" Width="200px" ValidationGroup="GrpGuardar"></asp:DropDownList>
</div>
</div>
<div id="Div3" runat="server" class="row">
<label class="col-md-2 truncate" style="width: 130px;">Tipo de gasto:</label>
<div class="col-md-6">
<asp:DropDownList ID="DdlTipoGasto" runat="server" AppendDataBoundItems="True" DataTextField="TipoGasto" DataValueField="CveTipoGasto" Class="form-control input-sm select2me" Width="200px" ValidationGroup="GrpGuardar"></asp:DropDownList>
</div>
</div>
<div id="Div4" runat="server" class="row">
<label class="col-md-2 truncate" style="width: 130px;">Cuenta contable:</label>
<div class="col-md-6">
<asp:DropDownList ID="DdlCtaContable" runat="server" AppendDataBoundItems="True" DataTextField="CtaCodigo" DataValueField="Id" Class="form-control input-sm select2me" Width="200px" ValidationGroup="GrpGuardar"></asp:DropDownList>
</div>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
</div>
<div style="text-align: center; padding-top: 20px;">
<asp:UpdatePanel ID="UpGuardar" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Button ID="BtnGuardar" runat="server" Text="Guardar" ValidationGroup="GrpGuardar" CssClass="btn btn-primary" Visible="true" OnClick="BtnGuardar_Click" />
<asp:Button ID="BtnEliminar" runat="server" Text="Eliminar" Visible="false" CssClass="btn btn-danger" data-toggle="confirmation" data-popout="true" data-original-title="Esta seguro de eliminar el Contrato?" data-btn-ok-label="si" OnClick="BtnEliminar_Click" />
<%--<asp:ValidationSummary ID="VS" runat="server" DisplayMode="BulletList" ShowSummary="true" ValidationGroup="GrpGuardar" />--%>
<asp:Button ID="BtnCancelar" CssClass="btn btn-default" runat="server" Text="Cancelar" OnClientClick="javascript:window.location.href='/Nomina/CatConceptos.aspx';return false" />
&nbsp;
</ContentTemplate>
</asp:UpdatePanel>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
</asp:Content>

View File

@@ -0,0 +1,310 @@
using Extensiones;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Nomina_CatConcepto : ClsPaginas
{
#region "Propiedades"
private DataTable DTCuentas
{
get
{
return (DataTable)ViewState["DTCuentas"];
}
set
{
ViewState["DTCuentas"] = value;
}
}
private Boolean EsEditar
{
get
{
return (Boolean)ViewState["EsEditar"];
}
set
{
ViewState["EsEditar"] = value;
}
}
private int CveConcepto
{
get
{
return ViewState["CveConcepto"].ToEntero();
}
set
{
ViewState["CveConcepto"] = value;
}
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
InicializaDatos();
}
}
protected void InicializaDatos()
{
if (Request["CveConcepto"] != null && !Request["CveConcepto"].ToString().Equals("") && Request["CveConcepto"].ToEntero() > 0)
{
ViewState["CveConcepto"] = Request["CveConcepto"];
EsEditar = true;
BtnGuardar.Text = "Guardar cambios";
BtnEliminar.Visible = true;
ChkTipoCalculo.Checked = false;
}
else
{
ViewState["CveConcepto"] = -1;
EsEditar = false;
}
CargaTipo();
CargaConceptoPadre();
CargaConceptoContable();
CargaClasificacion();
CargaTipoGasto();
CargaCtaContable();
CargaDatos();
}
protected void CargaTipo()
{
DdlTipo.Items.Insert(0, new ListItem("Seleccione", "-1"));
DdlTipo.Items.Insert(1, new ListItem("Percepciones", "P"));
DdlTipo.Items.Insert(2, new ListItem("Deducciones", "D"));
DdlTipo.Items.Insert(3, new ListItem("Obligaciones", "O"));
DdlTipo.SelectedValueExist("-1");
}
protected void CargaConceptoPadre()
{
DdlConceptoPadre.DataSource = get_GlobalDTNomConceptos(UsuarioActual.CveEmpresa);
DdlConceptoPadre.DataBind();
DdlConceptoPadre.Items.Insert(0, new ListItem("Seleccione", "-1"));
DdlConceptoPadre.SelectedValueExist("-1");
}
protected void CargaConceptoContable()
{
DdlConceptoContable.DataSource = get_GlobalDTContaConceptosContables(-1);
DdlConceptoContable.DataBind();
DdlConceptoContable.Items.Insert(0, new ListItem("Seleccione", "-1"));
DdlConceptoContable.SelectedValueExist("-1");
}
protected void CargaClasificacion()
{
DdlClasificacion.DataSource = get_GlobalDTClasificaciones(UsuarioActual.CveEmpresa);
DdlClasificacion.DataBind();
DdlClasificacion.Items.Insert(0, new ListItem("Seleccione", "-1"));
DdlClasificacion.SelectedValueExist("-1");
}
protected void CargaTipoGasto()
{
DdlTipoGasto.DataSource = get_GlobalDTTiposGastos(UsuarioActual.CveEmpresa);
DdlTipoGasto.DataBind();
DdlTipoGasto.Items.Insert(0, new ListItem("Seleccione", "-1"));
DdlTipoGasto.SelectedValueExist("-1");
}
protected void CargaCtaContable()
{
if(UsuarioActual.Empresa.UsaContabilidad)
{
ClsContPAQi ObjConta = new ClsContPAQi(UsuarioActual.Empresa);
if (ObjConta.GetCuentas(-1, "-1", 1))
{
DdlCtaContable.DataSource = ObjConta.DtResultados;
DdlCtaContable.DataBind();
}
DdlCtaContable.Items.Insert(0, new ListItem("Seleccione", "-1"));
DdlCtaContable.SelectedValueExist("-1");
}
}
protected void BtnGuardar_Click(object sender, EventArgs e)
{
String codigo = TxtCodigo.Text;
String concepto = TxtConcepto.Text;
String tipo = DdlTipo.SelectedValue;
String formula = TxtFormula.Text;
if (!ValidaFormula(formula).Equals(""))
{
Alert("Fórmula no válida. Favor de ingresar una correcta.", ModExtensiones.TipoMensaje.MsgError);
}
else
{
bool retencion;
if (ChkRetencion.Checked) retencion = true;
else retencion = false;
bool tipoCalculo;
if (ChkTipoCalculo.Checked) tipoCalculo = true;
else tipoCalculo = false;
int CveConceptoPadre = DdlConceptoPadre.SelectedValue.ToEntero();
int CveConceptoContable = DdlConceptoContable.SelectedValue.ToEntero();
bool estado;
if (ChkEstado.Checked) estado = true;
else estado = false;
bool sistema;
if (ChkSistema.Checked) sistema = true;
else sistema = false;
int CveClasificacion = DdlClasificacion.SelectedValue.ToEntero();
int CveTipoGasto = DdlTipoGasto.SelectedValue.ToEntero();
int IdCtaContable = DdlCtaContable.SelectedValue.ToEntero();
ClsNominas ObjNomina = new ClsNominas();
ObjNomina.IniciaTransacSQL();
bool TieneError = false;
if (EsEditar)
{
TieneError = !ObjNomina.UpdateConcepto(codigo, concepto, tipo, formula, sistema, estado, CveConceptoPadre, CveConcepto, retencion, CveClasificacion, IdCtaContable, CveTipoGasto, tipoCalculo, CveConceptoContable);
if (TieneError)
{
ObjNomina.RollBack();
}
else
{
ObjNomina.Commit();
Alert("El concepto de nómina fue actualizado correctamente.", ModExtensiones.TipoMensaje.MsgInformacion, $"document.location.href=\"/Nomina/ConceptoNomina.aspx?CveConcepto={CveConcepto}\"");
}
}
else
{
CveConcepto = ObjNomina.AddConcepto(codigo, concepto, tipo, formula, sistema, estado, CveConceptoPadre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, retencion, CveClasificacion, IdCtaContable, CveTipoGasto, tipoCalculo, CveConceptoContable);
if (CveConcepto == -1)
{
ObjNomina.RollBack();
}
else
{
ObjNomina.Commit();
Alert("El concepto de nómina fue creado correctamente.", ModExtensiones.TipoMensaje.MsgInformacion, $"document.location.href=\"/Nomina/ConceptoNomina.aspx?CveConcepto={CveConcepto}\"");
}
}
ObjNomina.Dispose();
CargaDatos();
}
}
private string ValidaFormula(string Formula)
{
string retorno = "Error en Fórmula";
try
{
FormulaEvaluator.Expression exp;
foreach (DataRow dr in GlobalDTNomConceptosFunciones.Rows)
{
exp = new FormulaEvaluator.Expression(String.Format("{0}:=1", dr["Funcion"]));
exp.Eval();
}
exp = new FormulaEvaluator.Expression(Formula);
if (exp.Errors.Count > 0)
{
retorno = exp.Errors[0].Message;
}
Object val = exp.Eval();
if (exp.Errors.Count == 0)
{
retorno = "";
}
else
{
retorno = exp.Errors[0].Message;
}
}
catch (Exception e) {
Alert(e.Message,ModExtensiones.TipoMensaje.MsgError);
}
return retorno;
}
protected void CargaDatos()
{
if(CveConcepto > 0)
{
ClsNominas ObjNomina = new ClsNominas();
if (ObjNomina.GetConceptos(UsuarioActual.CveEmpresa, CveConcepto: CveConcepto) && ObjNomina.DtResultados.Rows.Count > 0)
{
TxtCodigo.Text = ObjNomina.DtResultados.FiltroPrimeroValor("Codigo");
TxtConcepto.Text = ObjNomina.DtResultados.FiltroPrimeroValor("Concepto");
DdlTipo.SelectedValueExist(ObjNomina.DtResultados.FiltroPrimeroValor("Tipo"));
TxtFormula.Text = ObjNomina.DtResultados.FiltroPrimeroValor("Formula");
if (ObjNomina.DtResultados.FiltroPrimeroValor("EsRetencion").Equals("1")) ChkRetencion.Checked = true;
if (ObjNomina.DtResultados.FiltroPrimeroValor("TipoCalculo").Equals("True")) ChkTipoCalculo.Checked = true;
DdlConceptoPadre.SelectedValueExist(ObjNomina.DtResultados.FiltroPrimeroValor("CveConceptoPadre"));
DdlConceptoContable.SelectedValueExist(ObjNomina.DtResultados.FiltroPrimeroValor("CveConceptoContable"));
if (ObjNomina.DtResultados.FiltroPrimeroValor("Estado").Equals("Activo")) ChkEstado.Checked = true;
if (ObjNomina.DtResultados.FiltroPrimeroValor("Sistema").Equals("Sí")) ChkSistema.Checked = true;
DdlClasificacion.SelectedValueExist(ObjNomina.DtResultados.FiltroPrimeroValor("CveClasificacion"));
DdlTipoGasto.SelectedValueExist(ObjNomina.DtResultados.FiltroPrimeroValor("CveTipoGasto"));
DdlCtaContable.SelectedValueExist(ObjNomina.DtResultados.FiltroPrimeroValor("IdCtaContable"));
}
ObjNomina.Dispose();
} else
{
TxtCodigo.Text = "";
TxtConcepto.Text = "";
DdlTipo.SelectedValueExist("-1");
TxtFormula.Text = "";
ChkRetencion.Checked = false;
DdlConceptoPadre.SelectedValueExist("-1");
DdlConceptoContable.SelectedValueExist("-1");
ChkEstado.Checked = false;
ChkSistema.Checked = false;
DdlClasificacion.SelectedValueExist("-1");
DdlTipoGasto.SelectedValueExist("-1");
DdlCtaContable.SelectedValueExist("-1");
}
}
protected void BtnEliminar_Click(object sender, EventArgs e)
{
ClsNominas ObjNomina = new ClsNominas();
if (ObjNomina.RemoveConcepto(CveConcepto, UsuarioActual.CveEmpresa))
{
Response.Redirect("./CatConceptos.aspx");
}
else
{
Alert("Ocurrio un error al eliminar el concepto de nómina", ModExtensiones.TipoMensaje.MsgError);
}
}
}

View File

@@ -0,0 +1,101 @@
<%@ Page Title="Nómina - Pre Nómina" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="ConceptosEspeciales.aspx.vb" Inherits="Nomina_ConceptosEspeciales" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
<asp:ImageButton ID="ImgExcel" runat="server" ImageUrl="/Imagenes/IconoExcel.gif" Width="17px" Height="17px" />
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Pre Nómina
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" style="">
<div class="portlet-title portlet-filterT" style="">
<div class="titlefiltros caption ">
<ul class="list-inline">
<li>Proyecto:
<asp:DropDownList ID="DdlProyecto" 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: 220px !important;" ValidationGroup="GrpGuardar">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</li>
<li>SubProyecto:
<asp:DropDownList ID="DdlSubProyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 250px !important;" ValidationGroup="GrpGuardar">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</li>
<li>Turno:
<asp:DropDownList ID="DdlTurno" runat="server" AppendDataBoundItems="true" DataTextField="Turno" DataValueField="CveTurno" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;" ValidationGroup="GrpGuardar">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</li>
<li>Concepto:
<asp:DropDownList ID="DdlConceptos" runat="server" AppendDataBoundItems="true" DataTextField="Concepto" DataValueField="CveConcepto" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;" ValidationGroup="GrpGuardar">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</li>
</ul>
</div>
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" />
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="right">
<asp:Button ID="BtnGuardar" runat="server" Text="Guardar" class="btn btn-primary" />
</td>
<td>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Empleados con los filtros especificados" ToolTip="Conceptos Especiales" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>
<HeaderTemplate>Código</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCodigo" runat="server" Text='<%# Eval("Codigo") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="250px" />
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Nombre</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlNombre" runat="server" Text='<%# Eval("Nombre") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="250px" />
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Aplica</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="ChkAplica" runat="server" />
</ItemTemplate>
<ItemStyle Width="250px" />
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Importe</HeaderTemplate>
<ItemTemplate>
<asp:TextBox ID="TxtImporte" runat="server" Text='<%# Eval("Importe") %>'></asp:TextBox>
</ItemTemplate>
<ItemStyle Width="250px" />
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,119 @@
Option Strict On
Option Explicit On
Imports Extensiones
Imports System.Data
Partial Class Nomina_ConceptosEspeciales
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
CargaProyecto()
CargaTurnos()
End If
End Sub
#Region "CargaCombos"
Private Sub CargaConceptos()
DdlConceptos.DataSource = GlobalDTNomConceptos(UsuarioActual.CveEmpresa)
DdlConceptos.DataBind()
End Sub
Private Sub CargaProyecto()
DdlProyecto.DataSource = GlobalDTProyectos(UsuarioActual.CveEmpresa)
DdlProyecto.DataBind()
End Sub
Private Sub CargaSubProyecto()
DdlSubProyecto.Items.Clear()
DdlSubProyecto.DataSource = GlobalDTSubProyectos(DdlProyecto.SelectedValue.ToEntero)
DdlSubProyecto.DataBind()
DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1"))
End Sub
Private Sub CargaTurnos()
DdlTurno.DataSource = GlobalDTTurno.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
DdlTurno.DataBind()
End Sub
#End Region
Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlProyecto.SelectedIndexChanged
CargaSubProyecto()
End Sub
'Protected Sub DdlTipoPeriodo_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlTipoPeriodo.SelectedIndexChanged
' CargaPeriodos()
'End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click
'If DdlPeriodo.SelectedValue <> "-1" Then
' Dim ObjNomina As New ClsRH
' Dim FechaI, FechaF As Date
' FechaI = DTPeriodos.FiltraParametros("CvePeriodo = " & DdlPeriodo.SelectedValue).Rows(0)("FechaInicio").ToString.ToDate
' FechaF = DTPeriodos.FiltraParametros("CvePeriodo = " & DdlPeriodo.SelectedValue).Rows(0)("FechaFin").ToString.ToDate
' If ObjNomina.GetPreNomina(DdlSubProyecto.SelectedValue.ToEntero, DdlTurno.SelectedValue.ToEntero, FechaI, FechaF, UsuarioActual.CveEmpresa) Then
' GvDatos.DataSource = ObjNomina.DtResultados
' Else
' GvDatos.DataSource = Nothing
' End If
' ObjNomina.Dispose()
' GvDatos.DataBind()
' UPDatos.Update()
'Else
' Alert("Debe de seleccionar el Período con el que se desea trabajar", TipoMensaje.MsgAdvertencia)
'End If
End Sub
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("Turno") = "" AndAlso e.Row.DBCampo("Nombre") = "" Then
e.Row.FCLiteral("LtlNombre").Text = "Sub Proyecto: " & e.Row.DBCampo("SubProyecto")
'e.Row.Cells(0).ColumnSpan = 22
e.Row.HorizontalAlign = HorizontalAlign.Left
ElseIf e.Row.DBCampo("Turno") <> "" AndAlso e.Row.DBCampo("Nombre") = "" Then
e.Row.FCLiteral("LtlNombre").Text = "Turno: " & e.Row.DBCampo("Turno")
'e.Row.Cells(0).ColumnSpan = 22
e.Row.HorizontalAlign = HorizontalAlign.Left
End If
End If
End Sub
Protected Sub ImgExcel_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs) Handles ImgExcel.Click
GvDatos.ExportToExcel("ConceptosEspeciales")
End Sub
Protected Sub BtnGuardar_Click(sender As Object, e As System.EventArgs) Handles BtnGuardar.Click
Dim ObjPersonal As New ClsRH
ObjPersonal.IniciaTransacSQL()
Dim OcurrioError As Boolean = False
For Each Row As GridViewRow In GvDatos.Rows
If Row.DataKey("CvePersonal") <> "" Then
If Not ObjPersonal.UpdatePersonalMasivo(Row.FCDropDownList("DdlTurno").SelectedValue.ToEntero, Row.FCDropDownList("DdlGVSubProyecto").SelectedValue.ToEntero, Row.FCDropDownList("DdlSupervisor").SelectedValue.ToEntero,
Row.FCTextBox("TxtSalarioDiario").Text.ToDouble, Row.FCTextBox("TxtSDI").Text.ToDouble, Row.FCTextBox("TxtSalarioCotizado").Text.ToDouble,
Row.DataKey("CvePersonal").ToEntero, UsuarioActual.CveEmpresa) Then
OcurrioError = True
ObjPersonal.RollBack()
Exit For
End If
End If
Next
If Not OcurrioError Then
ObjPersonal.Commit()
Alert("La información se guardó correctamente.", TipoMensaje.MsgInformacion)
Else
Alert("Ocurrió un error al guardar la información.", TipoMensaje.MsgError)
End If
ObjPersonal.Dispose()
End Sub
End Class

687
Nomina/EventoDetalle.aspx Normal file
View File

@@ -0,0 +1,687 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="EventoDetalle.aspx.vb" Inherits="OI_EventoDetalle" %>
<%@ Register Assembly="TimePicker" Namespace="MKB.TimePicker" TagPrefix="cc1" %>
<%@ Register Assembly="eWorld.UI" Namespace="eWorld.UI" TagPrefix="ew" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
<asp:Label ID="LblTitulo" runat="server" Text=""></asp:Label>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:HiddenField ID="HdnTipo" runat="server" ClientIDMode="Static" />
<div class="row">
<div class="col-md-8">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<div class="portlet light smmallpadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Tarea</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body rowpadding">
<div class="row" runat="server" id="RowFolio" visible="false">
<label class="col-sm-2"># Folio/tarea:</label>
<div class="col-sm-5 row ">
<asp:Label runat="server" ID="lblFolio" Font-Bold="true"></asp:Label>
</div>
<div class="col-sm-5 row " style="text-align:left!important">
<asp:LinkButton ID="LnkLigaCve" CssClass="Texto" runat="server" ></asp:LinkButton>
</div>
</div>
<div class="row" id="TrAsunto" visible="false" runat="server">
<label class="col-sm-2">Asunto:</label>
<div class="col-sm-10">
<asp:TextBox ID="TxtAsunto" runat="server" CssClass="form-control input-sm" MaxLength="100" ValidationGroup="Guarda"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVAsunto" runat="server" ControlToValidate="TxtAsunto" Display="None" ErrorMessage="El campo <b>''Asunto''</b> es necesario, por favor ingréselo." ValidationGroup="Guarda"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOAsunto" runat="server" TargetControlID="RFVAsunto" HighlightCssClass="vco" Width="250px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row" id="TrAgendaTipo" visible="false" runat="server">
<label class="col-sm-2">Tipo Asunto:</label>
<div class="col-sm-10">
<asp:DropDownList ID="DdlAgendaTipo" runat="server" Class="form-control input-sm input-small" DataValueField="CveAgendaTipo" DataTextField="AgendaTipo">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
<div class="row" id="TrDescripcion" visible="false" runat="server">
<label class="col-sm-2">Descripción:</label>
<div class="col-sm-10">
<asp:TextBox ID="TxtDescripcion" runat="server" CssClass="form-control input-sm" MaxLength="500" TextMode="MultiLine" Height="50px"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvDescripcion" runat="server" ControlToValidate="txtDescripcion" Display="None" ErrorMessage="El campo <b>''Descripción''</b> es necesario, por favor ingréselo." ValidationGroup="Guarda"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoDescripcion" runat="server" TargetControlID="rfvDescripcion" HighlightCssClass="vco" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row" id="TrPrioridad" visible="false" runat="server">
<label class="col-sm-2">Prioridad:</label>
<div class="col-sm-10">
<asp:DropDownList ID="DdlPrioridad" runat="server" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 136px !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Text="Baja" Value="1" style="color: #00CC00;"></asp:ListItem>
<asp:ListItem Text="Media" Value="2" style="color: #000000;"></asp:ListItem>
<asp:ListItem Text="Alta" Value="3" style="color: #FF0000;"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVPrioridad" runat="server" ControlToValidate="DdlPrioridad" Display="None" ErrorMessage="El campo <b>''Prioridad''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="Guarda"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOPrio" runat="server" TargetControlID="RFVPrioridad" HighlightCssClass="vco" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row" id="TrRevision" visible="false" runat="server">
<label class="col-sm-2">Revisión:</label>
<div class="col-sm-10">
<asp:UpdatePanel runat="server" ID="UpRevision" UpdateMode="Conditional">
<ContentTemplate>
<asp:DropDownList ID="DdlRevision" runat="server" Class="table-group-action-input form-control input-inline input-small input-sm" DataValueField="CveRevision" DataTextField="Revision">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<%--<asp:Image ID="ImgAddRevision" ToolTip="Agregar Revision" OnClientClick="$get('DivRevision').style.display='';" ImageUrl="/Imagenes/Btn_Add.png" runat="server" />--%>
<img id="ImgAddRevision" runat="server" alt="Agregar Revision" style="cursor: pointer;" src="/Imagenes/Btn_Add.png" onclick="$get('DivRevision').style.display='';" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div class="row">
<label class="col-sm-2">Orden:</label>
<div class="col-sm-10">
<asp:UpdatePanel runat="server" ID="UpOrden" UpdateMode="Conditional">
<ContentTemplate>
<asp:TextBox ID="TxtOrden" CssClass="form-control input-sm input-small" runat="server" />
<ajax:FilteredTextBoxExtender ID="SoloNumeros" runat="server" TargetControlID="TxtOrden" FilterType="Custom, Numbers" ValidChars="." />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div class="row" id="TrFechaInicio" visible="false" runat="server">
<label class="col-sm-2 truncate">Fecha Inicio:</label>
<div class="col-sm-3">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaInicio" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaInicio" runat="server" TargetControlID="TxtFechaInicio" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="TxtFechaInicio" PopupButtonID="ImgCalendario" Format="dd/MM/yyyy" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaInicio" runat="server" ControlToValidate="TxtFechaInicio" Display="None" ErrorMessage="El campo <b>''Fecha Inicio''</b> es requerido por la aplicación, por favor ingrese una Fecha Inicio." ValidationGroup="Guarda"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVFechaInicio" runat="server" ControlToValidate="TxtFechaInicio" Display="None" ErrorMessage="El campo <b>''FechaInicio''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Guarda"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOFfvFI" runat="server" HighlightCssClass="VCO" TargetControlID="RFVFechaInicio" Width="250px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="VCOCVFI" runat="server" HighlightCssClass="VCO" TargetControlID="CVFechaInicio" Width="250px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<label class="col-sm-1">Hora:</label>
<div class="col-sm-3">
<cc1:TimeSelector ID="TxtHoraInicio" runat="server" DisplaySeconds="false" DisplayButtons="false">
</cc1:TimeSelector>
<asp:CustomValidator ID="CVHoraInicio" runat="server" ClientValidationFunction="RevisaHora" ControlToValidate="TxtHoraInicio" Display="None" ErrorMessage="El campo <b>''Hora''</b> es necesario, por favor seleccione la hora correcta." ValidationGroup="Guardar" ValidateEmptyText="true"></asp:CustomValidator>
<ajax:ValidatorCalloutExtender ID="VcoHoraInicio" runat="server" HighlightCssClass="vco" TargetControlID="CVHoraInicio" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row" id="TrFechaFin" visible="false" runat="server">
<label class="col-sm-2 truncate">Fecha Fin:</label>
<div class="col-sm-3">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaFin" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgCalFechaFin" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaFin" runat="server" TargetControlID="TxtFechaFin" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaFin" TargetControlID="TxtFechaFin" PopupButtonID="ImgCalFechaFin" Format="dd/MM/yyyy" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaFin" runat="server" ControlToValidate="TxtFechaFin" Display="None" ErrorMessage="El campo <b>''Fecha Fin''</b> es requerido por la aplicación, por favor ingrese una Fecha Fin." ValidationGroup="Guarda"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVFechaFin" runat="server" ControlToValidate="TxtFechaFin" Display="None" ErrorMessage="El campo <b>''Fecha Fin''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Guarda"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCEFechaFin1" runat="server" HighlightCssClass="VCO" TargetControlID="RFVFechaFin" Width="250px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="VCEFechaFin2" runat="server" HighlightCssClass="VCO" TargetControlID="CVFechaFin" Width="250px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<label class="col-sm-1">Hora:</label>
<div class="col-sm-3">
<cc1:TimeSelector ID="TxtHoraFin" runat="server" DisplaySeconds="false" DisplayButtons="false">
</cc1:TimeSelector>
<asp:CustomValidator ID="CVHoraFin" runat="server" ClientValidationFunction="RevisaHora" ControlToValidate="TxtHoraFin" Display="None" ErrorMessage="El campo <b>''Hora''</b> es necesario, por favor seleccione la hora correcta." ValidationGroup="Guardar" ValidateEmptyText="true"></asp:CustomValidator>
<ajax:ValidatorCalloutExtender ID="VcoHoraFin" runat="server" HighlightCssClass="vco" TargetControlID="CVHoraFin" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div></div>
<div id="TrFechaRealTermino" visible="false" runat="server" class="row">
<label class="col-sm-2 truncate">Fecha Real de Término: </label>
<div class="col-sm-10">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaRealTermino" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgCalFechaRealTermino" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaRealTermino" runat="server" TargetControlID="TxtFechaRealTermino" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaRealTermino" TargetControlID="TxtFechaRealTermino" PopupButtonID="ImgCalFechaRealTermino" Format="dd/MM/yyyy" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CVFechaRealTermino" runat="server" ControlToValidate="TxtFechaRealTermino" Display="None" ErrorMessage="El campo <b>''Fecha Real de Término''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Guarda"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCEFechaRealTermino2" runat="server" HighlightCssClass="VCO" TargetControlID="CVFechaRealTermino" Width="250px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
<div class="row" id="TrTipoReferencia" visible="false" runat="server">
<label class="col-sm-2 truncate">Tipo de Referencia: </label>
<div class="col-sm-10">
<asp:TextBox ID="TxtTipoReferencia" runat="server" MaxLength="5" ValidationGroup="Guarda" CssClass="form-control input-sm input-small"></asp:TextBox>
</div>
</div>
<div class="row" id="TrReferencia" visible="false" runat="server">
<label class="col-sm-2 truncate">Referencia: </label>
<div class="col-sm-10">
<asp:TextBox ID="TxtReferencia" runat="server" MaxLength="50" ValidationGroup="Guarda" CssClass="form-control input-sm"></asp:TextBox>
</div>
</div>
<div class="row" id="TrReferenciaLiga" visible="false" runat="server">
<div class="col-sm-10 col-sm-offset-2">
<asp:HyperLink ID="HplReferencia" runat="server"></asp:HyperLink></div>
</div>
<div class="row" id="TrArchivo" visible="false" runat="server">
<label class="col-sm-2 truncate">Archivo </label>
<div class="col-sm-10">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<asp:UpdatePanel ID="UPAFUL" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:TextBox ID="TxtArchivo" ClientIDMode="Static" runat="server" Width="200px"></asp:TextBox>
<%-- <asp:HyperLink ID="ImgAddObs" Visible="true" class="Texto" data-toggle="modal" data-target="#ModalUpload" runat="server" Text=" <span style='font-weight: 700 !important;'>Archivo</span>" Style="cursor: pointer;" ToolTip="Observaciones"></asp:HyperLink>--%>
<a class="Texto" runat="server" clientidmode="Static" id="A1" data-toggle="modal" data-target="#ModalUpload" visible="true" >
<img id="ImgArchivo" runat="server" alt="Archivo" src="/Imagenes/attachment_icon.gif" style="width: 16px; height: 16px; border: 0px none white" />
</a>
<a class="Texto" runat="server" clientidmode="Static" id="A2" target="_blank" visible="false">
<img id="Img1" alt="Archivo" src="/Imagenes/descargar.png" style="width: 16px; height: 16px; border: 0px none white" />
</a>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
<tr>
<td>
<ul id="myGallery" runat="server" clientidmode="Static">
</ul>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="col-md-4" id="TdUsuarios" runat="server" visible="false">
<div id="TrEstatus" runat="server" visible="true">
<asp:UpdatePanel ID="uppEstatus" runat="server" UpdateMode="Conditional" class="portlet light smmallpadding bordered">
<ContentTemplate>
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Estatus</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body rowpadding">
<div class="row">
<div class="col-sm-8" style="text-align: center; vertical-align: central;">
<asp:DropDownList ID="DdlEventoEstatus" Visible="true" runat="server" DataValueField="CveEventoEstatus" CssClass="form-control input-sm" Style="width: 100px !important;" DataTextField="EventoEstatus">
</asp:DropDownList>
<asp:LinkButton ID="lbCambiaEstatus" runat="server" Text="Cambia Estatus"></asp:LinkButton>
<asp:Label ID="LblEstatusEvento" Visible="false" Font-Bold="true" runat="server" Text=""></asp:Label>
</div>
<div class="col-sm-4">
<asp:ImageButton OnClick="LinkReenviar_Click" ImageUrl="/Imagenes/ReEnviar.PNG" Style="margin-left: 20px;" runat="server" ToolTip="Reenviar Tarea" Visible="false" ID="LinkReenviar" Width="30" />
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel runat="server" class="portlet box grey-cascade">
<ContentTemplate>
<div class="portlet-title">
<div class="caption">
<i class="fa fa-user-plus"></i>Usuario(s)
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body" style="padding: 0px;">
<div id="divSeleccionUsuarios" runat="server">
<div class="text-right">
<asp:TextBox runat="server" ID="filtroGVtext" onkeyup="FiltrarGV();" ClientIDMode="Static" Style="height: 25px; margin-top: 5px; margin-bottom: 5px;"></asp:TextBox>
<a href="javascript:;" onclick="FiltrarGV();return false;" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
<%--<asp:Button ID="btnfiltro" Text="Buscar" runat="server" CssClass="btn btn-sm green" Style="margin-bottom: 2px; height:22px;" OnClientClick="FiltrarGV();return false;"></asp:Button>--%>
&nbsp; &nbsp; &nbsp;
</div>
<table class="table table-striped table-hover Widthall ">
<thead>
<tr>
<th align="center" class="Titulos" width="50px">Para</th>
<th align="center" class="Titulos" width="50px">
<div class="Widthall truncate">C. C. Para</div>
</th>
<th class="Titulos">Usuario</th>
</tr>
</thead>
</table>
<div id="DivUsr" runat="server" style="height: 200px; overflow-y: scroll;">
<asp:GridView ID="GVUsuarios" runat="server" AutoGenerateColumns="false" ShowHeader="false" Width="100%" DataKeyNames="CveUsuario,Nombre,Correo,Empresa" CssClass="table table-striped table-advance table-hover Widthall" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemStyle HorizontalAlign="Center" Width="50px" />
<ItemTemplate>
<asp:CheckBox ID="ChkPara" runat="server" Width="50px" />
<ajax:MutuallyExclusiveCheckBoxExtender ID="MECBE" runat="server" TargetControlID="ChkPara" Key="Para"></ajax:MutuallyExclusiveCheckBoxExtender>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemStyle HorizontalAlign="Center" Width="50px" />
<ItemTemplate>
<asp:CheckBox ID="ChkCCP" Checked="false" runat="server" Width="50px" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlNombre" runat="server" Text='<%# Eval("Nombre") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlRol" runat="server" Text='<%# Eval("Rol") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<div id="divUsuarios" runat="server" visible="false" class="portlet box grey-cascade">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-user-plus"></i>Usuarios
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
<div class="actions">
<asp:UpdatePanel runat="server" class="btn-group">
<ContentTemplate>
<asp:Button ID="BtnEditarUsuarios" CssClass="btn btn-default" Text="Editar" runat="server" OnClick="BtnEditarUsuarios_Click" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div class="portlet-body" style="padding: 0px;">
<table border="0" style="width: 100%; border-collapse: collapse;">
<tr>
<td style="font-weight: bold; height: 20px; background-color: gray; color: white; width: 60px">De:</td>
<td style="background-color: silver; color: white;">
<asp:Label runat="server" Font-Bold="true" ID="lblUsuarioDe"></asp:Label></td>
</tr>
<tr>
<td style="font-weight: bold; height: 20px; background-color: gray; color: white; width: 60px">Para:</td>
<td style="background-color: silver; color: white;">
<asp:Label runat="server" Font-Bold="true" ID="lblUsuarioPara"></asp:Label></td>
</tr>
<tr>
<td style="border-top: 10px; vertical-align: top; font-weight: bold; height: 20px; background-color: gray; color: white; width: 60px">CCP:</td>
<td>
<asp:GridView ID="gvUsuariosVista" runat="server" ShowHeader="false" AutoGenerateColumns="false" Width="100%" DataKeyNames="CveUsuario,Nombre,Correo" CssClass="table table-striped table-advance table-hover" Style="text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemStyle Height="20px" HorizontalAlign="Left" />
<HeaderStyle HorizontalAlign="Left" BackColor="Silver" />
<ItemTemplate>
<asp:Literal ID="LtlNombre" runat="server" Text='<%# Eval("Nombre") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</td>
</tr>
</table>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<asp:UpdatePanel ID="upGuardar" style="text-align: center;" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Button ID="btnGuardar" runat="server" Text="Guardar" ValidationGroup="Guarda" class="btn btn-primary" />
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel runat="server" ID="UPPObs" UpdateMode="Conditional">
<ContentTemplate>
<asp:Panel ID="PnlEncObs" runat="server" Visible="false">
<div id="divObs" tabindex="-1" role="dialog" style="width: 980px; background-color: White; border: solid 1px black; color: Black; display: inline;">
<table border="1" style="border-collapse: collapse;" width="980px" cellpadding="0" cellspacing="0">
<tr>
<td>
<table border="1" style="border-collapse: collapse;" width="980px" cellpadding="0" cellspacing="0">
<tr class="Titulos">
<td style="width: 92px">Fecha:</td>
<td style="width: 202px">Usuario:</td>
<td>Observaciones:</td>
<td style="width: 32px">Arch.</td>
</tr>
<tr>
<td align="center">
<asp:Label ID="lblFechaObs" runat="server"></asp:Label>
</td>
<td align="center">
<asp:Label ID="lblUsuarioObs" runat="server"></asp:Label>
</td>
<td>&nbsp;<asp:TextBox ID="TxtOBs" ClientIDMode="Static" runat="server" TextMode="MultiLine" Rows="2" Width="638px" MaxLength="1000"></asp:TextBox>
<%-- <asp:RequiredFieldValidator ID="RFVObs" runat="server" Display="None" ControlToValidate="TxtOBs" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Observaciones''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardaBit"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEOBs" runat="server" HighlightCssClass="vco" TargetControlID="RFVObs" Width="300px" />--%>
</td>
<td align="center">
<asp:UpdatePanel ID="UpImgBit" runat="server" UpdateMode="Conditional" ><ContentTemplate>
<a class="Texto" runat="server" clientidmode="Static" id="SubirArchivo" data-toggle="modal" data-target="#ModalUploadBit" >
<img id="ImgArchivoObs" runat="server" alt="Archivo" src="/Imagenes/attachment_icon.gif" style="width: 16px; height: 16px; border: 0px none white" /></a>
</ContentTemplate></asp:UpdatePanel>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td id="trBtnAddObs" style="display: none; text-align: center; width: 980px;">
<table width="100%">
<tr>
<td align="right" style="width: 40%">
<asp:CheckBox ID="ChkRegresaraEstatusAnterior" ClientIDMode="Static" runat="server" Text="Regresar a Pendiente" /></td>
<td align="left" style="width: 40%">
<asp:CheckBox ID="ChkPasarEstatusSiguiente" ClientIDMode="Static" runat="server" Text="Pasar a Revisado" /></td>
<td align="left" style="width: 20%">
<asp:CheckBox ID="ChkPasarEstatusCancelado" ClientIDMode="Static" runat="server" Text="CANCELAR" /></td>
</tr>
<tr>
<td colspan="3" align="center">
<asp:Button ID="BtnAddObs" runat="server" Text="Aceptar" ClientIDMode="Static" ValidationGroup="GrpGuardaBit" class="btn btn-primary" />
<caption>
<input id="BtnCancelObs" style="display: none;" type="button" value="Cancelar" onclick="$get('divObs').style.display = 'none';" class="btn btn-danger" />
</caption>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPPDatosObs" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvObservaciones" runat="server" AutoGenerateColumns="False" Width="980px" ShowHeader="false" CssClass="table table-striped table-advance table-hover" Style="text-align: center;" GridLines="None">
<Columns>
<asp:BoundField DataField="FechaIng" DataFormatString="{0:d}" HeaderText="Fecha">
<ItemStyle Width="90px" HorizontalAlign="Center" />
</asp:BoundField>
<asp:BoundField DataField="NombreUsuario" DataFormatString="&nbsp;{0}" HeaderText="Usuario">
<ItemStyle Width="200px" />
</asp:BoundField>
<asp:BoundField DataField="EventoComentario" DataFormatString="&nbsp;{0}" HeaderText="Observación"></asp:BoundField>
<asp:TemplateField HeaderText="">
<ItemTemplate>
<asp:HyperLink Target="_blank" ID="HplA" runat="server" Visible='<%# Eval("Archivo").ToString <> "" %>'><img src="/Imagenes/descargar.png" alt="Descargar" style="height:18px;border:0;"/></asp:HyperLink>
<asp:ImageButton ID="ImBtnPub" ToolTip="Publicar Documento" Visible="False" ImageUrl="/Imagenes/PublicarDoc.jpg" Height="18px" runat="server" />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" Width="30px" />
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DivRevision" runat="server" clientidmode="Static" width="500px" style="z-index: 999; border: solid 1px black; background-color: white; color: Black; display: none; position: fixed; top: 180px; left: 35%;">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr class="Titulos">
<td width="450px" align="center">Registrar Revisión</td>
<td style="padding-right: 0px;" valign="top">
<img alt="" src="/imagenes/cerrarX.jpg" style="cursor: pointer;" onclick="$get('DivRevision').style.display='none';" />
</td>
</tr>
</table>
<table width="100%" border="0">
<tr>
<td>Descripción</td>
<td>
<asp:TextBox ID="TxtDescripcionRevision" Text="" Width="450px" Rows="4" TextMode="MultiLine" ClientIDMode="Static" ValidationGroup="GrpGuardar" runat="server" />
<asp:RequiredFieldValidator ID="RFVDescripcionRevision" runat="server" ControlToValidate="TxtDescripcionRevision" InitialValue="" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Descripción''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEDescripcionRevision" runat="server" HighlightCssClass="vco" TargetControlID="RFVDescripcionRevision" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<asp:Button ID="BtnAgregarRevision" runat="server" Text="Agregar" ValidationGroup="GrpGuardar" Width="100px" OnClick="BtnAgregarRevision_Click" class="btn btn-primary" />
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div id="ModalUpload" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Subir Archivo</h4>
</div>
<div class="modal-body">
<asp:UpdatePanel runat="server" ID="UPAddEventoBitacora" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-12">
<asp:TextBox ID="Anexo" CssClass="ADSdropzone hidden" data-maxFile="1" Text="" runat="server"></asp:TextBox>
</div>
</div>
<%--<div>
</div>--%>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="modal-footer">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Button ID="BtnGuardarArchivo" runat="server" ClientIDMode="Static" Text="Guardar" CssClass="btn btn-primary" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
<div id="ModalUploadBit" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Subir Archivo</h4>
</div>
<div class="modal-body">
<asp:UpdatePanel runat="server" ID="UpdatePanel1" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-12">
<asp:TextBox ID="txtFileBit" CssClass="ADSdropzone hidden" data-maxFile="1" Text="" runat="server"></asp:TextBox>
</div>
</div>
<%--<div>
</div>--%>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="modal-footer">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Button ID="btnFileBit" runat="server" ClientIDMode="Static" Text="Guardar" CssClass="btn btn-primary" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script language="javascript" type="text/javascript">
var idConFocus = "-1";
function ConvierteCapital() {
__doPostBack('lnkNull', '');
}
function RevisaTextArea() {
var Texto = document.getElementById('TxtAsunto');
if (Texto)
if (Texto.value.length > 1000)
Texto.value = Texto.value.substring(0, 999);
}
function MostrarOpcionesObs() {
// $get('divObs').focus();
$get('TxtOBs').rows = "5";
$get('trBtnAddObs').style.display = 'inline';
$get('trBtnAddObs').style.width = "980px";
}
document.onclick = function (e) {
e = e || event
var target = e.target || e.srcElement
var elemento = document.getElementById('divObs');
var elemento2 = document.getElementById('TxtOBs');
do {
if (elemento == target || elemento2 == target) {
MostrarOpcionesObs();
return;
}
target = target.parentNode;
} while (target)
OcultarOpcionesObs();
}
function OcultarOpcionesObs() {
if (idConFocus == "ChkRegresaraEstatusAnterior" || idConFocus == "ChkPasarEstatusSiguiente" || idConFocus == "SubirArchivo") {
//alert("Tiene el foco");
} else {
if ($get('TxtOBs')) $get('trBtnAddObs').rows = "2";
if ($get('trBtnAddObs')) $get('trBtnAddObs').style.display = 'none';
}
}
function chkCambioEstatus(IDchkSel) {
var chkSel = $get(IDchkSel);
if (chkSel.id == 'ChkRegresaraEstatusAnterior') {
if ($get('ChkPasarEstatusSiguiente') != null) { $get('ChkPasarEstatusSiguiente').checked = false; }
if ($get('ChkPasarEstatusCancelado') != null) { $get('ChkPasarEstatusCancelado').checked = false; }
}
if (chkSel.id == 'ChkPasarEstatusSiguiente') {
if ($get('ChkRegresaraEstatusAnterior') != null) { $get('ChkRegresaraEstatusAnterior').checked = false; }
if ($get('ChkPasarEstatusCancelado') != null) { $get('ChkPasarEstatusCancelado').checked = false; }
}
if (chkSel.id == 'ChkPasarEstatusCancelado') {
if ($get('ChkRegresaraEstatusAnterior') != null) { $get('ChkRegresaraEstatusAnterior').checked = false; }
if ($get('ChkPasarEstatusSiguiente') != null) { $get('ChkPasarEstatusSiguiente').checked = false; }
}
}
</script>
<script type="text/javascript">
function CargaArchivo(Tipo) {
alert('dssdsd');
if (Tipo == "Resguardo") {
$("#BtnCargarResguardo").click();
}
else if (Tipo == "Imagen") {
$("#BtnCargarArchivo").click();
}
}
</script>
<script>
function FiltrarGV() {
var texto = $('#filtroGVtext').val();
$('#<%=GVUsuarios.ClientID%> > tbody > tr').css({'display':'none'});
$("#<%=GVUsuarios.ClientID%> > tbody > tr:contains('" + texto + "')").css({ 'display': '' });
$('#<%=GVUsuarios.ClientID%> > tbody > tr:nth-child(1)').css({ 'display': 'none' });
}
</script>
</asp:Content>

2035
Nomina/EventoDetalle.aspx.vb Normal file

File diff suppressed because it is too large Load Diff

295
Nomina/Finiquito.aspx Normal file
View File

@@ -0,0 +1,295 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Finiquito.aspx.vb" Inherits="Nomina_Finiquito" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.GvConceptos.table > tbody > tr > th {
border-top: 1px solid #c49f47;
color: #fff;
font-size: 15px;
background-color: #c49f47;
}
.GvConceptos.table > tbody > tr.thTituloConcepto > th:nth-child(1),
.GvConceptos.table > tbody > tr:not(.thTituloConcepto) > th:nth-child(2),
.GvConceptos.table > tbody > tr > td:nth-child(2) {
border-right: 1px solid #c49f47;
}
.dtosEmpleado {
font-size: 15px;
font-weight: 600;
}
.dtosEmpleado a {
color: #2196f3;
}
.dtosEmpleado .row {
padding-top: 10px;
padding-bottom: 10px;
}
.GvConceptos.table > tbody > tr > td span {
display: block;
min-height: 12px;
}
.GvConceptos.table > tbody > tr.ConceptosTotales {
font-weight: bold;
font-size: 15px;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Finiquito
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:HyperLink ID="HypCambiarEmpleado" onclick="$('#ModalEmpleados').modal();" runat="server"><i class="fa fa-exchange" aria-hidden="true"></i>Cambiar Empleado</asp:HyperLink></li>
<li>
<asp:LinkButton ID="LnkReCalcular" OnClick="LnkCalcular_Click" runat="server"><i class="fa fa-pencil"></i>ReCalcular </asp:LinkButton></li>
<li>
<asp:LinkButton ID="LnkAutorizar" OnClick="LnkAutorizar_Click" runat="server"><i class='material-icons'>done_all</i>Autorizar</asp:LinkButton></li>
<li>
<asp:LinkButton ID="LnkTimbrar" OnClick="LnkTimbrar_Click" runat="server"><i class="fa fa-bell"></i>Timbrar</asp:LinkButton></li>
<li>
<asp:LinkButton ID="LnkFormatoRenuncia" OnClick="LnkFormatoRenuncia_Click" runat="server"><i class="fa fa-bell"></i>Formato Renuncia</asp:LinkButton></li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="upDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row ">
<div class="col-md-6 col-md-offset-3 col-sm-10 col-sm-offset-1">
<div class="portlet box yellow smallpadding" id="pnldl">
<div class="portlet-title">
<div class="caption ">
<i class="icon-pin "></i>
<span class="caption-subject bold uppercase">Datos del Empleado</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 dtosEmpleado">
<div class="row ">
<div class="col-sm-4 col-lg-3">Empleado: </div>
<div class="col-sm-8 col-lg-9">
<asp:HyperLink ID="HypEmpleado" CssClass="LinkEmpleado" runat="server"></asp:HyperLink>
</div>
</div>
<div class="row ">
<div class="col-sm-4 col-lg-3">Estatus</div>
<div class="col-sm-8 col-lg-9">
<asp:Label ID="LblEstatus" runat="server" Text=""></asp:Label>
</div>
</div>
<div class="row ">
<div class="col-sm-4 col-lg-3">Motivo Baja</div>
<div class="col-sm-8 col-lg-9 ">
<asp:Label ID="LblMotivoBaja" runat="server" Text=""></asp:Label>
</div>
</div>
<div class="row ">
<div class="col-sm-4 col-lg-3">Fecha Baja</div>
<div class="col-sm-8 col-lg-9">
<asp:Label ID="LblFechaBaja" runat="server" Text=""></asp:Label>
</div>
</div>
<div class="row ">
<div class="col-sm-4 col-lg-3">Perido Finiquito</div>
<div class="col-sm-8 col-lg-9">
<asp:Label ID="LblPerido" runat="server" Text=""></asp:Label>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="portlet box yellow smallpadding" id="pnlSobreRecivo">
<div class="portlet-title">
<div class="caption ">
<i class="icon-pin "></i>
<span class="caption-subject bold uppercase">Sobre Recibo</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 " style="padding: 0px;">
<asp:GridView ID="GvConceptos" runat="server" AutoGenerateColumns="False" CssClass="table table-striped table-hover Widthall GvConceptos"
Style="text-align: center;" GridLines="None" OnRowDataBound="GvConceptos_RowDataBound"
DataKeyNames="Concepto,CveConcepto,Importe,Estatus,ConceptoD,CveConceptoD,ImporteD,EstatusD">
<Columns>
<asp:TemplateField HeaderText="Concepto">
<ItemTemplate>
<asp:Label ID="LtlConcepto" runat="server" Text='<%# Eval("Concepto") %>' Style="word-break: break-all;"></asp:Label>
<asp:LinkButton ID="LnkConcepto" OnClick="LnkConcepto_Click" runat="server" Text='<%# Eval("Concepto") %>'></asp:LinkButton>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" Width="37%" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Importe">
<ItemTemplate>
<asp:Label ID="LtlImporte" runat="server" Text='<%# Eval("Importe", "${0:N}") %>' Style="word-break: break-all;"></asp:Label>
<asp:LinkButton ID="LnkImporte" OnClick="LnkConcepto_Click" runat="server" Text='<%# Eval("Importe", "${0:N}") %>'></asp:LinkButton>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" Width="13%" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Concepto">
<ItemTemplate>
<asp:Label ID="LtlConceptoD" runat="server" Text='<%# Eval("ConceptoD") %>' Style="word-break: break-all;"></asp:Label>
<asp:LinkButton ID="LnkConceptoD" OnClick="LnkConceptoD_Click" runat="server" Text='<%# Eval("ConceptoD") %>'></asp:LinkButton>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" Width="37%" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Importe">
<ItemTemplate>
<asp:Label ID="LtlImporteD" runat="server" Text='<%# Eval("ImporteD", "${0:N}") %>' Style="word-break: break-all;"></asp:Label>
<asp:LinkButton ID="LnkImporteD" OnClick="LnkConceptoD_Click" runat="server" Text='<%# Eval("ImporteD", "${0:N}") %>'></asp:LinkButton>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" Width="13%" />
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
<div id="ModalConceptos" class="modal ADS fade " role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalConceptos" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">LtlTituloConcepto</h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlConcepto" runat="server" AppendDataBoundItems="true" CssClass="form-control select2me" DataTextField="NominaEstatus" DataValueField="CvePeriodo">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:Label runat="server" Text="Concepto:" AssociatedControlID="DdlConcepto"></asp:Label>
</div>
</div>
<div class="modal-footer">
<asp:UpdatePanel runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:LinkButton ID="LnkAceptarConceptos" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpSeleccionar" OnClick="LnkAceptarConceptos_Click"> Aceptar</asp:LinkButton>
<asp:Literal ID="Literal1" Visible="false" runat="server"> <button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button></asp:Literal>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div id="ModalEmpleados" class="modal ADS fade " role="dialog" data-backdrop="static" data-keyboard="false">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalEmpleados" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">Seleccione un Empleado</h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlPersonal" DataTextField="Nombre" DataValueField="CvePersonal" runat="server" Width="100%" AppendDataBoundItems="true" CssClass="form-control select2me" AutoPostBack="true" OnSelectedIndexChanged="DdlPersonal_SelectedIndexChanged">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:Label runat="server" Text="Empleado: " AssociatedControlID="DdlPersonal"></asp:Label>
</div>
<asp:Panel ID="pnlupValoresFiniquito" runat="server" Visible="false">
<h4>Debe llenar los siguientes valores para continuar</h4>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlMotivoBaja" runat="server" AppendDataBoundItems="True" DataTextField="MotivoBaja" DataValueField="CveMotivoBaja" CssClass="form-control select2me" ValidationGroup="GrpGuardar">
<asp:ListItem Selected="True" Text="Sin asignar Motivo de Baja" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:Label runat="server" Text="Motivo de Baja: " AssociatedControlID="DdlMotivoBaja"></asp:Label>
</div>
<div class="row">
<div class="col-md-6" style="padding-right: 0px">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtFechaBaja" runat="server" CausesValidation="True" CssClass="form-control"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvTxtFechaBaja" runat="server" ControlToValidate="TxtFechaBaja" CssClass="help-block errorimput"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha de Baja''</b> es necesario "
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<asp:Label runat="server" Text="Fecha de Baja: " AssociatedControlID="TxtFechaBaja"></asp:Label>
<ajax:MaskedEditExtender ID="MKEFechaBaja" runat="server" TargetControlID="TxtFechaBaja" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left" BehaviorID="_content_MKEFechaBaja" Century="2000" CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" CultureThousandsPlaceholder="" CultureTimePlaceholder=""></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CEFechaBaja" runat="server" TargetControlID="TxtFechaBaja" PopupButtonID="ImgFechaBaja" PopupPosition="BottomRight" BehaviorID="_content_CEFechaBaja"></ajax:CalendarExtender>
<asp:CompareValidator ID="CVFechaBaja" runat="server" ControlToValidate="TxtFechaBaja" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha de Baja''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar" Visible="False"></asp:CompareValidator>
</div>
</div>
<div class="col-md-6" style="padding-left: 0px">
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFechaBaja" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlTipoPeriodo" runat="server" AppendDataBoundItems="true" CssClass="form-control select2me" AutoPostBack="true" DataTextField="TipoPeriodo" DataValueField="CveTipoPeriodo" OnSelectedIndexChanged="DdlTipoPeriodo_SelectedIndexChanged">
<asp:ListItem Selected="True" Text="Ordinario" Value="-1"></asp:ListItem>
<asp:ListItem Text="Extraordinario" Value="6"></asp:ListItem>
</asp:DropDownList>
<asp:Label runat="server" Text="Tipo Período: " AssociatedControlID="DdlTipoPeriodo"></asp:Label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlPeriodo" runat="server" AppendDataBoundItems="true" CssClass="form-control select2me" DataTextField="NominaEstatus" DataValueField="CvePeriodo">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:Label runat="server" Text="Período:" AssociatedControlID="DdlPeriodo"></asp:Label>
</div>
</asp:Panel>
</div>
<div class="modal-footer">
<asp:UpdatePanel runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:LinkButton ID="LnkCampiarEmpleado" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpSeleccionar" OnClick="LnkCampiarEmpleado_Click"> Aceptar</asp:LinkButton>
<asp:Literal ID="LtlEmpleadoCancelar" Visible="false" runat="server"> <button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button></asp:Literal>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<%--"<tr class=\"thTituloConcepto\"> <th scope=\"col\" colspan=\"2\">Percepciones</th><th scope=\"col\" colspan=\"2\">Deducciones</th> </tr>"--%>
<script>
function ADSBegin() {
if ($('.thTituloConcepto').length == 0) {
$('.GvConceptos').prepend("<tr class=\"thTituloConcepto\"> <th scope=\"col\" colspan=\"2\">Percepciones</th><th scope=\"col\" colspan=\"2\">Deducciones</th> </tr>");
}
}
</script>
</asp:Content>

406
Nomina/Finiquito.aspx.vb Normal file
View File

@@ -0,0 +1,406 @@
Option Strict On
Imports System.Data
Imports Extensiones
Partial Class Nomina_Finiquito
Inherits ClsPaginas
Private Class ConceptosPersonal
Public Sub New()
Concepto = ""
ConceptoD = ""
CveConcepto = 0
CveConceptoD = 0
Estatus = 0
Estatus = 0
End Sub
Public Property Concepto As String
Public Property CveConcepto As Integer
Public Property Importe As Decimal
Public Property Estatus As Integer
Public Property ConceptoD As String
Public Property CveConceptoD As Integer
Public Property ImporteD As Decimal
Public Property EstatusD As Integer
End Class
#Region "Propiedades"
Private Property CvePersonal As Integer
Get
If Not IsNothing(ViewState("CvePersonal")) Then
Return ViewState("CvePersonal").ToString().ToEntero()
Else
Return 0
End If
End Get
Set(value As Integer)
ViewState("CvePersonal") = value
End Set
End Property
Private Property CveTipoPeriodo As Integer
Get
If Not IsNothing(ViewState("CveTipoPeriodo")) Then
Return ViewState("CveTipoPeriodo").ToString().ToEntero()
Else
Return 0
End If
End Get
Set(value As Integer)
ViewState("CveTipoPeriodo") = value
End Set
End Property
Private Property CvePeriodoFiniquito As Integer
Get
If Not IsNothing(ViewState("CvePeriodoFiniquito")) Then
Return ViewState("CvePeriodoFiniquito").ToString().ToEntero()
Else
Return 0
End If
End Get
Set(value As Integer)
ViewState("CvePeriodoFiniquito") = value
End Set
End Property
Private Property GCEstatus As Integer
Get
If Not IsNothing(ViewState("GCEstatus")) Then
Return ViewState("GCEstatus").ToString().ToEntero()
Else
Return 0
End If
End Get
Set
ViewState("GCEstatus") = Value
End Set
End Property
Private Property GCCveConcepto As Integer
Get
If Not IsNothing(ViewState("GCCveConcepto")) Then
Return ViewState("GCCveConcepto").ToString().ToEntero()
Else
Return 0
End If
End Get
Set
ViewState("GCCveConcepto") = Value
End Set
End Property
Private Property GCImporte As Decimal
Get
If Not IsNothing(ViewState("GCImporte")) Then
Return ViewState("GCImporte").ToString().ToDecimal()
Else
Return 0
End If
End Get
Set
ViewState("GCImporte") = Value
End Set
End Property
Private ReadOnly Property ConceptsPersonas As List(Of ConceptosPersonal)
Get
Dim listaconceptos As New List(Of ConceptosPersonal)
Dim TotalP As Decimal = 0
Dim TotalD As Decimal = 0
If (Not IsNothing(DTConceptosPersonal) AndAlso DTConceptosPersonal.Rows.Count > 0) Then
Dim dtP As DataTable = DTConceptosPersonal.FiltraParametros("Tipo=1")
Dim dtD As DataTable = DTConceptosPersonal.FiltraParametros("Tipo=2")
Dim noP = dtP.Rows.Count()
Dim noD = dtD.Rows.Count()
Dim max = If(noP > noD, noP, noD)
TotalP = dtP.SUM("Importe").ToString().ToDecimal()
TotalD = dtD.SUM("Importe").ToString().ToDecimal()
For index = 0 To max
Dim obj As New ConceptosPersonal()
If index < noP Then
obj.Importe = dtP.Rows(index)("Importe").ToString().ToDecimal()
obj.CveConcepto = dtP.Rows(index)("CveConcepto").ToString().ToEntero()
obj.Concepto = dtP.Rows(index)("Concepto").ToString()
obj.Estatus = dtP.Rows(index)("Estatus").ToString().ToEntero()
ElseIf index = noP Then
obj.Estatus = -1
obj.Concepto = "Agregar"
End If
If index < noD Then
obj.ImporteD = dtD.Rows(index)("Importe").ToString().ToDecimal()
obj.CveConceptoD = dtD.Rows(index)("CveConcepto").ToString().ToEntero()
obj.ConceptoD = dtD.Rows(index)("Concepto").ToString()
obj.EstatusD = dtD.Rows(index)("Estatus").ToString().ToEntero()
ElseIf index = noD Then
obj.EstatusD = -1
obj.ConceptoD = "Agregar"
End If
listaconceptos.Add(obj)
Next
End If
listaconceptos.Add(New ConceptosPersonal())
Dim objST As New ConceptosPersonal()
objST.Importe = TotalP
objST.CveConcepto = 0
objST.Concepto = "Total Percepciones"
objST.Estatus = -2
objST.ImporteD = TotalD
objST.CveConceptoD = 0
objST.ConceptoD = "Total Deducciones"
objST.EstatusD = -2
listaconceptos.Add(objST)
Dim objT As New ConceptosPersonal()
objT.CveConcepto = 0
objT.Concepto = ""
objT.Estatus = -3
objT.ImporteD = objST.Importe - objT.Importe
objT.CveConceptoD = 0
objT.ConceptoD = "Total"
objT.EstatusD = -3
listaconceptos.Add(objT)
Return listaconceptos
End Get
End Property
Private Property DTConceptosPersonal As DataTable
Get
If Not IsNothing(ViewState("DTConceptosPersonal")) Then
Return DirectCast(ViewState("DTConceptosPersonal"), DataTable)
Else
Return Nothing
End If
End Get
Set
ViewState("DTConceptosPersonal") = Value
End Set
End Property
Private Property DTConceptos As DataTable
Get
If Not IsNothing(ViewState("DTConceptos")) Then
Return DirectCast(ViewState("DTConceptos"), DataTable)
Else
Return Nothing
End If
End Get
Set
ViewState("DTConceptos") = Value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CargaDdlPersonal()
CargaMotivoBaja()
CvePeriodoFiniquito = 0
If Request("CvePersonal") IsNot Nothing AndAlso IsNumeric(Request("CvePersonal")) AndAlso Request("CvePersonal").ToEntero > 0 Then
ViewState("CvePersonal") = Request("CvePersonal")
Else
CvePersonal = -1
End If
If Not CargaDatosFiniquito() Then
RegistraScript("$('#ModalEmpleados').modal();")
End If
End If
If CvePersonal > 0 And CvePeriodoFiniquito > 0 Then
LtlEmpleadoCancelar.Visible = True
End If
End Sub
Private Sub CargaMotivoBaja()
DdlMotivoBaja.DataSource = GlobalDTMotivoBaja.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
DdlMotivoBaja.DataBind()
End Sub
Private Sub CargaDdlPersonal()
Dim ObjPersonal As New ClsRH
If ObjPersonal.GetPersonal(-1, "-1", "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, 2, -1, -1, "-1", -1, -1, -1, -1, -1, -1, "-1", "-1", "-1", "-1", UsuarioActual.CveEmpresa) Then
DdlPersonal.DataSource = ObjPersonal.DtResultados
DdlPersonal.DataBind()
End If
ObjPersonal.Dispose()
End Sub
Private Function CargaDatosFiniquito() As Boolean
Dim retorno As Boolean = True
If CvePersonal > 0 Then
DdlPersonal.SelectedValueExist(CvePersonal.ToString())
Dim Nombre As String = ""
Dim FechaBaja As String = ""
Dim MotivoBaja As String = ""
Dim EstatusPersonal As String = ""
CvePeriodoFiniquito = 0
CveTipoPeriodo = 0
pnlupValoresFiniquito.Visible = False
Dim ObjPersonal As New ClsRH
If ObjPersonal.GetPersonal(CvePersonal, "-1", "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, 2, -1, -1, "-1", -1, -1, -1, -1, -1, -1, "-1", "-1", "-1", "-1", UsuarioActual.CveEmpresa) AndAlso ObjPersonal.DtResultados.Rows.Count > 0 Then
Nombre = ObjPersonal.DtResultados.Rows(0)("Nombre").ToString()
FechaBaja = String.Format("{0:dd/MM/yyyy}", ObjPersonal.FechaBaja)
MotivoBaja = String.Format("{0}", ObjPersonal.DtResultados.Rows(0)("MotivoBaja"))
EstatusPersonal = String.Format("{0}", ObjPersonal.DtResultados.Rows(0)("EstatusPersonal"))
CvePeriodoFiniquito = ObjPersonal.DtResultados.Rows(0)("CvePeriodoFiniquito").ToString().ToEntero()
CveTipoPeriodo = ObjPersonal.DtResultados.Rows(0)("CveTipoPeriodo").ToString().ToEntero()
End If
ObjPersonal.Dispose()
HypEmpleado.Text = Nombre
HypEmpleado.NavigateUrl = String.Format("/RH/Personal.aspx?CvePersonal={0}", CvePersonal)
LblFechaBaja.Text = FechaBaja
LblMotivoBaja.Text = MotivoBaja
LblEstatus.Text = EstatusPersonal
TxtFechaBaja.Text = FechaBaja
If CvePeriodoFiniquito <= 0 Then
DdlTipoPeriodo_SelectedIndexChanged(Nothing, Nothing)
retorno = False
pnlupValoresFiniquito.Visible = True
End If
Dim ObjNom As New ClsNominas
If ObjNom.GetFiniquitosPersonal(CvePersonal, UsuarioActual.CveEmpresa) Then
DTConceptosPersonal = ObjNom.DtResultados
End If
ObjNom.Dispose()
GvConceptos.DataSource = ConceptsPersonas
GvConceptos.DataBind()
Else
retorno = False
End If
Return retorno
End Function
Protected Sub LnkCampiarEmpleado_Click(sender As Object, e As EventArgs)
CvePersonal = DdlPersonal.SelectedValue.ToEntero()
If pnlupValoresFiniquito.Visible Then
End If
If Not CargaDatosFiniquito() Then
RegistraScript("$('#ModalEmpleados').modal('hide');")
End If
upDatos.Update()
End Sub
Protected Sub LnkCalcular_Click(sender As Object, e As EventArgs)
End Sub
Protected Sub LnkAutorizar_Click(sender As Object, e As EventArgs)
End Sub
Protected Sub LnkTimbrar_Click(sender As Object, e As EventArgs)
End Sub
Protected Sub LnkFormatoRenuncia_Click(sender As Object, e As EventArgs)
End Sub
Protected Sub DdlPersonal_SelectedIndexChanged(sender As Object, e As EventArgs)
End Sub
Protected Sub DdlTipoPeriodo_SelectedIndexChanged(sender As Object, e As EventArgs)
Dim CveTipoPeriodoactual As Integer = If(DdlTipoPeriodo.SelectedValue.ToEntero() > 0, DdlTipoPeriodo.SelectedValue.ToEntero(), CveTipoPeriodo)
Dim fechabaja As String = TxtFechaBaja.Text
Dim dtperiodos As New DataTable
Dim ObjPeriodos As New ClsNominas
If ObjPeriodos.GetPeriodos(CveTipoPeriodoactual, UsuarioActual.CveEmpresa, -1, -1, -1) Then
dtperiodos = ObjPeriodos.DtResultados.FiltraParametros("Estatus IN (1,2,3,4)")
'FechaInicio, P.FechaFin
DdlPeriodo.DataSource = dtperiodos
Else
DdlPeriodo.DataSource = Nothing
End If
ObjPeriodos.Dispose()
DdlPeriodo.DataBind()
If fechabaja.Length > 0 AndAlso dtperiodos.Rows.Count > 0 Then
Dim row As DataRow = dtperiodos.FiltroPrimero(String.Format("FechaInicio<='{0:yyyy/MM/dd}' AND FechaFin>='{0:yyyy/MM/dd}'", fechabaja.ToDate()))
If Not IsNothing(row) Then
DdlPeriodo.SelectedValueExist(row("CvePeriodo"))
End If
End If
End Sub
#Region "Conceptos"
Protected Sub GvConceptos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
'Datakeys
'Concepto,CveConcepto,Importe,Estatus,ConceptoD,CveConceptoD,ImporteD,EstatusD
Dim CveConcepto As Integer = e.Row.DataKey("CveConcepto").ToEntero()
Dim CveConceptoD As Integer = e.Row.DataKey("CveConceptoD").ToEntero()
'Dim Importe As Decimal = e.Row.DataKey("Importe").ToDecimal()
'Dim ImporteD As Decimal = e.Row.DataKey("ImporteD").ToDecimal()
Dim Estatus As Integer = e.Row.DataKey("Estatus").ToEntero()
Dim EstatusD As Integer = e.Row.DataKey("EstatusD").ToEntero()
'Controles
Dim LtlConcepto As Label = e.Row.FCLabel("LtlConcepto")
Dim LnkConcepto As LinkButton = e.Row.FCLinkButton("LnkConcepto")
Dim LtlConceptoD As Label = e.Row.FCLabel("LtlConceptoD")
Dim LnkConceptoD As LinkButton = e.Row.FCLinkButton("LnkConceptod")
Dim LtlImporte As Label = e.Row.FCLabel("LtlImporte")
Dim LnkImporte As LinkButton = e.Row.FCLinkButton("LnkImporte")
Dim LtlImporteD As Label = e.Row.FCLabel("LtlImporteD")
Dim LnkImporteD As LinkButton = e.Row.FCLinkButton("LnkImporteD")
If Estatus < -1 Or EstatusD < -1 Then
e.Row.CssClass = "ConceptosTotales"
End If
If CveConcepto = 0 AndAlso (Estatus = 0 OrElse Estatus = -1 OrElse Estatus = -3) Then
LtlImporte.Text = ""
End If
If CveConceptoD = 0 AndAlso (EstatusD = 0 OrElse EstatusD = -1) Then
LtlImporteD.Text = ""
End If
If Estatus = -1 Then
LtlConcepto.Visible = False
ElseIf Estatus > 0 Then
LtlImporte.Visible = False
End If
If EstatusD = -1 Then
LtlConceptoD.Visible = False
ElseIf EstatusD > 0 Then
LtlImporteD.Visible = False
End If
LnkConcepto.Visible = Not LtlConcepto.Visible
LnkConceptoD.Visible = Not LtlConceptoD.Visible
LnkImporte.Visible = Not LtlImporte.Visible
LnkImporteD.Visible = Not LtlImporteD.Visible
End If
End Sub
Protected Sub LnkConcepto_Click(sender As Object, e As EventArgs)
Dim gvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
GCEstatus = gvRow.DataKey("Estatus").ToEntero()
GCCveConcepto = gvRow.DataKey("CveConcepto").ToEntero()
GCImporte = gvRow.DataKey("Importe").ToDecimal()
OpenModalConceptos(1)
End Sub
Protected Sub LnkConceptoD_Click(sender As Object, e As EventArgs)
Dim gvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
GCEstatus = gvRow.DataKey("Estatus").ToEntero()
GCCveConcepto = gvRow.DataKey("CveConcepto").ToEntero()
GCImporte = gvRow.DataKey("Importe").ToDecimal()
OpenModalConceptos(2)
End Sub
Private Sub OpenModalConceptos(Tipo As Integer)
If GCEstatus = -1 Then
Else
End If
RegistraScript("$('#ModalConceptos').modal();")
End Sub
Protected Sub LnkAceptarConceptos_Click(sender As Object, e As EventArgs)
RegistraScript("$('#ModalConceptos').modal('hide');")
End Sub
#End Region
End Class

313
Nomina/Nomina.aspx Normal file
View File

@@ -0,0 +1,313 @@
<%@ Page Title="Nómina - Nómina" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Nomina.aspx.vb" Inherits="Nomina_Nomina" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
<li>
<asp:LinkButton ID="ImgExcel" runat="server" Visible="True" Target="_blank"><img src="/Imagenes/IconoExcel.gif"/>Descargar Excel</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="ImgDownZip" runat="server" Visible="True" Target="_blank"><i class="fa fa-folder-o"></i> Descargar Zip</asp:LinkButton>
</li>
<asp:UpdatePanel ID="UpnTools" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkPagoNomina" Visible="false" runat="server"><i class="fa fa-money"></i>Pagar Nómina</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LnkProvisionNomina" Visible="false" runat="server"><i class="fa fa-money"></i>Provisionar Nómina</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LnkCorreos" runat="server" Visible="true" Target="_blank" OnClick="LnkCorreos_Click"><i class="fa fa-envelope-o"></i>Enviar Recibos</asp:LinkButton>
</li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
<%-- Nómina <asp:Button ID="BtnTest" runat="server" Text="Genera PDF" Visible="True" />--%>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="titlefiltros caption">
<div class="row">
<label class="col-md-1" style="width: 60px !important;">Ejercicio: </label>
<div class="col-md-2">
<asp:DropDownList ID="DdlEjercicios" runat="server" Style="width: 70px !important;" CssClass="select2me"></asp:DropDownList>
</div>
<label class="col-md-1 ">Tipo Período:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlTipoPeriodo" runat="server" AppendDataBoundItems="true" CssClass="select2me" AutoPostBack="true" DataTextField="TipoPeriodo" DataValueField="CveTipoPeriodo" Style="width: 110px !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<label class="col-md-1 " style="width: 60px !important;">Período:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlPeriodo" runat="server" AppendDataBoundItems="true" CssClass="select2me" DataTextField="NominaEstatus" DataValueField="CvePeriodo" Style="width: 170px !important;" AutoPostBack="True">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<label class="col-md-1 " style="width: 70px !important;">Agrupador:</label>
<div class="col-md-1">
<asp:DropDownList ID="DdlAgrupador" runat="server" Style="width: 100px !important;" CssClass="select2me">
<asp:ListItem Text="Empresa" Value="1"></asp:ListItem>
<asp:ListItem Text="Turno" Value="2"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>
<div class="portlet-body">
<div class="row">
<label class="col-md-1" style="width: 60px !important;">Proyecto: </label>
<div class="col-md-2">
<asp:DropDownList ID="DdlProyecto" runat="server" AppendDataBoundItems="true" CssClass="select2me" AutoPostBack="true" DataTextField="Proyecto" DataValueField="CveProyecto" Style="width: 150px !important;" ValidationGroup="GrpGuardar">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<label class="col-md-1 ">SubProyecto:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlSubProyecto" runat="server" AppendDataBoundItems="true" CssClass="select2me" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Style="width: 150px !important;" ValidationGroup="GrpGuardar">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<label class="col-md-1 " style="width: 60px !important;">Turno:</label>
<div class="col-md-2" style="width: 110px !important;">
<asp:DropDownList ID="DdlTurno" runat="server" AppendDataBoundItems="true" CssClass="select2me" DataTextField="Turno" DataValueField="CveTurno" Style="width: 100px !important;" ValidationGroup="GrpGuardar">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList></td>
</div>
<div class="col-md-1">
<asp:Button ID="BtnConsultar" runat="server" Text="Buscar" Visible="False" class="btn btn-primary" />&nbsp;
</div>
<div class="col-md-1">
<asp:Button ID="BtnAutorizar" runat="server" Text="Autorizar" Visible="False" class="btn btn-primary" />
<asp:Button ID="BtnGeneraPDF" runat="server" Text="PDF" Visible="False" class="btn btn-primary" />
<asp:Button ID="BtnEmitir" runat="server" Text="Timbrar" Visible="False" class="btn btn-primary" />
<asp:Button ID="BtnActualizaNomina" runat="server" Text="Act Nomina" Visible="False" class="btn btn-primary" />
<a style="display: none;" href="/Coolings.docx">Recibos</a>
</div>
<asp:Label ID="LblFechaPago" runat="server" Visible="false" CssClass="col-md-1 ">Fecha Pago:</asp:Label>
<div class="col-md-1" id="DivFechaPago" runat="server" visible="false">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="TxtFechaPago" runat="server" CssClass="form-control" CausesValidation="true" Width="100%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="TxtFechaPago" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="TxtFechaPago" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="TxtFechaPago" Display="None" ErrorMessage="El campo <b>''Fecha Pago''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="TxtFechaPago" Display="None" ErrorMessage="El campo <b>''Fecha Pago''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GVDatos" runat="server" DataKeyNames="CvePeriodo, CvePersonal, CveNomina, SeTimbro, SumaPercepciones, SumaDeducciones, Total, SerieFolio,Nombre,Correo" AutoGenerateColumns="False"
CssClass="table table-striped table-advance table-hover mysmallbtn ScrollAD" Style="text-align: center;" GridLines="None">
<Columns>
<asp:HyperLinkField
DataNavigateUrlFields="CvePersonal,CvePeriodo"
DataNavigateUrlFormatString="/Nomina/SobreRecibo.aspx?CvePersonal={0}&CvePeriodo={1}"
Text='<i class="fa fa-list-alt"></i>'
Target="_blank"
HeaderText="Recibo" />
<asp:TemplateField>
<HeaderTemplate>Nombre</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlNombre" runat="server" Text='<%# Eval("Nombre") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="350px" HorizontalAlign="Left" />
</asp:TemplateField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField DataFormatString="{0:N2}" HeaderText="Percepciones" DataField="SumaPercepciones">
<ItemStyle Width="120px" HorizontalAlign="Right" BackColor="LightGray" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField DataFormatString="{0:N2}" HeaderText="Deducciones" DataField="SumaDeducciones">
<ItemStyle Width="120px" HorizontalAlign="Right" BackColor="LightGray" />
</asp:BoundField>
<asp:BoundField DataFormatString="{0:N2}" HeaderText="Total" DataField="Total">
<ItemStyle Width="120px" HorizontalAlign="Right" BackColor="LightGray" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField Visible="false" DataFormatString="{0:N2}">
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField DataFormatString="{0:N2}" HeaderText="Obligaciones" DataField="SumaObligaciones">
<ItemStyle Width="120px" HorizontalAlign="Right" BackColor="LightGray" />
</asp:BoundField>
<asp:TemplateField ItemStyle-Width="20px">
<ItemTemplate>
<asp:Image runat="server" ID="ImgBandera" Visible="false" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField >
<ItemTemplate>
<div style="width: 70px; text-align:right;">
<asp:LinkButton runat="server" ID="LnkTimbrar" CssClass="btn btn-circle btn-sm blue mysmallbtn" Text="<i class='fa fa-bell'></i>" OnClick="LnkTimbrar_Click" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea Timbrar?" data-btn-ok-label="si" />
<asp:LinkButton runat="server" ID="ImgDelete" CssClass="btn btn-circle btn-sm red mysmallbtn" Text="<i class='icon-trash'></i>" OnClick="ImgDelete_Click" CommandArgument='<%# Eval("CveNomina") %>' Visible='<%# If(Eval("CveNomina").ToString <> "" AND Eval("SeTimbro").tostring = "False", True, False)%>' OnClientClick="javascript:return confirm('¿Está seguro que desea eliminar la nómina?');" />
<asp:LinkButton runat="server" ID="LnkCancelar" CssClass="btn btn-circle btn-sm red mysmallbtn" Text="<i class='fas fa-ban'></i>" OnClick="ImgCancelar_Click" CommandArgument='<%# Eval("CveNomina") %>' Visible='<%# If(Eval("CveNomina").ToString <> "" AndAlso PermisoCancelarEmitido AndAlso Eval("SeTimbro").ToString = "True", True, False)%>' OnClientClick="javascript:return confirm('¿Está seguro que desea cancelar la nómina?');" />
</div>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<HeaderStyle CssClass="Titulos"></HeaderStyle>
<AlternatingRowStyle CssClass="TextoAlterno"></AlternatingRowStyle>
<RowStyle CssClass="Texto"></RowStyle>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

2443
Nomina/Nomina.aspx.vb Normal file

File diff suppressed because it is too large Load Diff

391
Nomina/PreNomina.aspx Normal file
View File

@@ -0,0 +1,391 @@
<%@ Page Title="Nómina - Pre Nómina" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PreNomina.aspx.vb" Inherits="Nomina_PreNomina" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
<asp:UpdatePanel ID="UpnTools" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<%-- <asp:LinkButton ID="ImgExcel" runat="server"><i class="fa fa-ad-excel"></i> Imprimir EXCEL</asp:LinkButton>--%>
<asp:ImageButton ID="ImgExcel" runat="server" ImageUrl="/Imagenes/IconoExcel.gif" Width="17px" Height="17px" />
</li>
<li>
<asp:HyperLink ID="HLImgImprimir" Target="_blank" runat="server" NavigateUrl="#"> <i class="fa fa-ad-pdf"></i> Imprimir</asp:HyperLink>
<%--<a id="HLImgImprimir" runat="server" href="#" class="Texto">
<img alt="Imprimir" src="/Imagenes/btnImprimir.gif"/>
</a>--%>
</li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Pre Nómina
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" style="">
<div class="portlet-title portlet-filterT" style="">
<div class="titlefiltros caption ">
<ul class="list-inline">
<li>Tipo Período:
<asp:DropDownList ID="DdlTipoPeriodo" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="TipoPeriodo" DataValueField="CveTipoPeriodo" 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>
</li>
<li>Período:
<asp:DropDownList ID="DdlPeriodo" runat="server" AppendDataBoundItems="true" DataTextField="NumPeriodo" DataValueField="CvePeriodo" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 170px !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</li>
<li>Proyecto:
<asp:DropDownList ID="DdlProyecto" 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: 135px !important;" ValidationGroup="GrpGuardar">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</li>
</ul>
</div>
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" />
<a href="javascript:;" class="expand"></a>
<a onclick="document.getElementById('C_BtnConsultar').click();" class="reload"></a>
<asp:Button ID="BtnGuardarBono" runat="server" Text="Guardar Bonos" class="btn btn-primary" />
<asp:Button ID="BtnImpresion" runat="server" Text="Cerrar Nómina" class="btn btn-primary" />
</div>
</div>
<div class="portlet-body" style="display: none;">
<ul class="list-inline">
<li>SubProyecto:
<asp:DropDownList ID="DdlSubProyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 200px !important;" ValidationGroup="GrpGuardar">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</li>
<li>Turno:
<asp:DropDownList ID="DdlTurno" runat="server" AppendDataBoundItems="true" DataTextField="Turno" DataValueField="CveTurno" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;" ValidationGroup="GrpGuardar">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</li>
</ul>
</div>
</div>
<table id="TblHeader" runat="server" class="table table-striped table-advance table-hover" width="1385px">
<thead>
<tr class="Titulos">
<th rowspan="2" width="250px">Nombre</th>
<th colspan="3">Lunes&nbsp;<asp:Literal ID="LtlLunes" runat="server"></asp:Literal></th>
<th colspan="3">Martes&nbsp;<asp:Literal ID="LtlMartes" runat="server"></asp:Literal></th>
<th colspan="3">Miércoles&nbsp;<asp:Literal ID="LtlMiercoles" runat="server"></asp:Literal></th>
<th colspan="3">Jueves&nbsp;<asp:Literal ID="LtlJueves" runat="server"></asp:Literal></th>
<th colspan="3">Viernes&nbsp;<asp:Literal ID="LtlViernes" runat="server"></asp:Literal></th>
<th colspan="3">Sábado&nbsp;<asp:Literal ID="LtlSabado" runat="server"></asp:Literal></th>
<th colspan="3">Domingo&nbsp;<asp:Literal ID="LtlDomingo" runat="server"></asp:Literal></th>
<th rowspan="2" width="70px">&nbsp;Asis</th>
<th rowspan="2" width="40px">Faltas</th>
<%--<td rowspan="2" width="60px">&nbsp;% Sem&nbsp;</td>--%>
<th rowspan="2" width="60px">&nbsp;Hrs Ext</th>
<%--<td rowspan="2" width="65px">&nbsp;Hrs Trip&nbsp;</td>--%>
<%--<th id="TDAplica" runat="server" rowspan="2" style="width: 70px;">¿Aplica?</th>
<th id="TDBono" runat="server" rowspan="2" style="width: 60px;">Bono</th>
<th id="TDPagoAdicional" runat="server" rowspan="2" style="width: 60px;">Pago Adi</th>
<th id="TDDescuento" runat="server" rowspan="2" style="width: 60px;">Desc Adi</th>--%>
<th rowspan="2">&nbsp;</th>
</tr>
<tr class="Titulos">
<th width="35px">Tipo</th>
<th width="30px">%</th>
<th width="40px">Hrs E</th>
<%--<td width="60px">Hrs Trip</td>--%>
<th width="35px">Tipo</th>
<th width="30px">%</th>
<th width="40px">Hrs E</th>
<%--<td width="60px">Hrs Trip</td>--%>
<th width="35px">Tipo</th>
<th width="30px">%</th>
<th width="40px">Hrs E</th>
<%--<td width="60px">Hrs Trip</td>--%>
<th width="35px">Tipo</th>
<th width="30px">%</th>
<th width="40px">Hrs E</th>
<%--<td width="60px">Hrs Trip</td>--%>
<th width="35px">Tipo</th>
<th width="30px">%</th>
<th width="40px">Hrs E</th>
<%--<td width="60px">Hrs Trip</td>--%>
<th width="35px">Tipo</th>
<th width="30px">%</th>
<th width="40px">Hrs E</th>
<%--<td width="60px">Hrs Trip</td>--%>
<th width="35px">Tipo</th>
<th width="30px">%</th>
<th width="40px">Hrs E</th>
<%--<td width="60px">Hrs Trip</td>--%>
</tr>
</thead>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CvePersonal" EmptyDataText="No se encontraron Ventas con los filtros especificados" ToolTip="Pre Nómina" Width="1385px" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlNombre" runat="server" Text='<%# Eval("Nombre") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="250px" />
</asp:TemplateField>
<%--Lunes--%>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlLu" runat="server" Text='<%# Eval("Lu") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="35px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlLu_Porcentaje" runat="server" Text='<%# Eval("Lu_Porcentaje") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="30px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlLu_HrsDobles" runat="server" Text='<%# Eval("Lu_HrsDobles") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="40px" />
</asp:TemplateField>
<%--<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlLu_HrsTriples" runat="server" Text='<%# Eval("Lu_HrsTriples") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="60px" />
</asp:TemplateField>--%>
<%--Martes--%>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlMa" runat="server" Text='<%# Eval("Ma") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="35px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlMa_Porcentaje" runat="server" Text='<%# Eval("Ma_Porcentaje") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="30px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlMa_HrsDobles" runat="server" Text='<%# Eval("Ma_HrsDobles") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="40px" />
</asp:TemplateField>
<%--<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlMa_HrsTriples" runat="server" Text='<%# Eval("Ma_HrsTriples") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="60px" />
</asp:TemplateField>--%>
<%--Miércoles--%>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlMi" runat="server" Text='<%# Eval("Mi") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="35px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlMi_Porcentaje" runat="server" Text='<%# Eval("Mi_Porcentaje") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="30px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlMi_HrsDobles" runat="server" Text='<%# Eval("Mi_HrsDobles") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="40px" />
</asp:TemplateField>
<%--<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlMi_HrsTriples" runat="server" Text='<%# Eval("Mi_HrsTriples") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="60px" />
</asp:TemplateField>--%>
<%--Jueves--%>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlJu" runat="server" Text='<%# Eval("Ju") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="35px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlJu_Porcentaje" runat="server" Text='<%# Eval("Ju_Porcentaje") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="30px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlJu_HrsDobles" runat="server" Text='<%# Eval("Ju_HrsDobles") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="40px" />
</asp:TemplateField>
<%--<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlJu_HrsTriples" runat="server" Text='<%# Eval("Ju_HrsTriples") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="60px" />
</asp:TemplateField>--%>
<%--Viernes--%>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlVi" runat="server" Text='<%# Eval("Vi") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="35px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlVi_Porcentaje" runat="server" Text='<%# Eval("Vi_Porcentaje") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="30px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlVi_HrsDobles" runat="server" Text='<%# Eval("Vi_HrsDobles") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="40px" />
</asp:TemplateField>
<%--<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlVi_HrsTriples" runat="server" Text='<%# Eval("Vi_HrsTriples") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="60px" />
</asp:TemplateField>--%>
<%--Sábado--%>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlSa" runat="server" Text='<%# Eval("Sa") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="35px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlSa_Porcentaje" runat="server" Text='<%# Eval("Sa_Porcentaje") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="30px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlSa_HrsDobles" runat="server" Text='<%# Eval("Sa_HrsDobles") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="40px" />
</asp:TemplateField>
<%--<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlSa_HrsTriples" runat="server" Text='<%# Eval("Sa_HrsTriples") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="60px" />
</asp:TemplateField>--%>
<%--Domingo--%>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlDo" runat="server" Text='<%# Eval("Do") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="35px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlDo_Porcentaje" runat="server" Text='<%# Eval("Do_Porcentaje") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="30px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlDo_HrsDobles" runat="server" Text='<%# Eval("Do_HrsDobles") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="40px" />
</asp:TemplateField>
<%--<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlDo_HrsTriples" runat="server" Text='<%# Eval("Do_HrsTriples") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="60px" />
</asp:TemplateField>--%>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlAsistencias" runat="server" Text='<%# Eval("Asistencias") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="70px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFaltas" runat="server" Text='<%# Eval("Faltas") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="40px" />
</asp:TemplateField>
<%--<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlPorSemanal" runat="server" Text='<%# Eval("Porcentaje", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="60px" />
</asp:TemplateField>--%>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlHorasExtras" runat="server" Text='<%# Eval("HorasDobles") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="60px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="ChkAplica" runat="server" Visible="false" Checked='<%# Eval("AplicaBono") %>' />
</ItemTemplate>
<ItemStyle Width="70px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:TextBox ID="TxtBono" runat="server" Visible="false" Text='<%# Eval("Importe", "{0:N0}") %>' Width="44px"></asp:TextBox>
</ItemTemplate>
<ItemStyle Width="60px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:TextBox ID="TxtPagoAdicional" Visible="false" runat="server" Text='<%# Eval("PagoAdicional", "{0:N0}") %>' Width="44px"></asp:TextBox>
</ItemTemplate>
<ItemStyle Width="60px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:TextBox ID="TxtDescuentoAdicional" Visible="false" runat="server" Text='<%# Eval("DescuentoAdicional", "{0:N0}") %>' Width="44px"></asp:TextBox>
</ItemTemplate>
<ItemStyle Width="60px" />
</asp:TemplateField>
<%--<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlHorasTriples" runat="server" Text='<%# Eval("HorasTriples") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="65px" />
</asp:TemplateField>--%>
<asp:TemplateField>
<ItemTemplate>
&nbsp;
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

254
Nomina/PreNomina.aspx.vb Normal file
View File

@@ -0,0 +1,254 @@
Option Strict On
Option Explicit On
Imports Extensiones
Imports System.Data
Partial Class Nomina_PreNomina
Inherits ClsPaginas
Private ReadOnly Property DTPeriodos As DataTable
Get
Return DirectCast(ViewState("DTPeriodos"), DataTable)
End Get
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
SetValues()
SetPermisos()
CargaTiposPeriodo()
CargaProyecto()
CargaTurnos()
End If
End Sub
Private Sub SetValues()
End Sub
Private Sub SetPermisos()
'Permisos
If UsuarioActual.EsSupervisorRH Then
BtnGuardarBono.Visible = False
BtnImpresion.Visible = False
For i As Integer = 25 To 28
GvDatos.Columns(i).Visible = False
Next
'TDAplica.Visible = False : TDBono.Visible = False : TDDescuento.Visible = False : TDPagoAdicional.Visible = False
End If
End Sub
#Region "CargaCombos"
Private Sub CargaTiposPeriodo()
DdlTipoPeriodo.DataSource = GlobalDTTipoPeriodo
DdlTipoPeriodo.DataBind()
End Sub
Private Sub CargaPeriodos()
Dim ObjPeriodos As New ClsNominas
If ObjPeriodos.GetPeriodos(DdlTipoPeriodo.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, -1, -1, -1) Then
ViewState("DTPeriodos") = ObjPeriodos.DtResultados
DdlPeriodo.DataSource = DTPeriodos
Else
DdlPeriodo.DataSource = Nothing
End If
ObjPeriodos.Dispose()
DdlPeriodo.DataBind()
DdlPeriodo.Items.Clear()
DdlPeriodo.DataBind()
DdlPeriodo.Items.Insert(0, New ListItem("Seleccione", "-1"))
End Sub
Private Sub CargaProyecto()
DdlProyecto.DataSource = GlobalDTProyectos(UsuarioActual.Empresa.CveEmpresa).FiltraParametros("", DistinctColumns:={"CveProyecto", "Proyecto"})
DdlProyecto.DataBind()
End Sub
Private Sub CargaSubProyecto()
DdlSubProyecto.Items.Clear()
DdlSubProyecto.DataSource = GlobalDTSubProyectos(DdlProyecto.SelectedValue.ToEntero)
DdlSubProyecto.DataBind()
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub
Private Sub CargaTurnos()
DdlTurno.DataSource = GlobalDTTurno.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
DdlTurno.DataBind()
End Sub
#End Region
Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlProyecto.SelectedIndexChanged
CargaSubProyecto()
End Sub
Protected Sub DdlTipoPeriodo_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlTipoPeriodo.SelectedIndexChanged
CargaPeriodos()
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click
If DdlPeriodo.SelectedValue <> "-1" Then
Dim ObjNomina As New ClsRH
Dim FechaI, FechaF As Date
FechaI = DTPeriodos.FiltraParametros("CvePeriodo = " & DdlPeriodo.SelectedValue).Rows(0)("FechaInicio").ToString.ToDate
FechaF = DTPeriodos.FiltraParametros("CvePeriodo = " & DdlPeriodo.SelectedValue).Rows(0)("FechaFin").ToString.ToDate
LtlLunes.Text = If(FechaI.Day.ToString.Length = 1, "0" & FechaI.Day.ToString, FechaI.Day.ToString)
LtlMartes.Text = If(FechaI.AddDays(1).Day.ToString.Length = 1, "0" & FechaI.AddDays(1).Day.ToString, FechaI.AddDays(1).Day.ToString)
LtlMiercoles.Text = If(FechaI.AddDays(2).Day.ToString.Length = 1, "0" & FechaI.AddDays(2).Day.ToString, FechaI.AddDays(2).Day.ToString)
LtlJueves.Text = If(FechaI.AddDays(3).Day.ToString.Length = 1, "0" & FechaI.AddDays(3).Day.ToString, FechaI.AddDays(3).Day.ToString)
LtlViernes.Text = If(FechaI.AddDays(4).Day.ToString.Length = 1, "0" & FechaI.AddDays(4).Day.ToString, FechaI.AddDays(4).Day.ToString)
LtlSabado.Text = If(FechaI.AddDays(5).Day.ToString.Length = 1, "0" & FechaI.AddDays(5).Day.ToString, FechaI.AddDays(5).Day.ToString)
LtlDomingo.Text = If(FechaI.AddDays(6).Day.ToString.Length = 1, "0" & FechaI.AddDays(6).Day.ToString, FechaI.AddDays(6).Day.ToString)
If ObjNomina.GetPreNomina(DdlProyecto.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlTurno.SelectedValue.ToEntero, FechaI, FechaF, UsuarioActual.CveEmpresa) Then
GvDatos.DataSource = ObjNomina.DtResultados
Else
GvDatos.DataSource = Nothing
End If
ObjNomina.Dispose()
GvDatos.DataBind()
UPDatos.Update()
HLImgImprimir.NavigateUrl = String.Format("/Nomina/RepPreNomina.aspx?CveProyecto={0}&CveSubProyecto={1}&CveTurno={2}&FechaI={3}&FechaF={4}&Periodo={5}", DdlProyecto.SelectedValue, DdlSubProyecto.SelectedValue, DdlTurno.SelectedValue, FechaI.ToShortDateString, FechaF.ToShortDateString, DdlPeriodo.SelectedItem.Text)
UpnTools.Update()
Else
Alert("Debe de seleccionar el Período con el que se desea trabajar", TipoMensaje.MsgAdvertencia)
End If
End Sub
Protected Sub BtnImpresion_Click(sender As Object, e As System.EventArgs) Handles BtnImpresion.Click
'System.Threading.Thread.Sleep(1500)
Alert("La Prenómina se cerró correctamente y se generaron los importes de la nómina.", TipoMensaje.MsgInformacion)
End Sub
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("Turno") = "" AndAlso e.Row.DBCampo("Nombre") = "" Then
e.Row.FCLiteral("LtlNombre").Text = "<b>Sub Proyecto: " & e.Row.DBCampo("SubProyecto") & "<b>"
e.Row.Cells(0).ColumnSpan = 22
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
For i As Integer = 1 To 21
e.Row.Cells(i).Visible = False
Next
e.Row.FCCheckBox("ChkAplica").Visible = False : e.Row.FCTextBox("TxtBono").Visible = False : e.Row.FCTextBox("TxtPagoAdicional").Visible = False : e.Row.FCTextBox("TxtDescuentoAdicional").Visible = False
e.Row.FCLiteral("LtlAsistencias").Text = CType(CType(sender, GridView).DataSource, DataTable).SUM("Asistencias", "Nombre <> ''").ToString
e.Row.FCLiteral("LtlFaltas").Text = CType(CType(sender, GridView).DataSource, DataTable).SUM("Faltas", "Nombre <> ''").ToString
If e.Row.FCLiteral("LtlAsistencias").Text.ToDouble = 0 Then
e.Row.FCLiteral("LtlAsistencias").Text = ""
Else
e.Row.FCLiteral("LtlAsistencias").Text = "<b>" & e.Row.FCLiteral("LtlAsistencias").Text & "</b>"
End If
If e.Row.FCLiteral("LtlFaltas").Text.ToDouble = 0 Then
e.Row.FCLiteral("LtlFaltas").Text = ""
Else
e.Row.FCLiteral("LtlFaltas").Text = "<b>" & e.Row.FCLiteral("LtlFaltas").Text & "</b>"
End If
If e.Row.FCLiteral("LtlHorasExtras").Text.ToDouble = 0 Then
e.Row.FCLiteral("LtlHorasExtras").Text = ""
Else
e.Row.FCLiteral("LtlHorasExtras").Text = "<b>" & e.Row.FCLiteral("LtlHorasExtras").Text & "</b>"
End If
ElseIf e.Row.DBCampo("Turno") <> "" AndAlso e.Row.DBCampo("Nombre") = "" Then
e.Row.FCLiteral("LtlNombre").Text = "Turno: " & e.Row.DBCampo("Turno")
e.Row.Cells(0).ColumnSpan = 22
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
For i As Integer = 1 To 21
e.Row.Cells(i).Visible = False
Next
e.Row.FCCheckBox("ChkAplica").Visible = False : e.Row.FCTextBox("TxtBono").Visible = False : e.Row.FCTextBox("TxtPagoAdicional").Visible = False : e.Row.FCTextBox("TxtDescuentoAdicional").Visible = False
e.Row.FCLiteral("LtlAsistencias").Text = CType(CType(sender, GridView).DataSource, DataTable).SUM("Asistencias", "Turno = '" & e.Row.DBCampo("Turno") & "' AND Nombre <> ''").ToString
e.Row.FCLiteral("LtlFaltas").Text = CType(CType(sender, GridView).DataSource, DataTable).SUM("Faltas", "Turno = '" & e.Row.DBCampo("Turno") & "' AND Nombre <> ''").ToString
If e.Row.FCLiteral("LtlAsistencias").Text.ToDouble = 0 Then
e.Row.FCLiteral("LtlAsistencias").Text = ""
Else
e.Row.FCLiteral("LtlAsistencias").Text = "<b>" & e.Row.FCLiteral("LtlAsistencias").Text & "</b>"
End If
If e.Row.FCLiteral("LtlFaltas").Text.ToDouble = 0 Then
e.Row.FCLiteral("LtlFaltas").Text = ""
Else
e.Row.FCLiteral("LtlFaltas").Text = "<b>" & e.Row.FCLiteral("LtlFaltas").Text & "</b>"
End If
If e.Row.FCLiteral("LtlHorasExtras").Text.ToDouble = 0 Then
e.Row.FCLiteral("LtlHorasExtras").Text = ""
Else
e.Row.FCLiteral("LtlHorasExtras").Text = "<b>" & e.Row.FCLiteral("LtlHorasExtras").Text & "</b>"
End If
Else
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
Dim FechaI, FechaF As String
FechaI = String.Empty : FechaF = String.Empty
Dim Array() As String = DdlPeriodo.SelectedItem.Text.Split("-"c)
If Array.Length > 0 Then
FechaI = Array(1).Trim
FechaF = Array(2).Trim
End If
e.Row.FCLiteral("LtlNombre").Text = "<a class=""Texto"" href=""/RH/Personal.aspx?CvePersonal=" & e.Row.DBCampo("CvePersonal") & "&CveSubProyecto=" & e.Row.DBCampo("CveSubProyecto") & "&FechaI=" & FechaI & "&FechaF=" & FechaF & "&CveTurno=" & e.Row.DBCampo("CveTurno") & "&Opt=3"">" & e.Row.FCLiteral("LtlNombre").Text & "</a>"
If e.Row.DBCampo("Lu_HrsDobles").ToDouble = 0 Then e.Row.FCLiteral("LtlLu_HrsDobles").Text = ""
If e.Row.DBCampo("Ma_HrsDobles").ToDouble = 0 Then e.Row.FCLiteral("LtlMa_HrsDobles").Text = ""
If e.Row.DBCampo("Mi_HrsDobles").ToDouble = 0 Then e.Row.FCLiteral("LtlMi_HrsDobles").Text = ""
If e.Row.DBCampo("Ju_HrsDobles").ToDouble = 0 Then e.Row.FCLiteral("LtlJu_HrsDobles").Text = ""
If e.Row.DBCampo("Vi_HrsDobles").ToDouble = 0 Then e.Row.FCLiteral("LtlVi_HrsDobles").Text = ""
If e.Row.DBCampo("Sa_HrsDobles").ToDouble = 0 Then e.Row.FCLiteral("LtlSa_HrsDobles").Text = ""
If e.Row.DBCampo("Do_HrsDobles").ToDouble = 0 Then e.Row.FCLiteral("LtlDo_HrsDobles").Text = ""
If e.Row.DBCampo("Asistencias").ToDouble = 0 Then e.Row.FCLiteral("LtlAsistencias").Text = ""
If e.Row.DBCampo("Faltas").ToDouble = 0 Then e.Row.FCLiteral("LtlFaltas").Text = ""
If e.Row.DBCampo("HorasDobles").ToDouble = 0 Then e.Row.FCLiteral("LtlHorasExtras").Text = ""
End If
End If
End Sub
Protected Sub ImgExcel_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs) Handles ImgExcel.Click
GvDatos.ExportToExcel("PreNomina", TblHeader)
End Sub
Protected Sub BtnGuardarBono_Click(sender As Object, e As System.EventArgs) Handles BtnGuardarBono.Click
Dim ObjPersonal As New ClsRH
ObjPersonal.IniciaTransacSQL()
Dim OcurrioError As Boolean = False
For Each Row As GridViewRow In GvDatos.Rows
If Row.DataKey("CvePersonal") <> "" Then
If Not ObjPersonal.AddConcepto(Row.DataKey("CvePersonal").ToEntero, 14, Row.FCTextBox("TxtBono").Text.ToDouble, If(Row.FCCheckBox("ChkAplica").Checked, 1, 0), 0, 0, UsuarioActual.CveUsuario) Then
OcurrioError = True
ObjPersonal.RollBack()
Exit For
End If
'Pago Adicional
If Not ObjPersonal.AddConcepto(Row.DataKey("CvePersonal").ToEntero, 11, Row.FCTextBox("TxtPagoAdicional").Text.ToDouble, 1, 0, 0, UsuarioActual.CveUsuario) Then
OcurrioError = True
ObjPersonal.RollBack()
Exit For
End If
'Descuentos Varios
If Not ObjPersonal.AddConcepto(Row.DataKey("CvePersonal").ToEntero, 10, Row.FCTextBox("TxtDescuentoAdicional").Text.ToDouble, 1, 0, 0, UsuarioActual.CveUsuario) Then
OcurrioError = True
ObjPersonal.RollBack()
Exit For
End If
End If
Next
If Not OcurrioError Then
ObjPersonal.Commit()
Alert("La información se guardó correctamente.", TipoMensaje.MsgInformacion)
Else
Alert("Ocurrió un error al guardar la información.", TipoMensaje.MsgError)
End If
ObjPersonal.Dispose()
End Sub
End Class

View File

@@ -0,0 +1,354 @@
<%@ Page Title="Nómina - Pre Nómina" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PreNominaHistorial.aspx.vb" Inherits="Nomina_PreNominaHistorial" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<asp:ImageButton ID="ImgExcel" runat="server" ImageUrl="/Imagenes/IconoExcel.gif" Width="17px" Height="17px" /></td>
<td>
<asp:UpdatePanel ID="UpnTools" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<a id="HLImgImprimir" runat="server" href="#" class="Texto">
<img alt="Imprimir" src="/Imagenes/btnImprimir.gif" height="17px" width="17px" /></a>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Pre Nómina Historial
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" style="">
<div class="portlet-title portlet-filterT" style="">
<div class="titlefiltros caption ">
<ul class="list-inline">
<li>Tipo Período:
<asp:DropDownList ID="DdlTipoPeriodo" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="TipoPeriodo" DataValueField="CveTipoPeriodo" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 120px !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</li>
<li>Período:
<asp:DropDownList ID="DdlPeriodo" runat="server" AppendDataBoundItems="true" DataTextField="NumPeriodo" DataValueField="CvePeriodo" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 200px !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</li>
<li>Proyecto:
<asp:DropDownList ID="DdlProyecto" 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: 120px !important;" ValidationGroup="GrpGuardar">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</li>
</ul>
</div>
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" />
<a href="javascript:;" class="expand"></a>
<a onclick="document.getElementById('C_BtnConsultar').click();" class="reload"></a>
</div>
</div>
<div class="portlet-body" style="display: none;">
<ul class="list-inline">
<li>SubProyecto:
<asp:DropDownList ID="DdlSubProyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 200px !important;" ValidationGroup="GrpGuardar">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</li>
<li>Turno:
<asp:DropDownList ID="DdlTurno" runat="server" AppendDataBoundItems="true" DataTextField="Turno" DataValueField="CveTurno" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;" ValidationGroup="GrpGuardar">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</li>
</ul>
</div>
</div>
<table id="TblHeader" runat="server" class="table table-striped table-advance table-hover" width="1385px">
<thead>
<tr class="Titulos">
<th rowspan="2" width="250px">Nombre</th>
<th colspan="3">Lunes&nbsp;<asp:Literal ID="LtlLunes" runat="server"></asp:Literal></th>
<th colspan="3">Martes&nbsp;<asp:Literal ID="LtlMartes" runat="server"></asp:Literal></th>
<th colspan="3">Miércoles&nbsp;<asp:Literal ID="LtlMiercoles" runat="server"></asp:Literal></th>
<th colspan="3">Jueves&nbsp;<asp:Literal ID="LtlJueves" runat="server"></asp:Literal></th>
<th colspan="3">Viernes&nbsp;<asp:Literal ID="LtlViernes" runat="server"></asp:Literal></th>
<th colspan="3">Sábado&nbsp;<asp:Literal ID="LtlSabado" runat="server"></asp:Literal></th>
<th colspan="3">Domingo&nbsp;<asp:Literal ID="LtlDomingo" runat="server"></asp:Literal></th>
<th rowspan="2" width="70px">&nbsp;Asis</th>
<th rowspan="2" width="40px">Faltas</th>
<%--<td rowspan="2" width="60px">&nbsp;% Sem&nbsp;</td>--%>
<th rowspan="2" width="60px">&nbsp;Hrs Ext</th>
<%--<td rowspan="2" width="65px">&nbsp;Hrs Trip&nbsp;</td>--%>
<th rowspan="2">&nbsp;</th>
</tr>
<tr class="Titulos">
<th width="35px">Tipo</th>
<th width="30px">%</th>
<th width="40px">Hrs E</th>
<%--<td width="60px">Hrs Trip</td>--%>
<th width="35px">Tipo</th>
<th width="30px">%</th>
<th width="40px">Hrs E</th>
<%--<td width="60px">Hrs Trip</td>--%>
<th width="35px">Tipo</th>
<th width="30px">%</th>
<th width="40px">Hrs E</th>
<%--<td width="60px">Hrs Trip</td>--%>
<th width="35px">Tipo</th>
<th width="30px">%</th>
<th width="40px">Hrs E</th>
<%--<td width="60px">Hrs Trip</td>--%>
<th width="35px">Tipo</th>
<th width="30px">%</th>
<th width="40px">Hrs E</th>
<%--<td width="60px">Hrs Trip</td>--%>
<th width="35px">Tipo</th>
<th width="30px">%</th>
<th width="40px">Hrs E</th>
<%--<td width="60px">Hrs Trip</td>--%>
<th width="35px">Tipo</th>
<th width="30px">%</th>
<th width="40px">Hrs E</th>
<%--<td width="60px">Hrs Trip</td>--%>
</tr>
</thead>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CvePersonal" EmptyDataText="No se encontraron Ventas con los filtros especificados" ToolTip="Pre Nómina" Width="1385px" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlNombre" runat="server" Text='<%# Eval("Nombre") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="250px" />
</asp:TemplateField>
<%--Lunes--%>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlLu" runat="server" Text='<%# Eval("Lu") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="35px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlLu_Porcentaje" runat="server" Text='<%# Eval("Lu_Porcentaje") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="30px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlLu_HrsDobles" runat="server" Text='<%# Eval("Lu_HrsDobles") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="40px" />
</asp:TemplateField>
<%--<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlLu_HrsTriples" runat="server" Text='<%# Eval("Lu_HrsTriples") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="60px" />
</asp:TemplateField>--%>
<%--Martes--%>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlMa" runat="server" Text='<%# Eval("Ma") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="35px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlMa_Porcentaje" runat="server" Text='<%# Eval("Ma_Porcentaje") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="30px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlMa_HrsDobles" runat="server" Text='<%# Eval("Ma_HrsDobles") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="40px" />
</asp:TemplateField>
<%--<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlMa_HrsTriples" runat="server" Text='<%# Eval("Ma_HrsTriples") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="60px" />
</asp:TemplateField>--%>
<%--Miércoles--%>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlMi" runat="server" Text='<%# Eval("Mi") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="35px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlMi_Porcentaje" runat="server" Text='<%# Eval("Mi_Porcentaje") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="30px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlMi_HrsDobles" runat="server" Text='<%# Eval("Mi_HrsDobles") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="40px" />
</asp:TemplateField>
<%--<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlMi_HrsTriples" runat="server" Text='<%# Eval("Mi_HrsTriples") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="60px" />
</asp:TemplateField>--%>
<%--Jueves--%>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlJu" runat="server" Text='<%# Eval("Ju") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="35px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlJu_Porcentaje" runat="server" Text='<%# Eval("Ju_Porcentaje") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="30px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlJu_HrsDobles" runat="server" Text='<%# Eval("Ju_HrsDobles") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="40px" />
</asp:TemplateField>
<%--<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlJu_HrsTriples" runat="server" Text='<%# Eval("Ju_HrsTriples") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="60px" />
</asp:TemplateField>--%>
<%--Viernes--%>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlVi" runat="server" Text='<%# Eval("Vi") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="35px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlVi_Porcentaje" runat="server" Text='<%# Eval("Vi_Porcentaje") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="30px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlVi_HrsDobles" runat="server" Text='<%# Eval("Vi_HrsDobles") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="40px" />
</asp:TemplateField>
<%--<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlVi_HrsTriples" runat="server" Text='<%# Eval("Vi_HrsTriples") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="60px" />
</asp:TemplateField>--%>
<%--Sábado--%>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlSa" runat="server" Text='<%# Eval("Sa") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="35px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlSa_Porcentaje" runat="server" Text='<%# Eval("Sa_Porcentaje") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="30px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlSa_HrsDobles" runat="server" Text='<%# Eval("Sa_HrsDobles") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="40px" />
</asp:TemplateField>
<%--<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlSa_HrsTriples" runat="server" Text='<%# Eval("Sa_HrsTriples") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="60px" />
</asp:TemplateField>--%>
<%--Domingo--%>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlDo" runat="server" Text='<%# Eval("Do") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="35px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlDo_Porcentaje" runat="server" Text='<%# Eval("Do_Porcentaje") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="30px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlDo_HrsDobles" runat="server" Text='<%# Eval("Do_HrsDobles") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="40px" />
</asp:TemplateField>
<%--<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlDo_HrsTriples" runat="server" Text='<%# Eval("Do_HrsTriples") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="60px" />
</asp:TemplateField>--%>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlAsistencias" runat="server" Text='<%# Eval("Asistencias") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="70px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFaltas" runat="server" Text='<%# Eval("Faltas") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="40px" />
</asp:TemplateField>
<%--<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlPorSemanal" runat="server" Text='<%# Eval("Porcentaje", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="60px" />
</asp:TemplateField>--%>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlHorasExtras" runat="server" Text='<%# Eval("HorasDobles") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="60px" />
</asp:TemplateField>
<%--<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlHorasTriples" runat="server" Text='<%# Eval("HorasTriples") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="65px" />
</asp:TemplateField>--%>
<asp:TemplateField>
<ItemTemplate>
&nbsp;
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,188 @@
Option Strict On
Option Explicit On
Imports Extensiones
Imports System.Data
Partial Class Nomina_PreNominaHistorial
Inherits ClsPaginas
Private ReadOnly Property DTPeriodos As DataTable
Get
Return DirectCast(ViewState("DTPeriodos"), DataTable)
End Get
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
CargaTiposPeriodo()
CargaProyecto()
CargaTurnos()
End If
End Sub
#Region "CargaCombos"
Private Sub CargaTiposPeriodo()
DdlTipoPeriodo.DataSource = GlobalDTTipoPeriodo
DdlTipoPeriodo.DataBind()
End Sub
Private Sub CargaPeriodos()
Dim ObjPeriodos As New ClsNominas
If ObjPeriodos.GetPeriodos(DdlTipoPeriodo.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, -1, -1, -1) Then
ViewState("DTPeriodos") = ObjPeriodos.DtResultados
DdlPeriodo.DataSource = DTPeriodos
Else
DdlPeriodo.DataSource = Nothing
End If
ObjPeriodos.Dispose()
DdlPeriodo.DataBind()
DdlPeriodo.Items.Clear()
DdlPeriodo.DataBind()
DdlPeriodo.Items.Insert(0, New ListItem("Seleccione", "-1"))
End Sub
Private Sub CargaProyecto()
DdlProyecto.DataSource = GlobalDTProyectos(UsuarioActual.Empresa.CveEmpresa)
DdlProyecto.DataBind()
End Sub
Private Sub CargaSubProyecto()
DdlSubProyecto.Items.Clear()
DdlSubProyecto.DataSource = GlobalDTSubProyectos(DdlProyecto.SelectedValue.ToEntero)
DdlSubProyecto.DataBind()
DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1"))
End Sub
Private Sub CargaTurnos()
DdlTurno.DataSource = GlobalDTTurno.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
DdlTurno.DataBind()
End Sub
#End Region
Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlProyecto.SelectedIndexChanged
CargaSubProyecto()
End Sub
Protected Sub DdlTipoPeriodo_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlTipoPeriodo.SelectedIndexChanged
CargaPeriodos()
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click
If DdlPeriodo.SelectedValue <> "-1" Then
Dim ObjNomina As New ClsRH
Dim FechaI, FechaF As Date
FechaI = DTPeriodos.FiltraParametros("CvePeriodo = " & DdlPeriodo.SelectedValue).Rows(0)("FechaInicio").ToString.ToDate
FechaF = DTPeriodos.FiltraParametros("CvePeriodo = " & DdlPeriodo.SelectedValue).Rows(0)("FechaFin").ToString.ToDate
LtlLunes.Text = If(FechaI.Day.ToString.Length = 1, "0" & FechaI.Day.ToString, FechaI.Day.ToString)
LtlMartes.Text = If(FechaI.AddDays(1).Day.ToString.Length = 1, "0" & FechaI.AddDays(1).Day.ToString, FechaI.AddDays(1).Day.ToString)
LtlMiercoles.Text = If(FechaI.AddDays(2).Day.ToString.Length = 1, "0" & FechaI.AddDays(2).Day.ToString, FechaI.AddDays(2).Day.ToString)
LtlJueves.Text = If(FechaI.AddDays(3).Day.ToString.Length = 1, "0" & FechaI.AddDays(3).Day.ToString, FechaI.AddDays(3).Day.ToString)
LtlViernes.Text = If(FechaI.AddDays(4).Day.ToString.Length = 1, "0" & FechaI.AddDays(4).Day.ToString, FechaI.AddDays(4).Day.ToString)
LtlSabado.Text = If(FechaI.AddDays(5).Day.ToString.Length = 1, "0" & FechaI.AddDays(5).Day.ToString, FechaI.AddDays(5).Day.ToString)
LtlDomingo.Text = If(FechaI.AddDays(6).Day.ToString.Length = 1, "0" & FechaI.AddDays(6).Day.ToString, FechaI.AddDays(6).Day.ToString)
If ObjNomina.GetPreNominaHistorial(DdlSubProyecto.SelectedValue.ToEntero, DdlTurno.SelectedValue.ToEntero, FechaI, FechaF, UsuarioActual.CveEmpresa) Then
GvDatos.DataSource = ObjNomina.DtResultados
Else
GvDatos.DataSource = Nothing
End If
ObjNomina.Dispose()
GvDatos.DataBind()
UPDatos.Update()
HLImgImprimir.HRef = String.Format("/Nomina/RepPreNomina.aspx?CveSubProyecto={0}&CveTurno={1}&FechaI={2}&FechaF={3}&Periodo={4}", DdlSubProyecto.SelectedValue, DdlTurno.SelectedValue, FechaI.ToShortDateString, FechaF.ToShortDateString, DdlPeriodo.SelectedItem.Text)
UpnTools.Update()
Else
Alert("Debe de seleccionar el Periodo con el que se desea trabajar", TipoMensaje.MsgAdvertencia)
End If
End Sub
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("Turno") = "" AndAlso e.Row.DBCampo("Nombre") = "" Then
e.Row.FCLiteral("LtlNombre").Text = "<b>Sub Proyecto: " & e.Row.DBCampo("SubProyecto") & "<b>"
e.Row.Cells(0).ColumnSpan = 22
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
For i As Integer = 1 To 21
e.Row.Cells(i).Visible = False
Next
e.Row.FCLiteral("LtlAsistencias").Text = CType(CType(sender, GridView).DataSource, DataTable).SUM("Asistencias", "Nombre <> ''").ToString
e.Row.FCLiteral("LtlFaltas").Text = CType(CType(sender, GridView).DataSource, DataTable).SUM("Faltas", "Nombre <> ''").ToString
If e.Row.FCLiteral("LtlAsistencias").Text.ToDouble = 0 Then
e.Row.FCLiteral("LtlAsistencias").Text = ""
Else
e.Row.FCLiteral("LtlAsistencias").Text = "<b>" & e.Row.FCLiteral("LtlAsistencias").Text & "</b>"
End If
If e.Row.FCLiteral("LtlFaltas").Text.ToDouble = 0 Then
e.Row.FCLiteral("LtlFaltas").Text = ""
Else
e.Row.FCLiteral("LtlFaltas").Text = "<b>" & e.Row.FCLiteral("LtlFaltas").Text & "</b>"
End If
If e.Row.FCLiteral("LtlHorasExtras").Text.ToDouble = 0 Then
e.Row.FCLiteral("LtlHorasExtras").Text = ""
Else
e.Row.FCLiteral("LtlHorasExtras").Text = "<b>" & e.Row.FCLiteral("LtlHorasExtras").Text & "</b>"
End If
ElseIf e.Row.DBCampo("Turno") <> "" AndAlso e.Row.DBCampo("Nombre") = "" Then
e.Row.FCLiteral("LtlNombre").Text = "Turno: " & e.Row.DBCampo("Turno")
e.Row.Cells(0).ColumnSpan = 22
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
For i As Integer = 1 To 21
e.Row.Cells(i).Visible = False
Next
e.Row.FCLiteral("LtlAsistencias").Text = CType(CType(sender, GridView).DataSource, DataTable).SUM("Asistencias", "Turno = '" & e.Row.DBCampo("Turno") & "' AND Nombre <> ''").ToString
e.Row.FCLiteral("LtlFaltas").Text = CType(CType(sender, GridView).DataSource, DataTable).SUM("Faltas", "Turno = '" & e.Row.DBCampo("Turno") & "' AND Nombre <> ''").ToString
If e.Row.FCLiteral("LtlAsistencias").Text.ToDouble = 0 Then
e.Row.FCLiteral("LtlAsistencias").Text = ""
Else
e.Row.FCLiteral("LtlAsistencias").Text = "<b>" & e.Row.FCLiteral("LtlAsistencias").Text & "</b>"
End If
If e.Row.FCLiteral("LtlFaltas").Text.ToDouble = 0 Then
e.Row.FCLiteral("LtlFaltas").Text = ""
Else
e.Row.FCLiteral("LtlFaltas").Text = "<b>" & e.Row.FCLiteral("LtlFaltas").Text & "</b>"
End If
If e.Row.FCLiteral("LtlHorasExtras").Text.ToDouble = 0 Then
e.Row.FCLiteral("LtlHorasExtras").Text = ""
Else
e.Row.FCLiteral("LtlHorasExtras").Text = "<b>" & e.Row.FCLiteral("LtlHorasExtras").Text & "</b>"
End If
Else
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
Dim FechaI, FechaF As String
FechaI = String.Empty : FechaF = String.Empty
Dim Array() As String = DdlPeriodo.SelectedItem.Text.Split("-"c)
If Array.Length > 0 Then
FechaI = Array(1).Trim
FechaF = Array(2).Trim
End If
e.Row.FCLiteral("LtlNombre").Text = "<a class=""Texto"" href=""/RH/Personal.aspx?CvePersonal=" & e.Row.DBCampo("CvePersonal") & "&CveSubProyecto=" & e.Row.DBCampo("CveSubProyecto") & "&FechaI=" & FechaI & "&FechaF=" & FechaF & "&CveTurno=" & e.Row.DBCampo("CveTurno") & "&Opt=3"">" & e.Row.FCLiteral("LtlNombre").Text & "</a>"
If e.Row.DBCampo("Lu_HrsDobles").ToDouble = 0 Then e.Row.FCLiteral("LtlLu_HrsDobles").Text = ""
If e.Row.DBCampo("Ma_HrsDobles").ToDouble = 0 Then e.Row.FCLiteral("LtlMa_HrsDobles").Text = ""
If e.Row.DBCampo("Mi_HrsDobles").ToDouble = 0 Then e.Row.FCLiteral("LtlMi_HrsDobles").Text = ""
If e.Row.DBCampo("Ju_HrsDobles").ToDouble = 0 Then e.Row.FCLiteral("LtlJu_HrsDobles").Text = ""
If e.Row.DBCampo("Vi_HrsDobles").ToDouble = 0 Then e.Row.FCLiteral("LtlVi_HrsDobles").Text = ""
If e.Row.DBCampo("Sa_HrsDobles").ToDouble = 0 Then e.Row.FCLiteral("LtlSa_HrsDobles").Text = ""
If e.Row.DBCampo("Do_HrsDobles").ToDouble = 0 Then e.Row.FCLiteral("LtlDo_HrsDobles").Text = ""
If e.Row.DBCampo("Asistencias").ToDouble = 0 Then e.Row.FCLiteral("LtlAsistencias").Text = ""
If e.Row.DBCampo("Faltas").ToDouble = 0 Then e.Row.FCLiteral("LtlFaltas").Text = ""
If e.Row.DBCampo("HorasDobles").ToDouble = 0 Then e.Row.FCLiteral("LtlHorasExtras").Text = ""
End If
End If
End Sub
Protected Sub ImgExcel_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs) Handles ImgExcel.Click
GvDatos.ExportToExcel("PreNomina", TblHeader)
End Sub
End Class

244
Nomina/RegistroNomina.aspx Normal file
View File

@@ -0,0 +1,244 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RegistroNomina.aspx.vb" Inherits="Nomina_RegistroNomina" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Registro de Nómina
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="padding-top: 20px;">
<tr>
<td align="left">
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table border="0" class="contenido" width="550px">
<tr>
<td style="vertical-align: top;">
<div>
<fieldset>
<legend><b>Datos del Empleado</b></legend>
<table>
<tr>
<td>Año:</td>
<td>
<asp:DropDownList ID="DdlEjercicios" runat="server" CssClass="select2me" Style="width: 90px !important;" ValidationGroup="GrpGuardar" AutoPostBack="True">
</asp:DropDownList>
</tr>
<tr>
<td>Tipo Periodo:</td>
<td>
<asp:DropDownList ID="DdlTipoPeriodo" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="TipoPeriodo" DataValueField="CveTipoPeriodo" CssClass="select2me" Style="width: 100px !important;" ValidationGroup="GrpGuardar">
</asp:DropDownList>
</tr>
<tr>
<td>Periodo:</td>
<td>
<asp:DropDownList ID="DdlPeriodo" runat="server" AutoPostBack="true" DataTextField="NominaEstatus" DataValueField="CvePeriodo" ValidationGroup="GrpGuardar" CssClass="select2me" Style="width: 200px !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td width="80px">Empleado:</td>
<td width="230px">
<asp:DropDownList ID="DdlPersonal" runat="server" AutoPostBack="true" AppendDataBoundItems="true" DataTextField="Nombre" DataValueField="CvePersonal" ValidationGroup="GrpGuardar" CssClass="select2me" Style="width: 200px !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>&nbsp;&nbsp;&nbsp;<asp:HyperLink ID="HplIr" runat="server">Ir</asp:HyperLink>
</td>
</tr>
</table>
</fieldset>
</div>
</td>
<td>
<asp:Panel ID="PnlMasivo" runat="server" GroupingText="<b>Actualización Masiva</b>" Visible="False" Width="450px">
<table>
<tr>
<td>Año:</td>
<td>
<asp:DropDownList ID="DdlEjerciciosMasivo" runat="server" CssClass="select2me" Style="width: 90px !important;" ValidationGroup="GrpGuardar" AutoPostBack="True">
</asp:DropDownList>
</tr>
<tr>
<td>Tipo Periodo:</td>
<td>
<asp:DropDownList ID="DdlTipoPeriodoMasivo" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="TipoPeriodo" DataValueField="CveTipoPeriodo" CssClass="select2me" Style="width: 100px !important;" ValidationGroup="GrpGuardar">
</asp:DropDownList>
</tr>
<tr>
<td>Periodo:</td>
<td>
<asp:DropDownList ID="DdlPeriodoMasivo" runat="server" DataTextField="NominaEstatus" DataValueField="CvePeriodo" ValidationGroup="GrpGuardar" CssClass="select2me" Style="width: 200px !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td width="80px">Concepto:</td>
<td width="220px">
<asp:DropDownList ID="DdlConceptosMasivo" runat="server" AppendDataBoundItems="true" DataTextField="Concepto" DataValueField="CveConcepto" ValidationGroup="GrpGuardar" CssClass="select2me" Style="width: 200px !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>&nbsp;
</td>
</tr>
<tr>
<td width="80px">Salario:</td>
<td width="220px">
<asp:DropDownList ID="DdlSalarioMasivo" runat="server" AppendDataBoundItems="true" DataTextField="SalarioDiario" DataValueField="SalarioDiario" ValidationGroup="GrpGuardar" CssClass="select2me" Style="width: 100px !important;">
</asp:DropDownList>&nbsp;
</td>
</tr>
<tr>
<td width="80px">Importe:</td>
<td width="220px">
<asp:TextBox ID="TxtImporteMasivo" runat="server" Width="80px"></asp:TextBox>&nbsp;
</td>
</tr>
<tr>
<td colspan="2" style="text-align: center;">
<asp:Button ID="BtnAplicarMasivo" runat="server" Text="Aplicar Cambio Masivo" class="btn btn-primary" /></td>
</tr>
</table>
</asp:Panel>
</td>
</tr>
<tr>
<td colspan="2">
<fieldset>
<legend><b>Movimientos</b></legend>
<asp:UpdatePanel ID="UpRegistros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Panel ID="PnlTitulosMovimientos" runat="server" DefaultButton="LbAgregar">
<table style="width: 100%;" class="table table-striped table-advance table-hover">
<thead>
<tr class="Titulos TextTab">
<th width="20px">#</th>
<th width="230px">Tipo Concepto</th>
<th>Importe</th>
<th width="170px">Comandos</th>
</tr>
</thead>
<tr class="TextTab">
<td>&nbsp;</td>
<td>
<asp:DropDownList ID="DdlTipo" runat="server" AppendDataBoundItems="true" AutoPostBack="true" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 230px !important;">
<asp:ListItem Selected="True" Text="Seleccione el Tipo (Todos)" Value="-1"></asp:ListItem>
<asp:ListItem Text="Percepciones" Value="P"></asp:ListItem>
<asp:ListItem Text="Deducciones" Value="D"></asp:ListItem>
<asp:ListItem Text="Obligaciones" Value="O"></asp:ListItem>
</asp:DropDownList>
<asp:DropDownList ID="DdlConcepto" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Concepto" DataValueField="CveConcepto" ValidationGroup="GprAgrega" CssClass="select2me" Style="width: 230px !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Text="*** Actualizar listado de Conceptos ***" Value="-2"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVConcepto" runat="server" ControlToValidate="DdlConcepto" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Concepto''</b> es necesario, por favor seleccione uno." ValidationGroup="GprAgrega"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOConcepto" runat="server" HighlightCssClass="vco" TargetControlID="RFVConcepto" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td align="center">
<asp:TextBox ID="TxtImporte" runat="server" CausesValidation="true" ClientIDMode="Static" MaxLength="12" ValidationGroup="GprAgrega" Width="80px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVImporte" runat="server" ControlToValidate="TxtImporte" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Importe''</b> es necesario, por favor ingréselo." ValidationGroup="GprAgrega"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVImporte" runat="server" ControlToValidate="TxtImporte" Display="None" ErrorMessage="El campo <b>''Importe''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico)." Operator="DataTypeCheck" Type="Currency" ValidationGroup="GprAgrega"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCImporte" runat="server" HighlightCssClass="vco" TargetControlID="RFVImporte" Width="300px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="VCImporteA" runat="server" HighlightCssClass="vco" TargetControlID="CVImporte" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td style="text-align: center;">
<asp:LinkButton ID="LbAgregar" ValidationGroup="GprAgrega" runat="server" Text="Agregar" /></td>
</tr>
</table>
</asp:Panel>
<asp:GridView ID="GvMovimientos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveNominaDetalle" EmptyDataText="Sin Movimientos de Nomina agregados" ShowFooter="True" ToolTip="Listado de Movimientos de Nomina" Width="100%" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:BoundField ReadOnly="True">
<ItemStyle Width="20px" />
</asp:BoundField>
<asp:TemplateField>
<ItemTemplate>
<span style="border-bottom: 1px solid gray;">
<asp:Label ID="LblTipoGV" runat="server" Text='<%# Eval("TipoD") %>' Width="220px"></asp:Label></span>
<br />
<asp:Label ID="LblConceptoGV" runat="server" Text='<%# Eval("Concepto") %>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="220px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Importe">
<ItemTemplate>
<asp:Literal ID="LtlImporteGV" runat="server" Text='<%# Eval("Importe","{0:N2}")%>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtImporteGV" runat="server" Text='<%# Eval("Importe")%>' CausesValidation="true" ClientIDMode="Static" MaxLength="12" ValidationGroup="GprGV" Width="80px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVImporteGV" runat="server" ControlToValidate="TxtImporteGV" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Importe''</b> es necesario, por favor ingréselo." ValidationGroup="GprGV"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVImporteGV" runat="server" ControlToValidate="TxtImporteGV" Display="None" ErrorMessage="El campo <b>''Importe''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico)." Operator="DataTypeCheck" Type="Currency" ValidationGroup="GprGV"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCImporteGV" runat="server" HighlightCssClass="vco" TargetControlID="RFVImporteGV" Width="300px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="VCImporteAGV" runat="server" HighlightCssClass="vco" TargetControlID="CVImporteGV" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
<FooterTemplate>
<asp:Label ID="LblImporte" runat="server" Text=""></asp:Label>
</FooterTemplate>
<ItemStyle Width="100px" />
<FooterStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<center>
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
&nbsp;<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
</center>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" OnClientClick="javascript:return C();" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false" HeaderText="">
<ItemTemplate>
</ItemTemplate>
<ItemStyle Width="55px" />
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
<HeaderStyle CssClass="TextTab1" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</fieldset>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
<tr>
<td align="center">
<asp:UpdatePanel ID="UpGuardar" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Button ID="BtnGuardar" runat="server" Text="Guardar" ValidationGroup="GrpGuardar" class="btn btn-primary" Visible="false" />
<asp:Button ID="BtnEliminar" runat="server" Text="Eliminar" Visible="false" class="btn btn-success" />
<asp:ValidationSummary ID="VS" runat="server" DisplayMode="BulletList" ShowSummary="true" ValidationGroup="GrpGuardar" />
<asp:Button ID="BtnCancelar" runat="server" Text="Cancelar" Visible="false" class="btn btn-success" OnClientClick="javascript:window.location.href='/OS/CatOrdenesServicios.aspx';return false" />
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script language="javascript" type="text/javascript">
function C() {
return confirm('¿Está seguro que desea eliminar el Concepto de Nómina?');
}
</script>
</asp:Content>

View File

@@ -0,0 +1,542 @@
Option Explicit On
Option Strict On
Imports Extensiones
Imports System.Data
'Imports msExcel = Microsoft.Office.Interop.Excel
'Imports VBIDE
Partial Class Nomina_RegistroNomina
Inherits ClsPaginas
#Region "Propiedades"
Private Shared missing As Object = System.Reflection.Missing.Value
Private ReadOnly Property CvePeriodo As Integer
Get
Return ViewState("CvePeriodo").ToString.ToEntero
End Get
End Property
Private ReadOnly Property CvePersonal As Integer
Get
Return ViewState("CvePersonal").ToString.ToEntero
End Get
End Property
Private ReadOnly Property CveTipoPeriodo As Integer
Get
Return ViewState("CveTipoPeriodo").ToString.ToEntero
End Get
End Property
Private ReadOnly Property CveNomina As Integer
Get
Return ViewState("CveNomina").ToString.ToEntero
End Get
End Property
Private Property TmpDT As DataTable
Get
Return CType(ViewState("TmpDT"), DataTable)
End Get
Set(value As DataTable)
ViewState("TmpDT") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CargaConceptos()
CargaPersonal()
CargaTipoPeriodo()
CreaDT()
DdlEjercicios.Items.Add(New ListItem(UsuarioActual.Empresa.EjercicioActual.ToString, UsuarioActual.Empresa.EjercicioActual.ToString))
DdlEjercicios.Items.Add(New ListItem((UsuarioActual.Empresa.EjercicioActual - 1).ToString, (UsuarioActual.Empresa.EjercicioActual - 1).ToString))
DdlEjerciciosMasivo.Items.Add(New ListItem(UsuarioActual.Empresa.EjercicioActual.ToString, UsuarioActual.Empresa.EjercicioActual.ToString))
DdlEjerciciosMasivo.Items.Add(New ListItem((UsuarioActual.Empresa.EjercicioActual - 1).ToString, (UsuarioActual.Empresa.EjercicioActual - 1).ToString))
If Request("CvePeriodo") IsNot Nothing AndAlso IsNumeric(Request("CvePeriodo")) AndAlso Request("CvePeriodo").ToEntero > 0 Then
ViewState("CvePeriodo") = Request("CvePeriodo")
DdlPeriodo.SelectedValue = CvePeriodo.ToString
Else
ViewState("CvePeriodo") = -1
End If
If Request("CvePersonal") IsNot Nothing AndAlso IsNumeric(Request("CvePersonal")) AndAlso Request("CvePersonal").ToEntero > 0 Then
ViewState("CvePersonal") = Request("CvePersonal")
DdlPersonal.SelectedValue = CvePersonal.ToString
Else
ViewState("CvePersonal") = -1
End If
If CvePeriodo > 0 And CvePersonal > 0 Then
CargaDatos()
End If
If UsuarioActual.CveEmpresa.Contiene(8, 15) Then
'busco los diferentes salarios
Dim ObjPersonal As New ClsRH
If ObjPersonal.GetPersonal(-1, UsuarioActual.CveEmpresa) Then
If ObjPersonal.DtResultados.Rows.Count > 0 Then
DdlSalarioMasivo.DataSource = ObjPersonal.DtResultados.FiltraParametros("", "SalarioDiario", DistinctColumns:={"SalarioDiario"})
DdlSalarioMasivo.DataBind()
End If
End If
ObjPersonal.Dispose()
PnlMasivo.Visible = True
DdlTipoPeriodoMasivo.DataSource = GlobalDTTipoPeriodo
DdlTipoPeriodoMasivo.DataBind()
CargaPeriodosMasivo()
DdlConceptosMasivo.DataSource = GlobalDTNomConceptos(UsuarioActual.CveEmpresa)
DdlConceptosMasivo.DataBind()
End If
CargaPeriodos()
End If
End Sub
Private Sub CreaDT()
TmpDT = New DataTable
TmpDT.Columns.Add("Consecutivo", GetType(Integer))
TmpDT.Columns.Add("CveNominaDetalle", GetType(Integer))
TmpDT.Columns.Add("Tipo", GetType(String))
TmpDT.Columns.Add("TipoD", GetType(String))
TmpDT.Columns.Add("CveConcepto", GetType(Integer))
TmpDT.Columns.Add("Concepto", GetType(String))
TmpDT.Columns.Add("Importe", GetType(Decimal))
End Sub
Private Sub CargaConceptos()
DdlConcepto.DataSource = GlobalDTNomConceptos(UsuarioActual.CveEmpresa)
DdlConcepto.DataBind()
End Sub
Private Sub CargaPersonal()
Dim ObjPersonal As New ClsRH
If ObjPersonal.GetPersonal(-1, UsuarioActual.CveEmpresa) Then
DdlPersonal.DataSource = ObjPersonal.DtResultados.FiltraParametros("", "NombreCompleto")
DdlPersonal.DataBind()
End If
ObjPersonal.Dispose()
End Sub
Private Sub CargaTipoPeriodo()
DdlTipoPeriodo.DataSource = GlobalDTTipoPeriodo
DdlTipoPeriodo.DataBind()
End Sub
Private Sub CargaPeriodos()
Dim ObjPeriodos As New ClsNominas
If ObjPeriodos.GetPeriodos(DdlTipoPeriodo.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlEjercicios.SelectedValue.ToEntero, -1, -1) Then
DdlPeriodo.DataSource = ObjPeriodos.DtResultados
DdlPeriodo.DataBind()
ViewState("CvePeriodo") = DdlPeriodo.SelectedValue.ToEntero
End If
ObjPeriodos.Dispose()
End Sub
Private Sub CargaPeriodosMasivo()
Dim ObjPeriodos As New ClsNominas
If ObjPeriodos.GetPeriodos(DdlTipoPeriodoMasivo.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlEjerciciosMasivo.SelectedValue.ToEntero, -1, -1) Then
DdlPeriodoMasivo.DataSource = ObjPeriodos.DtResultados
DdlPeriodoMasivo.DataBind()
End If
ObjPeriodos.Dispose()
End Sub
Private Sub CargaDatos()
Dim ObjNomina As New ClsNominas
Dim ID As Integer = 1
TmpDT.Rows.Clear()
ViewState("CveNomina") = 0
If ObjNomina.GetNom_Nominas(-1, CvePersonal, CvePeriodo, -1, UsuarioActual.CveEmpresa) Then
If ObjNomina.DtResultados.Rows.Count > 0 Then
ViewState("CveNomina") = ObjNomina.DtResultados.Rows(0)("CveNomina").ToString
If ObjNomina.DtResultados.Rows(0)("SeTimbro").ToString = "True" Then
Alert("Nómina Timbrada", TipoMensaje.MsgInformacion)
GvMovimientos.Columns(3).Visible = False
GvMovimientos.Columns(4).Visible = False
Else
GvMovimientos.Columns(3).Visible = True
GvMovimientos.Columns(4).Visible = True
End If
If ObjNomina.GetNom_NominasDetalles(-1, CvePersonal, CvePeriodo, "-1") Then
GvMovimientos.DataSource = ObjNomina.DtResultados
GvMovimientos.DataBind()
If ObjNomina.DtResultados IsNot Nothing Then
For Each Row As DataRow In ObjNomina.DtResultados.Rows
AddMovimientoNomina(ID, Row("CveNominaDetalle").ToString.ToEntero, Row("Tipo").ToString, Row("TipoD").ToString, Row("CveConcepto").ToString.ToEntero, Row("Concepto").ToString, Row("Importe").ToString.ToDecimal)
ID = ID + 1
Next
End If
End If
Else
Alert("Personal no registrado en nomina seleccionada", TipoMensaje.MsgAdvertencia)
End If
End If
ObjNomina.Dispose()
End Sub
Protected Sub LbAgregar_Click(sender As Object, e As EventArgs) Handles LbAgregar.Click
If DdlConcepto.SelectedValue.ToEntero > 0 Then
Dim Consecutivo As Integer = TmpDT.Rows.Count + 1
AddMovimientoNomina(Consecutivo, -1, DdlTipo.SelectedValue, DdlTipo.SelectedItem.Text, DdlConcepto.SelectedValue.ToEntero, DdlConcepto.SelectedItem.Text, TxtImporte.Text.ToDecimal)
Dim Nom As New ClsNominas
If Nom.AddNom_NominasDetalles(CveNomina, DdlPeriodo.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero, DdlConcepto.SelectedValue.ToEntero, TxtImporte.Text.ToDecimal, TxtImporte.Text.ToDecimal, 0) Then
Alert("Movimiento Agregado", TipoMensaje.MsgInformacion)
End If
Nom.Dispose()
DdlTipo.SelectedIndex = 0
DdlConcepto.SelectedIndex = 0
TxtImporte.Text = ""
Else
Alert("Seleccione un Concepto de Nómina", TipoMensaje.MsgAdvertencia)
End If
End Sub
Private Sub AddMovimientoNomina(Consecutivo As Integer, CveNominaDetalle As Integer, Tipo As String, TipoD As String, CveConcepto As Integer, Concepto As String, Importe As Decimal)
Dim Row As DataRow = Nothing
Row = TmpDT.NewRow()
Row("Consecutivo") = Consecutivo
Row("CveNominaDetalle") = CveNominaDetalle
Row("Tipo") = Tipo
Row("TipoD") = TipoD
Row("CveConcepto") = CveConcepto
Row("Concepto") = Concepto
Row("Importe") = Importe
TmpDT.Rows.Add(Row)
GvMovimientos.DataSource = TmpDT
GvMovimientos.DataBind()
End Sub
'Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
' Guardar()
'End Sub
'Protected Sub Guardar()
' Dim ObjNomina As New ClsNominas()
' ObjNomina.IniciaTransacSQL()
' Dim Errores As Boolean = False
' For Each Row As DataRow In TmpDT.Rows
' If Errores = False Then
' Dim CveMovimientoNomina As Integer = Row("CveNominaDetalle").ToString.ToEntero
' Dim CvePeriodo As Integer = DdlPeriodo.SelectedValue.ToEntero
' Dim CvePersonal As Integer = DdlPersonal.SelectedValue.ToEntero
' Dim CveConcepto As Integer = Row("CveConcepto").ToString.ToEntero
' Dim Importe As Decimal = Row("Importe").ToString.ToDecimal
' ViewState("CvePeriodo") = CvePeriodo
' ViewState("CvePersonal") = CvePersonal
' If CveMovimientoNomina = -1 Then
' Errores = Not ObjNomina.AddNom_NominasDetalles(1, CvePeriodo, CvePersonal, CveConcepto, Importe, Importe, 0)
' Else
' Errores = Not ObjNomina.UpdateNom_NominasDetalles(CveMovimientoNomina, Importe)
' End If
' End If
' Next
' If Errores = False Then
' ObjNomina.Commit()
' Else
' ObjNomina.RollBack()
' End If
' ObjNomina.Dispose()
' GeneraPDF()
'End Sub
#Region "GeneraPDFs"
'Private Function GetMacro() As String
' Dim SB As New StringBuilder
' SB.Append(" Sub AddRow(Row As String) " & vbLf)
' SB.Append(" Rows(Row & "":"" & Row).Select " & vbLf)
' SB.Append(" Selection.Copy " & vbLf)
' SB.Append(" Selection.Insert Shift:=xlDown " & vbLf)
' SB.Append(" End Sub ")
' Return SB.ToString
'End Function
'Private Sub GeneraPDF()
' Dim TC As Double = 1
' Dim Excel As msExcel.Application = New msExcel.Application()
' Dim VB_Module As VBComponent = Nothing
' Excel.Visible = True
' Excel.ScreenUpdating = True
' Excel.DisplayAlerts = True
' If Not IO.File.Exists(UsuarioActual.Empresa.Ruta & "Formatos\Nomina.xlsm") Then
' IO.File.Copy(String.Format("{0}Empresas\Grales\Nomina.xlsm", AppDomain.CurrentDomain.BaseDirectory), UsuarioActual.Empresa.Ruta & "Formatos\Nomina.xlsm", False)
' End If
' Dim ArchivoBase As New System.IO.FileInfo(UsuarioActual.Empresa.Ruta & "Formatos\Nomina.xlsm")
' ArchivoBase.CopyTo(UsuarioActual.Empresa.Ruta & "Formatos\" & CvePersonal & "_" & CvePeriodo & ".xlsm", True)
' Dim ArchivoTemp As New System.IO.FileInfo(UsuarioActual.Empresa.Ruta & "Formatos\" & CvePersonal & "_" & CvePeriodo & ".xlsm")
' Dim Libro As msExcel.Workbook = Excel.Workbooks.Open(ArchivoTemp.FullName, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing)
' Libro.Activate()
' Dim Hoja As msExcel.Worksheet
' Hoja = CType(Libro.Worksheets(1), Microsoft.Office.Interop.Excel.Worksheet)
' Hoja.Visible = Microsoft.Office.Interop.Excel.XlSheetVisibility.xlSheetVisible
' Hoja.Activate()
' Try
' 'Agregar los datos generales del RH
' Dim objPersonal As New ClsRH
' If objPersonal.GetPersonal(CvePersonal, UsuarioActual.CveEmpresa) Then
' Hoja.Range("C5:C5").Value = objPersonal.CvePersonal.ToString
' Hoja.Range("C6:C6").Value = objPersonal.NombreCompleto
' Hoja.Range("C7:C7").Value = objPersonal.RFC
' Dim Departamento As DataRow = GlobalDTDepartamentos().FiltraParametros("CveDepartamento = " & objPersonal.CveDepartamento)(0)
' Hoja.Range("C8:C8").Value = Departamento("Departamento").ToString
' Dim Puesto As DataRow = GlobalDTPuestos().FiltraParametros("CvePuesto = " & objPersonal.CvePuesto)(0)
' Hoja.Range("C9:C9").Value = Puesto("Puesto").ToString
' End If
' objPersonal.Dispose()
' 'Agregar los datos del Periodo
' Dim objPeriodos As New ClsNominas
' If objPeriodos.GetPeriodos(-1, UsuarioActual.CveEmpresa, -1, -1, -1) Then
' 'Hoja.Range("I6:I6").Value = DIAS PAGADOS
' Hoja.Range("K6:K6").Value = objPeriodos.Numero.ToString
' 'Hoja.Range("I7:I7").Value = FALTAS
' Hoja.Range("I8:I8").Value = objPeriodos.FechaInicio
' Hoja.Range("K8:K8").Value = objPeriodos.FechaFin
' 'Hoja.Range("I9:I9").Value = RECIBO NUMERO
' End If
' objPeriodos.Dispose()
' VB_Module = CType(Libro.VBProject.VBComponents.Add(Microsoft.Vbe.Interop.vbext_ComponentType.vbext_ct_StdModule), VBComponent)
' VB_Module.CodeModule.AddFromString(GetMacro)
' Dim Celda As Integer
' Dim AddedRow As Integer = 0
' 'Movimientos de Deducciones
' Dim ObjNomina As New ClsNominas
' If ObjNomina.GetNom_NominasDetalles(-1, CvePersonal, CvePeriodo, "") Then
' 'Percepciones
' Dim dtPercepciones As DataTable = ObjNomina.DtResultados.FiltraParametros("Tipo = 'P'")
' Dim dtDeducciones As DataTable = ObjNomina.DtResultados.FiltraParametros("Tipo = 'D'")
' 'Insertar percepciones
' Celda = 13
' For Each Row As DataRow In dtPercepciones.Rows
' Hoja.Range("A" & Celda & ":A" & Celda).Value = Row("Codigo").ToString
' Hoja.Range("B" & Celda & ":B" & Celda).Value = Row("Concepto").ToString
' Hoja.Range("E" & Celda & ":E" & Celda).Value = Row("Importe").ToString
' Celda = Celda + 1
' Next
' 'Insertar deducciones
' Celda = 13
' For Each Row As DataRow In dtDeducciones.Rows
' Hoja.Range("G" & Celda & ":G" & Celda).Value = Row("Codigo").ToString
' Hoja.Range("H" & Celda & ":H" & Celda).Value = Row("Concepto").ToString
' Hoja.Range("K" & Celda & ":K" & Celda).Value = Row("Importe").ToString
' Celda = Celda + 1
' Next
' Libro.Save()
' Libro.Application.DisplayAlerts = False
' Libro.Application.ScreenUpdating = False
' End If
' ObjNomina.Dispose()
' Dim EsVistaPrevia As Boolean = True
' 'Exportar PDF
' Dim pdfFileOut As String = UsuarioActual.Empresa.Ruta & "PDF\Nom_" & CvePersonal & "_" & CvePeriodo & ".pdf"
' Dim outputFileName As Object = pdfFileOut
' Dim fileFormat As msExcel.XlFixedFormatType = msExcel.XlFixedFormatType.xlTypePDF
' Hoja.ExportAsFixedFormat(fileFormat, outputFileName, missing, missing, missing, missing, missing, missing, missing)
' Catch ex As Exception
' Alert("Ocurrió un error" & ex.Message, TipoMensaje.MsgError)
' End Try
' System.Runtime.InteropServices.Marshal.ReleaseComObject(Hoja)
' Hoja = Nothing
' Dim saveChanges As Object = msExcel.XlSaveAction.xlDoNotSaveChanges
' CType(Libro, msExcel._Workbook).Close(saveChanges, missing, missing)
' System.Runtime.InteropServices.Marshal.ReleaseComObject(Libro)
' Libro = Nothing
' Excel.Quit()
' System.Runtime.InteropServices.Marshal.ReleaseComObject(Excel)
' Excel = Nothing
' GC.Collect()
' GC.WaitForPendingFinalizers()
' ArchivoTemp.Delete()
' Dim Descargas As New StringBuilder()
' Descargas.AppendFormat("<li><a class=""Texto"" target=""_blank"" onclick=""window.open('/Empresas/{0}/PDF/Nom_{1}_{2}.pdf?{3}')"" href=""#"">PDF</a></li>", UsuarioActual.CveEmpresa, CvePersonal, CvePeriodo, Now.Ticks)
' Alert("<br />El Registro de Nómina<b><span style='font-size=26px;'></span></b>, se generó correctamente.<br /><br /><br />Descargas:<ul>" & Descargas.ToString & "</ul>", TipoMensaje.MsgInformacion)
'End Sub
#End Region
Protected Sub DdlPersonal_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPersonal.SelectedIndexChanged
ViewState("CvePersonal") = DdlPersonal.SelectedValue
If CvePeriodo > 0 And CvePersonal > 0 Then
CargaDatos()
HplIr.NavigateUrl = String.Format("/RH/Personal.aspx?CvePersonal={0}", CvePersonal)
Else
GvMovimientos.DataSource = Nothing
GvMovimientos.DataBind()
End If
End Sub
Protected Sub DdlPeriodo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPeriodo.SelectedIndexChanged
ViewState("CvePeriodo") = DdlPeriodo.SelectedValue
If CvePeriodo > 0 And CvePersonal > 0 Then
CargaDatos()
Else
GvMovimientos.DataSource = Nothing
GvMovimientos.DataBind()
End If
End Sub
Protected Sub GvMovimientos_RowCancelingEdit(sender As Object, e As GridViewCancelEditEventArgs) Handles GvMovimientos.RowCancelingEdit
GvMovimientos.EditIndex = -1
GvMovimientos.DataSource = TmpDT
GvMovimientos.DataBind()
End Sub
Protected Sub GvMovimientos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvMovimientos.RowDataBound
If e.Row.RowType = DataControlRowType.Footer Then
Dim Suma As Double = 0
Suma = TmpDT.SUM("Importe", "Tipo = 'P'").ToString.ToDouble - TmpDT.SUM("Importe", "Tipo = 'D'").ToString.ToDouble
e.Row.FCLabel("LblImporte").Text = "$" & Suma.FormatoNumero()
End If
End Sub
Protected Sub GvMovimientos_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvMovimientos.RowDeleting
Dim Nom As New ClsNominas
If Nom.RemoveNom_NominasDetalles(GvMovimientos.DataKeys(e.RowIndex).Value.ToString().ToEntero) Then
Alert("Movimiento Eliminado", TipoMensaje.MsgInformacion)
End If
Nom.Dispose()
End Sub
Protected Sub GvMovimientos_RowEditing(sender As Object, e As GridViewEditEventArgs) Handles GvMovimientos.RowEditing
GvMovimientos.EditIndex = e.NewEditIndex
GvMovimientos.DataSource = TmpDT
GvMovimientos.DataBind()
GvMovimientos.Rows(e.NewEditIndex).FCTextBox("TxtImporteGV").Focus()
End Sub
Protected Sub GvMovimientos_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GvMovimientos.RowUpdating
Dim Importe As Decimal = GvMovimientos.Rows(e.RowIndex).FCTextBox("TxtImporteGV").Text.ToDecimal
TmpDT.Rows(e.RowIndex)("Importe") = Importe
Dim Nom As New ClsNominas
If Nom.UpdateNom_NominasDetalles(GvMovimientos.DataKeys(e.RowIndex).Value.ToString().ToEntero, Importe, 0, Importe) Then
Alert("Movimiento Actualizado", TipoMensaje.MsgInformacion)
End If
Nom.Dispose()
GvMovimientos.EditIndex = -1
GvMovimientos.DataSource = TmpDT
GvMovimientos.DataBind()
End Sub
Protected Sub DdlTipoPeriodo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoPeriodo.SelectedIndexChanged
CargaPeriodos()
End Sub
Protected Sub DdlTipoPeriodoMasivo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoPeriodoMasivo.SelectedIndexChanged
CargaPeriodosMasivo()
End Sub
Protected Sub BtnAplicarMasivo_Click(sender As Object, e As EventArgs) Handles BtnAplicarMasivo.Click
Dim ImporteGravado As Double = 0
Dim ImporteExento As Double = TxtImporteMasivo.Text.ToDouble
Dim dr As DataRow = GlobalDTNomConceptos(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveConcepto = {0}", DdlConceptosMasivo.SelectedValue))
If dr IsNot Nothing Then
If dr("Tipo").ToString = "P" Then
ImporteGravado = TxtImporteMasivo.Text.ToDouble
ImporteExento = 0
End If
End If
Dim Nom As New ClsNominas
If Nom.UpdateNom_NominasDetallesMasivoSueldo(DdlPeriodoMasivo.SelectedValue.ToEntero, DdlConceptosMasivo.SelectedValue.ToEntero, DdlSalarioMasivo.SelectedValue.ToDouble, TxtImporteMasivo.Text.ToDouble, ImporteExento, ImporteGravado, UsuarioActual.CveEmpresa) Then
Alert("El cambio fue aplicado", TipoMensaje.MsgInformacion)
End If
Nom.Dispose()
End Sub
Protected Sub DdlEjerciciosMasivo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlEjerciciosMasivo.SelectedIndexChanged
CargaPeriodosMasivo()
End Sub
Protected Sub DdlEjercicios_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlEjercicios.SelectedIndexChanged
CargaPeriodos()
End Sub
'Protected Sub DdlPeriodoMasivo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPeriodoMasivo.SelectedIndexChanged
' CargaPeriodosMasivo()
'End Sub
End Class

View File

@@ -0,0 +1,134 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepConceptosAcumulados.aspx.vb" Inherits="Nomina_RepConceptosAcumulados" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
<asp:ImageButton ID="ImgImprimir" runat="server" ImageUrl="/Imagenes/btnImprimir.gif" Width="17px" Height="17px" Visible="false" Enabled="false" />
<asp:ImageButton ID="ImgExcel" runat="server" ImageUrl="/Imagenes/IconoExcel.gif" Width="17px" Height="17px" />
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Reporte Conceptos Acumulados
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<br />
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="50%">
<fieldset>
<legend><b>Datos del Concepto</b></legend>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="80px">Concepto: </td>
<td>
<asp:DropDownList ID="DdlConcepto" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Concepto" DataValueField="CveConcepto" Class="table-group-action-input form-control input-inline input-small input-sm select2me" Style="width: 270px !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
<td width="80px">Codigo: </td>
<td width="140px">
<asp:Label ID="LblCodigo" runat="server"></asp:Label></td>
</tr>
<tr>
<td>Tipo: </td>
<td>
<asp:Label ID="LblTipo" runat="server"></asp:Label></td>
<td></td>
<td>
<asp:Label ID="LblFormula" runat="server" Visible="False"></asp:Label></td>
</tr>
</table>
</fieldset>
</td>
<td width="50%">
<fieldset>
<legend><b>Datos del Periodo</b></legend>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="80px">Ejercicio: </td>
<td>
<asp:DropDownList ID="DDlEjercicio" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="TipoPeriodo" DataValueField="CveTipoPeriodo" Class="table-group-action-input form-control input-inline input-small input-sm select2me" Style="width: 220px !important;">
<asp:ListItem Text="2016" Value="2016"></asp:ListItem>
<asp:ListItem Text="2017" Value="2017"></asp:ListItem>
<asp:ListItem Text="2018" Value="2018"></asp:ListItem>
<asp:ListItem Text="2019" Value="2019"></asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td width="80px">Tipo Periodo: </td>
<td>
<asp:DropDownList ID="DdlTipoPeriodo" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="TipoPeriodo" DataValueField="CveTipoPeriodo" Class="table-group-action-input form-control input-inline input-small input-sm select2me" Style="width: 220px !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td width="80px">Periodo: </td>
<td width="140px">
<asp:DropDownList ID="DdlPeriodo" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NominaEstatus" DataValueField="CvePeriodo" Class="table-group-action-input form-control input-inline input-small input-sm select2me" Style="width: 220px !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList></td>
</tr>
</table>
</fieldset>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Movimientos de Percepciones y/o Deduciones" ToolTip="Listado de Percepciones y/o Deducciones" CssClass="table table-striped table-advance table-hover" GridLines="None">
<Columns>
<asp:TemplateField>
<HeaderTemplate>
Nombre
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlNombre" runat="server" Text='<%# Eval("Nombre") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
Acumulado Actual
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlActual" runat="server" Text='<%# Eval("Actual", "{0:N2}")%>'></asp:Literal>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
Acumulado Anterior
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlAnterior" runat="server" Text='<%# Eval("Anterior", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
Acumulado Anual
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlAnual" runat="server" Text='<%# Eval("Anual", "{0:N2}")%>'></asp:Literal>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,133 @@
Option Explicit On
Option Strict On
Imports Extensiones
Imports System.Data
Partial Class Nomina_RepConceptosAcumulados
Inherits ClsPaginas
#Region "Propiedades"
Private ReadOnly Property CveConcepto As Integer
Get
Return ViewState("CveConcepto").ToString.ToEntero
End Get
End Property
Private ReadOnly Property CveTipoPeriodo As Integer
Get
Return ViewState("CveTipoPeriodo").ToString.ToEntero
End Get
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
CargaConceptos()
CargaTiposPeriodos()
If Request("CveConcepto") IsNot Nothing AndAlso IsNumeric(Request("CveConcepto")) AndAlso Request("CveConcepto").ToEntero > 0 Then
ViewState("CveConcepto") = Request("CveConcepto")
DdlConcepto.SelectedValue = CveConcepto.ToString
Else
ViewState("CveConcepto") = -1
End If
If Request("CveTipoPeriodo") IsNot Nothing AndAlso IsNumeric(Request("CveTipoPeriodo")) AndAlso Request("CveTipoPeriodo").ToEntero > 0 Then
ViewState("CveTipoPeriodo") = Request("CveTipoPeriodo")
DdlTipoPeriodo.SelectedValue = CveTipoPeriodo.ToString
Else
ViewState("CveTipoPeriodo") = -1
End If
CargaDatos()
End If
End Sub
Private Sub CargaConceptos()
DdlConcepto.DataSource = GlobalDTNomConceptos(UsuarioActual.CveEmpresa).FiltraParametros("", "Concepto")
DdlConcepto.DataBind()
End Sub
Private Sub CargaTiposPeriodos()
Dim ObjTiposPeriodos As New ClsNominas
If ObjTiposPeriodos.GetTiposPeriodos() Then
DdlTipoPeriodo.DataSource = ObjTiposPeriodos.DtResultados
End If
ObjTiposPeriodos.Dispose()
DdlTipoPeriodo.DataBind()
End Sub
Private Sub CargaDatos()
If CveConcepto > 0 And CveTipoPeriodo > 0 Then
Dim ObjNomina As New ClsNominas()
If ObjNomina.GetRepConceptosAcumulados(CveConcepto, DDlEjercicio.SelectedValue.ToEntero, CveTipoPeriodo, DdlPeriodo.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
GvDatos.DataSource = ObjNomina.DtResultados
Else
GvDatos.DataSource = Nothing
End If
ObjNomina.Dispose()
GvDatos.DataBind()
UPDatos.Update()
End If
End Sub
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
Dim Css As String = "Texto"
If e.Row.RowIndex = 0 Then
'e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
'e.Row.Cells(0).Width = Unit.Pixel(200)
'e.Row.Cells(1).Width = Unit.Pixel(100)
'e.Row.Cells(2).Width = Unit.Pixel(100)
'e.Row.Cells(3).Width = Unit.Pixel(100)
e.Row.CssClass = "Totales"
Css = "Totales"
End If
End If
End Sub
Protected Sub ImgExcel_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs) Handles ImgExcel.Click
GvDatos.ExportToExcel("ReporteConceptosAcumulados" & Now.ToShortDateString)
End Sub
Protected Sub DdlTipoPeriodo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoPeriodo.SelectedIndexChanged
ViewState("CveTipoPeriodo") = DdlTipoPeriodo.SelectedValue
'Saca el periodo activo
CargaPeriodos(DDlEjercicio.SelectedValue.ToEntero, DdlTipoPeriodo.SelectedValue.ToEntero)
CargaDatos()
End Sub
Private Sub CargaPeriodos(Ejercicio As Integer, CveTipoPeriodo As Integer)
Dim ObjTiposPeriodos As New ClsNominas
If ObjTiposPeriodos.GetPeriodos(CveTipoPeriodo, UsuarioActual.CveEmpresa, Ejercicio, -1, -1) Then
DdlPeriodo.DataSource = ObjTiposPeriodos.DtResultados
End If
ObjTiposPeriodos.Dispose()
DdlPeriodo.DataBind()
End Sub
Protected Sub DdlConcepto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlConcepto.SelectedIndexChanged
ViewState("CveConcepto") = DdlConcepto.SelectedValue
Dim Concepto As DataRow = GlobalDTNomConceptos(UsuarioActual.CveEmpresa).FiltraParametros("CveConcepto = " & CveConcepto)(0)
LblCodigo.Text = Concepto("Codigo").ToString
LblFormula.Text = Concepto("Formula").ToString
LblTipo.Text = Concepto("TipoD").ToString
CargaDatos()
End Sub
Private Sub DdlPeriodo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPeriodo.SelectedIndexChanged
CargaDatos()
End Sub
End Class

View File

@@ -0,0 +1,155 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepPersonalAcumulados.aspx.vb" Inherits="Nomina_RepPersonalAcumulados" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
<asp:ImageButton ID="ImgImprimir" runat="server" ImageUrl="/Imagenes/btnImprimir.gif" Width="17px" Height="17px" Visible="false" Enabled="false" />
<asp:ImageButton ID="ImgExcel" runat="server" ImageUrl="/Imagenes/IconoExcel.gif" Width="17px" Height="17px" />
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Reporte Personal Acumulados
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPBusqueda" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<fieldset>
<legend>Buscar Personal</legend>
<asp:DropDownList ID="DdlPersonal" runat="server" AutoPostBack="true" AppendDataBoundItems="true" DataTextField="Nombre" DataValueField="CvePersonal" Class="table-group-action-input form-control input-inline input-small input-sm select2me" Style="width: 450px !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<div>
&nbsp;
</div>
</fieldset>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPEmpleado" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="70%">
<fieldset>
<legend><b>Datos del Empleado</b></legend>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="100px">Nombre: </td>
<td>
<asp:Label ID="LblNombre" runat="server"></asp:Label></td>
<td width="80px">Codigo: </td>
<td width="140px">
<asp:Label ID="LblCodigo" runat="server"></asp:Label></td>
</tr>
<tr>
<td>Departamento: </td>
<td>
<asp:Label ID="LblDepartamento" runat="server"></asp:Label></td>
<td>RFC: </td>
<td>
<asp:Label ID="LblRFC" runat="server"></asp:Label></td>
</tr>
<tr>
<td>Puesto: </td>
<td>
<asp:Label ID="LblPuesto" runat="server"></asp:Label></td>
<td>CURP: </td>
<td>
<asp:Label ID="LblCURP" runat="server"></asp:Label></td>
</tr>
</table>
</fieldset>
</td>
<td width="30%">
<fieldset>
<legend><b>Periodo Actual</b></legend>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="80px">Periodo: </td>
<td>
<asp:Label ID="LblTipoPeriodo" runat="server"></asp:Label></td>
<td width="80px">Numero: </td>
<td>
<asp:Label ID="LblNumero" runat="server"></asp:Label></td>
</tr>
<tr>
<td>Inicio: </td>
<td>
<asp:Label ID="LblFechaInicio" runat="server"></asp:Label></td>
<td>Fin: </td>
<td>
<asp:Label ID="LblFechaFin" runat="server"></asp:Label></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</fieldset>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Movimientos de Percepciones y/o Deduciones" ToolTip="Listado de Percepciones y/o Deducciones" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>
<HeaderTemplate>
Tipo
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlTipo" runat="server" Text='<%# Eval("Tipo") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
Concepto
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlConcepto" runat="server" Text='<%# Eval("Concepto") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
Acumulado Actual
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlActual" runat="server" Text='<%# Eval("Actual", "{0:N2}")%>'></asp:Literal>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
Acumulado Anterior
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlAnterior" runat="server" Text='<%# Eval("Anterior", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
Acumulado Anual
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlAnual" runat="server" Text='<%# Eval("Anual", "{0:N2}")%>'></asp:Literal>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,133 @@
Option Explicit On
Option Strict On
Imports Extensiones
Imports System.Data
Partial Class Nomina_RepPersonalAcumulados
Inherits ClsPaginas
#Region "Propiedades"
Private ReadOnly Property CvePersonal As Integer
Get
Return ViewState("CvePersonal").ToString.ToEntero
End Get
End Property
Private ReadOnly Property CveTipoPeriodo As Integer
Get
Return ViewState("CveTipoPeriodo").ToString.ToEntero
End Get
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
CargaPersonal()
If Request("CvePersonal") IsNot Nothing AndAlso IsNumeric(Request("CvePersonal")) AndAlso Request("CvePersonal").ToEntero > 0 Then
ViewState("CvePersonal") = Request("CvePersonal")
CargaPersona()
CargarPeriodo()
CargaDatos()
DdlPersonal.SelectedValue = CvePersonal.ToString
End If
End If
End Sub
Private Sub CargaPersonal()
Dim ObjPersonal As New ClsRH
If ObjPersonal.GetPersonal(-1, UsuarioActual.CveEmpresa) Then
DdlPersonal.DataSource = ObjPersonal.DtResultados
DdlPersonal.DataBind()
End If
ObjPersonal.Dispose()
End Sub
Private Sub CargaPersona()
Dim ObjPersonal As New ClsRH
If CvePersonal > 0 AndAlso ObjPersonal.GetPersonal(CvePersonal, UsuarioActual.CveEmpresa) Then
ViewState("CveTipoPeriodo") = ObjPersonal.CveTipoPeriodo
LblNombre.Text = ObjPersonal.NombreCompleto
LblCodigo.Text = ObjPersonal.Codigo
Dim Departamento As DataRow = GlobalDTDepartamentos().FiltraParametros("CveDepartamento = " & ObjPersonal.CveDepartamento)(0)
LblDepartamento.Text = Departamento("Departamento").ToString
Dim Puesto As DataRow = GlobalDTRHPuestos(UsuarioActual.CveEmpresa).FiltraParametros("CvePuesto = " & ObjPersonal.CvePuesto)(0)
LblPuesto.Text = Puesto("Puesto").ToString
LblRFC.Text = ObjPersonal.RFC
LblCURP.Text = ObjPersonal.CURP
Else
ViewState("CveTipoPeriodo") = -1
LblNombre.Text = ""
LblCodigo.Text = ""
LblDepartamento.Text = ""
LblPuesto.Text = ""
LblRFC.Text = ""
LblCURP.Text = ""
End If
ObjPersonal.Dispose()
End Sub
Private Sub CargarPeriodo()
Dim objPeriodo As New ClsNominas
If objPeriodo.GetPeriodos(CveTipoPeriodo, UsuarioActual.CveEmpresa, -1, -1, -1) Then
LblTipoPeriodo.Text = objPeriodo.TipoPeriodo
LblNumero.Text = objPeriodo.Numero.ToString
LblFechaInicio.Text = objPeriodo.FechaInicio.ToShortDateString
LblFechaFin.Text = objPeriodo.FechaFin.ToShortDateString
End If
objPeriodo.Dispose()
End Sub
Private Sub CargaDatos()
Dim ObjNomina As New ClsNominas()
If ObjNomina.GetRepPersonalAcumulados(CvePersonal, UsuarioActual.Empresa.EjercicioActual) Then
GvDatos.DataSource = ObjNomina.DtResultados
Else
GvDatos.DataSource = Nothing
End If
ObjNomina.Dispose()
GvDatos.DataBind()
End Sub
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
Dim Css As String = "Texto"
If e.Row.RowIndex = 0 Then
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(0).Width = Unit.Pixel(100)
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(1).Width = Unit.Pixel(200)
e.Row.Cells(2).Width = Unit.Pixel(100)
e.Row.Cells(3).Width = Unit.Pixel(100)
e.Row.Cells(4).Width = Unit.Pixel(100)
e.Row.CssClass = "Totales"
Css = "Totales"
End If
End If
End Sub
Protected Sub ImgExcel_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs) Handles ImgExcel.Click
GvDatos.ExportToExcel("ReportePersonalAcumulados" & Now.ToShortDateString)
End Sub
Protected Sub DdlPersonal_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPersonal.SelectedIndexChanged
ViewState("CvePersonal") = DdlPersonal.SelectedValue
CargaPersona()
CargaDatos()
CargarPeriodo()
UPEmpleado.Update()
UPDatos.Update()
End Sub
End Class

326
Nomina/RepPreNomina.aspx Normal file
View File

@@ -0,0 +1,326 @@
<%@ Page Title="Nómina - Pre Nómina" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepPreNomina.aspx.vb" Inherits="Nomina_RepPreNomina" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
<asp:ImageButton ID="ImgExcel" runat="server" ImageUrl="/Imagenes/IconoExcel.gif" Width="17px" Height="17px" />
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Pre Nómina
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<table id="Tbl" runat="server" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table id="TblHeader" runat="server" class="table table-striped table-advance table-hover" width="1505px">
<thead>
<tr class="Titulos">
<th rowspan="2" width="180px">Nombre</th>
<th colspan="3">Lunes&nbsp;<asp:Literal ID="LtlLunes" runat="server"></asp:Literal></th>
<th colspan="3">Martes&nbsp;<asp:Literal ID="LtlMartes" runat="server"></asp:Literal></th>
<th colspan="3">Miércoles&nbsp;<asp:Literal ID="LtlMiercoles" runat="server"></asp:Literal></th>
<th colspan="3">Jueves&nbsp;<asp:Literal ID="LtlJueves" runat="server"></asp:Literal></th>
<th colspan="3">Viernes&nbsp;<asp:Literal ID="LtlViernes" runat="server"></asp:Literal></th>
<th colspan="3">Sábado&nbsp;<asp:Literal ID="LtlSabado" runat="server"></asp:Literal></th>
<th colspan="3">Domingo&nbsp;<asp:Literal ID="LtlDomingo" runat="server"></asp:Literal></th>
<th rowspan="2" width="70px">&nbsp;Asis</th>
<th rowspan="2" width="40px">Faltas</th>
<th rowspan="2" width="60px">&nbsp;Hrs Ext</th>
<th rowspan="2" width="60px">&nbsp;Bono</th>
<th rowspan="2" width="60px">&nbsp;Pago Adi</th>
<th rowspan="2" width="120px">&nbsp;Firma</th>
<th rowspan="2" width="70px">&nbsp;Corección&nbsp;</th>
<th rowspan="2">&nbsp;</th>
</tr>
<tr class="Titulos">
<th width="35px">Tipo</th>
<th width="30px">%</th>
<th width="40px">Hrs E</th>
<th width="35px">Tipo</th>
<th width="30px">%</th>
<th width="40px">Hrs E</th>
<th width="35px">Tipo</th>
<th width="30px">%</th>
<th width="40px">Hrs E</th>
<th width="35px">Tipo</th>
<th width="30px">%</th>
<th width="40px">Hrs E</th>
<th width="35px">Tipo</th>
<th width="30px">%</th>
<th width="40px">Hrs E</th>
<th width="35px">Tipo</th>
<th width="30px">%</th>
<th width="40px">Hrs E</th>
<th width="35px">Tipo</th>
<th width="30px">%</th>
<th width="40px">Hrs E</th>
</tr>
</thead>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CvePersonal" ShowHeader="false" EmptyDataText="No se encontraron Ventas con los filtros especificados" ToolTip="Pre Nómina" Width="1505px" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlNombre" runat="server" Text='<%# Eval("Nombre") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="180px" />
</asp:TemplateField>
<%--Lunes--%>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlLu" runat="server" Text='<%# Eval("Lu") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="35px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlLu_Porcentaje" runat="server" Text='<%# Eval("Lu_Porcentaje") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="30px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlLu_HrsDobles" runat="server" Text='<%# Eval("Lu_HrsDobles") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="40px" />
</asp:TemplateField>
<%--Martes--%>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlMa" runat="server" Text='<%# Eval("Ma") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="35px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlMa_Porcentaje" runat="server" Text='<%# Eval("Ma_Porcentaje") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="30px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlMa_HrsDobles" runat="server" Text='<%# Eval("Ma_HrsDobles") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="40px" />
</asp:TemplateField>
<%--Miércoles--%>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlMi" runat="server" Text='<%# Eval("Mi") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="35px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlMi_Porcentaje" runat="server" Text='<%# Eval("Mi_Porcentaje") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="30px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlMi_HrsDobles" runat="server" Text='<%# Eval("Mi_HrsDobles") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="40px" />
</asp:TemplateField>
<%--Jueves--%>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlJu" runat="server" Text='<%# Eval("Ju") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="35px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlJu_Porcentaje" runat="server" Text='<%# Eval("Ju_Porcentaje") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="30px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlJu_HrsDobles" runat="server" Text='<%# Eval("Ju_HrsDobles") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="40px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlVi" runat="server" Text='<%# Eval("Vi") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="35px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlVi_Porcentaje" runat="server" Text='<%# Eval("Vi_Porcentaje") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="30px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlVi_HrsDobles" runat="server" Text='<%# Eval("Vi_HrsDobles") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="40px" />
</asp:TemplateField>
<%--Sábado--%>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlSa" runat="server" Text='<%# Eval("Sa") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="35px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlSa_Porcentaje" runat="server" Text='<%# Eval("Sa_Porcentaje") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="30px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlSa_HrsDobles" runat="server" Text='<%# Eval("Sa_HrsDobles") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="40px" />
</asp:TemplateField>
<%--Domingo--%>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlDo" runat="server" Text='<%# Eval("Do") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="35px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlDo_Porcentaje" runat="server" Text='<%# Eval("Do_Porcentaje") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="30px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlDo_HrsDobles" runat="server" Text='<%# Eval("Do_HrsDobles") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="40px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlAsistencias" runat="server" Text='<%# Eval("Asistencias") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="70px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFaltas" runat="server" Text='<%# Eval("Faltas") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="40px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlHorasExtras" runat="server" Text='<%# Eval("HorasDobles") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="60px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlBono" runat="server" Text='<%# If(Eval("AplicaBono").ToString = "True", Eval("Importe", "{0:N2}"), "") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="60px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlPagoAdi" runat="server" Text='<%# Eval("PagoAdicional", "{0:###,###.##}") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="60px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFirma" runat="server"></asp:Literal>
</ItemTemplate>
<ItemStyle Width="120px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlCorección" runat="server">&nbsp;</asp:Literal>
</ItemTemplate>
<ItemStyle Width="70px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
&nbsp;
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
<br />
<center><b>CUALQUIER CORRECCIÓN DEBE SER ESPECIFICADA AL FINAL DE LA HOJA</b></center>
<br />
<table class="table table-striped table-advance table-hover" style="width: 100%">
<tr>
<th align="center" class="Titulos">CORRECCIONES</th>
</tr>
</table>
<asp:GridView ID="GVAnomalias" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Ventas con los filtros especificados" ToolTip="Pre Nómina" Width="1300px" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>
<HeaderTemplate>NOMBRE</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlNombre" runat="server"></asp:Literal>
</ItemTemplate>
<ItemStyle Width="200px" />
<HeaderStyle Width="200px" />
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
DESCRIPCIÓN COMPLETA DE LA CORRECCIÓN<br />
(HRS EXTRA, FALTAS, ASISTENCIAS, ETC)
</HeaderTemplate>
<ItemTemplate>
&nbsp;
</ItemTemplate>
<ItemStyle Width="200px" />
<HeaderStyle Width="200px" />
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>DESCRIPCIÓN COMPLETA DE LA CAUSA</HeaderTemplate>
<ItemTemplate>
&nbsp;
</ItemTemplate>
<ItemStyle Width="200px" />
<HeaderStyle Width="200px" />
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>FIRMA DEL SUPERVISOR INVOLUCRADO</HeaderTemplate>
<ItemTemplate>
&nbsp;
</ItemTemplate>
<ItemStyle Width="120px" />
<HeaderStyle Width="120px" />
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>FIRMA DEL OPERADOR</HeaderTemplate>
<ItemTemplate>
&nbsp;
</ItemTemplate>
<ItemStyle Width="120px" />
<HeaderStyle Width="120px" />
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

159
Nomina/RepPreNomina.aspx.vb Normal file
View File

@@ -0,0 +1,159 @@
Option Strict On
Option Explicit On
Imports Extensiones
Imports System.Data
Partial Class Nomina_RepPreNomina
Inherits ClsPaginas
Private ReadOnly Property DTPeriodos As DataTable
Get
Return DirectCast(ViewState("DTPeriodos"), DataTable)
End Get
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
CargaDatos()
End If
End Sub
Private Sub CargaDatos()
Dim ObjNomina As New ClsRH
Dim FechaI, FechaF As Date
FechaI = CDate(Request("FechaI"))
FechaF = CDate(Request("FechaF"))
LtlLunes.Text = If(FechaI.Day.ToString.Length = 1, "0" & FechaI.Day.ToString, FechaI.Day.ToString)
LtlMartes.Text = If(FechaI.AddDays(1).Day.ToString.Length = 1, "0" & FechaI.AddDays(1).Day.ToString, FechaI.AddDays(1).Day.ToString)
LtlMiercoles.Text = If(FechaI.AddDays(2).Day.ToString.Length = 1, "0" & FechaI.AddDays(2).Day.ToString, FechaI.AddDays(2).Day.ToString)
LtlJueves.Text = If(FechaI.AddDays(3).Day.ToString.Length = 1, "0" & FechaI.AddDays(3).Day.ToString, FechaI.AddDays(3).Day.ToString)
LtlViernes.Text = If(FechaI.AddDays(4).Day.ToString.Length = 1, "0" & FechaI.AddDays(4).Day.ToString, FechaI.AddDays(4).Day.ToString)
LtlSabado.Text = If(FechaI.AddDays(5).Day.ToString.Length = 1, "0" & FechaI.AddDays(5).Day.ToString, FechaI.AddDays(5).Day.ToString)
LtlDomingo.Text = If(FechaI.AddDays(6).Day.ToString.Length = 1, "0" & FechaI.AddDays(6).Day.ToString, FechaI.AddDays(6).Day.ToString)
If ObjNomina.GetPreNomina(Request("CveProyecto").ToEntero, Request("CveSubProyecto").ToEntero, Request("CveTurno").ToEntero, FechaI, FechaF, UsuarioActual.CveEmpresa) Then
GvDatos.DataSource = ObjNomina.DtResultados
Dim Arr() As String = {"", "", "", "", ""}
GVAnomalias.DataSource = Arr
Else
GvDatos.DataSource = Nothing
GVAnomalias.DataSource = Nothing
End If
ObjNomina.Dispose()
GvDatos.DataBind()
GVAnomalias.DataBind()
UPDatos.Update()
End Sub
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("Turno") = "" AndAlso e.Row.DBCampo("Nombre") = "" Then
e.Row.FCLiteral("LtlNombre").Text = "<b>Sub Proyecto: " & e.Row.DBCampo("SubProyecto") & "<b>"
e.Row.Cells(0).ColumnSpan = 22
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
For i As Integer = 1 To 21
e.Row.Cells(i).Visible = False
Next
e.Row.FCLiteral("LtlAsistencias").Text = CType(CType(sender, GridView).DataSource, DataTable).SUM("Asistencias", "Nombre <> ''").ToString
e.Row.FCLiteral("LtlFaltas").Text = CType(CType(sender, GridView).DataSource, DataTable).SUM("Faltas", "Nombre <> ''").ToString
If e.Row.FCLiteral("LtlAsistencias").Text.ToDouble = 0 Then
e.Row.FCLiteral("LtlAsistencias").Text = ""
Else
e.Row.FCLiteral("LtlAsistencias").Text = "<b>" & e.Row.FCLiteral("LtlAsistencias").Text & "</b>"
End If
If e.Row.FCLiteral("LtlFaltas").Text.ToDouble = 0 Then
e.Row.FCLiteral("LtlFaltas").Text = ""
Else
e.Row.FCLiteral("LtlFaltas").Text = "<b>" & e.Row.FCLiteral("LtlFaltas").Text & "</b>"
End If
If e.Row.FCLiteral("LtlHorasExtras").Text.ToDouble = 0 Then
e.Row.FCLiteral("LtlHorasExtras").Text = ""
Else
e.Row.FCLiteral("LtlHorasExtras").Text = "<b>" & e.Row.FCLiteral("LtlHorasExtras").Text & "</b>"
End If
ElseIf e.Row.DBCampo("Turno") <> "" AndAlso e.Row.DBCampo("Nombre") = "" Then
e.Row.FCLiteral("LtlNombre").Text = "Turno: " & e.Row.DBCampo("Turno")
e.Row.Cells(0).ColumnSpan = 22
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
For i As Integer = 1 To 21
e.Row.Cells(i).Visible = False
Next
e.Row.FCLiteral("LtlAsistencias").Text = CType(CType(sender, GridView).DataSource, DataTable).SUM("Asistencias", "Turno = '" & e.Row.DBCampo("Turno") & "' AND Nombre <> ''").ToString
e.Row.FCLiteral("LtlFaltas").Text = CType(CType(sender, GridView).DataSource, DataTable).SUM("Faltas", "Turno = '" & e.Row.DBCampo("Turno") & "' AND Nombre <> ''").ToString
If e.Row.FCLiteral("LtlAsistencias").Text.ToDouble = 0 Then
e.Row.FCLiteral("LtlAsistencias").Text = ""
Else
e.Row.FCLiteral("LtlAsistencias").Text = "<b>" & e.Row.FCLiteral("LtlAsistencias").Text & "</b>"
End If
If e.Row.FCLiteral("LtlFaltas").Text.ToDouble = 0 Then
e.Row.FCLiteral("LtlFaltas").Text = ""
Else
e.Row.FCLiteral("LtlFaltas").Text = "<b>" & e.Row.FCLiteral("LtlFaltas").Text & "</b>"
End If
If e.Row.FCLiteral("LtlHorasExtras").Text.ToDouble = 0 Then
e.Row.FCLiteral("LtlHorasExtras").Text = ""
Else
e.Row.FCLiteral("LtlHorasExtras").Text = "<b>" & e.Row.FCLiteral("LtlHorasExtras").Text & "</b>"
End If
Else
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
Dim FechaI, FechaF As String
FechaI = String.Empty : FechaF = String.Empty
Dim Array() As String = Request("Periodo").Split("-"c)
If Array.Length > 0 Then
FechaI = Array(1).Trim
FechaF = Array(2).Trim
End If
'e.Row.FCLiteral("LtlNombre").Text = "<a class=""Texto"" href=""/RH/Personal.aspx?CvePersonal=" & e.Row.DBCampo("CvePersonal") & "&CveSubProyecto=" & e.Row.DBCampo("CveSubProyecto") & "&FechaI=" & FechaI & "&FechaF=" & FechaF & "&CveTurno=" & e.Row.DBCampo("CveTurno") & "&Opt=3"">" & e.Row.FCLiteral("LtlNombre").Text & "</a>"
If e.Row.DBCampo("Lu_HrsDobles").ToDouble = 0 Then e.Row.FCLiteral("LtlLu_HrsDobles").Text = ""
If e.Row.DBCampo("Ma_HrsDobles").ToDouble = 0 Then e.Row.FCLiteral("LtlMa_HrsDobles").Text = ""
If e.Row.DBCampo("Mi_HrsDobles").ToDouble = 0 Then e.Row.FCLiteral("LtlMi_HrsDobles").Text = ""
If e.Row.DBCampo("Ju_HrsDobles").ToDouble = 0 Then e.Row.FCLiteral("LtlJu_HrsDobles").Text = ""
If e.Row.DBCampo("Vi_HrsDobles").ToDouble = 0 Then e.Row.FCLiteral("LtlVi_HrsDobles").Text = ""
If e.Row.DBCampo("Sa_HrsDobles").ToDouble = 0 Then e.Row.FCLiteral("LtlSa_HrsDobles").Text = ""
If e.Row.DBCampo("Do_HrsDobles").ToDouble = 0 Then e.Row.FCLiteral("LtlDo_HrsDobles").Text = ""
If e.Row.DBCampo("Asistencias").ToDouble = 0 Then e.Row.FCLiteral("LtlAsistencias").Text = ""
If e.Row.DBCampo("Faltas").ToDouble = 0 Then e.Row.FCLiteral("LtlFaltas").Text = ""
If e.Row.DBCampo("HorasDobles").ToDouble = 0 Then e.Row.FCLiteral("LtlHorasExtras").Text = ""
End If
End If
End Sub
'Protected Sub GVAnomalias_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVAnomalias.RowDataBound
' If e.Row.RowType = DataControlRowType.DataRow Then
' If e.Row.DBCampo("Turno") = "" AndAlso e.Row.DBCampo("Nombre") = "" Then
' e.Row.FCLiteral("LtlNombre").Text = "<b>Sub Proyecto: " & e.Row.DBCampo("SubProyecto") & "<b>"
' e.Row.Cells(0).ColumnSpan = 4
' e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
' For i As Integer = 1 To 4
' e.Row.Cells(i).Visible = False
' Next
' ElseIf e.Row.DBCampo("Turno") <> "" AndAlso e.Row.DBCampo("Nombre") = "" Then
' e.Row.FCLiteral("LtlNombre").Text = "Turno: " & e.Row.DBCampo("Turno")
' e.Row.Cells(0).ColumnSpan = 4
' e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
' For i As Integer = 1 To 4
' e.Row.Cells(i).Visible = False
' Next
' Else
' e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
' End If
' End If
'End Sub
Protected Sub ImgExcel_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs) Handles ImgExcel.Click
Tbl.ExportToExcel("PreNomina")
End Sub
End Class

201
Nomina/ReportePTU.aspx Normal file
View File

@@ -0,0 +1,201 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="ReportePTU.aspx.vb" Inherits="Nomina_ReportePTU" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.GVCalcularUtilidades tr td:nth-child(2) {
text-align: center;
}
.GVCalcularUtilidades tr td:nth-child(n+3) {
text-align: right;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Reparto de Utilidades
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
Reparto de Utilidades
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="titlefiltros caption">
<div class="row">
<label class="col-md-1" style="width: 60px !important;">Ejercicio: </label>
<div class="col-md-2" style="width: 140px !important;">
<asp:DropDownList ID="DdlEjercicios" DataTextField="Ejercicio" OnSelectedIndexChanged="DdlEjercicios_SelectedIndexChanged" AutoPostBack="true" DataValueField="Ejercicio" runat="server" Style="width: 120px !important;" CssClass="select2me"></asp:DropDownList>
</div>
<label class="col-md-1" style="width: 60px !important;">Importe: </label>
<div class="col-md-2">
<asp:TextBox ID="TxtPA_Nimporte" CssClass="form-control input-sm " runat="server"></asp:TextBox>
</div>
<label class="col-md-1" style="width: 120px !important;">Importe Anterior: </label>
<div class="col-md-2">
<asp:TextBox ID="TxtPA_NimporteA" CssClass="form-control input-sm " runat="server"></asp:TextBox>
</div>
<div class="col-md-3">
<asp:Button ID="BtnCalcular" runat="server" Text="Calcular" OnClick="BtnCalcular_Click" class="btn btn-primary" />
<asp:Button ID="LnkAutorizarModal" runat="server" Text="Autorizar" OnClick="LnkAutorizarModal_Click" Visible="false" class="btn btn-primary" />
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="upDatosPA_N" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Panel runat="server" ID="pnlTotales" Visible ="false" CssClass="row">
<div class="col-md-3 col-md-offset-1">
<div class="dashboard-stat blue">
<div class="visual"><i class="fa fa-sort-numeric-desc"></i></div>
<div class="details">
<div class="number"> <asp:Literal ID="LblNumeroDias" runat="server" Text="0"></asp:Literal></div>
<div class="desc">
Días Laborados
</div>
</div>
</div>
</div>
<div class="col-md-3 col-md-offset-2">
<div class="dashboard-stat green">
<div class="visual"><i class="fa fa-line-chart"></i></div>
<div class="details">
<div class="number"> <asp:Literal ID="LblSueldos" runat="server" Text="0"></asp:Literal></div>
<div class="desc">
Sueldo Año Laborado
</div>
</div>
</div>
</div>
</asp:Panel>
<br />
<asp:GridView ID="GVCalcularUtilidades" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall GVCalcularUtilidades" AutoGenerateColumns="False"
DataKeyNames="Nombre,CvePersonal,DiasLaborados,SueldoTotal,Importe">
<Columns>
<asp:TemplateField HeaderText="Nombre ">
<ItemTemplate>
<asp:Label ID="lblnombreCompleto" runat="server" Text='<%# Eval("Nombre")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Días Laborados">
<ItemTemplate>
<asp:Label ID="lbldiasLaborados" runat="server" Text='<%# Eval("DiasLaborados")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Sueldo Año Laborado">
<ItemTemplate>
<asp:Label ID="lblsueldoTotal" runat="server" Text='<%# Eval("SueldoTotal", "${0:N2}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Utilidades">
<ItemTemplate>
<asp:Label ID="lblutilidades" runat="server" Text='<%# Eval("Importe", "${0:N2}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
</ItemTemplate>
</asp:TemplateField>
<%-- <asp:TemplateField HeaderText="Gravadas">
<ItemTemplate>
<asp:Label ID="lbluGravadas" runat="server" Text='<%# Eval("UGravadas", "${0:N2}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="ISR">
<ItemTemplate>
<asp:Label ID="lbluisr" runat="server" Text='<%# Eval("Uisr", "${0:N2}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="UTilidades por Pagar">
<ItemTemplate>
<asp:Label ID="lbluporPagar" runat="server" Text='<%# Eval("UporPagar", "${0:N2}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>--%>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div id="ModalAutorizar" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalAutorizar" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">Autorizar</h4>
</div>
<div class="modal-body">
<%--<div class="row">
<label class="col-md-4 ">Tipo Período:</label>
<div class="col-md-8">
<asp:DropDownList ID="DdlTipoPeriodo" runat="server" CssClass="select2me" AutoPostBack="true" OnSelectedIndexChanged="DdlTipoPeriodo_SelectedIndexChanged"
DataTextField="TipoPeriodo" DataValueField="CveTipoPeriodo" Style="width: 100% !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
</div>--%>
<div class="row">
<label class="col-md-4 ">Período Extraordinario:</label>
<div class="col-md-8">
<asp:DropDownList ID="DdlPeriodo" runat="server" CssClass="select2me" DataTextField="NominaEstatus" DataValueField="CvePeriodo" Style="width: 100% !important;" AutoPostBack="True" OnSelectedIndexChanged="DdlPeriodo_SelectedIndexChanged">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
<asp:Panel ID="PnlTipoPeriodos" runat="server">
<asp:GridView ID="GVTipoPeriodo" runat="server" Visible="false" GridLines="None" CssClass="table table-hover table-striped Widthall" AutoGenerateColumns="False"
DataKeyNames="CveTipoPeriodo,TipoPeriodo" OnRowDataBound="GVTipoPeriodo_RowDataBound">
<Columns>
<asp:TemplateField HeaderText="UTilidades por Pagar">
<ItemTemplate>
<div class="row">
<label class="col-md-4 "><%# Eval("TipoPeriodo") %></label>
<div class="col-md-8">
<asp:DropDownList ID="ddlPeriodo" runat="server" CssClass="select2me" DataTextField="NominaEstatus" DataValueField="CvePeriodo" Style="width: 100% !important;" AutoPostBack="True">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</asp:Panel>
</div>
<div class="modal-footer">
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:LinkButton ID="LnkAutorizar" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpUpDatosFiel" OnClick="LnkAutorizar_Click"> <i class='material-icons'>done_all</i> Actualizar</asp:LinkButton>
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

240
Nomina/ReportePTU.aspx.vb Normal file
View File

@@ -0,0 +1,240 @@
Imports Extensiones
Imports System.Data
Imports System.Drawing
Imports Microsoft.Reporting.WebForms
Imports System.IO
Imports System.Xml
Partial Class Nomina_ReportePTU
Inherits ClsPaginas
#Region "Propiedades"
Dim dtPeriodos As DataTable
Private Property DTUtilidades As DataTable
Get
Return CType(ViewState("DTUtilidades"), DataTable)
End Get
Set(value As DataTable)
ViewState("DTUtilidades") = value
End Set
End Property
Private Property utilimporte As Double
Get
Return ViewState("utilimporte").ToString().ToDouble()
End Get
Set(value As Double)
ViewState("utilimporte") = value
End Set
End Property
Private Property utilimporteAnt As Double
Get
Return ViewState("utilimporteAnt").ToString().ToDouble()
End Get
Set(value As Double)
ViewState("utilimporteAnt") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
Dim objnom As New ClsNominas()
objnom.GetEjercicios(UsuarioActual.CveEmpresa)
DdlEjercicios.DataSource = objnom.DtResultados
'DdlTipoPeriodo.DataSource = GlobalDTTipoPeriodo.FiltraParametros("Estatus = 'Activo'")
'DdlTipoPeriodo.DataBind()
'DdlTipoPeriodo.SelectedValueExist("6")
'DdlTipoPeriodo.Enabled = False
objnom.Dispose()
DdlEjercicios.DataBind()
If (DdlEjercicios.Items.Count > 0) Then
DdlEjercicios.SelectedIndex = 0
DdlEjercicios_SelectedIndexChanged(Nothing, Nothing)
End If
End If
End Sub
Protected Sub BtnCalcular_Click(sender As Object, e As EventArgs)
Dim ejercicio As Integer = DdlEjercicios.SelectedValue.ToEntero()
utilimporte = TxtPA_Nimporte.Text.ToDouble()
utilimporteAnt = TxtPA_NimporteA.Text.ToDouble()
Dim objnom As New ClsNominas()
objnom.GetCalculoUtilidades(ejercicio, UsuarioActual.CveEmpresa, utilimporte, utilimporteAnt)
DTUtilidades = objnom.DtResultados
objnom.Dispose()
cargaEjercicio(DTUtilidades)
LnkAutorizarModal.Visible = True
upDatosPA_N.Update()
End Sub
Private Sub CargaPeriodos()
Dim ObjPeriodos As New ClsNominas()
If ObjPeriodos.GetPeriodos(-1, UsuarioActual.CveEmpresa, DdlEjercicios.SelectedValue.ToEntero, -1, -1) Then
dtPeriodos = ObjPeriodos.DtResultados.FiltraParametros("Estatus IN (0,1)")
End If
ObjPeriodos.Dispose()
Dim listaCveTipoPeriodo As New StringBuilder("-1")
Dim dt As DataTable = DTUtilidades.FiltraParametros("", "", {"CveTipoPeriodo"})
For Each rowp As DataRow In dt.Rows
listaCveTipoPeriodo.Append(",")
listaCveTipoPeriodo.Append(rowp("CveTipoPeriodo"))
Next
GVTipoPeriodo.DataSource = GlobalDTTipoPeriodo.FiltraParametros($"Estatus = 'Activo' AND CveTipoPeriodo IN({listaCveTipoPeriodo.ToString()})")
GVTipoPeriodo.DataBind()
If (Not IsNothing(dtPeriodos) AndAlso dtPeriodos.Rows.Count()) Then
DdlPeriodo.DataSource = dtPeriodos.FiltraParametros("CveTipoPeriodo=6")
End If
DdlPeriodo.DataBind()
DdlPeriodo.Items.Insert(0, New ListItem("Seleccione", "-1"))
UpModalAutorizar.Update()
End Sub
Protected Sub DdlPeriodo_SelectedIndexChanged(sender As Object, e As EventArgs)
PnlTipoPeriodos.Visible = (DdlPeriodo.SelectedValue.ToEntero() <= 0)
End Sub
'Protected Sub DdlTipoPeriodo_SelectedIndexChanged(sender As Object, e As EventArgs)
' CargaPeriodos()
'End Sub
Protected Sub LnkAutorizarModal_Click(sender As Object, e As EventArgs)
CargaPeriodos()
RegistraScript("$('#ModalAutorizar').modal();")
End Sub
Protected Sub LnkAutorizar_Click(sender As Object, e As EventArgs)
Dim continuar As Boolean = True
Dim mensaje As String = ""
Dim DiasLaborados As Integer
Dim SueldoTotal As Double
Dim Importe As Double
Dim CveMoneda As Integer = 1
Dim CvePeriodoSeleccionado = DdlPeriodo.SelectedValue.ToEntero()
Dim ejercicio As Integer = DdlEjercicios.SelectedValue.ToEntero()
Dim CvePersonal As Integer
Dim CvePeriodo As Integer
Dim listaperiodos As New List(Of Periodos)
If CvePeriodoSeleccionado <= 0 Then
For Each gvRow As GridViewRow In GVTipoPeriodo.Rows
Dim periodo As New Periodos
periodo.CveTipoPeriodo = gvRow.DataKey("CveTipoPeriodo").ToString().ToEntero()
periodo.CvePeriodo = gvRow.FCDropDownList("ddlPeriodo").SelectedValue.ToEntero()
If periodo.CvePeriodo <= 0 Then
continuar = False
mensaje = "debe seleccionar un periodo Extraordinario o el periodo para los distintos tipo de periodos del personal!"
Exit For
End If
listaperiodos.Add(periodo)
Next
End If
'Dim ImporteGravado As Double
'Dim ImporteExento As Double
''Dim NombrePersonal As String
'Dim CveMetodoPago As Integer
'Dim CveNomina As Integer
Dim CveConcepto As Integer = 0
If continuar Then
Dim objNomina As New ClsNominas()
objNomina.IniciaTransacSQL()
If continuar Then
continuar = objNomina.UpADDdUtilidadesEjercicio(UsuarioActual.CveEmpresa, ejercicio, utilimporte, utilimporteAnt, False)
If continuar Then
If objNomina.DtResultados.Rows.Count < 0 OrElse objNomina.DtResultados.Rows(0)("CONTimbrado").ToString() = "1" Then
continuar = False
End If
End If
End If
If continuar Then continuar = objNomina.GetConceptos(UsuarioActual.CveEmpresa)
If continuar Then
Dim rowc As DataRow = objNomina.DtResultados.FiltroPrimero("Concepto='Utilidades' AND Tipo='P'")
If Not IsNothing(rowc) Then
CveConcepto = rowc("CveConcepto").ToString().ToEntero()
Else
CveConcepto = objNomina.AddConcepto("PTU", "Utilidades", "P", "", True, True, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, -1, -1, -1, 0, -1)
End If
If CveConcepto < 1 Then
continuar = False
End If
End If
For Each row As DataRow In DTUtilidades.Rows
Importe = row("Importe").ToString().ToDouble()
SueldoTotal = row("SueldoTotal").ToString().ToDouble()
DiasLaborados = row("DiasLaborados").ToString().ToEntero()
CvePersonal = row("CvePersonal").ToString().ToEntero()
CvePeriodo = CvePeriodoSeleccionado
If continuar Then
continuar = objNomina.AddUtilidad(CvePersonal, Importe, CvePeriodo, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, ejercicio, DiasLaborados, SueldoTotal)
End If
If Not continuar Then
Exit For
End If
Next
If continuar And CvePeriodoSeleccionado > 0 Then
continuar = objNomina.CambiaEstatusPeriodo(CvePeriodoSeleccionado, enumNominasEstatus.Activa, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
End If
If continuar Then
objNomina.Commit()
Else
objNomina.RollBack()
End If
objNomina.Dispose()
End If
If mensaje.Length > 0 Then
Alert(mensaje, TipoMensaje.MsgAdvertencia)
continuar = False
End If
If continuar Then
RegistraScript("$('#ModalAutorizar').modal('hide');")
Alert("Se han generado las utilidades")
End If
End Sub
Private Class Periodos
Public Property CveTipoPeriodo As Integer
Public Property CvePeriodo As Integer
End Class
Protected Sub DdlEjercicios_SelectedIndexChanged(sender As Object, e As EventArgs)
Dim ejercicio As Integer = DdlEjercicios.SelectedValue.ToEntero()
Dim objnom As New ClsNominas()
Dim dt As DataTable = Nothing
objnom.GetUtilidadesEjercicio(UsuarioActual.CveEmpresa, ejercicio)
If (objnom.DtResultados.Rows.Count > 0) Then
TxtPA_Nimporte.Text = $"{objnom.DtResultados.Rows(0)("Importe"):N2}"
TxtPA_NimporteA.Text = $"${objnom.DtResultados.Rows(0)("ImporteAnterior"):N2}"
objnom.GetUtilidad(-1, -1, UsuarioActual.CveEmpresa, ejercicio)
dt = objnom.DtResultados
End If
objnom.Dispose()
cargaEjercicio(dt)
End Sub
Private Sub cargaEjercicio(dt As DataTable)
If Not IsNothing(dt) AndAlso dt.Rows.Count > 0 Then
pnlTotales.Visible = True
LblNumeroDias.Text = $"{dt.SUM("DiasLaborados"):N0}"
LblSueldos.Text = $"{dt.SUM("SueldoTotal"):N0}"
Else
pnlTotales.Visible = False
End If
GVCalcularUtilidades.DataSource = dt
GVCalcularUtilidades.DataBind()
End Sub
Protected Sub GVTipoPeriodo_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
If (Not IsNothing(dtPeriodos) AndAlso dtPeriodos.Rows.Count()) Then
Dim dddlperiodo As DropDownList = e.Row.FCDropDownList("ddlPeriodo")
dddlperiodo.DataSource = dtPeriodos.FiltraParametros(String.Format("CveTipoPeriodo={0}", e.Row.DataKey("CveTipoPeriodo")))
dddlperiodo.DataBind()
dddlperiodo.Items.Insert(0, New ListItem("Seleccione", "-1"))
End If
End If
End Sub
End Class

146
Nomina/SobreRecibo.aspx Normal file
View File

@@ -0,0 +1,146 @@
<%@ Page Title="Nómina - SobreRecibo" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="SobreRecibo.aspx.vb" Inherits="Nominas_SobreRecibo" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="titlefiltros caption">
<div class="row">
<label class="col-md-1 ">Personal:</label>
<div class="col-md-3">
<asp:DropDownList ID="DdlPersonal" runat="server" AppendDataBoundItems="true" CssClass="select2me" AutoPostBack="true" DataTextField="Nombre" DataValueField="CvePersonal" Style="width: 110px !important;">
</asp:DropDownList>
</div>
<label class="col-md-1 ">Tipo Período:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlTipoPeriodo" runat="server" AppendDataBoundItems="true" CssClass="select2me" AutoPostBack="true" DataTextField="TipoPeriodo" DataValueField="CveTipoPeriodo" Style="width: 110px !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<label class="col-md-1 " style="width: 60px !important;">Período:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlPeriodo" runat="server" AppendDataBoundItems="true" CssClass="select2me" DataTextField="NominaEstatus" DataValueField="CvePeriodo" Style="width: 170px !important;" AutoPostBack="True">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-2">
<asp:Button ID="BtnConsultar" runat="server" Text="Buscar" class="btn btn-primary" />&nbsp;
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="LtNombrePersonal" runat="server" Font-Bold="true" Font-Size="Large"/>
<div class="row" style="margin-top:10px;">
<div class="col-md-6">
<table id="tPercepciones" runat="server" visible="false" width="100%" style="font-weight: bold; font-size: 14px; color: white; background-color: #E87E04;">
<tr>
<td align="center">Percepciones
</td>
</tr>
</table>
<asp:GridView ID="GvPercepciones" runat="server" AutoGenerateColumns="False" CssClass="table table-striped table-advance table-hover Widthall" Style="text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Concepto">
<ItemTemplate>
<asp:Label ID="LtlConcepto" runat="server" Text='<%# Eval("Concepto") %>' Style="word-break: break-all;"></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" Width="75%" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Importe">
<ItemTemplate>
<asp:Label ID="LtlImporte" runat="server" Text='<%# Eval("Importe", "{0:N}") %>' Style="word-break: break-all;"></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" Width="25%" />
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
<div class="col-md-6">
<table id="tDeducciones" runat="server" visible="false" width="100%" style="font-weight: bold; font-size: 14px; color: white; background-color: #E87E04;">
<tr>
<td align="center">Deducciones
</td>
</tr>
</table>
<asp:GridView ID="GvDeducciones" runat="server" AutoGenerateColumns="False" CssClass="table table-striped table-advance table-hover Widthall" Style="text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Concepto">
<ItemTemplate>
<asp:Label ID="LtlConcepto" runat="server" Text='<%# Eval("Concepto") %>' Style="word-break: break-all;"></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" Width="75%" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Importe">
<ItemTemplate>
<asp:Label ID="LtlImporte" runat="server" Text='<%# Eval("Importe", "{0:N}") %>' Style="word-break: break-all;"></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" Width="25%" />
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
<div class="row">
<div class="col-md-6">
<table id="tPercepcionesF" runat="server" visible="false" width="100%">
<tr>
<td width="75%">
<asp:Label runat="server" Text="Suma de Percepciones" Font-Bold="true" Font-Size="13px" />
</td>
<td width="25%" align="right">
<asp:Label ID="LblTotalPercepciones" runat="server" />
</td>
</tr>
</table>
</div>
<div class="col-md-6">
<table id="tDeduccionesF" runat="server" visible="false" width="100%">
<tr>
<td width="75%">
<asp:Label runat="server" Text="Suma de Deducciones" Font-Bold="true" Font-Size="13px" />
</td>
<td width="25%" align="right">
<asp:Label ID="LblTotalDeducciones" runat="server" />
</td>
</tr>
<tr>
<td width="75%">
<asp:Label runat="server" Text="Neto a Pagar" Font-Bold="true" Font-Size="13px" />
</td>
<td width="25%" align="right">
<asp:Label ID="LblTotal" runat="server" />
</td>
</tr>
</table>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

152
Nomina/SobreRecibo.aspx.vb Normal file
View File

@@ -0,0 +1,152 @@
Imports Extensiones
Imports System.Data
Imports System.Drawing
Imports Microsoft.Reporting.WebForms
Imports System.IO
Partial Class Nominas_SobreRecibo
Inherits ClsPaginas
Private ReadOnly Property CvePersonal As Integer
Get
Return ViewState("CvePersonal").ToString.ToEntero
End Get
End Property
Private ReadOnly Property CvePeriodo As Integer
Get
Return ViewState("CvePeriodo").ToString.ToEntero
End Get
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
ViewState("CvePersonal") = 0
ViewState("CvePeriodo") = 0
If Request("CvePersonal") IsNot Nothing AndAlso IsNumeric(Request("CvePersonal")) AndAlso Request("CvePersonal").ToEntero > 0 Then
ViewState("CvePersonal") = Request("CvePersonal")
End If
If Request("CvePeriodo") IsNot Nothing AndAlso IsNumeric(Request("CvePeriodo")) AndAlso Request("CvePeriodo").ToEntero > 0 Then
ViewState("CvePeriodo") = Request("CvePeriodo")
End If
If CvePersonal > 0 AndAlso CvePeriodo > 0 Then
CargaDatos()
CargaPersonal()
DdlPersonal.SelectedValue = CvePersonal
LtNombrePersonal.Text = DdlPersonal.SelectedItem.Text
UPFiltros.Visible = False
End If
CargaPersonal()
CargaTiposPeriodo()
End If
End Sub
#Region "Carga Datos,Combos, Etc..."
Private Sub CargaPersonal()
DdlPersonal.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa)
DdlPersonal.DataBind()
End Sub
Private Sub CargaTiposPeriodo()
DdlTipoPeriodo.DataSource = GlobalDTTipoPeriodo.FiltraParametros("Estatus = 'Activo'")
DdlTipoPeriodo.DataBind()
End Sub
Private Sub CargaPeriodos()
If DdlTipoPeriodo.SelectedValue.ToEntero > 0 Then
Dim ObjPeriodos As New ClsNominas
If ObjPeriodos.GetPeriodos(DdlTipoPeriodo.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, Now.Year, -1, -1) Then
DdlPeriodo.DataSource = ObjPeriodos.DtResultados.FiltraParametros("Estatus IN (1,2,3)")
Else
DdlPeriodo.DataSource = Nothing
End If
ObjPeriodos.Dispose()
End If
DdlPeriodo.Items.Clear()
DdlPeriodo.DataBind()
DdlPeriodo.Items.Insert(0, New ListItem("Seleccione", "-1"))
End Sub
Private Sub CargaDatos()
Dim ObjRH As New ClsNominas
Dim CvePeriodoC As Integer
Dim CvePersonalC As Integer
If CvePeriodo > 0 Then
CvePeriodoC = CvePeriodo
Else
CvePeriodoC = DdlPeriodo.SelectedValue.ToEntero
End If
If CvePersonal > 0 Then
CvePersonalC = CvePersonal
Else
CvePersonalC = DdlPersonal.SelectedValue.ToEntero
End If
If ObjRH.GetSobreRecibo(CvePeriodoC, UsuarioActual.CveEmpresa, CvePersonalC) Then
tPercepciones.Visible = True
tDeducciones.Visible = True
tPercepcionesF.Visible = True
tDeduccionesF.Visible = True
LblTotalDeducciones.Text = (ObjRH.DtResultados.FiltroPrimeroValor("ImporteTotales", "Tipo='D' AND CveConcepto IS NULL").ToDecimal * -1).FormatoNumero(2)
LblTotalPercepciones.Text = ObjRH.DtResultados.FiltroPrimeroValor("ImporteTotales", "Tipo='P' AND CveConcepto IS NULL").FormatoNumero(2)
LblTotal.Text = ObjRH.DtResultados.FiltroPrimeroValor("ImporteTotales", "Tipo IS NULL AND CveConcepto IS NULL").FormatoNumero(2)
GvDeducciones.DataSource = ObjRH.DtResultados.FiltraParametros("Tipo='D' AND CveConcepto > 0")
GvPercepciones.DataSource = ObjRH.DtResultados.FiltraParametros("Tipo='P' AND CveConcepto > 0")
GvDeducciones.DataBind()
GvPercepciones.DataBind()
End If
UPDatos.Update()
ObjRH.Dispose()
End Sub
#End Region
#Region "BTN'S CLICK"
Protected Sub DdlTipoPeriodo_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlTipoPeriodo.SelectedIndexChanged
CargaPeriodos()
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click
CargaDatos()
End Sub
#End Region
#Region "Gv"
Protected Sub GvDeducciones_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDeducciones.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("Origen").ToEntero = 1 Then
e.Row.Font.Italic = True
e.Row.Cells(0).Style.Add("padding-left", "16px")
End If
e.Row.FCLabel("LtlImporte").Text = e.Row.FCLabel("LtlImporte").Text.ToDecimal
End If
End Sub
Protected Sub GvPercepciones_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvPercepciones.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("Origen").ToEntero = 1 Then
e.Row.Font.Italic = True
e.Row.Cells(0).Style.Add("padding-left", "16px")
End If
End If
End Sub
#End Region
End Class