IEPS Por Entidad Federativa
This commit is contained in:
98
General/CATIEPSxEntidadFed.aspx.cs
Normal file
98
General/CATIEPSxEntidadFed.aspx.cs
Normal file
@@ -0,0 +1,98 @@
|
||||
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 General_CATIEPSxEntidadFed : ClsPaginas
|
||||
{
|
||||
#region Propiedades
|
||||
private int RcveEstado
|
||||
{
|
||||
get { return (ViewState["RcveEstado"] == null) ? 0 : Convert.ToInt32(ViewState["RcveEstado"]); }
|
||||
set { ViewState["RcveEstado"] = value; }
|
||||
}
|
||||
private decimal RtasaIEPS
|
||||
{
|
||||
get { return (ViewState["RtasaIEPS"] == null) ? 0 : Convert.ToDecimal(ViewState["RtasaIEPS"]); }
|
||||
set { ViewState["RtasaIEPS"] = value; }
|
||||
}
|
||||
private string RfechaInicio
|
||||
{
|
||||
get { return (ViewState["RfechaInicio"] == null) ? "-1": (ViewState["RfechaInicio"]).ToString(); }
|
||||
set { ViewState["RfechaInicio"] = value; }
|
||||
}
|
||||
private string RfechaFin
|
||||
{
|
||||
get { return (ViewState["RfechaFin"] == null) ? "-1": (ViewState["RfechaFin"]).ToString(); }
|
||||
set { ViewState["RfechaFin"] = value; }
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
|
||||
DdlEstado.DataSource = get_GlobalDTEstado("Mex");
|
||||
DdlEstado.DataBind();
|
||||
|
||||
|
||||
DdlEstado.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
||||
RcveEstado = Request["cveEstado"] == null ? -1 : Request["cveEstado"].ToString().ToEntero();
|
||||
RtasaIEPS = Request["tasaIEPS"] == null ? -1 : Request["tasaIEPS"].ToString().ToDecimal();
|
||||
RfechaInicio = Request["fechaInicio"] == null ? string.Format("01/{0:MM/yyyy}", DateTime.Now.AddMonths(-1)) : Request["fechaInicio"].ToString();
|
||||
RfechaFin = Request["fechaFin"] == null ? string.Format("{0:dd/MM/yyyy}", DateTime.Now.AddMonths(-1).LastDayOfMonth()) : Request["fechaFin"].ToString();
|
||||
DdlEstado .SelectedValueExist( RcveEstado.ToString());
|
||||
DdlIeps.SelectedValueExist ( RtasaIEPS.ToString());
|
||||
TxtIEPSfechaInicio.Text = $"{RfechaInicio:dd/MM/yyyy}";
|
||||
TxtIEPSfechaFin.Text = $"{RfechaFin:dd/MM/yyyy}";
|
||||
|
||||
RfechaInicio = RfechaInicio.ToDate().ToString("yyyy/MM/dd");
|
||||
RfechaFin = RfechaFin.ToDate().ToString("yyyy/MM/dd");
|
||||
CargaIEPSxEntidadFed();
|
||||
}
|
||||
}
|
||||
protected void CargaIEPSxEntidadFed()
|
||||
{
|
||||
ClsGenerales ObjIEPS = new ClsGenerales();
|
||||
ObjIEPS.IEPSxEntidadFed(RcveEstado, RtasaIEPS, RfechaInicio, RfechaFin, 119);
|
||||
GVIEPSxEntidadFed.DataSource = ObjIEPS.DtResultados;
|
||||
ObjIEPS.Dispose();
|
||||
GVIEPSxEntidadFed.DataBind();
|
||||
upDatosIEPS.Update();
|
||||
}
|
||||
|
||||
protected void GVIEPSxEntidadFed_RowDataBound(object sender, GridViewRowEventArgs e)
|
||||
{
|
||||
if(e.Row.RowType == DataControlRowType.DataRow)
|
||||
{
|
||||
int cveGrupo = e.Row.DBCampo("CveGrupo").ToEntero();
|
||||
if (cveGrupo == 1)
|
||||
{
|
||||
e.Row.CssClass = "Titulos";
|
||||
}
|
||||
if (cveGrupo == 2)
|
||||
{
|
||||
e.Row.CssClass = "Totales";
|
||||
}
|
||||
}
|
||||
}
|
||||
protected void BtnIEPSFiltrar_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
RcveEstado = DdlEstado.SelectedValue.ToEntero();
|
||||
RtasaIEPS = DdlIeps.SelectedValue.ToDecimal();
|
||||
RfechaInicio = TxtIEPSfechaInicio.Text.ToDate().ToString("yyyy/MM/dd") ;
|
||||
RfechaFin = TxtIEPSfechaFin.Text.ToDate().ToString("yyyy/MM/dd");
|
||||
|
||||
CargaIEPSxEntidadFed();
|
||||
}
|
||||
|
||||
protected void LnkExcel_Click(object sender, EventArgs e)
|
||||
{
|
||||
GVIEPSxEntidadFed.ExportToExcelx("IEPS porEntidad Federativa");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user