74 lines
2.7 KiB
C#
74 lines
2.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.UI.WebControls;
|
|
using Extensiones;
|
|
using System.Data;
|
|
using static Extensiones.ModExtensiones;
|
|
using Microsoft.Reporting.WebForms;
|
|
|
|
public partial class CGame_RepMateriales : ClsPaginas
|
|
{
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!IsPostBack)
|
|
{
|
|
InicializaValores();
|
|
DdlHuerta.SelectedValueExist(Request["CveHuerta"] == null ? "-1" : Request["CveHuerta"].ToString());
|
|
txtFechaI.Text = Request["FechaI"] == null ? DateTime.Now.ToString() : Request["FechaI"].ToString();
|
|
txtFechaF.Text = Request["FechaF"] == null ? DateTime.Now.ToString() : Request["FechaF"].ToString();
|
|
if (DdlHuerta.SelectedValue.ToEntero() > 0) { Consulta(); }
|
|
}
|
|
}
|
|
|
|
private void InicializaValores()
|
|
{
|
|
CargaHuerta();
|
|
txtFechaI.Text = DateTime.Now.FirstDayOfMonth().ToShortDateString();
|
|
txtFechaF.Text = DateTime.Now.ToShortDateString();
|
|
UPFiltros.Update();
|
|
}
|
|
|
|
private void CargaHuerta()
|
|
{
|
|
ClsCGame ObjCGame = new ClsCGame();
|
|
if (ObjCGame.GetHuerta(UsuarioActual.CveEmpresa))
|
|
{
|
|
DdlHuerta.DataSource = ObjCGame.DtResultados;
|
|
DdlHuerta.Items.Insert(0, new ListItem("Todos", "-1"));
|
|
}
|
|
ObjCGame.Dispose();
|
|
DdlHuerta.DataBind();
|
|
}
|
|
|
|
private void Consulta()
|
|
{
|
|
ClsCGame ObjCGame = new ClsCGame();
|
|
if (ObjCGame.GetRepMateriales(DdlHuerta.SelectedValue.ToEntero(), txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), UsuarioActual.CveEmpresa))
|
|
{
|
|
GvDatos.DataSource = ObjCGame.DtResultados;
|
|
}
|
|
ObjCGame.Dispose();
|
|
GvDatos.DataBind();
|
|
UPDatos.Update();
|
|
}
|
|
|
|
protected void BtnConsultar_Click(object sender, EventArgs e)
|
|
{
|
|
Consulta();
|
|
}
|
|
|
|
protected void GvDatos_RowDataBound(object sender, GridViewRowEventArgs e)
|
|
{
|
|
if (e.Row.RowType == DataControlRowType.DataRow)
|
|
{
|
|
if (e.Row.RowIndex == 0)
|
|
{
|
|
e.Row.Cells[0].Text = "Total";
|
|
e.Row.CssClass = "Totales";
|
|
}
|
|
else if (e.Row.DBCampo("CveCargoFijo").ToEntero() < 1)
|
|
{
|
|
e.Row.CssClass = "SubTotales";
|
|
e.Row.Cells[0].Text = e.Row.DBCampo("Folio");
|
|
String Css = "Texto";
|
|
String Liga = $"/CGame/Empaque.aspx?&CveProduccion={e.Row.DBCampo("CveProduccion")}";
|
|
e.Row.Cells[0].Text = "<a class=" + "" + Css + "" + " href=" + "" + Liga + "" + ">" + e.Row.Cells[0].Text + "</a>";
|
|
}
|
|
}
|
|
}
|
|
} |