66 lines
2.1 KiB
C#
66 lines
2.1 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_RepOrdenProduccionXHuerta : ClsPaginas
|
|
{
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!IsPostBack)
|
|
{
|
|
InicializaValores();
|
|
}
|
|
}
|
|
|
|
|
|
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("Seleccione", "-1"));
|
|
}
|
|
ObjCGame.Dispose();
|
|
DdlHuerta.DataBind();
|
|
}
|
|
|
|
protected void BtnConsultar_Click(object sender, EventArgs e)
|
|
{
|
|
Consulta();
|
|
}
|
|
|
|
private void Consulta()
|
|
{
|
|
ClsCGame ObjCGame = new ClsCGame();
|
|
if (ObjCGame.GetRepOrdenProduccionXHuerta(DdlHuerta.SelectedValue.ToEntero(), txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), UsuarioActual.CveEmpresa))
|
|
{
|
|
GvDatos.DataSource = ObjCGame.DtResultados;
|
|
}
|
|
ObjCGame.Dispose();
|
|
GvDatos.DataBind();
|
|
UpDatos.Update();
|
|
}
|
|
|
|
protected void GvDatos_RowDataBound(object sender, GridViewRowEventArgs e)
|
|
{
|
|
if (e.Row.RowType == DataControlRowType.DataRow)
|
|
{
|
|
if (e.Row.DBCampo("Liquidado").ToEntero() == 1)
|
|
{
|
|
e.Row.Cells[7].BackColor = System.Drawing.Color.Green;
|
|
}
|
|
else if (e.Row.DBCampo("Liquidado").ToEntero() ==0)
|
|
{
|
|
e.Row.Cells[7].BackColor = System.Drawing.Color.Red;
|
|
}
|
|
}
|
|
}
|
|
} |