90 lines
3.2 KiB
C#
90 lines
3.2 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 Documentacion_TableroMaterialidadDetalle : ClsPaginas
|
|
{
|
|
#region "Propiedades"
|
|
public int CveCliente
|
|
{
|
|
get { return ViewState["CveCliente"] != null ? ViewState["CveCliente"].ToString().ToEntero() : 0; }
|
|
set { ViewState["CveCliente"] = value; }
|
|
}
|
|
|
|
public int anio
|
|
{
|
|
get { return ViewState["anio"] != null ? ViewState["anio"].ToString().ToEntero() : 0; }
|
|
set { ViewState["anio"] = value; }
|
|
}
|
|
public int mes
|
|
{
|
|
get { return ViewState["mes"] != null ? ViewState["mes"].ToString().ToEntero() : 0; }
|
|
set { ViewState["mes"] = value; }
|
|
}
|
|
#endregion
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
|
|
if (!IsPostBack)
|
|
{
|
|
if (Request["CveCliente"] != null && Request["CveCliente"].ToString().ToEntero() > 0)
|
|
{
|
|
CveCliente = Request["CveCliente"].ToString().ToEntero();
|
|
DdlCliente.SelectedValue = CveCliente.ToString();
|
|
}
|
|
if (Request["anio"] != null && Request["anio"].ToString().ToEntero() > 0)
|
|
{
|
|
anio = Request["anio"].ToString().ToEntero();
|
|
Txtanio.Text = anio.ToString();
|
|
}
|
|
if (Request["mes"] != null && Request["mes"].ToString().ToEntero() > 0)
|
|
{
|
|
mes = Request["mes"].ToString().ToEntero();
|
|
ddlMes.SelectedValueExist(mes.ToString());
|
|
}
|
|
cargadatos();
|
|
}
|
|
}
|
|
public void cargadatos()
|
|
{
|
|
using (ClsEdocumentacion edoc = new ClsEdocumentacion())
|
|
{
|
|
if (edoc.TableroMaterialidadDetalleGET(UsuarioActual.CveEmpresa, (anio = Txtanio.Text.ToEntero()), (mes = ddlMes.SelectedValue.ToEntero()), CveCliente) && edoc.DSResultados.Tables.Count > 0)
|
|
{
|
|
GVData.DataSource = edoc.DSResultados.Tables[0];
|
|
int CurrentColumn = 4;
|
|
BoundField bf;
|
|
foreach (DataRow item in edoc.DSResultados.Tables[1].Rows)
|
|
{
|
|
GVData.Columns[CurrentColumn].Visible = true;
|
|
bf = (BoundField)GVData.Columns[CurrentColumn];
|
|
bf.DataField = string.Format("V_{0}", item["CvePeriodo"]);
|
|
bf.HeaderText = string.Format("({0:dd/MM/yyyy}-{1:dd/MM/yyyy})", item["FechaInicio"], item["FechaFin"]);
|
|
bf.Visible = true;
|
|
//Alert(string.Format("{0}-{1}", item["FechaInicio"], item["FechaFin"]));
|
|
CurrentColumn = CurrentColumn + 1;
|
|
}
|
|
for (int i = CurrentColumn; i < GVData.Columns.Count; i++)
|
|
{
|
|
GVData.Columns[i].Visible = false;
|
|
bf = (BoundField)GVData.Columns[i];
|
|
bf.DataField = "";
|
|
bf.HeaderText = "";
|
|
}
|
|
GVData.DataBind();
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
protected void BtnConsultar_Click(object sender, EventArgs e)
|
|
{
|
|
cargadatos();
|
|
}
|
|
} |