Files
SIG/CGame/RepFletesPendientes.aspx.cs
JORGE LUIS CAUDILLO ESPARZA c35cf91883 Commit inicial Ventas Productivo
2019-08-14 16:40:54 -07:00

132 lines
4.4 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;
using System.Activities.Expressions;
public partial class CGame_RepFletesPendientes : ClsPaginas
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
CargaEmpaque();
CargaOrdenCorte();
CargaCliente();
}
}
protected void CargaEmpaque()
{
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetEmpaques(UsuarioActual.CveEmpresa))
{
DdlEmpaque.DataSource = ObjCGame.DtResultados;
DdlEmpaque.Items.Insert(0, new ListItem("Todos", "-1"));
}
ObjCGame.Dispose();
DdlEmpaque.DataBind();
UPFiltros.Update();
}
protected void CargaCliente()
{
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetCliente(-1, -1, UsuarioActual.CveEmpresa))
{
DdlCliente.DataSource = ObjCGame.DtResultados;
DdlCliente.Items.Insert(0, new ListItem("Todos", "-1"));
DdlCliente.DataBind();
}
ObjCGame.Dispose();
UPFiltros.Update();
}
protected void CargaOrdenCorte()
{
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetOrdenCorte(UsuarioActual.CveEmpresa))
{
DdlOrdenCorte.DataSource = ObjCGame.DtResultados;
DdlOrdenCorte.Items.Insert(0, new ListItem("Todos", "-1"));
}
ObjCGame.Dispose();
DdlOrdenCorte.DataBind();
UPFiltros.Update();
}
protected void GvFletes_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
String Css = "Texto";
String Liga = $"/CGame/RepOrdenCorteDetalle.aspx?&CveOrdenCorte={e.Row.DataKey("CveOrdenCorte")}";
e.Row.FCLabel("LblFolio").Text = "<a class=" + "" + Css + "" + " href=" + "" + Liga + "" + ">" + e.Row.FCLabel("LblFolio").Text + "</a>";
}
}
protected void BtnConsultar_Click(object sender, EventArgs e)
{
ClsCGame ObjCGame = new ClsCGame();
if (DdlModalidad.SelectedValue.ToEntero() == 1)
{
if (ObjCGame.GetFleteHuertaEmpaque(UsuarioActual.CveEmpresa, CveOrdenCorte: DdlOrdenCorte.SelectedValue.ToEntero(), CveEmpaque: DdlEmpaque.SelectedValue.ToEntero(), FInicio: txtFechaI.Text.ToDate(), FFinal: txtFechaF.Text.ToDate()))
{
GvFletes.DataSource = ObjCGame.DtResultados.FiltraParametros("CveFlete IS NULL");
}
ObjCGame.Dispose();
GvFletes.DataBind();
}else
{
if (ObjCGame.GetOrdenProduccion(-1,UsuarioActual.CveEmpresa,-1,"-1",txtFechaI.Text.ToDate(),txtFechaF.Text.ToDate(),DdlCliente.SelectedValue.ToEntero()))
{
GvOP.DataSource = ObjCGame.DtResultados.FiltraParametros("CveEstatus = 5");
}
ObjCGame.Dispose();
GvOP.DataBind();
}
UPDatos.Update();
}
protected void DdlModalidad_SelectedIndexChanged(object sender, EventArgs e)
{
GvFletes.Visible = false;
GvOP.Visible = false;
DivDdlCliente.Visible = false;
DivDdlEmpaque.Visible = false;
DivDdlOrdenCorte.Visible = false;
DivLblCliente.Visible = false;
DivLblEmpaque.Visible = false;
DivLblOrdenCorte.Visible = false;
if (DdlModalidad.SelectedValue.ToEntero() == 1)
{
DivDdlEmpaque.Visible = true;
DivDdlOrdenCorte.Visible = true;
DivLblEmpaque.Visible = true;
DivLblOrdenCorte.Visible = true;
GvFletes.Visible = true;
}else
{
DivLblCliente.Visible = true;
DivDdlCliente.Visible = true;
GvOP.Visible = true;
}
UPDatos.Update();
}
protected void GvOP_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
String Css = "Texto";
String Liga = $"/CGame/OrdenProduccion.aspx?&CveOrdenProduccion={e.Row.DataKey("CveOrdenProduccion")}";
e.Row.FCLabel("LblFolio").Text = "<a class=" + "" + Css + "" + " href=" + "" + Liga + "" + ">" + e.Row.FCLabel("LblFolio").Text + "</a>";
}
}
}