105 lines
3.1 KiB
C#
105 lines
3.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
using Extensiones;
|
|
|
|
public partial class Nomina_MovimientosSUA : ClsPaginas
|
|
{
|
|
|
|
|
|
private DataTable dtMovtosSUA
|
|
{
|
|
get
|
|
{
|
|
if (ViewState["dtMovtosSUA"] == null) { return null; }
|
|
else { return (DataTable)ViewState["dtMovtosSUA"]; }
|
|
}
|
|
|
|
set { ViewState["dtMovtosSUA"] = value; }
|
|
}
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!IsPostBack)
|
|
{
|
|
TxtRpdFechaInicio.Text = string.Format(" {0:dd/MM/yyyy}", NowADS().AddMonths(-1).FirstDayOfMonth());
|
|
TxtRpdFechaFin.Text = string.Format(" {0:dd/MM/yyyy}", NowADS().AddMonths(-1).LastDayOfMonth());
|
|
CargaCombos();
|
|
CargaTiposPeriodo();
|
|
}
|
|
}
|
|
|
|
private void CargaCombos()
|
|
{
|
|
|
|
ClsRH ObjRH = new ClsRH();
|
|
|
|
|
|
if (ObjRH.GetRegistrosPatronales(-1, UsuarioActual.CveEmpresa, -1))
|
|
{
|
|
DdlRegistroPatronal.DataSource = ObjRH.DtResultados;
|
|
}
|
|
else
|
|
{
|
|
DdlRegistroPatronal.DataSource = null;
|
|
}
|
|
|
|
ObjRH.Dispose();
|
|
DdlRegistroPatronal.DataBind();
|
|
|
|
DdlRegistroPatronal.Items.Insert(0, new ListItem("Todos","-1"));
|
|
|
|
}
|
|
|
|
private void CargaTiposPeriodo()
|
|
{
|
|
DdlTipoPeriodo.DataSource = GlobalDTTipoPeriodo.FiltraParametros("Estatus = 'Activo'");
|
|
DdlTipoPeriodo.DataBind();
|
|
DdlTipoPeriodo.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
|
if (DdlTipoPeriodo.Items.Count > 0)
|
|
{
|
|
DdlTipoPeriodo.SelectedIndex = 0;
|
|
}
|
|
}
|
|
|
|
protected void LnkConsultar_Click(object sender, EventArgs e)
|
|
{
|
|
using (ClsNominas onom = new ClsNominas())
|
|
{
|
|
|
|
if (onom.SUAMovmientosAfiliatoriosGET(UsuarioActual.CveEmpresa, TxtRpdFechaInicio.Text.ToDateTime(), TxtRpdFechaFin.Text.ToDateTime(), DdlTipoPeriodo.SelectedValue.ToEntero(), CveRegistroPatronal:DdlRegistroPatronal.SelectedValue.ToEntero())
|
|
&& onom.DTSetResultados.Tables.Count > 3)
|
|
{
|
|
GVAsistencia.DataSource = onom.DTSetResultados.Tables[0];
|
|
GVAltasBajas.DataSource = onom.DTSetResultados.Tables[1];
|
|
GVModSalario.DataSource = onom.DTSetResultados.Tables[2];
|
|
dtMovtosSUA = onom.DTSetResultados.Tables[3];
|
|
GVAsistencia.DataBind();
|
|
GVAltasBajas.DataBind();
|
|
GVModSalario.DataBind();
|
|
}
|
|
}
|
|
upDatosSUAM.Update();
|
|
}
|
|
|
|
protected void LnkDownTxt_Click(object sender, EventArgs e)
|
|
{
|
|
string movtos = "";
|
|
string concater = "";
|
|
foreach (DataRow item in dtMovtosSUA.Rows)
|
|
{
|
|
|
|
movtos = string.Format("{0}{1}{2}", movtos, concater, item["TxtRow"]);
|
|
concater = "\\r\\n";
|
|
}
|
|
RegistraScript(string.Format("SaveCsv(\"Movt.txt\", '{0}');", movtos));
|
|
}
|
|
|
|
protected void LNKDownIDSE_Click(object sender, EventArgs e)
|
|
{
|
|
|
|
}
|
|
} |