Commit inicial Ventas Productivo

This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2019-08-14 16:40:54 -07:00
commit c35cf91883
13328 changed files with 3711549 additions and 0 deletions

View File

@@ -0,0 +1,387 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="AsignacionEmpaque.aspx.cs" Inherits="CGame_AsignacionEmpaque" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Asignación de Empaque
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel ID="UpExportar" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="ImgImprimirPDF" runat="server" OnClick="ImgImprimirPDF_Click"> <i class="fa fa-ad-pdf"></i> Generar PDF </asp:LinkButton>
</li>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="ImgImprimirPDF" />
</Triggers>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<%--FILTROS--%>
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" id="FiltrosCotratos">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" OnClick="BtnConsultar_Click" class="btn btn-primary" />
<a href="javascript:;" class="expand"></a>
</div>
<div class="titlefiltros caption">
<div class="row">
<label class="col-md-1 text-right" id="LblHuerta" runat="server">Huerta:</label>
<div class="col-md-1" id="DivDdlHuerta" runat="server">
<asp:DropDownList ID="DdlHuerta" runat="server" DataTextField="Huerta" DataValueField="CveHuerta" AppendDataBoundItems="true" CssClass="table-group-action-input form-control input-inline input-sm select2me " Width="100px">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<label class="col-md-1 text-right" id="LblFruto" runat="server">Fruto:</label>
<div class="col-md-1" id="DivDdlFruto" runat="server">
<asp:DropDownList ID="DdlFruto" runat="server" DataTextField="PS" DataValueField="CvePS" AppendDataBoundItems="true" CssClass="table-group-action-input form-control input-inline input-sm select2me " Width="100px">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<label class="col-md-1 text-right" id="LblVariedad" runat="server">Variedad:</label>
<div class="col-md-1" id="DivDdlVariedad" runat="server">
<asp:DropDownList ID="DdlVariedad" runat="server" DataTextField="TipoMaduracion" DataValueField="CveTipoMaduracion" AppendDataBoundItems="true" CssClass="table-group-action-input form-control input-inline input-sm select2me " Width="100px">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<label class="col-md-2 text-right" id="LblTipoProduccion" runat="server">Tipo Producción:</label>
<div class="col-md-1" id="DivDdlTipoProduccion" runat="server">
<asp:DropDownList ID="DdlTipoProduccion" runat="server" DataTextField="TipoProducto" DataValueField="CveTipoProducto" AppendDataBoundItems="true" CssClass="table-group-action-input form-control input-inline input-sm select2me " Width="100px">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>
<div class="portlet-body" style="display: none;">
<div class="row">
<label class="col-md-1 text-right" id="LblTamaño" runat="server">Tamaño:</label>
<div class="col-md-1" id="DivDdlTamaño" runat="server">
<asp:DropDownList ID="DdlTamaño" runat="server" DataTextField="Tamaño" DataValueField="CveTamaño" AppendDataBoundItems="true" CssClass="table-group-action-input form-control input-inline input-sm select2me " Width="100px">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<label class="col-md-1 text-right" id="LblCalidad" runat="server">Calidad:</label>
<div class="col-md-1" id="DivDdlCalidad" runat="server">
<asp:DropDownList ID="DdlCalidad" runat="server" DataTextField="Calidad" DataValueField="CveCalidad" AppendDataBoundItems="true" CssClass="table-group-action-input form-control input-inline input-sm select2me " Width="100px">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<label class="col-md-1 text-right" id="LblEtiqueta" runat="server">Etiqueta:</label>
<div class="col-md-1" id="DivDdlEtiqueta" runat="server">
<asp:DropDownList ID="DdlEtiqueta" runat="server" DataTextField="TipoCaja" DataValueField="CveTipoCaja" AppendDataBoundItems="true" CssClass="table-group-action-input form-control input-inline input-sm select2me " Width="100px">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<label class="col-md-2 text-right" id="LblTipoEmpaque" runat="server">Tipo Empaque:</label>
<div class="col-md-1" id="DivDdlTipoEmpaque" runat="server">
<asp:DropDownList ID="DdlTipoEmpaque" runat="server" DataTextField="TipoEmpaque" DataValueField="CveTipoEmpaque" AppendDataBoundItems="true" CssClass="table-group-action-input form-control input-inline input-sm select2me " Width="100px">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<%-- INDICADORES --%>
<asp:UpdatePanel ID="UpIndicadores" runat="server" class="portlet-body form" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-2 col-md-offset-4">
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding-top: 0px;">
<div class="display" style="margin-bottom: 0px">
<div class="number">
<h3 class="font-green-sharp">
<span data-counter="counterup">
<asp:Label runat="server" Text="0" ID="LblCajas"></asp:Label></span>
<asp:Label runat="server" ID="Lb11" Text=""></asp:Label>
</h3>
<small>Cajas</small>
</div>
</div>
</div>
</div>
<div class="col-md-2">
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding-top: 0px;">
<div class="display" style="margin-bottom: 0px">
<div class="number">
<h3 class="font-red-haze">
<span data-counter="counterup">
<asp:Label runat="server" Text="0" ID="LblBins"></asp:Label></span>
<asp:Label runat="server" ID="Label2" Text=""></asp:Label>
</h3>
<small>Bins</small>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" class="Widthall" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-12 ">
<div class="portlet light bordered xspadding">
<div class="portlet-title">
<div class="caption font-green">
<i class="fa fa-check-circle font-green"></i>
<span class="caption-subject bold uppercase">Cajas
</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
</div>
<div class="portlet-body form">
<%-- <div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlFolio" DataValueField="CveProduccion" DataTextField="FolioHuertaFecha" OnSelectedIndexChanged="DdlFolio_SelectedIndexChanged" AutoPostBack="true" runat="server" CssClass="form-control select2me" AppendDataBoundItems="true" Width="250px"></asp:DropDownList>
<label for="<%= DdlFolio.ClientID.ToString()%>">Folio de Empaque:</label>
</div>
<br />
<br />--%>
<asp:GridView ID="GvCajas" runat="server" OnRowDataBound="GvResultado_RowDataBound" EmptyDataText="No se encontraron los resultados" ShowHeader="true" GridLines="None" ShowHeaderWhenEmpty="true" CssClass="table table-hover table-striped mysmallbtn ScrollAD" Width="100%" data-sort="true" AutoGenerateColumns="False"
DataKeyNames="CveProduccionResultado,CveProduccion,CveOrdenProduccionDetalle,Cantidad,CvePS,CveTamaño,CveTipoEtiqueta,CveCalidad,CveTipoCaja,Peso,CveTipoEmpaque,CveTipoMaduracion,CveTipoProducto,ImportePreEnfriado">
<Columns>
<asp:HyperLinkField HeaderText="Folio EMP" DataTextField="Folio" DataNavigateUrlFields="CveProduccion" DataNavigateUrlFormatString="/CGame/Empaque.aspx?&CveProduccion={0}" />
<asp:HyperLinkField HeaderText="Folio OC" DataTextField="FolioOC" DataNavigateUrlFields="CveOrdenCorte" DataNavigateUrlFormatString="/CGame/RepOrdenCorteDetalle.aspx?&CveOrdenCorte={0}" />
<asp:TemplateField HeaderText="Huerta" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblHuerta" runat="server" Text='<%# Eval("Huerta")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="LblCantidad" runat="server" Text='<%# Eval("Cantidad")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fruto" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblPS" runat="server" Text='<%# Eval("PS")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo Producción" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoProducto" runat="server" Text='<%# Eval("TipoProducto")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Variedad" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoMaduracion" runat="server" Text='<%# Eval("TipoMaduracion")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo Empaque" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoEmpaque" runat="server" Text='<%# Eval("TipoEmpaque")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tamaño" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTamaño" runat="server" Text='<%# Eval("Tamaño")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="PLU" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoEtiqueta" runat="server" Text='<%# Eval("CveTipoEtiqueta")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Calidad" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblCalidad" runat="server" Text='<%# Eval("Calidad")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Etiqueta" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoCaja" runat="server" Text='<%# Eval("TipoCaja")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Orden de Producción" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:DropDownList ID="DdlOrdenProduccionDetalle" AutoPostBack="true" OnSelectedIndexChanged="DdlOrdenProduccionDetalle_SelectedIndexChanged" DataValueField="CveOrdenProduccionDetalle" DataTextField="Folio" runat="server" CssClass="form-control select2me" AppendDataBoundItems="true" Width="200px"></asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Desglosar">
<ItemTemplate>
<asp:TextBox ID="TxtCantDividir" Width="30px" runat="server" />
<ajax:FilteredTextBoxExtender ID="SoloNumeros" runat="server" TargetControlID="TxtCantDividir" FilterType="Custom, Numbers" ValidChars="." />
<asp:LinkButton data-toggle="tooltip" data-placement="top" ToolTip="Aplicar Desglose" runat="server" ID="BtnDividir" Text="<i class='fa fa-check' style='color:green'></i>" OnClick="Dividir" Style="display: none;" CssClass="btn btn-default btn-circle btn-xs" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Fecha" ItemStyle-Width="15%" HeaderText="Fecha Empaque" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
</Columns>
</asp:GridView>
<asp:HiddenField runat="server" ClientIDMode="Static" ID="HdnCantidad" />
</div>
</div>
</div>
</div>
<br />
<div class="row">
<div class="col-md-12 ">
<div class="portlet light bordered xspadding">
<div class="portlet-title">
<div class="caption font-green">
<i class="fa fa-check-circle font-green"></i>
<span class="caption-subject bold uppercase">Bins
</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
</div>
<div class="portlet-body form">
<%-- <div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlFolio" DataValueField="CveProduccion" DataTextField="FolioHuertaFecha" OnSelectedIndexChanged="DdlFolio_SelectedIndexChanged" AutoPostBack="true" runat="server" CssClass="form-control select2me" AppendDataBoundItems="true" Width="250px"></asp:DropDownList>
<label for="<%= DdlFolio.ClientID.ToString()%>">Folio de Empaque:</label>
</div>
<br />
<br />--%>
<asp:GridView ID="GvBins" runat="server" OnRowDataBound="GvBins_RowDataBound" EmptyDataText="No se encontraron los resultados" ShowHeader="true" GridLines="None" ShowHeaderWhenEmpty="true" CssClass="table table-hover table-striped mysmallbtn ScrollAD" Width="100%" data-sort="true" AutoGenerateColumns="False"
DataKeyNames="CveProduccionResultado,CveProduccion,CveOrdenProduccionDetalle,Cantidad,CvePS,CveTamaño,CveTipoEtiqueta,CveCalidad,CveTipoCaja,Peso,CveTipoEmpaque,CveTipoMaduracion,CveTipoProducto,ImportePreEnfriado">
<Columns>
<asp:HyperLinkField HeaderText="Folio EMP" DataTextField="Folio" DataNavigateUrlFields="CveProduccion" DataNavigateUrlFormatString="/CGame/Empaque.aspx?&CveProduccion={0}" />
<asp:HyperLinkField HeaderText="Folio OC" DataTextField="FolioOC" DataNavigateUrlFields="CveOrdenCorte" DataNavigateUrlFormatString="/CGame/RepOrdenCorteDetalle.aspx?&CveOrdenCorte={0}" />
<asp:TemplateField HeaderText="Huerta" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblHuerta" runat="server" Text='<%# Eval("Huerta")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="LblCantidad" runat="server" Text='<%# Eval("Cantidad")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fruto" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblPS" runat="server" Text='<%# Eval("PS")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo Producción" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoProducto" runat="server" Text='<%# Eval("TipoProducto")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Variedad" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoMaduracion" runat="server" Text='<%# Eval("TipoMaduracion")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo Empaque" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoEmpaque" runat="server" Text='<%# Eval("TipoEmpaque")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tamaño" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTamaño" runat="server" Text='<%# Eval("Tamaño")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="PLU" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoEtiqueta" runat="server" Text='<%# Eval("CveTipoEtiqueta")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Calidad" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblCalidad" runat="server" Text='<%# Eval("Calidad")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Etiqueta" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoCaja" runat="server" Text='<%# Eval("TipoCaja")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Orden de Producción" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:DropDownList ID="DdlOrdenProduccionDetalle" AutoPostBack="true" OnSelectedIndexChanged="DdlOrdenProduccionDetalle_SelectedIndexChanged" DataValueField="CveOrdenProduccionDetalle" DataTextField="Folio" runat="server" CssClass="form-control select2me" AppendDataBoundItems="true" Width="200px"></asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Desglosar">
<ItemTemplate>
<asp:TextBox ID="TxtCantDividir" Width="30px" runat="server" />
<ajax:FilteredTextBoxExtender ID="SoloNumeros" runat="server" TargetControlID="TxtCantDividir" FilterType="Custom, Numbers" ValidChars="." />
<asp:LinkButton data-toggle="tooltip" data-placement="top" ToolTip="Aplicar Desglose" runat="server" ID="BtnDividir" Text="<i class='fa fa-check' style='color:green'></i>" OnClick="Dividir2" Style="display: none;" CssClass="btn btn-default btn-circle btn-xs" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Fecha" ItemStyle-Width="15%" HeaderText="Fecha Empaque" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
</Columns>
</asp:GridView>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript">
function Dividir(t) {
$get("HdnCantidad").value = $get(t).value;
}
function LimitaCantidad(C, textbox, button) {
// var contenedor = $(textbox).parent().find("#" + buttonIdDiv);
if (ToDouble(textbox.value) >= C) {
textbox.value = "";
}
if (parseFloat(textbox.value) > 0) {
$get(button).style.display = "";
//$(contenedor).show();
}
else {
$get(button).style.display = "none";
//$(contenedor).hide();
}
}
function Dividir2(t) {
$get("HdnCantidad").value = $get(t).value;
}
function LimitaCantidad2(C, textbox, button) {
// var contenedor = $(textbox).parent().find("#" + buttonIdDiv);
if (ToDouble(textbox.value) >= C) {
textbox.value = "";
}
if (parseFloat(textbox.value) > 0) {
$get(button).style.display = "";
//$(contenedor).show();
}
else {
$get(button).style.display = "none";
//$(contenedor).hide();
}
}
</script>
</asp:Content>

View File

@@ -0,0 +1,421 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;
using Extensiones;
using System.Data;
using Microsoft.Reporting.WebForms;
//using Extensiones;
public partial class CGame_AsignacionEmpaque : ClsPaginas
{
#region PROPIEDADES
private DataTable DtCant
{
get { return DtCant = (DataTable)ViewState["DtCant"]; }
set { ViewState["DtCant"] = value; }
}
private DataTable DtBins
{
get { return DtBins = (DataTable)ViewState["DtBins"]; }
set { ViewState["DtBins"] = value; }
}
private DataTable DtCajas
{
get { return DtCajas = (DataTable)ViewState["DtCajas"]; }
set { ViewState["DtCajas"] = value; }
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
CreaDtCant();
CargaFiltros();
CargaResultado();
}
}
#region "CARGA DATOS"
protected void CreaDtCant()
{
DtCant = new DataTable();
DtCant.Columns.Add("CveOrdenProduccionDetalle");
DtCant.Columns.Add("CantRest");
}
protected void CargaFiltros()
{
ClsCGame ObjCGame = new ClsCGame();
int CveEmpresa = UsuarioActual.CveEmpresa;
if (ObjCGame.GetHuerta(CveEmpresa))
{
DdlHuerta.DataSource = ObjCGame.DtResultados;
DdlHuerta.DataBind();
}
if (ObjCGame.GetPS(CveEmpresa))
{
DdlFruto.DataSource = ObjCGame.DtResultados;
DdlFruto.DataBind();
}
if (ObjCGame.GetTipoMaduracion(-1, -1, -1, CveEmpresa))
{
DdlVariedad.DataSource = ObjCGame.DtResultados;
DdlVariedad.DataBind();
}
if (ObjCGame.GetTipoProducto(CveEmpresa))
{
DdlTipoProduccion.DataSource = ObjCGame.DtResultados;
DdlTipoProduccion.DataBind();
}
if (ObjCGame.GetTamaños(CveEmpresa))
{
DdlTamaño.DataSource = ObjCGame.DtResultados;
DdlTamaño.DataBind();
}
if (ObjCGame.GetCalidad(CveEmpresa))
{
DdlCalidad.DataSource = ObjCGame.DtResultados;
DdlCalidad.DataBind();
}
if (ObjCGame.GetTipoCaja(CveEmpresa))
{
DdlEtiqueta.DataSource = ObjCGame.DtResultados;
DdlEtiqueta.DataBind();
}
if (ObjCGame.GetTipoEmpaque(-1, -1, CveEmpresa))
{
DdlTipoEmpaque.DataSource = ObjCGame.DtResultados;
DdlTipoEmpaque.DataBind();
}
ObjCGame.Dispose();
}
protected void CargaResultado()
{
ClsCGame ObjCGame = new ClsCGame();
Double TotalCajas = 0, TotalBins = 0;
if (ObjCGame.GetProduccionResultado(-1, CveEmpresa: UsuarioActual.CveEmpresa))
{
DtCajas = ObjCGame.DtResultados.FiltraParametros("CveOrdenProduccionDetalle IS NULL AND Tipo = 1");
GvCajas.DataSource = DtCajas;
TotalCajas = ObjCGame.DtResultados.FiltraParametros("CveOrdenProduccionDetalle IS NULL AND Tipo = 1").SUM("Cantidad");
DtBins = ObjCGame.DtResultados.FiltraParametros("CveOrdenProduccionDetalle IS NULL AND Tipo = 2");
GvBins.DataSource = DtBins;
TotalBins = ObjCGame.DtResultados.FiltraParametros("CveOrdenProduccionDetalle IS NULL AND Tipo = 2").SUM("Cantidad");
ObjCGame.Dispose();
}
GvCajas.DataBind();
GvBins.DataBind();
UpDatos.Update();
LblCajas.Text = TotalCajas.FormatoNumero(0);
LblBins.Text = TotalBins.FormatoNumero(0);
UpIndicadores.Update();
}
#endregion
protected void Dividir(object sender, EventArgs e)
{
int Index = ((LinkButton)sender).CommandArgument.ToString().ToEntero();
int Cantidad = HdnCantidad.Value.ToEntero();
int CantidadPasada = GvCajas.Rows[Index].DataKey("Cantidad").ToEntero();
double PesoUnitario = GvCajas.Rows[Index].DataKey("Peso").ToDouble() / CantidadPasada;
int CantActualizada = GvCajas.Rows[Index].DataKey("Cantidad").ToEntero() - Cantidad;
double ImporteUnitario = GvCajas.Rows[Index].DataKey("ImportePreEnfriado").ToDouble() / CantidadPasada;
ClsCGame ObjCGame = new ClsCGame();
ObjCGame.IniciaTransacSQL();
bool Error = false;
if (ObjCGame.UpdateProduccionResultado(GvCajas.Rows[Index].DataKey("CveProduccionResultado").ToEntero(), GvCajas.Rows[Index].DataKey("CveProduccion").ToEntero(), GvCajas.Rows[Index].DataKey("CvePS").ToEntero(),
CantActualizada, CantActualizada * PesoUnitario, GvCajas.Rows[Index].DataKey("CveTamaño").ToEntero(), GvCajas.Rows[Index].DataKey("CveCalidad").ToEntero(), GvCajas.Rows[Index].DataKey("CveTipoCaja").ToEntero(),
Convert.ToBoolean(GvCajas.Rows[Index].DataKey("CveTipoEtiqueta")), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, GvCajas.Rows[Index].DataKey("CveTipoEmpaque").ToEntero(), GvCajas.Rows[Index].DataKey("CveTipoMaduracion").ToEntero(), GvCajas.Rows[Index].DataKey("CveTipoProducto").ToEntero(), -1))
{
ObjCGame.UpdateProduccionResultadoImporte(GvCajas.Rows[Index].DataKey("CveProduccionResultado").ToEntero(), CantActualizada * ImporteUnitario);
if (ObjCGame.AddProduccionResultado(GvCajas.Rows[Index].DataKey("CveProduccion").ToEntero(), GvCajas.Rows[Index].DataKey("CvePS").ToEntero(),
Cantidad, Cantidad * PesoUnitario, GvCajas.Rows[Index].DataKey("CveTamaño").ToEntero(), GvCajas.Rows[Index].DataKey("CveCalidad").ToEntero(), GvCajas.Rows[Index].DataKey("CveTipoCaja").ToEntero(),
Convert.ToBoolean(GvCajas.Rows[Index].DataKey("CveTipoEtiqueta").ToEntero()), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, GvCajas.Rows[Index].DataKey("CveTipoEmpaque").ToEntero(), GvCajas.Rows[Index].DataKey("CveTipoMaduracion").ToEntero(), GvCajas.Rows[Index].DataKey("CveTipoProducto").ToEntero(), -1) == false)
{
Error = true;
}
else
{
ObjCGame.UpdateProduccionResultadoImporte(ObjCGame.CveProduccionResultado, Cantidad * ImporteUnitario);
}
}
else
{
Error = true;
}
if (!Error) { ObjCGame.Commit(); } else { ObjCGame.RollBack(); };
ObjCGame.Dispose();
CargaResultado();
}
protected void Dividir2(object sender, EventArgs e)
{
int Index = ((LinkButton)sender).CommandArgument.ToString().ToEntero();
int Cantidad = HdnCantidad.Value.ToEntero();
int CantidadPasada = GvBins.Rows[Index].DataKey("Cantidad").ToEntero();
double PesoUnitario = GvBins.Rows[Index].DataKey("Peso").ToDouble() / CantidadPasada;
int CantActualizada = GvBins.Rows[Index].DataKey("Cantidad").ToEntero() - Cantidad;
double ImporteUnitario = GvBins.Rows[Index].DataKey("ImportePreEnfriado").ToDouble() / CantidadPasada;
ClsCGame ObjCGame = new ClsCGame();
ObjCGame.IniciaTransacSQL();
bool Error = false;
if (ObjCGame.UpdateProduccionResultado(GvBins.Rows[Index].DataKey("CveProduccionResultado").ToEntero(), GvBins.Rows[Index].DataKey("CveProduccion").ToEntero(), GvBins.Rows[Index].DataKey("CvePS").ToEntero(),
CantActualizada, CantActualizada * PesoUnitario, GvBins.Rows[Index].DataKey("CveTamaño").ToEntero(), GvBins.Rows[Index].DataKey("CveCalidad").ToEntero(), GvBins.Rows[Index].DataKey("CveTipoCaja").ToEntero(),
Convert.ToBoolean(GvBins.Rows[Index].DataKey("CveTipoEtiqueta")), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, GvBins.Rows[Index].DataKey("CveTipoEmpaque").ToEntero(), GvBins.Rows[Index].DataKey("CveTipoMaduracion").ToEntero(), GvBins.Rows[Index].DataKey("CveTipoProducto").ToEntero(), -1))
{
ObjCGame.UpdateProduccionResultadoImporte(GvBins.Rows[Index].DataKey("CveProduccionResultado").ToEntero(), CantActualizada * ImporteUnitario);
if (ObjCGame.AddProduccionResultado(GvBins.Rows[Index].DataKey("CveProduccion").ToEntero(), GvBins.Rows[Index].DataKey("CvePS").ToEntero(),
Cantidad, Cantidad * PesoUnitario, GvBins.Rows[Index].DataKey("CveTamaño").ToEntero(), GvBins.Rows[Index].DataKey("CveCalidad").ToEntero(), GvBins.Rows[Index].DataKey("CveTipoCaja").ToEntero(),
Convert.ToBoolean(GvBins.Rows[Index].DataKey("CveTipoEtiqueta").ToEntero()), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, GvBins.Rows[Index].DataKey("CveTipoEmpaque").ToEntero(), GvBins.Rows[Index].DataKey("CveTipoMaduracion").ToEntero(), GvBins.Rows[Index].DataKey("CveTipoProducto").ToEntero(), -1) == false)
{
Error = true;
}
else
{
ObjCGame.UpdateProduccionResultadoImporte(ObjCGame.CveProduccionResultado, Cantidad * ImporteUnitario);
}
}
else
{
Error = true;
}
if (!Error) { ObjCGame.Commit(); } else { ObjCGame.RollBack(); };
ObjCGame.Dispose();
CargaResultado();
}
protected void GvResultado_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetOrdenProduccionDetalleCant(UsuarioActual.CveEmpresa, e.Row.DBCampo("CvePS").ToEntero(), -1))
{
DtCant = ObjCGame.DtResultados.FiltraParametros(String.Format("CantRest > 0 AND Tipo = {0} AND CveEstatus IN (1,2,3)", 1));
e.Row.FCDropDownList("DdlOrdenProduccionDetalle").DataSource = DtCant;
e.Row.FCDropDownList("DdlOrdenProduccionDetalle").Items.Insert(0, new ListItem("Seleccione", "-1"));
}
ObjCGame.Dispose();
e.Row.FCDropDownList("DdlOrdenProduccionDetalle").DataBind();
e.Row.FCLinkButton("BtnDividir").Attributes.Add("onclick", String.Format("Dividir('{0}');", e.Row.FCTextBox("TxtCantDividir").ClientID));
e.Row.FCLinkButton("BtnDividir").CommandArgument = e.Row.RowIndex.ToString();
e.Row.FCTextBox("TxtCantDividir").Attributes.Add("onkeyup", String.Format("LimitaCantidad({0},this,'{1}');", e.Row.DBCampo("Cantidad"), e.Row.FCLinkButton("BtnDividir").ClientID));
//if (e.Row.FCDropDownList("DdlOrdenProduccionDetalle").Items.Count < 2)
//{
// e.Row.Visible = false;
//}
//String Css = "Texto";
//String Liga = $"/CGame/Empaque.aspx?&CveProduccion={e.Row.DataKey("CveProduccion")}";
// e.Row.FCLabel("LblFolio").Text = "<a class=" + "" + Css + "" + " href=" + "" + Liga + "" + ">" + e.Row.FCLabel("LblFolio").Text + "</a>";
if (e.Row.DataKey("CveTipoEtiqueta").ToEntero() == 1)
{
e.Row.FCLabel("LblTipoEtiqueta").Text = "Si";
}
else
{
e.Row.FCLabel("LblTipoEtiqueta").Text = "No";
}
}
}
protected void DdlOrdenProduccionDetalle_SelectedIndexChanged(object sender, EventArgs e)
{
GridViewRow GvRow = (GridViewRow)((DropDownList)sender).NamingContainer;
if (GvRow.FCDropDownList("DdlOrdenProduccionDetalle").SelectedValue != "-1")
{
ClsCGame ObjCGame = new ClsCGame();
ObjCGame.IniciaTransacSQL();
bool Error = false;
int CveOrdenProduccionDetalle = GvRow.FCDropDownList("DdlOrdenProduccionDetalle").SelectedValue.ToEntero();
double CantidadRequerida = 0.0;
if (ObjCGame.GetOrdenProduccionDetalleCant(UsuarioActual.CveEmpresa, -1, CveOrdenProduccionDetalle))
{
CantidadRequerida = ObjCGame.DtResultados.Rows[0]["CantRest"].ToString().ToDouble();
}
if (CantidadRequerida >= GvRow.DataKey("Cantidad").ToEntero())
{
CantidadRequerida = GvRow.DataKey("Cantidad").ToDouble();
//si lo que requiero es mayor, solo debo asignar lo que tiene el movimiento de resultado
if (ObjCGame.AsignaProduccionResultado(GvRow.DataKey("CveProduccionResultado").ToEntero(), CveOrdenProduccionDetalle, CantidadRequerida, false) == false)
{
Error = true;
}
}
else
{
// si el resultado es mayor, asigna la cantidad requerida y genera un nuevo movimento con la cantidad restante
if (ObjCGame.AsignaProduccionResultado(GvRow.DataKey("CveProduccionResultado").ToEntero(), CveOrdenProduccionDetalle, CantidadRequerida, true) == false)
{
Error = true;
}
}
if (!Error) { ObjCGame.Commit(); } else { ObjCGame.RollBack(); };
ObjCGame.Dispose();
CargaResultado();
}
}
protected void GvBins_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetOrdenProduccionDetalleCant(UsuarioActual.CveEmpresa, e.Row.DBCampo("CvePS").ToEntero(), -1))
{
DtCant = ObjCGame.DtResultados.FiltraParametros(String.Format("CantRest > 0 AND Tipo = {0} AND CveEstatus IN (1,2,3)", 2));
e.Row.FCDropDownList("DdlOrdenProduccionDetalle").DataSource = DtCant;
e.Row.FCDropDownList("DdlOrdenProduccionDetalle").Items.Insert(0, new ListItem("Seleccione", "-1"));
}
ObjCGame.Dispose();
e.Row.FCDropDownList("DdlOrdenProduccionDetalle").DataBind();
e.Row.FCLinkButton("BtnDividir").Attributes.Add("onclick", String.Format("Dividir2('{0}');", e.Row.FCTextBox("TxtCantDividir").ClientID));
e.Row.FCLinkButton("BtnDividir").CommandArgument = e.Row.RowIndex.ToString();
e.Row.FCTextBox("TxtCantDividir").Attributes.Add("onkeyup", String.Format("LimitaCantidad2({0},this,'{1}');", e.Row.DBCampo("Cantidad"), e.Row.FCLinkButton("BtnDividir").ClientID));
//if (e.Row.FCDropDownList("DdlOrdenProduccionDetalle").Items.Count < 2)
//{
// e.Row.Visible = false;
//}
//String Css = "Texto";
////String Liga = $"/CGame/Empaque.aspx?&CveProduccion={e.Row.DataKey("CveProduccion")}";
//e.Row.FCLabel("LblFolio").Text = "<a class=" + "" + Css + "" + " href=" + "" + Liga + "" + ">" + e.Row.FCLabel("LblFolio").Text + "</a>";
if (e.Row.DataKey("CveTipoEtiqueta").ToEntero() == 1)
{
e.Row.FCLabel("LblTipoEtiqueta").Text = "Si";
}
else
{
e.Row.FCLabel("LblTipoEtiqueta").Text = "No";
}
}
}
protected void BtnConsultar_Click(object sender, EventArgs e)
{
int CveHuerta = DdlHuerta.SelectedValue.ToEntero();
int CveFruto = DdlFruto.SelectedValue.ToEntero();
int CveTipoProduccion = DdlTipoProduccion.SelectedValue.ToEntero();
int CveVariedad = DdlVariedad.SelectedValue.ToEntero();
int CveTipoEmpaque = DdlTipoEmpaque.SelectedValue.ToEntero();
int CveTamaño = DdlTamaño.SelectedValue.ToEntero();
int CveCalidad = DdlCalidad.SelectedValue.ToEntero();
int CveEtiqueta = DdlEtiqueta.SelectedValue.ToEntero();
Double TotalCajas = 0, TotalBins = 0;
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetProduccionResultado(-1, -1, -1, UsuarioActual.CveEmpresa, -1, CveHuerta, CveFruto, CveVariedad, CveTipoProduccion, CveTamaño, CveCalidad, CveEtiqueta, CveTipoEmpaque))
{
GvCajas.DataSource = ObjCGame.DtResultados.FiltraParametros("CveOrdenProduccionDetalle IS NULL AND Tipo = 1");
TotalCajas = ObjCGame.DtResultados.FiltraParametros("CveOrdenProduccionDetalle IS NULL AND Tipo = 1").SUM("Cantidad");
GvBins.DataSource = ObjCGame.DtResultados.FiltraParametros("CveOrdenProduccionDetalle IS NULL AND Tipo = 2");
TotalBins = ObjCGame.DtResultados.FiltraParametros("CveOrdenProduccionDetalle IS NULL AND Tipo = 2").SUM("Cantidad");
ObjCGame.Dispose();
}
GvCajas.DataBind();
GvBins.DataBind();
UpDatos.Update();
LblCajas.Text = TotalCajas.FormatoNumero(0);
LblBins.Text = TotalBins.FormatoNumero(0);
UpIndicadores.Update();
}
#region "PDF"
protected void ImgImprimirPDF_Click(object sender, EventArgs e)
{
GenerarPDF("PDF");
}
protected void GenerarPDF(String Opcion)
{
if (DtCajas.Rows.Count > 0 && DtBins.Rows.Count > 0)
{
System.IO.FileInfo Imagen = new System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta));
String logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa);
List<ReportParameter> para = new List<ReportParameter>();
para.Add(new ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa));
para.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre));
para.Add(new ReportParameter("FechaImpresion", DateTime.Now.ToString()));
para.Add(new ReportParameter("Huerta", DdlHuerta.SelectedItem.Text));
para.Add(new ReportParameter("Fruto", DdlFruto.SelectedItem.Text));
para.Add(new ReportParameter("Variedad", DdlVariedad.SelectedItem.Text));
para.Add(new ReportParameter("TipoProduccion", DdlTipoProduccion.SelectedItem.Text));
para.Add(new ReportParameter("Tamaño", DdlTamaño.SelectedItem.Text));
para.Add(new ReportParameter("Calidad", DdlCalidad.SelectedItem.Text));
para.Add(new ReportParameter("Etiqueta", DdlEtiqueta.SelectedItem.Text));
para.Add(new ReportParameter("TipoEmpaque", DdlTipoEmpaque.SelectedItem.Text));
para.Add(new ReportParameter("TotalCajas", LblCajas.Text));
para.Add(new ReportParameter("TotalBins", LblBins.Text));
if (Imagen.Exists)
{
para.Add(new ReportParameter("LogoPath", logouri));
}
else
{
para.Add(new ReportParameter("LogoPath", ""));
}
List<ReportDataSource> lrds = new List<ReportDataSource>();
ReportDataSource rds = new ReportDataSource();
rds.Name = "DataSet1"; rds.Value = DtCajas;
ReportDataSource rds2 = new ReportDataSource();
rds2.Name = "DataSet2"; rds2.Value = DtBins;
lrds.Add(rds);
lrds.Add(rds2);
ImprimirPDF("Empresas/Grales/Formatos/RepAsignacionEmpaque.rdlc", lrds, para, "RepAsignacionEmpaque", Opcion);
}
else
{
Alert("No hay datos consultados", ModExtensiones.TipoMensaje.MsgAdvertencia);
}
}
#endregion
}

View File

@@ -0,0 +1,408 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="AsignacionEmpaque2.aspx.cs" Inherits="CGame_AsignacionEmpaque2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Asignación de Empaque
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<%--FILTROS--%>
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" id="FiltrosCotratos">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" OnClick="BtnConsultar_Click" class="btn btn-primary" />
<a href="javascript:;" class="expand"></a>
</div>
<div class="titlefiltros caption">
<div class="row">
<label class="col-md-1 text-right" id="LblHuerta" runat="server">Huerta:</label>
<div class="col-md-1" id="DivDdlHuerta" runat="server">
<asp:DropDownList ID="DdlHuerta" runat="server" DataTextField="Huerta" DataValueField="CveHuerta" AppendDataBoundItems="true" CssClass="table-group-action-input form-control input-inline input-sm select2me " Width="100px">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<label class="col-md-1 text-right" id="LblFruto" runat="server">Fruto:</label>
<div class="col-md-1" id="DivDdlFruto" runat="server">
<asp:DropDownList ID="DdlFruto" runat="server" DataTextField="PS" DataValueField="CvePS" AppendDataBoundItems="true" CssClass="table-group-action-input form-control input-inline input-sm select2me " Width="100px">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<label class="col-md-1 text-right" id="LblVariedad" runat="server">Variedad:</label>
<div class="col-md-1" id="DivDdlVariedad" runat="server">
<asp:DropDownList ID="DdlVariedad" runat="server" DataTextField="TipoMaduracion" DataValueField="CveTipoMaduracion" AppendDataBoundItems="true" CssClass="table-group-action-input form-control input-inline input-sm select2me " Width="100px">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<label class="col-md-2 text-right" id="LblTipoProduccion" runat="server">Tipo Producción:</label>
<div class="col-md-1" id="DivDdlTipoProduccion" runat="server">
<asp:DropDownList ID="DdlTipoProduccion" runat="server" DataTextField="TipoProducto" DataValueField="CveTipoProducto" AppendDataBoundItems="true" CssClass="table-group-action-input form-control input-inline input-sm select2me " Width="100px">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>
<div class="portlet-body" style="display: none;">
<div class="row">
<label class="col-md-1 text-right" id="LblTamaño" runat="server">Tamaño:</label>
<div class="col-md-1" id="DivDdlTamaño" runat="server">
<asp:DropDownList ID="DdlTamaño" runat="server" DataTextField="Tamaño" DataValueField="CveTamaño" AppendDataBoundItems="true" CssClass="table-group-action-input form-control input-inline input-sm select2me " Width="100px">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<label class="col-md-1 text-right" id="LblCalidad" runat="server">Calidad:</label>
<div class="col-md-1" id="DivDdlCalidad" runat="server">
<asp:DropDownList ID="DdlCalidad" runat="server" DataTextField="Calidad" DataValueField="CveCalidad" AppendDataBoundItems="true" CssClass="table-group-action-input form-control input-inline input-sm select2me " Width="100px">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<label class="col-md-1 text-right" id="LblEtiqueta" runat="server">Etiqueta:</label>
<div class="col-md-1" id="DivDdlEtiqueta" runat="server">
<asp:DropDownList ID="DdlEtiqueta" runat="server" DataTextField="TipoCaja" DataValueField="CveTipoCaja" AppendDataBoundItems="true" CssClass="table-group-action-input form-control input-inline input-sm select2me " Width="100px">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<label class="col-md-2 text-right" id="LblTipoEmpaque" runat="server">Tipo Empaque:</label>
<div class="col-md-1" id="DivDdlTipoEmpaque" runat="server">
<asp:DropDownList ID="DdlTipoEmpaque" runat="server" DataTextField="TipoEmpaque" DataValueField="CveTipoEmpaque" AppendDataBoundItems="true" CssClass="table-group-action-input form-control input-inline input-sm select2me " Width="100px">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<%-- INDICADORES --%>
<asp:UpdatePanel ID="UpIndicadores" runat="server" class="portlet-body form" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-2 col-md-offset-4">
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding-top: 0px;">
<div class="display" style="margin-bottom: 0px">
<div class="number">
<h3 class="font-green-sharp">
<span data-counter="counterup">
<asp:Label runat="server" Text="0" ID="LblCajas"></asp:Label></span>
<asp:Label runat="server" ID="Lb11" Text=""></asp:Label>
</h3>
<small>Cajas</small>
</div>
</div>
</div>
</div>
<div class="col-md-2">
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding-top: 0px;">
<div class="display" style="margin-bottom: 0px">
<div class="number">
<h3 class="font-red-haze">
<span data-counter="counterup">
<asp:Label runat="server" Text="0" ID="LblBins"></asp:Label></span>
<asp:Label runat="server" ID="Label2" Text=""></asp:Label>
</h3>
<small>Bins</small>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" class="Widthall" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-12 ">
<div class="portlet light bordered xspadding">
<div class="portlet-title">
<div class="caption font-green">
<i class="fa fa-check-circle font-green"></i>
<span class="caption-subject bold uppercase">Cajas
</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
</div>
<div class="portlet-body form">
<asp:GridView ID="GvCajas" runat="server" OnRowDataBound="GvResultado_RowDataBound" EmptyDataText="No se encontraron los resultados" ShowHeader="true" GridLines="None" ShowHeaderWhenEmpty="true" CssClass="table table-hover table-striped mysmallbtn ScrollAD" Width="100%" data-sort="true" AutoGenerateColumns="False"
DataKeyNames="CveProduccionResultado,CveProduccion,CveOrdenProduccionDetalle,Cantidad,CvePS,CveTamaño,CveTipoEtiqueta,CveCalidad,CveTipoCaja,Peso,CveTipoEmpaque,CveTipoMaduracion,CveTipoProducto,ImportePreEnfriado,Tipo,FechaCorte,FechaCorteNum">
<Columns>
<asp:HyperLinkField HeaderText="Folio EMP" DataTextField="Folio" Target="_blank" DataNavigateUrlFields="CveProduccion" DataNavigateUrlFormatString="/CGame/Empaque.aspx?&CveProduccion={0}" />
<asp:HyperLinkField HeaderText="Folio OC" DataTextField="FolioOC" Target="_blank" DataNavigateUrlFields="CveOrdenCorte" DataNavigateUrlFormatString="/CGame/RepOrdenCorteDetalle.aspx?&CveOrdenCorte={0}" />
<asp:TemplateField HeaderText="Huerta" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblHuerta" runat="server" Text='<%# Eval("Huerta")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
<asp:TemplateField HeaderText="Fruto" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblPS" runat="server" Text='<%# Eval("PS")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo Producción" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoProducto" runat="server" Text='<%# Eval("TipoProducto")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Variedad" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoMaduracion" runat="server" Text='<%# Eval("TipoMaduracion")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo Empaque" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoEmpaque" runat="server" Text='<%# Eval("TipoEmpaque")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tamaño" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTamaño" runat="server" Text='<%# Eval("Tamaño")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="PLU" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoEtiqueta" runat="server" Text='<%# Eval("CveTipoEtiqueta")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Calidad" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblCalidad" runat="server" Text='<%# Eval("Calidad")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Etiqueta" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoCaja" runat="server" Text='<%# Eval("TipoCaja")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Asignar" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Asignar" ID="LnkAsignar" OnClick="LnkAsignar_Click" CssClass="btn btn-default btn-circle btn-sm" runat="server" Text="<i class='fa fa-check' style='color:green'></i>"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Desglosar">
<ItemTemplate>
<asp:TextBox ID="TxtCantDividir" Width="30px" runat="server" />
<ajax:FilteredTextBoxExtender ID="SoloNumeros" runat="server" TargetControlID="TxtCantDividir" FilterType="Custom, Numbers" ValidChars="." />
<asp:LinkButton data-toggle="tooltip" data-placement="top" ToolTip="Aplicar Desglose" runat="server" ID="BtnDividir" Text="<i class='fa fa-check' style='color:green'></i>" OnClick="Dividir" Style="display: none;" CssClass="btn btn-default btn-circle btn-xs" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="FechaCorte" ItemStyle-Width="15%" HeaderText="Fecha Corte" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
</Columns>
</asp:GridView>
<asp:HiddenField runat="server" ClientIDMode="Static" ID="HdnCantidad" />
</div>
</div>
</div>
</div>
<br />
<div class="row">
<div class="col-md-12 ">
<div class="portlet light bordered xspadding">
<div class="portlet-title">
<div class="caption font-green">
<i class="fa fa-check-circle font-green"></i>
<span class="caption-subject bold uppercase">Bins
</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
</div>
<div class="portlet-body form">
<asp:GridView ID="GvBins" runat="server" OnRowDataBound="GvBins_RowDataBound" EmptyDataText="No se encontraron los resultados" ShowHeader="true" GridLines="None" ShowHeaderWhenEmpty="true" CssClass="table table-hover table-striped mysmallbtn ScrollAD" Width="100%" data-sort="true" AutoGenerateColumns="False"
DataKeyNames="CveProduccionResultado,CveProduccion,CveOrdenProduccionDetalle,Cantidad,CvePS,CveTamaño,CveTipoEtiqueta,CveCalidad,CveTipoCaja,Peso,CveTipoEmpaque,CveTipoMaduracion,CveTipoProducto,ImportePreEnfriado,Tipo,FechaCorte,FechaCorteNum">
<Columns>
<asp:HyperLinkField HeaderText="Folio EMP" DataTextField="Folio" Target="_blank" DataNavigateUrlFields="CveProduccion" DataNavigateUrlFormatString="/CGame/Empaque.aspx?&CveProduccion={0}" />
<asp:HyperLinkField HeaderText="Folio OC" DataTextField="FolioOC" Target="_blank" DataNavigateUrlFields="CveOrdenCorte" DataNavigateUrlFormatString="/CGame/RepOrdenCorteDetalle.aspx?&CveOrdenCorte={0}" />
<asp:TemplateField HeaderText="Huerta" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblHuerta" runat="server" Text='<%# Eval("Huerta")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
<asp:TemplateField HeaderText="Fruto" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblPS" runat="server" Text='<%# Eval("PS")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo Producción" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoProducto" runat="server" Text='<%# Eval("TipoProducto")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Variedad" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoMaduracion" runat="server" Text='<%# Eval("TipoMaduracion")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo Empaque" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoEmpaque" runat="server" Text='<%# Eval("TipoEmpaque")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tamaño" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTamaño" runat="server" Text='<%# Eval("Tamaño")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="PLU" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoEtiqueta" runat="server" Text='<%# Eval("CveTipoEtiqueta")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Calidad" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblCalidad" runat="server" Text='<%# Eval("Calidad")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Etiqueta" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoCaja" runat="server" Text='<%# Eval("TipoCaja")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Asignar" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Asignar" ID="LnkAsignar" OnClick="LnkAsignar_Click" CssClass="btn btn-default btn-circle btn-sm" runat="server" Text="<i class='fa fa-check' style='color:green'></i>"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Desglosar">
<ItemTemplate>
<asp:TextBox ID="TxtCantDividir" Width="30px" runat="server" />
<ajax:FilteredTextBoxExtender ID="SoloNumeros" runat="server" TargetControlID="TxtCantDividir" FilterType="Custom, Numbers" ValidChars="." />
<asp:LinkButton data-toggle="tooltip" data-placement="top" ToolTip="Aplicar Desglose" runat="server" ID="BtnDividir" Text="<i class='fa fa-check' style='color:green'></i>" OnClick="Dividir2" Style="display: none;" CssClass="btn btn-default btn-circle btn-xs" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="FechaCorte" ItemStyle-Width="15%" HeaderText="Fecha Corte" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
</Columns>
</asp:GridView>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DModalAsignacion" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalAsignacion" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Literal ID="LtlTitulo" Text="Asignar" runat="server"> </asp:Literal></h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-3">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCantidad" CssClass="form-control" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvTxtCantidad" runat="server" ControlToValidate="TxtCantidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> es necesario, por favor ingréselo." ValidationGroup="VGAsignar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoTxtCantidad" runat="server" HighlightCssClass="vco" TargetControlID="RfvTxtCantidad"></ajax:ValidatorCalloutExtender>
<asp:RangeValidator ID="RVTxtCantidad" runat="server" ControlToValidate="TxtCantidad" MinimumValue="0" MaximumValue="1" Type="Double" Text="<b><span style='text-decoration: underline'>ERROR:</span></b><br />No cuenta con la cantidad suficiente." ValidationGroup="VGAsignar" />
<label for="<%= TxtCantidad.ClientID.ToString()%>">Cantidad:</label>
</div>
</div>
<div class="col-md-7">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlOrdenProduccionDetalle" DataValueField="CveOrdenProduccionDetalle" DataTextField="Folio" runat="server" CssClass="form-control select2me" AppendDataBoundItems="true" Width="100%">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVOP" runat="server" InitialValue="-1" ControlToValidate="DdlOrdenProduccionDetalle" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Orden de Producción''</b> es necesario, por favor ingréselo." ValidationGroup="VGAsignar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOOP" runat="server" HighlightCssClass="vco" TargetControlID="RFVOP"></ajax:ValidatorCalloutExtender>
<label for="<%= DdlOrdenProduccionDetalle.ClientID.ToString()%>">Orden Producción:</label>
</div>
</div>
<div class="col-md-2">
<asp:Button ID="LnkAsignar" CssClass="btn green-haze btn-outline btn-circle btn-sm" OnClick="LnkAsignar_Click1" runat="server" Text="Agregar" ValidationGroup="VGAsignar" />
</div>
</div>
<div class="row">
<div class="col-md-12">
<asp:GridView ID="GvAsignado" runat="server" EmptyDataText="No hay asignaciones aun" ShowHeader="true" GridLines="None" ShowHeaderWhenEmpty="true"
CssClass="table table-hover table-striped mysmallbtn ScrollAD" Width="100%" data-sort="true" AutoGenerateColumns="False" DataKeyNames="Id,CveOrdenProduccionDetalle,CantidadAsignada">
<Columns>
<asp:HyperLinkField DataTextField="FolioOP" DataNavigateUrlFields="CveOrdenProduccion" HeaderText="Folio OP" ItemStyle-HorizontalAlign="Center" DataNavigateUrlFormatString="/CGame/OrdenProduccion.aspx?CveOrdenProduccion={0}" Target="_blank" />
<asp:BoundField HeaderText="CantidadAsignada" DataField="CantidadAsignada" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
<asp:BoundField HeaderText="Tipo Producción" DataField="TipoProducto" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Variedad" DataField="TipoMaduracion" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Tamaño" DataField="Tamaño" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Left" ItemStyle-Width="15%" HeaderText="Comandos">
<ItemTemplate>
<asp:LinkButton ID="LnkEliminar" runat="server" OnClick="LnkEliminar_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar la asignación?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnAsignar" OnClick="BtnAsignar_Click" runat="server" Text="Asignar" CssClass="btn btn-primary" ValidationGroup="VgmAsignar" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript">
function Dividir(t) {
$get("HdnCantidad").value = $get(t).value;
}
function LimitaCantidad(C, textbox, button) {
// var contenedor = $(textbox).parent().find("#" + buttonIdDiv);
if (ToDouble(textbox.value) >= C) {
textbox.value = "";
}
if (parseFloat(textbox.value) > 0) {
$get(button).style.display = "";
//$(contenedor).show();
}
else {
$get(button).style.display = "none";
//$(contenedor).hide();
}
}
function Dividir2(t) {
$get("HdnCantidad").value = $get(t).value;
}
function LimitaCantidad2(C, textbox, button) {
// var contenedor = $(textbox).parent().find("#" + buttonIdDiv);
if (ToDouble(textbox.value) >= C) {
textbox.value = "";
}
if (parseFloat(textbox.value) > 0) {
$get(button).style.display = "";
//$(contenedor).show();
}
else {
$get(button).style.display = "none";
//$(contenedor).hide();
}
}
</script>
</asp:Content>

View File

@@ -0,0 +1,570 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;
using Extensiones;
using System.Data;
using Microsoft.Reporting.WebForms;
public partial class CGame_AsignacionEmpaque2 : ClsPaginas
{
#region PROPIEDADES
private DataTable DtCant
{
get { return DtCant = (DataTable)ViewState["DtCant"]; }
set { ViewState["DtCant"] = value; }
}
private DataTable DtAsignado
{
get { return DtAsignado = (DataTable)ViewState["DtAsignado"]; }
set { ViewState["DtAsignado"] = value; }
}
private DataTable DtBins
{
get { return DtBins = (DataTable)ViewState["DtBins"]; }
set { ViewState["DtBins"] = value; }
}
private DataTable DtCajas
{
get { return DtCajas = (DataTable)ViewState["DtCajas"]; }
set { ViewState["DtCajas"] = value; }
}
private int CveProduccionResultado
{
get { return CveProduccionResultado = (int)ViewState["CveProduccionResultado"]; }
set { ViewState["CveProduccionResultado"] = value; }
}
private double Cantidad
{
get { return Cantidad = (double)ViewState["Cantidad"]; }
set { ViewState["Cantidad"] = value; }
}
private int CvePS
{
get { return CvePS = (int)ViewState["CvePS"]; }
set { ViewState["CvePS"] = value; }
}
private int Tipo
{
get { return Tipo = (int)ViewState["Tipo"]; }
set { ViewState["Tipo"] = value; }
}
private int FechaCorteNum
{
get { return FechaCorteNum = (int)ViewState["FechaCorteNum"]; }
set { ViewState["FechaCorteNum"] = value; }
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
CreaDt();
CargaFiltros();
CargaOrdenProduccionDetalle(false);
CargaResultado();
}
}
#region CARGAS
protected void CreaDt()
{
DtCant = new DataTable();
DtCant.Columns.Add("CveOrdenProduccionDetalle");
DtCant.Columns.Add("Folio");
DtCant.Columns.Add("CantRest");
DtCant.Columns.Add("Cantidad");
DtCant.Columns.Add("FolioOP");
DtCant.Columns.Add("TipoProducto");
DtCant.Columns.Add("TipoMaduracion");
DtCant.Columns.Add("Tamaño");
DtCant.Columns.Add("FechaNum");
DtAsignado = new DataTable();
DtAsignado.Columns.Add("CveOrdenProduccionDetalle");
DtAsignado.Columns.Add("CveProduccionResultado");
DtAsignado.Columns.Add("CantidadAsignada");
DtAsignado.Columns.Add("CveOrdenProduccion");
DtAsignado.Columns.Add("FolioOP");
DtAsignado.Columns.Add("TipoProducto");
DtAsignado.Columns.Add("TipoMaduracion");
DtAsignado.Columns.Add("Tamaño");
DtAsignado.Columns.Add("Id");
}
protected void CargaFiltros()
{
ClsCGame ObjCGame = new ClsCGame();
int CveEmpresa = UsuarioActual.CveEmpresa;
if (ObjCGame.GetHuerta(CveEmpresa))
{
DdlHuerta.DataSource = ObjCGame.DtResultados;
DdlHuerta.DataBind();
}
if (ObjCGame.GetPS(CveEmpresa))
{
DdlFruto.DataSource = ObjCGame.DtResultados;
DdlFruto.DataBind();
}
if (ObjCGame.GetTipoMaduracion(-1, -1, -1, CveEmpresa))
{
DdlVariedad.DataSource = ObjCGame.DtResultados;
DdlVariedad.DataBind();
}
if (ObjCGame.GetTipoProducto(CveEmpresa))
{
DdlTipoProduccion.DataSource = ObjCGame.DtResultados;
DdlTipoProduccion.DataBind();
}
if (ObjCGame.GetTamaños(CveEmpresa))
{
DdlTamaño.DataSource = ObjCGame.DtResultados;
DdlTamaño.DataBind();
}
if (ObjCGame.GetCalidad(CveEmpresa))
{
DdlCalidad.DataSource = ObjCGame.DtResultados;
DdlCalidad.DataBind();
}
if (ObjCGame.GetTipoCaja(CveEmpresa))
{
DdlEtiqueta.DataSource = ObjCGame.DtResultados;
DdlEtiqueta.DataBind();
}
if (ObjCGame.GetTipoEmpaque(-1, -1, CveEmpresa))
{
DdlTipoEmpaque.DataSource = ObjCGame.DtResultados;
DdlTipoEmpaque.DataBind();
}
ObjCGame.Dispose();
}
protected void CargaResultado()
{
ClsCGame ObjCGame = new ClsCGame();
Double TotalCajas = 0, TotalBins = 0;
int CveHuerta = DdlHuerta.SelectedValue.ToEntero();
int CveFruto = DdlFruto.SelectedValue.ToEntero();
int CveTipoProduccion = DdlTipoProduccion.SelectedValue.ToEntero();
int CveVariedad = DdlVariedad.SelectedValue.ToEntero();
int CveTipoEmpaque = DdlTipoEmpaque.SelectedValue.ToEntero();
int CveTamaño = DdlTamaño.SelectedValue.ToEntero();
int CveCalidad = DdlCalidad.SelectedValue.ToEntero();
int CveEtiqueta = DdlEtiqueta.SelectedValue.ToEntero();
if (ObjCGame.GetProduccionResultado(-1, -1, -1, UsuarioActual.CveEmpresa, -1, CveHuerta, CveFruto, CveVariedad, CveTipoProduccion, CveTamaño, CveCalidad, CveEtiqueta, CveTipoEmpaque))
{
DtCajas = ObjCGame.DtResultados.FiltraParametros("CveOrdenProduccionDetalle IS NULL AND Tipo = 1");
GvCajas.DataSource = DtCajas;
TotalCajas = ObjCGame.DtResultados.FiltraParametros("CveOrdenProduccionDetalle IS NULL AND Tipo = 1").SUM("Cantidad");
DtBins = ObjCGame.DtResultados.FiltraParametros("CveOrdenProduccionDetalle IS NULL AND Tipo = 2");
GvBins.DataSource = DtBins;
TotalBins = ObjCGame.DtResultados.FiltraParametros("CveOrdenProduccionDetalle IS NULL AND Tipo = 2").SUM("Cantidad");
ObjCGame.Dispose();
}
GvCajas.DataBind();
GvBins.DataBind();
UpDatos.Update();
LblCajas.Text = TotalCajas.FormatoNumero(2);
LblBins.Text = TotalBins.FormatoNumero(2);
UpIndicadores.Update();
}
private void CargaOrdenProduccionDetalle(bool SoloFiltra, int CvePS = -1, int Tipo = -1, int CveProduccionResultado = -1, double Cantidad = 0, int FechaCorteNum=0)
{
if (SoloFiltra)
{
DdlOrdenProduccionDetalle.Items.Clear();
DdlOrdenProduccionDetalle.DataSource = DtCant.FiltraParametros($"CvePS = {CvePS} AND Tipo = {Tipo} AND CantRest > 0 AND FechaNum >= {FechaCorteNum} ");
DdlOrdenProduccionDetalle.Items.Insert(0, new ListItem("Seleccione", "-1"));
DdlOrdenProduccionDetalle.DataBind();
double CantidadAsignada = 0;
foreach (DataRow Dr in DtAsignado.FiltraParametros($"CveProduccionResultado = {CveProduccionResultado}").Rows)
{
CantidadAsignada += Dr["CantidadAsignada"].ToString().ToDouble();
}
if (Cantidad == CantidadAsignada) { DdlOrdenProduccionDetalle.Enabled = false; } else { DdlOrdenProduccionDetalle.Enabled = true; RVTxtCantidad.MaximumValue = (Cantidad - CantidadAsignada) .ToString(); }
GvAsignado.DataSource = DtAsignado.FiltraParametros($"CveProduccionResultado = {CveProduccionResultado}");
GvAsignado.DataBind();
}
else
{
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetOrdenProduccionDetalleCant(UsuarioActual.CveEmpresa, -1, -1))
{
DtCant = ObjCGame.DtResultados.FiltraParametros("CantRest > 0 AND CveEstatus IN (1,2,3)");
}
ObjCGame.Dispose();
}
}
protected void BtnConsultar_Click(object sender, EventArgs e)
{
CargaResultado();
}
#endregion
#region GRIDVIEW
protected void GvResultado_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.FCLinkButton("BtnDividir").Attributes.Add("onclick", String.Format("Dividir('{0}');", e.Row.FCTextBox("TxtCantDividir").ClientID));
e.Row.FCLinkButton("BtnDividir").CommandArgument = e.Row.RowIndex.ToString();
e.Row.FCTextBox("TxtCantDividir").Attributes.Add("onkeyup", String.Format("LimitaCantidad({0},this,'{1}');", e.Row.DBCampo("Cantidad"), e.Row.FCLinkButton("BtnDividir").ClientID));
if (e.Row.DataKey("CveTipoEtiqueta").ToEntero() == 1)
{
e.Row.FCLabel("LblTipoEtiqueta").Text = "Si";
}
else
{
e.Row.FCLabel("LblTipoEtiqueta").Text = "No";
}
}
}
protected void GvBins_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.FCLinkButton("BtnDividir").Attributes.Add("onclick", String.Format("Dividir2('{0}');", e.Row.FCTextBox("TxtCantDividir").ClientID));
e.Row.FCLinkButton("BtnDividir").CommandArgument = e.Row.RowIndex.ToString();
e.Row.FCTextBox("TxtCantDividir").Attributes.Add("onkeyup", String.Format("LimitaCantidad2({0},this,'{1}');", e.Row.DBCampo("Cantidad"), e.Row.FCLinkButton("BtnDividir").ClientID));
if (e.Row.DataKey("CveTipoEtiqueta").ToEntero() == 1)
{
e.Row.FCLabel("LblTipoEtiqueta").Text = "Si";
}
else
{
e.Row.FCLabel("LblTipoEtiqueta").Text = "No";
}
}
}
#endregion
#region DIVIDIR
protected void Dividir(object sender, EventArgs e)
{
int Index = ((LinkButton)sender).CommandArgument.ToString().ToEntero();
if (DtAsignado.FiltraParametros($"CveProduccionResultado= {GvCajas.Rows[Index].DataKey("CveProduccionResultado").ToEntero()}").Rows.Count > 0)
{
Alert("No se puede dividir si se tienen asignaciones pendientes.", ModExtensiones.TipoMensaje.MsgAdvertencia);
return;
}
double Cantidad = HdnCantidad.Value.ToDouble();
double CantidadPasada = GvCajas.Rows[Index].DataKey("Cantidad").ToDouble();
double PesoUnitario = GvCajas.Rows[Index].DataKey("Peso").ToDouble() / CantidadPasada;
double CantActualizada = GvCajas.Rows[Index].DataKey("Cantidad").ToDouble() - Cantidad;
double ImporteUnitario = GvCajas.Rows[Index].DataKey("ImportePreEnfriado").ToDouble() / CantidadPasada;
ClsCGame ObjCGame = new ClsCGame();
ObjCGame.IniciaTransacSQL();
bool Error = false;
if (ObjCGame.UpdateProduccionResultado(GvCajas.Rows[Index].DataKey("CveProduccionResultado").ToEntero(), GvCajas.Rows[Index].DataKey("CveProduccion").ToEntero(), GvCajas.Rows[Index].DataKey("CvePS").ToEntero(),
CantActualizada, CantActualizada * PesoUnitario, GvCajas.Rows[Index].DataKey("CveTamaño").ToEntero(), GvCajas.Rows[Index].DataKey("CveCalidad").ToEntero(), GvCajas.Rows[Index].DataKey("CveTipoCaja").ToEntero(),
Convert.ToBoolean(GvCajas.Rows[Index].DataKey("CveTipoEtiqueta")), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, GvCajas.Rows[Index].DataKey("CveTipoEmpaque").ToEntero(), GvCajas.Rows[Index].DataKey("CveTipoMaduracion").ToEntero(), GvCajas.Rows[Index].DataKey("CveTipoProducto").ToEntero(), -1))
{
ObjCGame.UpdateProduccionResultadoImporte(GvCajas.Rows[Index].DataKey("CveProduccionResultado").ToEntero(), CantActualizada * ImporteUnitario);
if (ObjCGame.AddProduccionResultado(GvCajas.Rows[Index].DataKey("CveProduccion").ToEntero(), GvCajas.Rows[Index].DataKey("CvePS").ToEntero(),
Cantidad, Cantidad * PesoUnitario, GvCajas.Rows[Index].DataKey("CveTamaño").ToEntero(), GvCajas.Rows[Index].DataKey("CveCalidad").ToEntero(), GvCajas.Rows[Index].DataKey("CveTipoCaja").ToEntero(),
Convert.ToBoolean(GvCajas.Rows[Index].DataKey("CveTipoEtiqueta").ToEntero()), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, GvCajas.Rows[Index].DataKey("CveTipoEmpaque").ToEntero(), GvCajas.Rows[Index].DataKey("CveTipoMaduracion").ToEntero(), GvCajas.Rows[Index].DataKey("CveTipoProducto").ToEntero(), -1) == false)
{
Error = true;
}
else
{
ObjCGame.UpdateProduccionResultadoImporte(ObjCGame.CveProduccionResultado, Cantidad * ImporteUnitario);
}
}
else
{
Error = true;
}
if (!Error) { ObjCGame.Commit(); } else { ObjCGame.RollBack(); };
ObjCGame.Dispose();
CargaResultado();
}
protected void Dividir2(object sender, EventArgs e)
{
int Index = ((LinkButton)sender).CommandArgument.ToString().ToEntero();
if (DtAsignado.FiltraParametros($"CveProduccionResultado= {GvBins.Rows[Index].DataKey("CveProduccionResultado").ToEntero()}").Rows.Count > 0)
{
Alert("No se puede dividir si se tienen asignaciones pendientes.", ModExtensiones.TipoMensaje.MsgAdvertencia);
return;
}
double Cantidad = HdnCantidad.Value.ToDouble();
double CantidadPasada = GvBins.Rows[Index].DataKey("Cantidad").ToDouble();
double PesoUnitario = GvBins.Rows[Index].DataKey("Peso").ToDouble() / CantidadPasada;
double CantActualizada = GvBins.Rows[Index].DataKey("Cantidad").ToDouble() - Cantidad;
double ImporteUnitario = GvBins.Rows[Index].DataKey("ImportePreEnfriado").ToDouble() / CantidadPasada;
ClsCGame ObjCGame = new ClsCGame();
ObjCGame.IniciaTransacSQL();
bool Error = false;
if (ObjCGame.UpdateProduccionResultado(GvBins.Rows[Index].DataKey("CveProduccionResultado").ToEntero(), GvBins.Rows[Index].DataKey("CveProduccion").ToEntero(), GvBins.Rows[Index].DataKey("CvePS").ToEntero(),
CantActualizada, CantActualizada * PesoUnitario, GvBins.Rows[Index].DataKey("CveTamaño").ToEntero(), GvBins.Rows[Index].DataKey("CveCalidad").ToEntero(), GvBins.Rows[Index].DataKey("CveTipoCaja").ToEntero(),
Convert.ToBoolean(GvBins.Rows[Index].DataKey("CveTipoEtiqueta")), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, GvBins.Rows[Index].DataKey("CveTipoEmpaque").ToEntero(), GvBins.Rows[Index].DataKey("CveTipoMaduracion").ToEntero(), GvBins.Rows[Index].DataKey("CveTipoProducto").ToEntero(), -1))
{
ObjCGame.UpdateProduccionResultadoImporte(GvBins.Rows[Index].DataKey("CveProduccionResultado").ToEntero(), CantActualizada * ImporteUnitario);
if (ObjCGame.AddProduccionResultado(GvBins.Rows[Index].DataKey("CveProduccion").ToEntero(), GvBins.Rows[Index].DataKey("CvePS").ToEntero(),
Cantidad, Cantidad * PesoUnitario, GvBins.Rows[Index].DataKey("CveTamaño").ToEntero(), GvBins.Rows[Index].DataKey("CveCalidad").ToEntero(), GvBins.Rows[Index].DataKey("CveTipoCaja").ToEntero(),
Convert.ToBoolean(GvBins.Rows[Index].DataKey("CveTipoEtiqueta").ToEntero()), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, GvBins.Rows[Index].DataKey("CveTipoEmpaque").ToEntero(), GvBins.Rows[Index].DataKey("CveTipoMaduracion").ToEntero(), GvBins.Rows[Index].DataKey("CveTipoProducto").ToEntero(), -1) == false)
{
Error = true;
}
else
{
ObjCGame.UpdateProduccionResultadoImporte(ObjCGame.CveProduccionResultado, Cantidad * ImporteUnitario);
}
}
else
{
Error = true;
}
if (!Error) { ObjCGame.Commit(); } else { ObjCGame.RollBack(); };
ObjCGame.Dispose();
CargaResultado();
}
#endregion
#region ASIGNAR
protected void LnkAsignar_Click(object sender, EventArgs e)
{
GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
RegistraScript("$('#DModalAsignacion').modal()");
CveProduccionResultado = gvRow.DataKey("CveProduccionResultado").ToEntero();
Cantidad = gvRow.DataKey("Cantidad").ToDouble();
CvePS = gvRow.DataKey("CvePS").ToEntero();
Tipo = gvRow.DataKey("Tipo").ToEntero();
FechaCorteNum = gvRow.DataKey("FechaCorteNum").ToEntero();
TxtCantidad.Text = "";
CargaOrdenProduccionDetalle(true, CvePS, Tipo, CveProduccionResultado, Cantidad, FechaCorteNum);
UpModalAsignacion.Update();
}
protected void LnkAsignar_Click1(object sender, EventArgs e)
{
if (TxtCantidad.Text.ToDouble() <= 0)
{
Alert("La cantidad tiene que ser myor que 0.", ModExtensiones.TipoMensaje.MsgAdvertencia);
return;
}
if (DdlOrdenProduccionDetalle.SelectedValue.ToEntero() > 0)
{
foreach (DataRow Dr in DtCant.Rows)
{
if (Dr["CveOrdenProduccionDetalle"].ToEntero() == DdlOrdenProduccionDetalle.SelectedValue.ToEntero())
{
DataRow Row = DtAsignado.NewRow();
Row["CveProduccionResultado"] = CveProduccionResultado;
Row["CveOrdenProduccionDetalle"] = DdlOrdenProduccionDetalle.SelectedValue.ToEntero();
if (TxtCantidad.Text.ToDouble() <= Dr["CantRest"].ToString().ToDouble())
{
Row["CantidadAsignada"] = TxtCantidad.Text.ToDouble();
Dr["CantRest"] = Math.Round(Dr["CantRest"].ToString().ToDouble() - TxtCantidad.Text.ToDouble(),2);
}
else
{
Row["CantidadAsignada"] = Dr["CantRest"].ToString().ToDouble();
Dr["CantRest"] = 0;
}
Dr["Folio"] = $"OP# {Dr["FolioOP"].ToString()} - Cant. Rest.: {Dr["CantRest"]} - {Dr["TipoProducto"].ToString()} - {Dr["TipoMaduracion"].ToString()} - {Dr["Tamaño"].ToString()} - {Math.Round((Dr["CantRest"].ToString().ToDouble() * 100) / Dr["Cantidad"].ToString().ToDouble(),2)}% Avance";
Row["CveOrdenProduccion"] = Dr["CveOrdenProduccion"].ToEntero();
Row["FolioOP"] = Dr["FolioOP"].ToString();
Row["TipoProducto"] = Dr["TipoProducto"].ToString();
Row["TipoMaduracion"] = Dr["TipoMaduracion"].ToString();
Row["Tamaño"] = Dr["Tamaño"].ToString();
if (DtAsignado.Rows.Count > 0)
{
Row["Id"] = DtAsignado.MAX("Id").ToEntero() + 1;
}
else
{
Row["Id"] = 1;
}
DtAsignado.Rows.InsertAt(Row, 0);
DtAsignado.AcceptChanges();
TxtCantidad.Text = "";
CargaOrdenProduccionDetalle(true, CvePS, Tipo, CveProduccionResultado, Cantidad, FechaCorteNum);
return;
}
}
}
else
{
Alert("Tiene que seleccionar una orden de producción", ModExtensiones.TipoMensaje.MsgAdvertencia);
}
}
protected void BtnAsignar_Click(object sender, EventArgs e)
{
if (DtAsignado.FiltraParametros($"CveProduccionResultado = {CveProduccionResultado}").Rows.Count > 0)
{
ClsCGame ObjCGame = new ClsCGame();
ObjCGame.IniciaTransacSQL();
bool Error = false;
double CantidadSurtida = 0.0;
foreach (DataRow Dr in DtAsignado.FiltraParametros($"CveProduccionResultado = {CveProduccionResultado}").Rows)
{
if (Cantidad - (CantidadSurtida + Dr["CantidadAsignada"].ToString().ToDouble()) < 1)
{
if (!ObjCGame.AsignaProduccionResultado(CveProduccionResultado, Dr["CveOrdenProduccionDetalle"].ToEntero(), Dr["CantidadAsignada"].ToString().ToDouble(), false))
{
Error = true;
}
else
{
CantidadSurtida += Dr["CantidadAsignada"].ToString().ToDouble();
}
}
else
{
if (!ObjCGame.AsignaProduccionResultado(CveProduccionResultado, Dr["CveOrdenProduccionDetalle"].ToEntero(), Dr["CantidadAsignada"].ToString().ToDouble(), true))
{
Error = true;
}
else
{
CantidadSurtida += Dr["CantidadAsignada"].ToString().ToDouble();
}
}
}
if (!Error)
{
ObjCGame.Commit();
Alert("Asignado Correctamente");
CargaResultado();
RegistraScript("$('#DModalAsignacion').modal('hide')");
DtAsignado.Select($"CveProduccionResultado = {CveProduccionResultado}").ToList().ForEach(x => DtAsignado.Rows.Remove(x));
DtAsignado.AcceptChanges();
}
else
{
ObjCGame.RollBack();
}
ObjCGame.Dispose();
}
else
{
Alert("Tiene que tener asignaciones.", ModExtensiones.TipoMensaje.MsgAdvertencia);
}
}
protected void LnkEliminar_Click(object sender, EventArgs e)
{
GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
foreach (DataRow Dr in DtCant.Rows)
{
if (Dr["CveOrdenProduccionDetalle"].ToEntero() == gvRow.DataKey("CveOrdenProduccionDetalle").ToEntero())
{
Dr["CantRest"] = Dr["CantRest"].ToString().ToDouble() + gvRow.DataKey("CantidadAsignada").ToString().ToDouble();
Dr["Folio"] = $"OP# {Dr["FolioOP"].ToString()} - Cant. Rest.: {Dr["CantRest"]} - {Dr["TipoProducto"].ToString()} - {Dr["TipoMaduracion"].ToString()} - {Dr["Tamaño"].ToString()} - {(Dr["CantRest"].ToString().ToDouble() * 100) / Dr["Cantidad"].ToString().ToDouble()}% Avance";
}
}
DtAsignado.Select($"Id = { gvRow.DataKey("Id").ToEntero()}").ToList().ForEach(x => DtAsignado.Rows.Remove(x));
DtAsignado.AcceptChanges();
CargaOrdenProduccionDetalle(true, CvePS, Tipo, CveProduccionResultado, Cantidad,FechaCorteNum);
}
#endregion
#region "PDF"
protected void ImgImprimirPDF_Click(object sender, EventArgs e)
{
GenerarPDF("PDF");
}
protected void GenerarPDF(String Opcion)
{
if (DtCajas.Rows.Count > 0 && DtBins.Rows.Count > 0)
{
System.IO.FileInfo Imagen = new System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta));
String logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa);
List<ReportParameter> para = new List<ReportParameter>();
para.Add(new ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa));
para.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre));
para.Add(new ReportParameter("FechaImpresion", DateTime.Now.ToString()));
para.Add(new ReportParameter("Huerta", DdlHuerta.SelectedItem.Text));
para.Add(new ReportParameter("Fruto", DdlFruto.SelectedItem.Text));
para.Add(new ReportParameter("Variedad", DdlVariedad.SelectedItem.Text));
para.Add(new ReportParameter("TipoProduccion", DdlTipoProduccion.SelectedItem.Text));
para.Add(new ReportParameter("Tamaño", DdlTamaño.SelectedItem.Text));
para.Add(new ReportParameter("Calidad", DdlCalidad.SelectedItem.Text));
para.Add(new ReportParameter("Etiqueta", DdlEtiqueta.SelectedItem.Text));
para.Add(new ReportParameter("TipoEmpaque", DdlTipoEmpaque.SelectedItem.Text));
para.Add(new ReportParameter("TotalCajas", LblCajas.Text));
para.Add(new ReportParameter("TotalBins", LblBins.Text));
if (Imagen.Exists)
{
para.Add(new ReportParameter("LogoPath", logouri));
}
else
{
para.Add(new ReportParameter("LogoPath", ""));
}
List<ReportDataSource> lrds = new List<ReportDataSource>();
ReportDataSource rds = new ReportDataSource();
rds.Name = "DataSet1"; rds.Value = DtCajas;
ReportDataSource rds2 = new ReportDataSource();
rds2.Name = "DataSet2"; rds2.Value = DtBins;
lrds.Add(rds);
lrds.Add(rds2);
ImprimirPDF("Empresas/Grales/Formatos/RepAsignacionEmpaque.rdlc", lrds, para, "RepAsignacionEmpaque", Opcion);
}
else
{
Alert("No hay datos consultados", ModExtensiones.TipoMensaje.MsgAdvertencia);
}
}
#endregion
}

127
CGame/CatCGameClientes.aspx Normal file
View File

@@ -0,0 +1,127 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatCGameClientes.aspx.vb" Inherits="CGame_CatCGameClientes" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.Txt{
margin-top:-1px;
height: 25px;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Catálogo de Clientes
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkAgregarCGame_Clientes" OnClick="LnkAgregarCGam_Click" runat="server"><i class="fa fa-plus"></i>Agregar Cliente</asp:LinkButton></li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="upDatosCGam" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GVCGame_Clientes" EmptyDataText="No hay clientes registrados." runat="server" GridLines="None"
CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False"
DataKeyNames="CveCliente,Cliente,Estatus,FechaIng,CveUsuario,Usuario,CveEmpresa,Empresa">
<Columns>
<asp:TemplateField HeaderText="Cliente">
<ItemTemplate>
<asp:Label ID="lblcliente" runat="server" Text='<%# Eval("Cliente")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Estatus" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="lblestatus" runat="server" Text='<%# If(CBool(Eval("Estatus")), "Activo", "Inactivo")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Fecha Ingreso" ItemStyle-HorizontalAlign="Center" DataField="FechaIng" DataFormatString="{0:dd/MM/yyyy}" />
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText="Comandos">
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Editar" ID="LnkEditar" OnClick="LnkEditarCGam_Click" CssClass="btn btn-circle btn-sm green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
<asp:LinkButton ID="imgD" runat="server" OnClick="LnkEliminarCGam_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar el Cliente?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DModalCGame_Clientes" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UPModalCGam" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Literal ID="ltlCGamtitulo" Text="Agregar Cliente" runat="server"> </asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCGamcliente" CssClass="form-control" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvCGamcliente" runat="server" ControlToValidate="TxtCGamcliente" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cliente''</b> es necesario, por favor ingréselo." ValidationGroup="VGMCGam"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoCGamcliente" runat="server" HighlightCssClass="vco" TargetControlID="RfvCGamcliente"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtCGamcliente.ClientID.ToString()%>">Cliente:</label>
</div>
<div class="form-group form-md-line-input input-iconright" id="DivEstatus" runat="server">
<label for="<%= ChkCGamestatus.ClientID.ToString()%>">Estatus:</label>
<asp:CheckBox ID="ChkCGamestatus" Text=" " runat="server" />
</div>
<br />
<div class="row">
<label class="col-md-2">Cargo Fijo:</label>
<div class="col-md-4">
<asp:DropDownList ID="DdlCargoFijo" DataValueField="CveCargoFijo" DataTextField="Concepto" AutoPostBack="true" OnSelectedIndexChanged="DdlCargoFijo_SelectedIndexChanged" runat="server" CssClass="select2me" AppendDataBoundItems="true" Width="100%"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVCargoFijo" runat="server" InitialValue="-1" ControlToValidate="DdlCargoFijo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cargo Fijo''</b> es necesario, por favor ingréselo." ValidationGroup="VGMAgregarCargoFijo"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCECargoFijo" runat="server" HighlightCssClass="vco" TargetControlID="RFVCargoFijo"></ajax:ValidatorCalloutExtender>
</div>
<label class="col-md-1">Importe:</label>
<div class="col-md-2">
<asp:TextBox ID="TxtImporte" CssClass="form-control Txt" MaxLength="20" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVImporte" runat="server" ControlToValidate="TxtImporte" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Importe''</b> es necesario, por favor ingréselo." ValidationGroup="VGMAgregarCargoFijo"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEImporte" runat="server" HighlightCssClass="vco" TargetControlID="RFVImporte"></ajax:ValidatorCalloutExtender>
<ajax:FilteredTextBoxExtender ID="FTBEImporte" TargetControlID="TxtImporte" FilterType="Numbers,Custom" ValidChars="." runat="server" />
</div>
<div class="col-md-2">
<asp:LinkButton ID="LnkAgregarCargoFijo" data-toggle="tooltip" CssClass="btn btn-default btn-circle btn-xs " OnClick="LnkAgregarCargoFijo_Click" data-placement="top" ToolTip="Agregar Cargo Fijo" runat="server" ValidationGroup="VGMAgregarCargoFijo"><i class="fa fa-plus" style="color:black" aria-hidden="true"></i></asp:LinkButton>
</div>
</div>
<br />
<div class="row">
<div class="col-md-12">
<asp:GridView ID="GvCargosFijos" EmptyDataText="No hay cargos fijos registrados." runat="server" GridLines="None"
CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False"
DataKeyNames="CveCargoFijo">
<Columns>
<asp:BoundField HeaderText="Cargo Fijo" DataField="Concepto" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Importe" DataField="Importe" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N4}" />
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText="Comandos">
<ItemTemplate>
<asp:LinkButton ID="LnkEliminarCargoFijo" runat="server" OnClick="LnkEliminarCargoFijo_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar el cargo fijo?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
<div class="modal-footer">
<div class="modal-btn">
<asp:Button ID="BtnCGamADD" OnClick="BtnCGamADD_Click" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="VGMCGam" />
<asp:Button ID="BtnCGamEdit" OnClick="BtnCGamEdit_Click" runat="server" Text="Actualizar" CssClass="btn btn-primary" ValidationGroup="VGMCGam"></asp:Button>
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,243 @@
Option Strict On
Imports System.Data
Imports System.Collections.Generic
Imports System.Linq
Imports System.Web
Imports System.Web.UI.WebControls
Imports Extensiones
Partial Class CGame_CatCGameClientes
Inherits ClsPaginas
#Region "Propiedades"
Private Property RcveCliente() As Int32
Get
Return If(IsNothing(ViewState("RcveCliente")), 0, CInt(ViewState("RcveCliente")))
End Get
Set
ViewState("RcveCliente") = Value
End Set
End Property
Private Property CveCliente() As Int32
Get
Return If(IsNothing(ViewState("CcveCliente")), 0, CInt(ViewState("CcveCliente")))
End Get
Set
ViewState("CcveCliente") = Value
End Set
End Property
Private Property RcveUsuario() As Int32
Get
Return If(IsNothing(ViewState("RcveUsuario")), 0, CInt(ViewState("RcveUsuario")))
End Get
Set
ViewState("RcveUsuario") = Value
End Set
End Property
Private Property RcveEmpresa() As Int32
Get
Return If(IsNothing(ViewState("RcveEmpresa")), 0, CInt(ViewState("RcveEmpresa")))
End Get
Set
ViewState("RcveEmpresa") = Value
End Set
End Property
Private Property DtCargosFijos As DataTable
Get
DtCargosFijos = DirectCast(ViewState("DtCargosFijos"), DataTable)
End Get
Set(ByVal value As DataTable)
ViewState("DtCargosFijos") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
RcveCliente = If(IsNothing(Request("cveCliente")), -1, Request("cveCliente").ToString().ToEntero())
RcveUsuario = If(IsNothing(Request("cveUsuario")), -1, Request("cveUsuario").ToString().ToEntero())
CargaClientes()
CargaCargosFijos()
ChkCGamestatus.Checked = True
End If
End Sub
Protected Sub CargaClientes()
Dim ObjCGam As New ClsCGame()
If ObjCGam.GetCliente(RcveCliente, RcveUsuario, UsuarioActual.CveEmpresa) Then
GVCGame_Clientes.DataSource = ObjCGam.DtResultados
End If
ObjCGam.Dispose()
GVCGame_Clientes.DataBind()
upDatosCGam.Update()
End Sub
Protected Sub CargaCargosFijos()
Dim ObjCGame As New ClsCGame()
If ObjCGame.GetCargoFijo(UsuarioActual.CveEmpresa) Then
DdlCargoFijo.DataSource = ObjCGame.DtResultados
DdlCargoFijo.Items.Insert(0, New ListItem("Seleccione", "-1"))
End If
ObjCGame.Dispose()
DdlCargoFijo.DataBind()
UPModalCGam.Update()
End Sub
Protected Sub CargaCargosFijosClientes(CveCliente As Integer)
Dim ObjCGame As New ClsCGame()
If ObjCGame.GetCargoFijoCliente(CveCliente) Then
GvCargosFijos.DataSource = ObjCGame.DtResultados
DtCargosFijos = ObjCGame.DtResultados
End If
ObjCGame.Dispose()
GvCargosFijos.DataBind()
End Sub
Protected Sub LimpiaCGame_Clientes()
TxtCGamcliente.Text = ""
DdlCargoFijo.SelectedIndex = 0
TxtImporte.Text = ""
GvCargosFijos.DataSource = Nothing
GvCargosFijos.DataBind()
UPModalCGam.Update()
End Sub
Protected Sub LnkEditarCGam_Click(sender As Object, e As EventArgs)
DivEstatus.Visible = True
ltlCGamtitulo.Text = "Editar Cliente"
LimpiaCGame_Clientes()
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
CveCliente = gvRow.DataKey("CveCliente").ToEntero()
Dim cliente As String = gvRow.DataKey("Cliente")
Dim estatus As Boolean = CBool(gvRow.DataKey("Estatus").ToString())
Dim fechaIng As DateTime = gvRow.DataKey("FechaIng").ToDateTime()
Dim cveUsuario As Int32 = gvRow.DataKey("CveUsuario").ToEntero()
Dim cveEmpresa As Int32 = gvRow.DataKey("CveEmpresa").ToEntero()
TxtCGamcliente.Text = cliente.ToString()
CargaCargosFijosClientes(CveCliente)
RegistraScript("$('#DModalCGame_Clientes').modal()")
BtnCGamADD.Visible = False
BtnCGamEdit.Visible = True
UPModalCGam.Update()
End Sub
Protected Sub LnkAgregarCGam_Click(sender As Object, e As EventArgs)
DivEstatus.Visible = False
ltlCGamtitulo.Text = "Agregar Cliente"
RegistraScript("$('#DModalCGame_Clientes').modal('show')")
LimpiaCGame_Clientes()
CargaCargosFijosClientes(-1)
BtnCGamADD.Visible = True
BtnCGamEdit.Visible = False
UPModalCGam.Update()
End Sub
Protected Sub BtnCGamADD_Click(sender As Object, e As EventArgs)
Dim cliente As String = TxtCGamcliente.Text
Dim estatus As Boolean = ChkCGamestatus.Checked
Dim fechaIng As DateTime = Now
Dim cveUsuario As Int32 = UsuarioActual.CveUsuario
Dim cveEmpresa As Int32 = UsuarioActual.CveEmpresa
Dim ObjCGam As New ClsCGame()
ObjCGam.IniciaTransacSQL()
Dim Continuar As Boolean = ObjCGam.AddCliente(cliente, True, fechaIng, cveUsuario, cveEmpresa)
For Each Dr As DataRow In DtCargosFijos.Rows
Continuar = ObjCGam.AddCargoFijoCliente(Dr("CveCargoFijo").ToString.ToEntero, ObjCGam.CveCliente, Dr("Importe").ToString.ToDouble)
Next
If (Continuar) Then
ObjCGam.Commit()
RegistraScript("$('#DModalCGame_Clientes').modal('hide')")
LimpiaCGame_Clientes()
UPModalCGam.Update()
CargaClientes()
Alert("El Cliente se ha agregado correctamente.")
Else
ObjCGam.RollBack()
End If
ObjCGam.Dispose()
End Sub
Protected Sub BtnCGamEdit_Click(sender As Object, e As EventArgs)
Dim cliente As String = TxtCGamcliente.Text
Dim estatus As Boolean = ChkCGamestatus.Checked
Dim cveUsuario As Int32 = UsuarioActual.CveUsuario
Dim ObjCGam As New ClsCGame()
ObjCGam.IniciaTransacSQL()
Dim Continuar As Boolean = ObjCGam.UpdateCliente(CveCliente, cliente, estatus, DateTime.Now, cveUsuario, UsuarioActual.CveEmpresa)
Continuar = ObjCGam.RemoveCargoFijoCliente(CveCliente)
For Each Dr As DataRow In DtCargosFijos.Rows
Continuar = ObjCGam.AddCargoFijoCliente(Dr("CveCargoFijo").ToString.ToEntero, CveCliente, Dr("Importe").ToString.ToDouble)
Next
If (Continuar) Then
ObjCGam.Commit()
RegistraScript("$('#DModalCGame_Clientes').modal('hide')")
LimpiaCGame_Clientes()
UPModalCGam.Update()
CargaClientes()
Alert("El Cliente se ha actualizado correctamente.")
Else
ObjCGam.RollBack()
End If
ObjCGam.Dispose()
End Sub
Protected Sub LnkEliminarCGam_Click(sender As Object, e As EventArgs)
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
CveCliente = gvRow.DataKey("CveCliente").ToEntero()
Dim ObjCGam As New ClsCGame()
ObjCGam.IniciaTransacSQL()
Dim Continuar As Boolean = ObjCGam.RemoveCliente(CveCliente)
Continuar = ObjCGam.RemoveCargoFijoCliente(CveCliente)
If (Continuar) Then
ObjCGam.Commit()
CargaClientes()
Alert("El Cliente se ha eliminado correctamente.")
Else
ObjCGam.RollBack()
End If
ObjCGam.Dispose()
End Sub
Protected Sub LnkEliminarCargoFijo_Click(sender As Object, e As EventArgs)
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
DtCargosFijos.Rows.RemoveAt(gvRow.RowIndex)
DtCargosFijos.AcceptChanges()
CargaGvCargosFijos()
End Sub
Protected Sub LnkAgregarCargoFijo_Click(sender As Object, e As EventArgs)
If DtCargosFijos.FiltraParametros($"CveCargoFijo = {DdlCargoFijo.SelectedValue.ToEntero}").Rows.Count > 0 Then
Alert("Ya se agrego el cargo fijo seleccionado.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim Dr As DataRow = Nothing
Dr = DtCargosFijos.NewRow
Dr("CveCargoFijo") = DdlCargoFijo.SelectedValue.ToEntero
Dr("Concepto") = DdlCargoFijo.SelectedItem.Text
Dr("Importe") = TxtImporte.Text.ToDouble
DtCargosFijos.Rows.InsertAt(Dr, DtCargosFijos.Rows.Count)
DtCargosFijos.AcceptChanges()
LimpiaAgregarCargoFijo()
CargaGvCargosFijos()
End Sub
Protected Sub LimpiaAgregarCargoFijo()
DdlCargoFijo.SelectedIndex = 0
TxtImporte.Text = ""
End Sub
Protected Sub CargaGvCargosFijos()
GvCargosFijos.DataSource = DtCargosFijos
GvCargosFijos.DataBind()
UPModalCGam.Update()
End Sub
Protected Sub DdlCargoFijo_SelectedIndexChanged(sender As Object, e As EventArgs)
RFVImporte.Enabled = True
TxtImporte.Enabled = True
If DdlCargoFijo.SelectedValue.ToEntero > 1 Then
Dim ObjCGame As New ClsCGame
If ObjCGame.GetCargoFijo(UsuarioActual.CveEmpresa, DdlCargoFijo.SelectedValue.ToEntero) Then
If ObjCGame.DtResultados.Rows.Count > 0 Then
If ObjCGame.DtResultados.Rows(0)("TipoCalculado").ToString.Contiene("COR", "MAQ", "FHE", "PEF", "FHN") Then
RFVImporte.Enabled = False
TxtImporte.Enabled = False
End If
End If
End If
ObjCGame.Dispose
End If
End Sub
End Class

89
CGame/CatCalidad.aspx Normal file
View File

@@ -0,0 +1,89 @@
<%@ Page Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="True" CodeFile="CatCalidad.aspx.VB" Inherits="CATCalidad" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Catalogo de Calidad
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkAgregarCalidad" OnClick="LnkAgregarCali_Click" runat="server"><i class="fa fa-plus"></i>Agregar Calidad</asp:LinkButton></li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="upDatosCali" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVCalidad.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVCalidad.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GVCalidad" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False"
DataKeyNames="CveCalidad,Calidad,Estatus,FechaIng,CveUsuario,Usuario,CveEmpresa,Empresa">
<Columns>
<asp:TemplateField HeaderText="Calidad" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblcalidad" runat="server" Text='<%# Eval("Calidad")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Estatus" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="lblestatus" runat="server" Text='<%# Eval("Estatus")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="FechaIng" ItemStyle-Width="15%" HeaderText="Fecha de Ingreso" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:TemplateField HeaderText="Usuario" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblusuario" runat="server" Text='<%# Eval("Usuario")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText="Comandos">
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Editar" ID="LnkEditar" OnClick="LnkEditarCali_Click" CssClass="btn btn-circle btn-sm green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
<asp:LinkButton ID="imgD" runat="server" OnClick="LnkEliminarCali_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar el Calidad?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DModalCalidad" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UPModalCali" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Literal ID="ltlCalititulo" Text="Calidad" runat="server"> </asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCalicalidad" CssClass="form-control" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvCalicalidad" runat="server" ControlToValidate="TxtCalicalidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Calidad''</b> es necesario, por favor ingréselo." ValidationGroup="VGMCali"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoCalicalidad" runat="server" HighlightCssClass="vco" TargetControlID="RfvCalicalidad"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtCalicalidad.ClientID.ToString()%>">Calidad:</label>
</div>
<div class="form-group form-md-line-input input-iconright" id="DivEstatus" runat="server">
<label for="<%= ChkCaliestatus.ClientID.ToString()%>">Estatus:</label>
<asp:CheckBox ID="ChkCaliestatus" runat="server" />
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnCaliADD" OnClick="BtnCaliADD_Click" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="VGMCali" />
<asp:Button ID="BtnCaliEdit" OnClick="BtnCaliEdit_Click" runat="server" Text="Actualizar" CssClass="btn btn-primary" ValidationGroup="VGMCali"></asp:Button>
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

37
CGame/CatCalidad.aspx.VB Normal file
View File

@@ -0,0 +1,37 @@
Option Strict On
Imports System.Data
Imports System.Collections.Generic
Imports System.Linq
Imports System.Web
Imports System.Web.UI.WebControls
Imports Extensiones
Partial Class CATCalidad
Inherits ClsPaginas
#Region "Propiedades"
Private Property CveCalidad() As Int32
Get
Return If(IsNothing(ViewState("CveCalidad")), 0, CInt(ViewState("CveCalidad")))
End Get
Set
ViewState("CveCalidad") = Value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
CargaCalidad()
End If
End Sub
Protected Sub CargaCalidad()
Dim ObjCali As New ClsCGame()
If ObjCali.GetCalidad(UsuarioActual.CveEmpresa) Then

127
CGame/CatCargosFijos.aspx Normal file
View File

@@ -0,0 +1,127 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="CatCargosFijos.aspx.cs" Inherits="CGame_CatCargosFijos" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Catalogo de Cargos Fijos
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkAgregarCargoFijo" OnClick="LnkAgregarCargoFijo_Click" runat="server"><i class="fa fa-plus"></i>Agregar Cargo Fijo</asp:LinkButton></li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvCargosFijos" runat="server" GridLines="None" OnRowDataBound="GvCargosFijos_RowDataBound" CssClass="table table-hover table-striped ScrollAD mysmallbtn"
data-sort="true" Width="100%" AutoGenerateColumns="False" DataKeyNames="CveCargoFijo,Concepto,FechaIng,Estatus,CveUsuario,Usuario,CveEmpresa,Tipo,TipoCalculado,CveMoneda,TipoLiquidacion"
EmptyDataText="No se han encontrado cargos fijos agregados.">
<Columns>
<asp:BoundField HeaderText="Concepto" DataField="Concepto" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Tipo" DataField="Tipo" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Tipo" DataField="TipoLiquidacionTexto" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Moneda" DataField="Moneda" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Estatus" DataField="Estatus" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="FechaIng" ItemStyle-Width="15%" HeaderText="Fecha de Ingreso" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:BoundField HeaderText="Usuario" DataField="Usuario" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText="Comandos">
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Editar" ID="LnkEditar" OnClick="LnkEditar_Click" CssClass="btn btn-circle btn-sm green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
<asp:LinkButton ID="LnkEliminar" runat="server" OnClick="LnkEliminar_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar el cargo fijo?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div id="ModalAgregarCargoFijo" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalCargoFijo" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Literal ID="LtlTituloModal" Text="Cargo Fijo" runat="server"> </asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtConcepto" CssClass="form-control " runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVConcepto" runat="server" ControlToValidate="TxtConcepto" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Concepto''</b> es necesario, por favor ingréselo." ValidationGroup="VGMModalCargoFijo"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEConcepto" runat="server" HighlightCssClass="vco" TargetControlID="RFVConcepto"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtConcepto.ClientID.ToString()%>">Concepto:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlTipo" runat="server" CssClass="form-control select2me" OnSelectedIndexChanged="DdlTipo_SelectedIndexChanged" AutoPostBack="true" AppendDataBoundItems="true" Width="100%">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Text="Calculado" Value="1"></asp:ListItem>
<asp:ListItem Text="Fijo" Value="2"></asp:ListItem>
</asp:DropDownList>
<label for="<%= DdlTipo.ClientID.ToString()%>">Tipo:</label>
</div>
<div class="form-group form-md-line-input input-iconright" id="DivTipoCalculado" runat="server" visible="false">
<asp:DropDownList ID="DdlTipoCalculado" runat="server" CssClass="form-control select2me" AppendDataBoundItems="true" Width="100%">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Text="Corte" Value="COR"></asp:ListItem>
<asp:ListItem Text="Flete Huerta-Empaque" Value="FHE"></asp:ListItem>
<asp:ListItem Text="Maquila" Value="MAQ"></asp:ListItem>
<asp:ListItem Text="PreEnfriado" Value="PEF"></asp:ListItem>
<asp:ListItem Text="Flete Hermosillo-Nogales" Value="FHN"></asp:ListItem>
<asp:ListItem Text="Cajas" Value="CJ"></asp:ListItem>
<asp:ListItem Text="Cajas Master" Value="CJM"></asp:ListItem>
<asp:ListItem Text="Tarimas" Value="TMR"></asp:ListItem>
<asp:ListItem Text="Mallas" Value="MLL"></asp:ListItem>
<asp:ListItem Text="Esquineros" Value="ESQ"></asp:ListItem>
<asp:ListItem Text="Gastos(Ficha, Fleje, Cera, Etc.)" Value="GFFC"></asp:ListItem>
<asp:ListItem Text="Bins/Tapas" Value="BT"></asp:ListItem>
<asp:ListItem Text="IN & OUT" Value="INOUT"></asp:ListItem>
<asp:ListItem Text="Flete Nogales-California" Value="FNC"></asp:ListItem>
<asp:ListItem Text="Programa de Sanidad Veg." Value="PRSV"></asp:ListItem>
<asp:ListItem Text="Tarimas (Bins)" Value="TARB"></asp:ListItem>
<asp:ListItem Text="Certificado de Origen" Value="CER"></asp:ListItem>
</asp:DropDownList>
<label for="<%= DdlTipo.ClientID.ToString()%>">Tipo Calculado:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlTipoLiquidacion" runat="server" CssClass="form-control select2me" AppendDataBoundItems="true" Width="100%">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Text="Corte" Value="COR"></asp:ListItem>
<asp:ListItem Text="Flete Huerta-Empaque" Value="FHE"></asp:ListItem>
<asp:ListItem Text="Maquila" Value="MAQ"></asp:ListItem>
<asp:ListItem Text="Materiales" Value="MAT"></asp:ListItem>
<asp:ListItem Text="PreEnfriado" Value="PEF"></asp:ListItem>
<asp:ListItem Text="Flete Hermosillo-Nogales" Value="FHN"></asp:ListItem>
<asp:ListItem Text="Otros (Aduana, I&O, USDA, etc)" Value="OTR"></asp:ListItem>
<asp:ListItem Text="Comisión" Value="COM"></asp:ListItem>
</asp:DropDownList>
<label for="<%= DdlTipoLiquidacion.ClientID.ToString()%>">Tipo Liquidación:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlMoneda" runat="server" CssClass="form-control select2me" DataTextField="Moneda" DataValueField="CveMoneda" AppendDataBoundItems="true" Width="100%">
</asp:DropDownList>
<label for="<%= DdlMoneda.ClientID.ToString()%>">Moneda:</label>
</div>
<div class="form-group form-md-line-input input-iconright" id="DivEstatus" runat="server">
<label for="<%= ChkEstatus.ClientID.ToString()%>">Estatus:</label>
<asp:CheckBox ID="ChkEstatus" runat="server" />
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnAddCargoFijo" OnClick="BtnAddCargoFijo_Click" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="VGMModalCargoFijo" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,209 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;
using Extensiones;
public partial class CGame_CatCargosFijos : ClsPaginas
{
#region PROPIEDADES
private int CveCargoFijo
{
get { return (ViewState["CveCargoFijo"] == null) ? 0 : ViewState["CveCargoFijo"].ToEntero(); }
set { ViewState["CveCargoFijo"] = value; }
}
private string Modalidad
{
get { return (ViewState["Modalidad"] == null) ? "" : ViewState["Modalidad"].ToString(); }
set { ViewState["Modalidad"] = value; }
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
CargaMoneda();
CargaCargosFijos();
}
}
protected void CargaCargosFijos()
{
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetCargoFijo(UsuarioActual.CveEmpresa))
{
GvCargosFijos.DataSource = ObjCGame.DtResultados;
}
ObjCGame.Dispose();
GvCargosFijos.DataBind();
UpDatos.Update();
}
protected void LimpiaModal()
{
TxtConcepto.Text = "";
DdlTipo.SelectedIndex = 0;
DdlTipoCalculado.SelectedIndex = 0;
DdlMoneda.SelectedIndex = 0;
DdlTipoLiquidacion.SelectedIndex = 0;
UpModalCargoFijo.Update();
}
protected void LnkAgregarCargoFijo_Click(object sender, EventArgs e)
{
this.RegistraScript("$('#ModalAgregarCargoFijo').modal();");
LimpiaModal();
BtnAddCargoFijo.Text = "Agregar";
Modalidad = "A";
DivEstatus.Visible = false;
DivTipoCalculado.Visible = false;
UpModalCargoFijo.Update();
}
protected void LnkEliminar_Click(object sender, EventArgs e)
{
GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
CveCargoFijo = gvRow.DataKey("CveCargoFijo").ToEntero();
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.RemoveCargoFijo(CveCargoFijo))
{
this.RegistraScript("$('#ModalAgregarCargoFijo').modal('hide');");
CargaCargosFijos();
Alert("Eliminado Correctamente.");
}
ObjCGame.Dispose();
}
protected void LnkEditar_Click(object sender, EventArgs e)
{
LimpiaModal();
GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
CveCargoFijo = gvRow.DataKey("CveCargoFijo").ToEntero();
Modalidad = "U";
TxtConcepto.Text = gvRow.DataKey("Concepto");
DdlTipo.SelectedValueExist(gvRow.DataKey("Tipo"));
DdlTipoCalculado.SelectedValueExist(gvRow.DataKey("TipoCalculado"));
DdlTipoLiquidacion.SelectedValueExist(gvRow.DataKey("TipoLiquidacion"));
DdlMoneda.SelectedValueExist(gvRow.DataKey("CveMoneda"));
ChkEstatus.Checked = Convert.ToBoolean(gvRow.DataKey("Estatus"));
CambioTipo();
this.RegistraScript("$('#ModalAgregarCargoFijo').modal();");
DivEstatus.Visible = true;
BtnAddCargoFijo.Text = "Actualizar";
UpModalCargoFijo.Update();
}
protected void BtnAddCargoFijo_Click(object sender, EventArgs e)
{
if (DdlTipo.SelectedValue.ToEntero() < 1)
{
Alert("Tiene que seleccionar un tipo.", ModExtensiones.TipoMensaje.MsgAdvertencia);
return;
}
if (DdlTipoLiquidacion.SelectedValue == "1")
{
Alert("Tiene que seleccionar un tipo de liquidación.", ModExtensiones.TipoMensaje.MsgAdvertencia);
return;
}
if (DdlMoneda.SelectedValue.ToEntero() < 1)
{
Alert("Tiene que seleccionar una moneda.", ModExtensiones.TipoMensaje.MsgAdvertencia);
return;
}
if (DdlTipo.SelectedValue.ToEntero() == 1)
{
if (DdlTipoCalculado.SelectedValue == "-1")
{
Alert("Tiene que seleccionar un tipo calculado.", ModExtensiones.TipoMensaje.MsgAdvertencia);
return;
}
foreach (GridViewRow Gvr in GvCargosFijos.Rows)
{
if (Gvr.DataKey("TipoCalculado").ToString()== DdlTipoCalculado.SelectedValue && Gvr.DataKey("CveCargoFijo").ToEntero() != CveCargoFijo)
{
Alert("Este tipo calculado ya ha sido registrado.", ModExtensiones.TipoMensaje.MsgAdvertencia);
return;
}
}
}
bool Error = false;
ClsCGame ObjCGame = new ClsCGame();
if (Modalidad == "A")
{
if (!ObjCGame.AddCargoFijo(UsuarioActual.CveEmpresa, TxtConcepto.Text, UsuarioActual.CveUsuario,DdlTipo.SelectedValue.ToEntero(),DdlTipoCalculado.SelectedValue,DdlMoneda.SelectedValue.ToEntero(), DdlTipoLiquidacion.SelectedValue))
{
Error = true;
}
}else if (Modalidad == "U")
{
if (!ObjCGame.UpdateCargoFijo(CveCargoFijo, TxtConcepto.Text,ChkEstatus.Checked, DdlTipo.SelectedValue.ToEntero(), DdlTipoCalculado.SelectedValue, DdlMoneda.SelectedValue.ToEntero(), DdlTipoLiquidacion.SelectedValue))
{
Error = true;
}
}
if (!Error)
{
this.RegistraScript("$('#ModalAgregarCargoFijo').modal('hide');");
CargaCargosFijos();
if (Modalidad=="A") { Alert("Agregado Correctamente."); } else if (Modalidad == "U") { Alert("Actualizado Correctamente."); }
}
ObjCGame.Dispose();
}
protected void GvCargosFijos_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (Convert.ToBoolean(e.Row.DBCampo("Estatus")) == true)
{
e.Row.Cells[3].Text = "Activo";
e.Row.Cells[3].ForeColor = System.Drawing.Color.Green;
}
else
{
e.Row.Cells[3].Text = "Inactivo";
e.Row.Cells[3].ForeColor = System.Drawing.Color.Red;
}
if (e.Row.DBCampo("Tipo").ToEntero() == 1)
{
e.Row.Cells[1].Text = "Calculado";
}
else if (e.Row.DBCampo("Tipo").ToEntero() == 2)
{
e.Row.Cells[1].Text = "Fijo";
}
}
}
private void CambioTipo()
{
if (DdlTipo.SelectedValue.ToEntero() == 1)
{
DivTipoCalculado.Visible = true;
}else
{
DdlTipoCalculado.SelectedIndex = 0;
DivTipoCalculado.Visible = false;
}
}
protected void DdlTipo_SelectedIndexChanged(object sender, EventArgs e)
{
CambioTipo();
UpModalCargoFijo.Update();
}
private void CargaMoneda()
{
DdlMoneda.DataSource = GlobalDTMonedas;
DdlMoneda.Items.Insert(0, new ListItem("Seleccione", "-1"));
DdlMoneda.DataBind();
UpModalCargoFijo.Update();
}
}

View File

@@ -0,0 +1,90 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="CatConceptoGastoCorte.aspx.cs" Inherits="CGame_CatConceptoGastoCorte" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
Catalogo de Conceptos
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkAgregarConcepto" OnClick="LnkAgregarConcepto_Click" runat="server"><i class="fa fa-plus"></i>Agregar Concepto</asp:LinkButton></li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvConcepto.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvConcepto.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GvConcepto" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD mysmallbtn" data-sort="true" Width="100%" AutoGenerateColumns="False"
DataKeyNames="CveConceptoGastoCorte,ConceptoGastoCorte,FechaIng,Estatus,CveUsuario,Usuario,CveEmpresa,Empresa" OnRowDataBound="GvConcepto_RowDataBound">
<Columns>
<asp:TemplateField HeaderText="Concepto" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblConcepto" runat="server" Text='<%# Eval("ConceptoGastoCorte")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="FechaIng" ItemStyle-Width="15%" HeaderText="Fecha de Ingreso" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:TemplateField HeaderText="Estatus" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="lblestatus" runat="server" Text='<%# Eval("Estatus")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Usuario" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblusuario" runat="server" Text='<%# Eval("Usuario")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText="Comandos">
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Editar" ID="LnkEditar" OnClick="LnkEditar_Click" CssClass="btn btn-circle btn-sm green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
<asp:LinkButton ID="LnkDelete" runat="server" OnClick="LnkDelete_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar el Scat?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DModalConcepto" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModal" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Literal ID="ltlMotititulo" Text="Concepto" runat="server"> </asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtConcepto" CssClass="form-control" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVScat" runat="server" ControlToValidate="TxtConcepto" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Scat''</b> es necesario, por favor ingréselo." ValidationGroup="VGMScat"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOScat" runat="server" HighlightCssClass="vco" TargetControlID="RFVScat"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtConcepto.ClientID.ToString()%>">Concepto:</label>
</div>
<div class="form-group form-md-line-input input-iconright" id="DivEstatus" runat="server">
<label for="<%= ChkEstatus.ClientID.ToString()%>">Estatus:</label>
<asp:CheckBox ID="ChkEstatus" runat="server" />
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnConceptoAdd" OnClick="BtnConceptoAdd_Click" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="VGMScat" />
<asp:Button ID="BtnConceptoEdit" OnClick="BtnConceptoEdit_Click" runat="server" Text="Actualizar" CssClass="btn btn-primary" ValidationGroup="VGMScat"></asp:Button>
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
</asp:Content>

View File

@@ -0,0 +1,73 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;
using Extensiones;
public partial class CGame_CatConceptoGastoCorte : ClsPaginas
{
#region Propiedades
private int CveConceptoGastoCorte
{
get { return (ViewState["CveConceptoGastoCorte"] == null) ? 0 : Convert.ToInt32(ViewState["CveConceptoGastoCorte"]); }
set { ViewState["CveConceptoGastoCorte"] = value; }
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
CargaConcepto();
}
}
protected void CargaConcepto()
{
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetConceptoGastoCorte(UsuarioActual.CveEmpresa))
{
GvConcepto.DataSource = ObjCGame.DtResultados;
}
ObjCGame.Dispose();
GvConcepto.DataBind();
UpDatos.Update();
}
protected void LimpiaConcepto()
{
TxtConcepto.Text = "";
UpModal.Update();
}
protected void LnkAgregarConcepto_Click(object sender, EventArgs e)
{
this.RegistraScript("$('#DModalConcepto').modal();");
LimpiaConcepto();
BtnConceptoAdd.Visible = true;
BtnConceptoEdit.Visible = false;
DivEstatus.Visible = false;
UpModal.Update();
}
protected void GvConcepto_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (Convert.ToBoolean(e.Row.DBCampo("Estatus")) == true)
{
e.Row.FCLabel("lblestatus").Text = "Activo";
e.Row.FCLabel("lblestatus").ForeColor = System.Drawing.Color.Green;
}
else
{
e.Row.FCLabel("lblestatus").Text = "Inactivo";
e.Row.FCLabel("lblestatus").ForeColor = System.Drawing.Color.Red;
}
}

161
CGame/CatEmpaque.aspx Normal file
View File

@@ -0,0 +1,161 @@
<%@ Page Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="True" CodeFile="CatEmpaque.aspx.VB" Inherits="CATTiposEtiqueta" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Catalogo de Empaques
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkAgregarTiposEtiqueta" OnClick="LnkAgregarTipo_Click" runat="server"><i class="fa fa-plus"></i>Agregar Empaque</asp:LinkButton></li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="upDatosTipo" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvEmpaque.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvEmpaque.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GvEmpaque" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False"
DataKeyNames="CveEmpaque,Empaque,Estatus,FechaIng,CveUsuario,Usuario,CveEmpresa,Empresa,CostoXTonelada,CostoPreEnfriado,Lleno,Sencillo,TermoLleno,TermoSencillo">
<Columns>
<asp:TemplateField HeaderText="Empaque" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lbltipoEtiqueta" runat="server" Text='<%# Eval("Empaque")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Costo X Tonelada" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="LblCostoXTonelada" runat="server" Text='<%# Eval("CostoXTonelada")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Costo PreEnfriado" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="LblCostoPreEnfriado" runat="server" Text='<%# Eval("CostoPreEnfriado")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Full" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="LblFull" runat="server" Text='<%# Eval("Lleno")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Sencillo" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="LblSencillo" runat="server" Text='<%# Eval("Sencillo")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="TermoFull" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="LblTermoFull" runat="server" Text='<%# Eval("TermoLleno")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="TermoSencillo" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="LblTermoSencillo" runat="server" Text='<%# Eval("TermoSencillo")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Estatus" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="lblestatus" runat="server" Text='<%# Eval("Estatus")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="FechaIng" ItemStyle-Width="15%" HeaderText="Fecha de Ingreso" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:TemplateField HeaderText="Usuario" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblusuario" runat="server" Text='<%# Eval("Usuario")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText="Comandos">
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Editar" ID="LnkEditar" OnClick="LnkEditarTipo_Click" CssClass="btn btn-circle btn-sm green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
<asp:LinkButton ID="imgD" runat="server" OnClick="LnkEliminarTipo_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar el TiposEtiqueta?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DModalTiposEtiqueta" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UPModalTipo" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Literal ID="ltlTipotitulo" Text="Empaque" runat="server"> </asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtEmpaque" CssClass="form-control" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvEmpaque" runat="server" ControlToValidate="TxtEmpaque" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Etiqueta''</b> es necesario, por favor ingréselo." ValidationGroup="VGMEmpaque"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoEmpaque" runat="server" HighlightCssClass="vco" TargetControlID="RfvEmpaque"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtEmpaque.ClientID.ToString()%>">Empaque:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCostoXTonelada" CssClass="form-control" runat="server"></asp:TextBox>
<%-- <asp:RequiredFieldValidator ID="RFVCostoXTonelada" runat="server" ControlToValidate="TxtCostoXTonelada" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Costo X Tonelada''</b> es necesario, por favor ingréselo." ValidationGroup="VGMEmpaque"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCECostoXTonelada" runat="server" HighlightCssClass="vco" TargetControlID="RFVCostoXTonelada"></ajax:ValidatorCalloutExtender>--%>
<ajax:FilteredTextBoxExtender ID="FIETCostoXToneladae" TargetControlID="TxtCostoXTonelada" FilterType="Numbers,Custom" ValidChars="." runat="server" />
<label for="<%= TxtCostoXTonelada.ClientID.ToString()%>">CostoXTonelada:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCostoPreEnfriado" CssClass="form-control" runat="server"></asp:TextBox>
<%-- <asp:RequiredFieldValidator ID="RFVViaje" runat="server" ControlToValidate="TxtViaje" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Viaje''</b> es necesario, por favor ingréselo." ValidationGroup="VGMEmpaque"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEViaje" runat="server" HighlightCssClass="vco" TargetControlID="RFVViaje"></ajax:ValidatorCalloutExtender>--%>
<ajax:FilteredTextBoxExtender ID="FTBECostoPreEnfriado" TargetControlID="TxtCostoPreEnfriado" FilterType="Numbers,Custom" ValidChars="." runat="server" />
<label for="<%= TxtCostoPreEnfriado.ClientID.ToString()%>">CostoPreEnfriado:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtFull" CssClass="form-control" runat="server"></asp:TextBox>
<%-- <asp:RequiredFieldValidator ID="RFVFull" runat="server" ControlToValidate="TxtFull" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Full''</b> es necesario, por favor ingréselo." ValidationGroup="VGMEmpaque"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEFull" runat="server" HighlightCssClass="vco" TargetControlID="RFVFull"></ajax:ValidatorCalloutExtender>--%>
<ajax:FilteredTextBoxExtender ID="FTBEFull" TargetControlID="TxtFull" FilterType="Numbers,Custom" ValidChars="." runat="server" />
<label for="<%= TxtFull.ClientID.ToString()%>">Full:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtSencillo" CssClass="form-control" runat="server"></asp:TextBox>
<%-- <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="TxtViaje" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Viaje''</b> es necesario, por favor ingréselo." ValidationGroup="VGMEmpaque"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="RFVViaje"></ajax:ValidatorCalloutExtender>--%>
<ajax:FilteredTextBoxExtender ID="FTBESencillo" TargetControlID="TxtSencillo" FilterType="Numbers,Custom" ValidChars="." runat="server" />
<label for="<%= TxtSencillo.ClientID.ToString()%>">Sencillo:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtTermoFull" CssClass="form-control" runat="server"></asp:TextBox>
<%-- <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="TxtViaje" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Viaje''</b> es necesario, por favor ingréselo." ValidationGroup="VGMEmpaque"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender3" runat="server" HighlightCssClass="vco" TargetControlID="RFVViaje"></ajax:ValidatorCalloutExtender>--%>
<ajax:FilteredTextBoxExtender ID="FTBETermoFull" TargetControlID="TxtTermoFull" FilterType="Numbers,Custom" ValidChars="." runat="server" />
<label for="<%= TxtTermoFull.ClientID.ToString()%>">TermoFull:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtTermoSencillo" CssClass="form-control" runat="server"></asp:TextBox>
<%-- <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="TxtViaje" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Viaje''</b> es necesario, por favor ingréselo." ValidationGroup="VGMEmpaque"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender4" runat="server" HighlightCssClass="vco" TargetControlID="RFVViaje"></ajax:ValidatorCalloutExtender>--%>
<ajax:FilteredTextBoxExtender ID="FTBETermoSencillo" TargetControlID="TxtTermoSencillo" FilterType="Numbers,Custom" ValidChars="." runat="server" />
<label for="<%= TxtTermoSencillo.ClientID.ToString()%>">TermoSencillo:</label>
</div>
<div class="form-group form-md-line-input input-iconright" id="DivEstatus" runat="server">
<label for="<%= ChkTipoestatus.ClientID.ToString()%>">Estatus:</label>
<asp:CheckBox ID="ChkTipoestatus" runat="server" />
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnTipoADD" OnClick="BtnTipoADD_Click" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="VGMEmpaque" />
<asp:Button ID="BtnTipoEdit" OnClick="BtnTipoEdit_Click" runat="server" Text="Actualizar" CssClass="btn btn-primary" ValidationGroup="VGMEmpaque"></asp:Button>
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

54
CGame/CatEmpaque.aspx.VB Normal file
View File

@@ -0,0 +1,54 @@
Option Strict On
Imports System.Data
Imports System.Collections.Generic
Imports System.Linq
Imports System.Web
Imports System.Web.UI.WebControls
Imports Extensiones
Partial Class CATTiposEtiqueta
Inherits ClsPaginas
#Region "Propiedades"
Private Property CveEmpaque() As Integer
Get
Return If(IsNothing(ViewState("CveEmpaque")), 0, CInt(ViewState("CveEmpaque")))
End Get
Set
ViewState("CveEmpaque") = Value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
CargaEmpaque()
End If
End Sub
Protected Sub CargaEmpaque()
Dim ObjTipo As New ClsCGame()
If ObjTipo.GetEmpaques(UsuarioActual.CveEmpresa) Then
GvEmpaque.DataSource = ObjTipo.DtResultados
GvEmpaque.DataBind()
End If
ObjTipo.Dispose()
upDatosTipo.Update()
End Sub
Protected Sub LimpiaEmpaque()
TxtEmpaque.Text = ""

89
CGame/CatEstatus.aspx Normal file
View File

@@ -0,0 +1,89 @@
<%@ Page Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="True" CodeFile="CatEstatus.aspx.VB" Inherits="CATEstatus" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Catalogo de Estatus
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkAgregarEstatus" OnClick="LnkAgregarEsta_Click" runat="server"><i class="fa fa-plus"></i>Agregar Estatus</asp:LinkButton></li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="upDatosEsta" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVEstatus.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVEstatus.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GVEstatus" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD mysmallbtn" data-sort="true" Width="100%" AutoGenerateColumns="False"
DataKeyNames="CveEstatus,Estatus,Estado,FechaIng,CveUsuario,Usuario,CveEmpresa,Empresa">
<Columns>
<asp:TemplateField HeaderText="Estatus" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblestatus" runat="server" Text='<%# Eval("Estatus")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Estado" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="lblestado" runat="server" Text='<%# Eval("Estado")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="FechaIng" ItemStyle-Width="15%" HeaderText="Fecha de Ingreso" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:TemplateField HeaderText="Usuario" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblusuario" runat="server" Text='<%# Eval("Usuario")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText="Comandos">
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Editar" ID="LnkEditar" OnClick="LnkEditarEsta_Click" CssClass="btn btn-circle btn-sm green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
<asp:LinkButton ID="imgD" runat="server" OnClick="LnkEliminarEsta_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar el Estatus?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DModalEstatus" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UPModalEsta" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Literal ID="ltlEstatitulo" Text="Estatus" runat="server"> </asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtEstaestatus" CssClass="form-control" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvEstaestatus" runat="server" ControlToValidate="TxtEstaestatus" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Estatus''</b> es necesario, por favor ingréselo." ValidationGroup="VGMEsta"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoEstaestatus" runat="server" HighlightCssClass="vco" TargetControlID="RfvEstaestatus"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtEstaestatus.ClientID.ToString()%>">Estatus:</label>
</div>
<div class="form-group form-md-line-input input-iconright" id="DivEstado" runat="server">
<label for="<%= ChkEstaestado.ClientID.ToString()%>">Estado:</label>
<asp:CheckBox ID="ChkEstaestado" runat="server" />
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnEstaADD" OnClick="BtnEstaADD_Click" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="VGMEsta" />
<asp:Button ID="BtnEstaEdit" OnClick="BtnEstaEdit_Click" runat="server" Text="Actualizar" CssClass="btn btn-primary" ValidationGroup="VGMEsta"></asp:Button>
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

44
CGame/CatEstatus.aspx.VB Normal file
View File

@@ -0,0 +1,44 @@
Option Strict On
Imports System.Data
Imports System.Collections.Generic
Imports System.Linq
Imports System.Web
Imports System.Web.UI.WebControls
Imports Extensiones
Partial Class CATEstatus
Inherits ClsPaginas
#Region "Propiedades"
Property CveEstatus As Integer
Get
If Not ViewState("CveEstatus") Is Nothing Then
Return ViewState("CveEstatus").ToString.ToEntero
Else
Return -1
End If
End Get
Set(value As Integer)
ViewState("CveEstatus") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
CargaEstatus()
End If
End Sub
Protected Sub CargaEstatus()
Dim ObjEsta As New ClsCGame()
If ObjEsta.GetEstatus(UsuarioActual.CveEmpresa) Then
GVEstatus.DataSource = ObjEsta.DtResultados
GVEstatus.DataBind()
End If
ObjEsta.Dispose()
upDatosEsta.Update()

135
CGame/CatHuerta.aspx Normal file
View File

@@ -0,0 +1,135 @@
<%@ Page Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="True" CodeFile="CATHuerta.aspx.CS" Inherits="CATHuerta" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Catalogo de Huerta
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkAgregarHuerta" OnClick="LnkAgregarHuer_Click" runat="server"><i class="fa fa-plus"></i>Agregar Huerta</asp:LinkButton></li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="upDatosHuer" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVHuerta.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVHuerta.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GVHuerta" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False"
DataKeyNames="CveHuerta,Huerta,CveProveedor,RazonSocial,FechaIng,Estatus,CveUsuario,Usuario,CveEmpresa,Empresa,TipoCobro,Importe,CostoXTonelada" OnRowDataBound="GvHuerta_RowDataBound">
<Columns>
<asp:TemplateField HeaderText="Huerta" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblhuerta" runat="server" Text='<%# Eval("Huerta")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Proveedor" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblrazonsocial" runat="server" Text='<%# Eval("RazonSocial")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo Cobro" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoCobro" runat="server" Text='<%# Eval("TipoCobro")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Importe" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="LblImporte" runat="server" Text='<%# Eval("Importe")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Costo X Tonelada E.M.P." ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="LblCostoXTonelada" runat="server" Text='<%# Eval("CostoXTonelada")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="FechaIng" ItemStyle-Width="15%" HeaderText="Fecha de Ingreso" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:TemplateField HeaderText="Estatus" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="lblestatus" runat="server" Text='<%# Eval("Estatus")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Usuario" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblusuario" runat="server" Text='<%# Eval("Usuario")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText="Comandos">
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Editar" ID="LnkEditar" OnClick="LnkEditarHuer_Click" CssClass="btn btn-circle btn-sm green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
<asp:LinkButton ID="imgD" runat="server" OnClick="LnkEliminarHuer_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar el Huerta?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DModalHuerta" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UPModalHuer" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Literal ID="ltlHuertitulo" runat="server" Text="Huerta"></asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtHuerhuerta" CssClass="form-control" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvHuerhuerta" runat="server" ControlToValidate="TxtHuerhuerta" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Huerta''</b> es necesario, por favor ingréselo." ValidationGroup="VGMHuer"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoHuerhuerta" runat="server" HighlightCssClass="vco" TargetControlID="RfvHuerhuerta"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtHuerhuerta.ClientID.ToString()%>">Huerta:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlProveedor" CssClass="form-control select2me " runat="server" DataTextField="RazonSocial" AppendDataBoundItems="true" DataValueField="CveProveedor" Style="width: 100%"></asp:DropDownList>
<label for="<%= DdlProveedor.ClientID.ToString()%>">Proveedor:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlTipoCobro" CssClass="form-control select2me" runat="server" AppendDataBoundItems="true" Style="width: 100%">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Text="Costo X Tonelada" Value="1"></asp:ListItem>
<asp:ListItem Text="Viaje" Value="2"></asp:ListItem>
</asp:DropDownList>
<label for="<%= DdlTipoCobro.ClientID.ToString()%>">Tipo de Cobro Flete Huerta Empaque:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtImporte" CssClass="form-control" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVImporte" runat="server" ControlToValidate="TxtImporte" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Importe''</b> es necesario, por favor ingréselo." ValidationGroup="VGMHuer"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEImporte" runat="server" HighlightCssClass="vco" TargetControlID="RFVImporte"></ajax:ValidatorCalloutExtender>
<ajax:FilteredTextBoxExtender ID="FIETTImporte" TargetControlID="TxtImporte" FilterType="Numbers,Custom" ValidChars="." runat="server" />
<label for="<%= TxtImporte.ClientID.ToString()%>">Importe:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCostoXTonelada" CssClass="form-control" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVCostoXTonelada" runat="server" ControlToValidate="TxtCostoXTonelada" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Costo X Tonelada E.M.P.''</b> es necesario, por favor ingréselo." ValidationGroup="VGMHuer"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCECostoXTonelada" runat="server" HighlightCssClass="vco" TargetControlID="RFVCostoXTonelada"></ajax:ValidatorCalloutExtender>
<ajax:FilteredTextBoxExtender ID="FTBECostoXTonelada" TargetControlID="TxtCostoXTonelada" FilterType="Numbers,Custom" ValidChars="." runat="server" />
<label for="<%= TxtCostoXTonelada.ClientID.ToString()%>">Costo X Tonelada E.M.P.:</label>
</div>
<div class="form-group form-md-line-input input-iconright" id="DivEstatus" runat="server">
<label for="<%= ChkHuerestatus.ClientID.ToString()%>">Estatus:</label>
<asp:CheckBox ID="ChkHuerestatus" runat="server" />
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnHuerADD" OnClick="BtnHuerADD_Click" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="VGMHuer" />
<asp:Button ID="BtnHuerEdit" OnClick="BtnHuerEdit_Click" runat="server" Text="Actualizar" CssClass="btn btn-primary" ValidationGroup="VGMHuer"></asp:Button>
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

51
CGame/CatHuerta.aspx.cs Normal file
View File

@@ -0,0 +1,51 @@

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;
using Extensiones;
public partial class CATHuerta :ClsPaginas
{
#region Propiedades
private int CveHuerta
{
get{return (ViewState["CveHuerta"] == null) ? 0 : Convert.ToInt32(ViewState["CveHuerta"]);}
set{ViewState["CveHuerta"] =value;}
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack){
CargaProveedor();
CargaHuerta();
}
}
protected void CargaHuerta()
{
ClsCGame ObjHuer =new ClsCGame();
if (ObjHuer.GetHuerta(UsuarioActual.CveEmpresa))
{
GVHuerta.DataSource = ObjHuer.DtResultados;
GVHuerta.DataBind();
}
ObjHuer.Dispose();
upDatosHuer.Update();
}
protected void CargaProveedor()
{
ClsCompProveedores ObjProv = new ClsCompProveedores();
if (ObjProv.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, -1, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa))
{
DdlProveedor.DataSource = ObjProv.DtResultados;
DdlProveedor.Items.Insert(0, new ListItem("Seleccione", "-1"));
DdlProveedor.DataBind();
}
ObjProv.Dispose();
}
protected void LimpiaHuerta()
{

View File

@@ -0,0 +1,89 @@
<%@ Page Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="True" CodeFile="CATMotivosMerma.aspx.CS" Inherits="CATMotivosMerma" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Catalogo de Motivos de Merma
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkAgregarMotivosMerma" OnClick="LnkAgregarMoti_Click" runat="server"><i class="fa fa-plus"></i>Agregar Motivos de Merma</asp:LinkButton></li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="upDatosMoti" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVMotivosMerma.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVMotivosMerma.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GVMotivosMerma" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD mysmallbtn" data-sort="true" Width="100%" AutoGenerateColumns="False"
DataKeyNames="CveMotivo,Motivo,FechaIng,Estatus,CveUsuario,Usuario,CveEmpresa,Empresa" OnRowDataBound="GvMotivoMerma_RowDataBound">
<Columns>
<asp:TemplateField HeaderText="Motivo" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblmotivo" runat="server" Text='<%# Eval("Motivo")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="FechaIng" ItemStyle-Width="15%" HeaderText="Fecha de Ingreso" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:TemplateField HeaderText="Estatus" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="lblestatus" runat="server" Text='<%# Eval("Estatus")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Usuario" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblusuario" runat="server" Text='<%# Eval("Usuario")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText="Comandos">
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Editar" ID="LnkEditar" OnClick="LnkEditarMoti_Click" CssClass="btn btn-circle btn-sm green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
<asp:LinkButton ID="imgD" runat="server" OnClick="LnkEliminarMoti_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar el MotivosMerma?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DModalMotivosMerma" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UPModalMoti" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Literal ID="ltlMotititulo" Text="Motivo de Merma" runat="server"> </asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtMotimotivo" CssClass="form-control" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvMotimotivo" runat="server" ControlToValidate="TxtMotimotivo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Motivo''</b> es necesario, por favor ingréselo." ValidationGroup="VGMMoti"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoMotimotivo" runat="server" HighlightCssClass="vco" TargetControlID="RfvMotimotivo"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtMotimotivo.ClientID.ToString()%>">Motivo de Merma:</label>
</div>
<div class="form-group form-md-line-input input-iconright" id="DivEstatus" runat="server">
<label for="<%= ChkMotiestatus.ClientID.ToString()%>">Estatus:</label>
<asp:CheckBox ID="ChkMotiestatus" runat="server" />
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnMotiADD" OnClick="BtnMotiADD_Click" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="VGMMoti" />
<asp:Button ID="BtnMotiEdit" OnClick="BtnMotiEdit_Click" runat="server" Text="Actualizar" CssClass="btn btn-primary" ValidationGroup="VGMMoti"></asp:Button>
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;
using Extensiones;
public partial class CATMotivosMerma :ClsPaginas
{
#region Propiedades
private int CveMotivo
{
get{return (ViewState["CveMotivo"] == null) ? 0 : Convert.ToInt32(ViewState["CveMotivo"]);}
set{ViewState["CveMotivo"] =value;}
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack){
CargaMotivosMerma();

96
CGame/CatProductos.aspx Normal file
View File

@@ -0,0 +1,96 @@
<%@ Page Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="True" CodeFile="CATProductos.aspx.CS" Inherits="CATProductos" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Catalogo de Frutos
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkAgregarProductos" OnClick="LnkAgregarProd_Click" runat="server"><i class="fa fa-plus"></i>Agregar Producto</asp:LinkButton></li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="upDatosProd" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GVProductos" runat="server" OnRowDataBound="GVProductos_RowDataBound" GridLines="None" CssClass="table table-hover table-striped ScrollAD mysmallbtn" data-sort="true" Width="100%" AutoGenerateColumns="False"
DataKeyNames="CvePS,PS,FechaIng,Estatus,CveUsuario,Usuario,CveEmpresa,Empresa">
<Columns>
<asp:TemplateField HeaderText="Fruto" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblpS" runat="server" Text='<%# Eval("PS")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Estatus" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="lblestatus" runat="server" Text='<%# Eval("Estatus")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="FechaIng" ItemStyle-Width="15%" HeaderText="Fecha de Ingreso" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:TemplateField HeaderText="Usuario" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblusuario" runat="server" Text='<%# Eval("Usuario")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText="Comandos">
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Editar" ID="LnkEditar" OnClick="LnkEditarProd_Click" CssClass="btn btn-circle btn-sm green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
<asp:LinkButton ID="imgD" runat="server" OnClick="LnkEliminarProd_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar el Productos?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DModalProductos" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UPModalProd" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Literal ID="ltlProdtitulo" Text="Fruto" runat="server"> </asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtProdpS" CssClass="form-control " runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvProdpS" runat="server" ControlToValidate="TxtProdpS" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''PS''</b> es necesario, por favor ingréselo." ValidationGroup="VGMProd"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoProdpS" runat="server" HighlightCssClass="vco" TargetControlID="RfvProdpS"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtProdpS.ClientID.ToString()%>">Fruto:</label>
</div>
<div class="form-group form-md-line-input input-iconright" id="DivTipoPS" visible="false" runat="server">
<asp:DropDownList ID="DdlTipoPS" CssClass="select2me" runat="server">
<Items>
<asp:ListItem Value="1" Text="Empacado"></asp:ListItem>
<asp:ListItem Value="2" Text="Envasado"></asp:ListItem>
</Items>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtProdpS" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''PS''</b> es necesario, por favor ingréselo." ValidationGroup="VGMProd"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RfvProdpS"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtProdpS.ClientID.ToString()%>">Producto:</label>
</div>
<div class="form-group form-md-line-input input-iconright" id="DivEstatus" runat="server">
<label for="<%= ChkProdestatus.ClientID.ToString()%>">Estatus:</label>
<asp:CheckBox ID="ChkProdestatus" runat="server" />
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnProdADD" OnClick="BtnProdADD_Click" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="VGMProd" />
<asp:Button ID="BtnProdEdit" OnClick="BtnProdEdit_Click" runat="server" Text="Actualizar" CssClass="btn btn-primary" ValidationGroup="VGMProd"></asp:Button>
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

126
CGame/CatProductos.aspx.cs Normal file
View File

@@ -0,0 +1,126 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;
using Extensiones;
public partial class CATProductos : ClsPaginas
{
#region Propiedades
private int CvePS
{
get{return (ViewState["CvePS"] == null) ? 0 : Convert.ToInt32(ViewState["CvePS"]);}
set{ViewState["CvePS"] =value;}
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack){
CargaProductos();
}
}
protected void CargaProductos()
{
ClsCGame ObjCGame =new ClsCGame();
if (ObjCGame.GetPS(UsuarioActual.CveEmpresa))
{
GVProductos.DataSource = ObjCGame.DtResultados;
GVProductos.DataBind();
}
ObjCGame.Dispose();
upDatosProd.Update();
}
protected void LimpiaProductos()
{
TxtProdpS.Text= "";
UPModalProd.Update();
}
protected void LnkEditarProd_Click(object sender, EventArgs e)
{
LimpiaProductos();
GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
CvePS = gvRow.DataKey("CvePS").ToEntero();
TxtProdpS.Text = gvRow.DataKey("PS");
ChkProdestatus.Checked = Convert.ToBoolean(gvRow.DataKey("Estatus"));
this.RegistraScript("$('#DModalProductos').modal();");
BtnProdADD.Visible = false;
BtnProdEdit.Visible = true;
DivEstatus.Visible = true;
UPModalProd.Update();
}
protected void LnkAgregarProd_Click(object sender, EventArgs e)
{
this.RegistraScript("$('#DModalProductos').modal();");
LimpiaProductos();
BtnProdADD.Visible=true;
BtnProdEdit.Visible=false;
DivEstatus.Visible = false;
UPModalProd.Update();
}
protected void BtnProdADD_Click(object sender, EventArgs e)
{
ClsCGame ObjCGame = new ClsCGame();
bool Continuar = ObjCGame.AddPS(TxtProdpS.Text, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa);
ObjCGame.Dispose();
if (Continuar)
{
this.RegistraScript("$('#DModalProductos').modal('hide');");
LimpiaProductos();
UPModalProd.Update();
Alert("El Producto se ha agregado");
CargaProductos();
}
}
protected void BtnProdEdit_Click(object sender, EventArgs e)
{
ClsCGame ObjCGame = new ClsCGame();
bool Continuar = ObjCGame.UpdatePS(CvePS, TxtProdpS.Text, 1, ChkProdestatus.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa);
ObjCGame.Dispose();
if (Continuar)
{
this.RegistraScript("$('#DModalProductos').modal('hide');");
LimpiaProductos();
UPModalProd.Update();
Alert("El Producto se ha actualizado");
CargaProductos();
}
}
protected void LnkEliminarProd_Click(object sender, EventArgs e)
{
GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
ClsCGame ObjCGame = new ClsCGame();
bool Continuar = ObjCGame.RemovePS(gvRow.DataKey("CvePS").ToEntero());
ObjCGame.Dispose();
if (Continuar)
{
CargaProductos();
Alert("El Producto se ha eliminado");
}
}
protected void GVProductos_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (Convert.ToBoolean(e.Row.DBCampo("Estatus")) == true)
{
e.Row.FCLabel("lblestatus").Text = "Activo";
e.Row.FCLabel("lblestatus").ForeColor = System.Drawing.Color.Green;
}
else
{
e.Row.FCLabel("lblestatus").Text = "Inactivo";
e.Row.FCLabel("lblestatus").ForeColor = System.Drawing.Color.Red;
}
}
}
}

90
CGame/CatScat.aspx Normal file
View File

@@ -0,0 +1,90 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="CatScat.aspx.cs" Inherits="CGame_CatScat" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
Catalogo de Scat
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkAgregarScat" OnClick="LnkAgregarScat_Click" runat="server"><i class="fa fa-plus"></i>Agregar Scat</asp:LinkButton></li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvScat.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvScat.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GvScat" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD mysmallbtn" data-sort="true" Width="100%" AutoGenerateColumns="False"
DataKeyNames="CveScat,Scat,FechaIng,Estatus,CveUsuario,Usuario,CveEmpresa,Empresa" OnRowDataBound="GvScat_RowDataBound">
<Columns>
<asp:TemplateField HeaderText="Scat" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblScat" runat="server" Text='<%# Eval("Scat")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="FechaIng" ItemStyle-Width="15%" HeaderText="Fecha de Ingreso" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:TemplateField HeaderText="Estatus" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="lblestatus" runat="server" Text='<%# Eval("Estatus")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Usuario" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblusuario" runat="server" Text='<%# Eval("Usuario")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText="Comandos">
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Editar" ID="LnkEditar" OnClick="LnkEditar_Click" CssClass="btn btn-circle btn-sm green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
<asp:LinkButton ID="imgD" runat="server" OnClick="imgD_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar el Scat?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DModalScat" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModal" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Literal ID="ltlMotititulo" Text="Scat" runat="server"> </asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtScat" CssClass="form-control" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVScat" runat="server" ControlToValidate="TxtScat" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Scat''</b> es necesario, por favor ingréselo." ValidationGroup="VGMScat"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOScat" runat="server" HighlightCssClass="vco" TargetControlID="RFVScat"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtScat.ClientID.ToString()%>">Scat:</label>
</div>
<div class="form-group form-md-line-input input-iconright" id="DivEstatus" runat="server">
<label for="<%= ChkEstatus.ClientID.ToString()%>">Estatus:</label>
<asp:CheckBox ID="ChkEstatus" runat="server" />
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnScatAdd" OnClick="BtnScatAdd_Click" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="VGMScat" />
<asp:Button ID="BtnScatEdit" OnClick="BtnScatEdit_Click" runat="server" Text="Actualizar" CssClass="btn btn-primary" ValidationGroup="VGMScat"></asp:Button>
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
</asp:Content>

71
CGame/CatScat.aspx.cs Normal file
View File

@@ -0,0 +1,71 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;
using Extensiones;
public partial class CGame_CatScat : ClsPaginas
{
#region Propiedades
private int CveScat
{
get { return (ViewState["CveScat"] == null) ? 0 : Convert.ToInt32(ViewState["CveScat"]); }
set { ViewState["CveScat"] = value; }
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
CargaScat();
}
}
protected void CargaScat()
{
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetScat(UsuarioActual.CveEmpresa))
{
GvScat.DataSource = ObjCGame.DtResultados;
}
ObjCGame.Dispose();
GvScat.DataBind();
UpDatos.Update();
}
protected void LimpiaScat()
{
TxtScat.Text = "";
UpModal.Update();
}
protected void LnkAgregarScat_Click(object sender, EventArgs e)
{
this.RegistraScript("$('#DModalScat').modal();");
LimpiaScat();
BtnScatAdd.Visible = true;
BtnScatEdit.Visible = false;
DivEstatus.Visible = false;
UpModal.Update();
}
protected void GvScat_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (Convert.ToBoolean(e.Row.DBCampo("Estatus")) == true)
{
e.Row.FCLabel("lblestatus").Text = "Activo";
e.Row.FCLabel("lblestatus").ForeColor = System.Drawing.Color.Green;
}
else
{
e.Row.FCLabel("lblestatus").Text = "Inactivo";
e.Row.FCLabel("lblestatus").ForeColor = System.Drawing.Color.Red;
}
}

89
CGame/CatTamaños.aspx Normal file
View File

@@ -0,0 +1,89 @@
<%@ Page Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="True" CodeFile="CatTamaños.aspx.VB" Inherits="CATTamaños" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Catalogo de Tamaños
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkAgregarTamaños" OnClick="LnkAgregarTama_Click" runat="server"><i class="fa fa-plus"></i>Agregar Tamaños</asp:LinkButton></li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="upDatosTama" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVTamaños.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVTamaños.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GVTamaños" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD mysmallbtn" data-sort="true" Width="100%" AutoGenerateColumns="False"
DataKeyNames="CveTamaño,Tamaño,Estatus,FechaIng,CveUsuario,Usuario,CveEmpresa,Empresa">
<Columns>
<asp:TemplateField HeaderText="Tamaño" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lbltamaño" runat="server" Text='<%# Eval("Tamaño")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Estatus" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="lblestatus" runat="server" Text='<%# Eval("Estatus")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="FechaIng" ItemStyle-Width="15%" HeaderText="Fecha de Ingreso" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:TemplateField HeaderText="Usuario" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblusuario" runat="server" Text='<%# Eval("Usuario")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText="Comandos">
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Editar" ID="LnkEditar" OnClick="LnkEditarTama_Click" CssClass="btn btn-circle btn-sm green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
<asp:LinkButton ID="imgD" runat="server" OnClick="LnkEliminarTama_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar el Tamaños?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DModalTamaños" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UPModalTama" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Literal ID="ltlTamatitulo" runat="server" Text="Tamaño"> </asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtTamatamaño" CssClass="form-control" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvTamatamaño" runat="server" ControlToValidate="TxtTamatamaño" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tamaño''</b> es necesario, por favor ingréselo." ValidationGroup="VGMTama"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoTamatamaño" runat="server" HighlightCssClass="vco" TargetControlID="RfvTamatamaño"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtTamatamaño.ClientID.ToString()%>">Tamaño:</label>
</div>
<div class="form-group form-md-line-input input-iconright" id="DivEstatus" runat="server">
<label for="<%= ChkTamaestatus.ClientID.ToString()%>">Estatus:</label>
<asp:CheckBox ID="ChkTamaestatus" runat="server" />
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnTamaADD" OnClick="BtnTamaADD_Click" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="VGMTama" />
<asp:Button ID="BtnTamaEdit" OnClick="BtnTamaEdit_Click" runat="server" Text="Actualizar" CssClass="btn btn-primary" ValidationGroup="VGMTama"></asp:Button>
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

41
CGame/CatTamaños.aspx.VB Normal file
View File

@@ -0,0 +1,41 @@
Option Strict On
Imports System.Data
Imports System.Collections.Generic
Imports System.Linq
Imports System.Web
Imports System.Web.UI.WebControls
Imports Extensiones
Partial Class CATTamaños
Inherits ClsPaginas
#Region "Propiedades"
Private Property CveTamaño() As Integer
Get
Return If(IsNothing(ViewState("CveTamaño")), -1, CInt(ViewState("CveTamaño")))
End Get
Set
ViewState("CveTamaño") = Value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
CargaTamaños()
End If
End Sub
Protected Sub CargaTamaños()
Dim ObjTama As New ClsCGame()
If ObjTama.GetTamaños(UsuarioActual.CveEmpresa) Then

102
CGame/CatTipoCaja.aspx Normal file
View File

@@ -0,0 +1,102 @@
<%@ Page Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="True" CodeFile="CatTipoCaja.aspx.VB" Inherits="CATTipoCaja" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Catalogo de Etiquetas
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkAgregarTipoCaja" OnClick="LnkAgregarTipo_Click" runat="server"><i class="fa fa-plus"></i>Agregar Tipo de Caja</asp:LinkButton></li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="upDatosTipo" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVTipoCaja.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVTipoCaja.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GVTipoCaja" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False"
DataKeyNames="CveTipoCaja,TipoCaja,Estatus,FechaIng,CveUsuario,Usuario,CveEmpresa,Empresa,Tipo">
<Columns>
<asp:TemplateField HeaderText="Etiqueta" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lbltipoCaja" runat="server" Text='<%# Eval("TipoCaja")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipo" runat="server" Text='<%# Eval("TipoEsc")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Estatus" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="lblestatus" runat="server" Text='<%# Eval("Estatus")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="FechaIng" ItemStyle-Width="15%" HeaderText="Fecha de Ingreso" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:TemplateField HeaderText="Usuario" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblusuario" runat="server" Text='<%# Eval("Usuario")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText="Comandos">
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Editar" ID="LnkEditar" OnClick="LnkEditarTipo_Click" CssClass="btn btn-circle btn-sm green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
<asp:LinkButton ID="imgD" runat="server" OnClick="LnkEliminarTipo_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar el TipoCaja?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DModalTipoCaja" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UPModalTipo" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Literal ID="ltlTipotitulo" Text="Etiqueta" runat="server"> </asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtTipotipoCaja" CssClass="form-control" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvTipotipoCaja" runat="server" ControlToValidate="TxtTipotipoCaja" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Caja''</b> es necesario, por favor ingréselo." ValidationGroup="VGMTipo"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoTipotipoCaja" runat="server" HighlightCssClass="vco" TargetControlID="RfvTipotipoCaja"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtTipotipoCaja.ClientID.ToString()%>">Etiqueta:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlTipo" runat="server" CssClass="form-control select2me" AppendDataBoundItems="true" Width="100%">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Text="Nacional" Value="1"></asp:ListItem>
<asp:ListItem Text="Japon" Value="2"></asp:ListItem>
</asp:DropDownList>
<label for="<%= DdlTipo.ClientID.ToString()%>">Tipo:</label>
</div>
<div class="form-group form-md-line-input input-iconright" id="DivEstatus" runat="server">
<label for="<%= ChkTipoestatus.ClientID.ToString()%>">Estatus:</label>
<asp:CheckBox ID="ChkTipoestatus" runat="server" />
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnTipoADD" OnClick="BtnTipoADD_Click" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="VGMTipo" />
<asp:Button ID="BtnTipoEdit" OnClick="BtnTipoEdit_Click" runat="server" Text="Actualizar" CssClass="btn btn-primary" ValidationGroup="VGMTipo"></asp:Button>
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

48
CGame/CatTipoCaja.aspx.VB Normal file
View File

@@ -0,0 +1,48 @@
Option Strict On
Imports System.Data
Imports System.Collections.Generic
Imports System.Linq
Imports System.Web
Imports System.Web.UI.WebControls
Imports Extensiones
Partial Class CATTipoCaja
Inherits ClsPaginas
#Region "Propiedades"
Private Property CveTipoCaja() As Int32
Get
Return If(IsNothing(ViewState("CveTipoCaja")), 0, CInt(ViewState("CveTipoCaja")))
End Get
Set
ViewState("CveTipoCaja") = Value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
CargaTipoCaja()
End If
End Sub
Protected Sub CargaTipoCaja()
Dim ObjTipo As New ClsCGame()
If ObjTipo.GetTipoCaja(UsuarioActual.CveEmpresa) Then
GVTipoCaja.DataSource = ObjTipo.DtResultados
GVTipoCaja.DataBind()
End If
ObjTipo.Dispose()
upDatosTipo.Update()
End Sub

115
CGame/CatTipoEmpaque.aspx Normal file
View File

@@ -0,0 +1,115 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatTipoEmpaque.aspx.vb" Inherits="CGame_CatTipoEmpaque" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Catálogo de Tipos de Empaque
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<li>
<asp:LinkButton ID="LnkAgregarCGame_TipoEmpaque" OnClick="LnkAgregarCGam_Click" runat="server"><i class="fa fa-plus"></i>Agregar Tipo de Empaque</asp:LinkButton></li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="upDatosCGam" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVCGame_TipoEmpaque.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVCGame_TipoEmpaque.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GVCGame_TipoEmpaque" EmptyDataText="No hay tipos de empaque registrados." runat="server" GridLines="None"
CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False"
DataKeyNames="CveTipoEmpaque,TipoEmpaque,Estatus,FechaIng,CveUsuario,Usuario,CveEmpresa,Empresa,Tipo,EsMaster">
<Columns>
<asp:TemplateField HeaderText="Tipo Empaque">
<ItemTemplate>
<asp:Label ID="lbltipoEmpaque" runat="server" Text='<%# Eval("TipoEmpaque")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo">
<ItemTemplate>
<asp:Label ID="LblTipo" runat="server" Text='<%# Eval("TipoEsc")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="¿Es Master?">
<ItemTemplate>
<asp:Label ID="LblEsMaster" runat="server" Text='<%# Eval("EsMasterDescripcion")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Estatus" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="lblestatus" runat="server" Text='<%# If(CBool(Eval("Estatus")), "Activo", "Inactivo")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Fecha Ingreso" ItemStyle-HorizontalAlign="Center" DataField="FechaIng" DataFormatString="{0:dd/MM/yyyy}" />
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText="Comandos">
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Editar" ID="LnkEditar" OnClick="LnkEditarCGam_Click" CssClass="btn btn-circle btn-sm green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
<asp:LinkButton ID="imgD" runat="server" OnClick="LnkEliminarCGam_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar el tipo de empaque?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DModalCGame_TipoEmpaque" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UPModalCGam" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Literal ID="ltlCGamtitulo" runat="server"> </asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCGamtipoEmpaque" CssClass="form-control" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvCGamtipoEmpaque" runat="server" ControlToValidate="TxtCGamtipoEmpaque" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Empaque''</b> es necesario, por favor ingréselo." ValidationGroup="VGMCGam"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoCGamtipoEmpaque" runat="server" HighlightCssClass="vco" TargetControlID="RfvCGamtipoEmpaque"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtCGamtipoEmpaque.ClientID.ToString()%>">Tipo de Empaque:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlTipoEmpaque" CssClass="form-control select2me " AppendDataBoundItems="true" runat="server">
<Items>
<asp:ListItem Value="-1" Selected="True" Text="Seleccione"></asp:ListItem>
<asp:ListItem Value="1" Text="Caja"></asp:ListItem>
<asp:ListItem Value="2" Text="Bins"></asp:ListItem>
</Items>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVTipoEmpaque" runat="server" InitialValue="-1" ControlToValidate="DdlTipoEmpaque" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo''</b> es necesario, por favor ingréselo." ValidationGroup="VGMCGam"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOTipoEmpaque" runat="server" HighlightCssClass="vco" TargetControlID="RFVTipoEmpaque"></ajax:ValidatorCalloutExtender>
<label for="<%= DdlTipoEmpaque.ClientID.ToString()%>">Tipo:</label>
</div>
<div class="form-group form-md-line-input input-iconright" >
<label for="<%= ChkEsMaster.ClientID.ToString()%>">¿Es Master?</label>
<asp:CheckBox ID="ChkEsMaster" runat="server" />
</div>
<div class="form-group form-md-line-input input-iconright" id="DivEstatus" runat="server">
<label for="<%= ChkCGamestatus.ClientID.ToString()%>">Estatus:</label>
<asp:CheckBox ID="ChkCGamestatus" Text=" " runat="server" />
</div>
</div>
<div class="modal-footer">
<div class="modal-btn">
<asp:Button ID="BtnCGamADD" OnClick="BtnCGamADD_Click" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="VGMCGam" />
<asp:Button ID="BtnCGamEdit" OnClick="BtnCGamEdit_Click" runat="server" Text="Actualizar" CssClass="btn btn-primary" ValidationGroup="VGMCGam"></asp:Button>
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,150 @@
Option Strict On
Imports System.Data
Imports System.Collections.Generic
Imports System.Linq
Imports System.Web
Imports System.Web.UI.WebControls
Imports Extensiones
Partial Class CGame_CatTipoEmpaque
Inherits ClsPaginas
#Region "Propiedades"
Private Property RcveTipoEmpaque() As Int32
Get
Return If(IsNothing(ViewState("RcveTipoEmpaque")), 0, CInt(ViewState("RcveTipoEmpaque")))
End Get
Set
ViewState("RcveTipoEmpaque") = Value
End Set
End Property
Private Property CcveTipoEmpaque() As Int32
Get
Return If(IsNothing(ViewState("CcveTipoEmpaque")), 0, CInt(ViewState("CcveTipoEmpaque")))
End Get
Set
ViewState("CcveTipoEmpaque") = Value
End Set
End Property
Private Property RcveUsuario() As Int32
Get
Return If(IsNothing(ViewState("RcveUsuario")), 0, CInt(ViewState("RcveUsuario")))
End Get
Set
ViewState("RcveUsuario") = Value
End Set
End Property
Private Property RcveEmpresa() As Int32
Get
Return If(IsNothing(ViewState("RcveEmpresa")), 0, CInt(ViewState("RcveEmpresa")))
End Get
Set
ViewState("RcveEmpresa") = Value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
RcveTipoEmpaque = If(IsNothing(Request("cveTipoEmpaque")), 0, Request("cveTipoEmpaque").ToString().ToEntero())
RcveUsuario = If(IsNothing(Request("cveUsuario")), 0, Request("cveUsuario").ToString().ToEntero())
RcveEmpresa = If(IsNothing(Request("cveEmpresa")), 0, Request("cveEmpresa").ToString().ToEntero())
CargaTipoEmpaque()
ChkCGamestatus.Checked = True
End If
End Sub
Protected Sub CargaTipoEmpaque()
Dim ObjCGam As New ClsCGame()
If ObjCGam.GetTipoEmpaque(-1, -1, UsuarioActual.CveEmpresa) Then
GVCGame_TipoEmpaque.DataSource = ObjCGam.DtResultados
End If
ObjCGam.Dispose()
GVCGame_TipoEmpaque.DataBind()
upDatosCGam.Update()
End Sub
Protected Sub LimpiaCGame_TipoEmpaque()
TxtCGamtipoEmpaque.Text = ""
DdlTipoEmpaque.SelectedIndex = 0
ChkEsMaster.Checked = False
UPModalCGam.Update()
End Sub
Protected Sub LnkEditarCGam_Click(sender As Object, e As EventArgs)
ltlCGamtitulo.Text = "Editar Tipo Empaque"
divEstatus.Visible = True
LimpiaCGame_TipoEmpaque()
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
CcveTipoEmpaque = gvRow.DataKey("CveTipoEmpaque").ToEntero()
Dim tipoEmpaque As String = gvRow.DataKey("TipoEmpaque")
Dim estatus As Boolean = CBool(gvRow.DataKey("Estatus"))
Dim EsMaster As Boolean = CBool(gvRow.DataKey("EsMaster"))
Dim fechaIng As DateTime = gvRow.DataKey("FechaIng").ToDateTime()
Dim cveUsuario As Int32 = gvRow.DataKey("CveUsuario").ToEntero()
Dim cveEmpresa As Int32 = gvRow.DataKey("CveEmpresa").ToEntero()
TxtCGamtipoEmpaque.Text = tipoEmpaque.ToString()
DdlTipoEmpaque.SelectedValueExist(gvRow.DataKey("Tipo"))
ChkCGamestatus.Checked = estatus
ChkEsMaster.Checked = EsMaster
RegistraScript("$('#DModalCGame_TipoEmpaque').modal('show')")
BtnCGamADD.Visible = False
BtnCGamEdit.Visible = True
UPModalCGam.Update()
End Sub
Protected Sub LnkAgregarCGam_Click(sender As Object, e As EventArgs)
ltlCGamtitulo.Text = "Agregar Tipo Empaque"
divEstatus.Visible = False
RegistraScript("$('#DModalCGame_TipoEmpaque').modal('show')")
LimpiaCGame_TipoEmpaque()
BtnCGamADD.Visible = True
BtnCGamEdit.Visible = False
UPModalCGam.Update()
End Sub
Protected Sub BtnCGamADD_Click(sender As Object, e As EventArgs)
Dim tipoEmpaque As String = TxtCGamtipoEmpaque.Text
Dim estatus As Boolean = ChkCGamestatus.Checked
Dim fechaIng As DateTime = Now
Dim cveUsuario As Int32 = UsuarioActual.CveUsuario
Dim cveEmpresa As Int32 = UsuarioActual.CveEmpresa
Dim ObjCGam As New ClsCGame()
Dim Continuar As Boolean = ObjCGam.AddTipoEmpaque(tipoEmpaque, estatus, fechaIng, cveUsuario, cveEmpresa, DdlTipoEmpaque.SelectedValue.ToEntero, ChkEsMaster.Checked)
ObjCGam.Dispose()
If (Continuar) Then
RegistraScript("$('#DModalCGame_TipoEmpaque').modal('hide')")
LimpiaCGame_TipoEmpaque()
UPModalCGam.Update()
CargaTipoEmpaque()
Alert("El Tipo de Empaque se ha agregado correctamente.")
End If
End Sub
Protected Sub BtnCGamEdit_Click(sender As Object, e As EventArgs)
Dim tipoEmpaque As String = TxtCGamtipoEmpaque.Text
Dim estatus As Boolean = ChkCGamestatus.Checked
Dim fechaIng As DateTime = Now
Dim cveUsuario As Int32 = UsuarioActual.CveUsuario
Dim cveEmpresa As Int32 = UsuarioActual.CveEmpresa
Dim ObjCGam As New ClsCGame()
Dim Continuar As Boolean = ObjCGam.UpdateTipoEmpaque(CcveTipoEmpaque, tipoEmpaque, estatus, fechaIng, cveUsuario, cveEmpresa, DdlTipoEmpaque.SelectedValue.ToEntero, ChkEsMaster.Checked)
ObjCGam.Dispose()
If (Continuar) Then
RegistraScript("$('#DModalCGame_TipoEmpaque').modal('hide')")
LimpiaCGame_TipoEmpaque()
UPModalCGam.Update()
CargaTipoEmpaque()
Alert("El Tipo de Empaque se ha actualizado correctamente.")
End If
End Sub
Protected Sub LnkEliminarCGam_Click(sender As Object, e As EventArgs)
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
CcveTipoEmpaque = gvRow.DataKey("CveTipoEmpaque").ToEntero()
Dim ObjCGam As New ClsCGame()
Dim Continuar As Boolean = ObjCGam.RemoveTipoEmpaque(CcveTipoEmpaque)
ObjCGam.Dispose()
If (Continuar) Then
CargaTipoEmpaque()
Alert("El Tipo de Empaque se ha eliminado correctamente.")
End If
End Sub
End Class

View File

@@ -0,0 +1,99 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatTipoMaduracion.aspx.vb" Inherits="CGame_CatTipoMaduracion" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Catálogo de Variedad
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkAgregarCGame_TipoMaduracion" OnClick="LnkAgregarCGam_Click" runat="server"><i class="fa fa-plus"></i> Agregar Tipo de Maduración</asp:LinkButton></li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="upDatosCGam" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVCGame_TipoMaduracion.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVCGame_TipoMaduracion.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GVCGame_TipoMaduracion" EmptyDataText="No hay tipos de maduración registrados." runat="server" GridLines="None"
CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False"
DataKeyNames="CveTipoMaduracion,TipoMaduracion,Estatus,FechaIng,CveUsuario,Usuario,CveEmpresa,Empresa,CvePS">
<Columns>
<asp:TemplateField HeaderText="Variedad" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblcliente" runat="server" Text='<%# Eval("TipoMaduracion")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Producto" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblPS" runat="server" Text='<%# Eval("PS")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Estatus" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="lblestatus" runat="server" Text='<%# If(CBool(Eval("Estatus")), "Activo", "Inactivo")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Fecha Ingreso" ItemStyle-HorizontalAlign="Center" DataField="FechaIng" DataFormatString="{0:dd/MM/yyyy}" />
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText="Comandos">
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Editar" ID="LnkEditar" OnClick="LnkEditarCGam_Click" CssClass="btn btn-circle btn-sm green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
<asp:LinkButton ID="imgD" runat="server" OnClick="LnkEliminarCGam_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar el tipo de maduracion?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DModalCGame_TipoMaduracion" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UPModalCGam" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Literal ID="ltlCGamtitulo" Text="Agregar Tipo Maduracion" runat="server"> </asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCGamtipoMaduracion" CssClass="form-control" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvCGamtipoMaduracion" runat="server" ControlToValidate="TxtCGamtipoMaduracion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Maduracion''</b> es necesario, por favor ingréselo." ValidationGroup="VGMCGam"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoCGamtipoMaduracion" runat="server" HighlightCssClass="vco" TargetControlID="RfvCGamtipoMaduracion"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtCGamtipoMaduracion.ClientID.ToString()%>">Variedad:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlPS" CssClass="form-control select2me " runat="server" DataTextField="PS" DataValueField="CvePS" Style="width: 50%"></asp:DropDownList>
<label for="<%= DdlPS.ClientID.ToString()%>">Producto:</label>
</div>
<div class="form-group form-md-line-input input-iconright" id="DivEstatus" runat="server">
<label for="<%= ChkCGamestatus.ClientID.ToString()%>">Estatus:</label>
<asp:CheckBox ID="ChkCGamestatus" CssClass="" Text=" " runat="server" />
</div>
</div>
<div class="modal-footer">
<div class="modal-btn">
<asp:Button ID="BtnCGamADD" OnClick="BtnCGamADD_Click" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="VGMCGam" />
<asp:Button ID="BtnCGamEdit" OnClick="BtnCGamEdit_Click" runat="server" Text="Actualizar" CssClass="btn btn-primary" ValidationGroup="VGMCGam"></asp:Button>
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,158 @@
Option Strict On
Imports System.Data
Imports System.Collections.Generic
Imports System.Linq
Imports Extensiones
Imports System.Web.UI.WebControls
Partial Class CGame_CatTipoMaduracion
Inherits ClsPaginas
#Region "Propiedades"
Private Property RcveTipoMaduracion() As Int32
Get
Return If(IsNothing(ViewState("RcveTipoMaduracion")), 0, CInt(ViewState("RcveTipoMaduracion")))
End Get
Set
ViewState("RcveTipoMaduracion") = Value
End Set
End Property
Private Property CcveTipoMaduracion() As Int32
Get
Return If(IsNothing(ViewState("CcveTipoMaduracion")), 0, CInt(ViewState("CcveTipoMaduracion")))
End Get
Set
ViewState("CcveTipoMaduracion") = Value
End Set
End Property
Private Property RcveUsuario() As Int32
Get
Return If(IsNothing(ViewState("RcveUsuario")), 0, CInt(ViewState("RcveUsuario")))
End Get
Set
ViewState("RcveUsuario") = Value
End Set
End Property
Private Property RcveEmpresa() As Int32
Get
Return If(IsNothing(ViewState("RcveEmpresa")), 0, CInt(ViewState("RcveEmpresa")))
End Get
Set
ViewState("RcveEmpresa") = Value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
RcveTipoMaduracion = If(IsNothing(Request("cveTipoMaduracion")), 0, Request("cveTipoMaduracion").ToString().ToEntero())
RcveUsuario = If(IsNothing(Request("cveUsuario")), 0, Request("cveUsuario").ToString().ToEntero())
RcveEmpresa = If(IsNothing(Request("cveEmpresa")), 0, Request("cveEmpresa").ToString().ToEntero())
CargaTipoMaduracion()
CargaProductos()
ChkCGamestatus.Checked = True
End If
End Sub
Protected Sub CargaTipoMaduracion()
Dim ObjCGam As New ClsCGame()
If ObjCGam.GetTipoMaduracion(-1, -1, -1, UsuarioActual.CveEmpresa) Then
GVCGame_TipoMaduracion.DataSource = ObjCGam.DtResultados
End If
ObjCGam.Dispose()
GVCGame_TipoMaduracion.DataBind()
upDatosCGam.Update()
End Sub
Protected Sub LimpiaCGame_TipoMaduracion()
TxtCGamtipoMaduracion.Text = ""
DdlPS.SelectedIndex = 0
UPModalCGam.Update()
End Sub
Protected Sub CargaProductos()
Dim ObjCGame As New ClsCGame
If ObjCGame.GetPS(UsuarioActual.CveEmpresa) Then
DdlPS.DataSource = ObjCGame.DtResultados
ObjCGame.Dispose()
End If
DdlPS.DataBind()
UPModalCGam.Update()
End Sub
Protected Sub LnkEditarCGam_Click(sender As Object, e As EventArgs)
ltlCGamtitulo.Text = "Editar Tipo de Maduración"
LimpiaCGame_TipoMaduracion()
divEstatus.Visible = True
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
CcveTipoMaduracion = gvRow.DataKey("CveTipoMaduracion").ToEntero()
Dim tipoMaduracion As String = gvRow.DataKey("TipoMaduracion")
Dim estatus As Boolean = CBool(gvRow.DataKey("Estatus"))
Dim fechaIng As DateTime = gvRow.DataKey("FechaIng").ToDateTime()
Dim cveUsuario As Int32 = gvRow.DataKey("CveUsuario").ToEntero()
Dim cveEmpresa As Int32 = gvRow.DataKey("CveEmpresa").ToEntero()
DdlPS.SelectedValueExist(gvRow.DataKey("CvePS"))
TxtCGamtipoMaduracion.Text = tipoMaduracion.ToString()
ChkCGamestatus.Checked = estatus
RegistraScript("$('#DModalCGame_TipoMaduracion').modal('show')")
BtnCGamADD.Visible = False
BtnCGamEdit.Visible = True
UPModalCGam.Update()
End Sub
Protected Sub LnkAgregarCGam_Click(sender As Object, e As EventArgs)
divEstatus.Visible = False
ltlCGamtitulo.Text = "Agregar Tipo de Maduración"
RegistraScript("$('#DModalCGame_TipoMaduracion').modal('show')")
LimpiaCGame_TipoMaduracion()
BtnCGamADD.Visible = True
BtnCGamEdit.Visible = False
UPModalCGam.Update()
End Sub
Protected Sub BtnCGamADD_Click(sender As Object, e As EventArgs)
Dim tipoMaduracion As String = TxtCGamtipoMaduracion.Text
Dim estatus As Boolean = ChkCGamestatus.Checked
Dim fechaIng As DateTime = Now
Dim cveUsuario As Int32 = UsuarioActual.CveUsuario
Dim cveEmpresa As Int32 = UsuarioActual.CveEmpresa
Dim ObjCGam As New ClsCGame()
Dim Continuar As Boolean = ObjCGam.AddTipoMaduracion(DdlPS.SelectedValue.ToEntero, tipoMaduracion, estatus, fechaIng, cveUsuario, cveEmpresa)
ObjCGam.Dispose()
If (Continuar) Then
RegistraScript("$('#DModalCGame_TipoMaduracion').modal('hide')")
LimpiaCGame_TipoMaduracion()
UPModalCGam.Update()
CargaTipoMaduracion()
Alert("La variedad se ha agregado correctamente.")
End If
End Sub
Protected Sub BtnCGamEdit_Click(sender As Object, e As EventArgs)
Dim tipoMaduracion As String = TxtCGamtipoMaduracion.Text
Dim estatus As Boolean = ChkCGamestatus.Checked
Dim fechaIng As DateTime = Now
Dim cveUsuario As Int32 = UsuarioActual.CveUsuario
Dim cveEmpresa As Int32 = UsuarioActual.CveEmpresa
Dim ObjCGam As New ClsCGame()
Dim Continuar As Boolean = ObjCGam.UpdateTipoMaduracion(DdlPS.SelectedValue.ToEntero(), CcveTipoMaduracion, tipoMaduracion, estatus, fechaIng, cveUsuario, cveEmpresa)
ObjCGam.Dispose()
If (Continuar) Then
RegistraScript("$('#DModalCGame_TipoMaduracion').modal('hide')")
LimpiaCGame_TipoMaduracion()
UPModalCGam.Update()
CargaTipoMaduracion()
Alert("La variedad se ha actualizado correctamente.")
End If
End Sub
Protected Sub LnkEliminarCGam_Click(sender As Object, e As EventArgs)
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
CcveTipoMaduracion = gvRow.DataKey("CveTipoMaduracion").ToEntero()
Dim ObjCGam As New ClsCGame()
Dim Continuar As Boolean = ObjCGam.RemoveTipoMaduracion(CcveTipoMaduracion)
ObjCGam.Dispose()
If (Continuar) Then
CargaTipoMaduracion()
CargaTipoMaduracion()
Alert("La variedad se ha eliminado correctamente.")
End If
End Sub
End Class

View File

@@ -0,0 +1,84 @@
<%@ Page Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="True" CodeFile="CATTipoProducto.aspx.CS" Inherits="CATTipoProducto" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Catalogo de Tipos de Producción
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkAgregarTipoProducto" OnClick="LnkAgregarTipo_Click" runat="server"><i class="fa fa-plus"></i>Agregar Tipo de Producto</asp:LinkButton></li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="upDatosTipo" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GVTipoProducto" runat="server" OnRowDataBound="GVTipoProducto_RowDataBound" GridLines="None" CssClass="table table-hover table-striped ScrollAD mysmallbtn" data-sort="true" Width="100%" AutoGenerateColumns="False"
DataKeyNames="CveTipoProducto,TipoProducto,Estatus,FechaIng,CveUsuario,Usuario,CveEmpresa,Empresa">
<Columns>
<asp:TemplateField HeaderText="Tipo Producción" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lbltipoProducto" runat="server" Text='<%# Eval("TipoProducto")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Estatus" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="lblestatus" runat="server" Text='<%# Eval("Estatus")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="FechaIng" ItemStyle-Width="15%" HeaderText="Fecha de Ingreso" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:TemplateField HeaderText="Usuario" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblusuario" runat="server" Text='<%# Eval("Usuario")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText="Comandos">
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Editar" ID="LnkEditar" OnClick="LnkEditarTipo_Click" CssClass="btn btn-circle btn-sm green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
<asp:LinkButton ID="imgD" runat="server" OnClick="LnkEliminarTipo_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar el TipoProducto?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DModalTipoProducto" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UPModalTipo" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Literal ID="ltlTipotitulo" Text="Tipo de Producción" runat="server"> </asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtTipotipoProducto" CssClass="form-control" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvTipotipoProducto" runat="server" ControlToValidate="TxtTipotipoProducto" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Producto''</b> es necesario, por favor ingréselo." ValidationGroup="VGMTipo"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoTipotipoProducto" runat="server" HighlightCssClass="vco" TargetControlID="RfvTipotipoProducto"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtTipotipoProducto.ClientID.ToString()%>">Tipo de Producción:</label>
</div>
<div class="form-group form-md-line-input input-iconright" id="DivEstatus" runat="server">
<label for="<%= ChkTipoestatus.ClientID.ToString()%>">Estatus:</label>
<asp:CheckBox ID="ChkTipoestatus" runat="server" />
</div>
<div class="modal-footer">
<asp:Button ID="BtnTipoADD" OnClick="BtnTipoADD_Click" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="VGMTipo" />
<asp:Button ID="BtnTipoEdit" OnClick="BtnTipoEdit_Click" runat="server" Text="Actualizar" CssClass="btn btn-primary" ValidationGroup="VGMTipo"></asp:Button>
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;
using Extensiones;
public partial class CATTipoProducto : ClsPaginas
{
#region Propiedades
private int CveTipoProducto
{
get{return (ViewState["CveTipoProducto"] == null) ? 0 : Convert.ToInt32(ViewState["CveTipoProducto"]);}
set{ViewState["CveTipoProducto"] =value;}
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack){
CargaTipoProducto();
}
}
protected void CargaTipoProducto()
{
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetTipoProducto(UsuarioActual.CveEmpresa))
{
GVTipoProducto.DataSource = ObjCGame.DtResultados;
GVTipoProducto.DataBind();
}

210
CGame/CorteGasto.aspx Normal file
View File

@@ -0,0 +1,210 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="CorteGasto.aspx.cs" Inherits="CGame_CorteGasto" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Registro de Corte de Gasto
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<div class="row">
<div class="col-md-4">
<asp:UpdatePanel ID="UpDatosCorteGasto" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet light smmallpadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Datos del Corte de Gasto</span>
</div>
<div class="tools">
<a href="javascript;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body form">
<div class="labeltruncate labeltext labelbold">
<%--linea 1--%>
<%-- <div class="row" style="padding-bottom: 0.6em;">
<%-- <label class="col-md-2">Folio:</label>
<label class="col-md-4">
<asp:Label runat="server" ID="lblFolio" Font-Bold="true"></asp:Label>
</label>
<b>
<asp:Label runat="server" ID="LblFecha" Text="Fecha:" class="col-md-2" /></b>
<div class="col-md-4" id="DivFecha" runat="server">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 80% !important; padding: 0px;">
<asp:TextBox ID="TxtFecha" runat="server" ClientIDMode="Static" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFecha" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFecha" runat="server" TargetControlID="TxtFecha" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFecha" TargetControlID="TxtFecha" PopupButtonID="ImgFecha" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CvFecha" runat="server" ControlToValidate="TxtFecha" Display="None" Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Entrega''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)."></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VcoFecha" runat="server" Enabled="True" HighlightCssClass="vco" TargetControlID="CvFecha" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>--%>
<%--linea 1--%>
<div class="row" style="padding-bottom: 0.6em;">
<label class="col-md-2">Folio OC:</label>
<div class="col-md-10">
<asp:DropDownList ID="DdlOrdenCorte" CssClass="select2me" AppendDataBoundItems="true" Style="width: 90%;" runat="server" DataTextField="FolioFechaHuerta" DataValueField="CveOrdenCorte">
</asp:DropDownList>
</div>
</div>
<div class="row" style="padding-bottom: 0.6em;">
<label class="col-md-2">Cuadro:</label>
<div class="col-md-10">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCuadro" CssClass="form-control" runat="server"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="SoloNumeros2" runat="server" TargetControlID="TxtCuadro" FilterType="Custom, Numbers" ValidChars="." />
<%-- <label for="<%= TxtCuadro.ClientID.ToString()%>">Cuadro:</label>--%>
</div>
</div>
</div>
<div class="row" style="padding-bottom: 0.6em;">
<label class="col-md-2 ">Fecha:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control" Text="01/09/2017" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="col-md-2">
<div class="portlet light xspadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Datos de Registro </span>
</div>
<div class="tools">
<a href="javascript;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<asp:UpdatePanel ID="UpDatosRegistro" runat="server" class="portlet-body form" UpdateMode="Conditional">
<ContentTemplate>
<table style="text-align: left">
<tr>
<td><b>F. Registro:</b></td>
<td>
<asp:Label ID="TxtFechaRegistro" ClientIDMode="Static" runat="server" Width="90px"></asp:Label>
</td>
</tr>
<tr>
<td><b>Capturó:</b></td>
<td>
<asp:Label ID="lblNombreUsuario" runat="server"></asp:Label></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
<br />
<asp:UpdatePanel ID="UpCorteGasto" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GVCorteGasto" OnRowCreated="GVCorteGasto_RowCreated" OnRowDataBound="GVCorteGasto_RowDataBound" runat="server" GridLines="None" ShowHeaderWhenEmpty="true" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="50%" AutoGenerateColumns="False" data-sort="true"
DataKeyNames="CveConceptoGastoCorte">
<Columns>
<asp:TemplateField HeaderText="Concepto" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblConcepto" runat="server" Text='<%# Eval("ConceptoGastoCorte")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:TextBox ID="TxtCantidad" runat="server"> </asp:TextBox>
<ajax:FilteredTextBoxExtender ID="SoloNumeros1" runat="server" TargetControlID="TxtCantidad" FilterType="Custom, Numbers" ValidChars="." />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="P.U." ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:TextBox ID="TxtPU" runat="server"> </asp:TextBox>
<ajax:FilteredTextBoxExtender ID="SoloNumeros2" runat="server" TargetControlID="TxtPU" FilterType="Custom, Numbers" ValidChars="." />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Importe" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="LblImporte" runat="server"> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<asp:UpdatePanel runat="server" ID="uppOpciones" class="portlet-body form" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-6">
<div class="col-md-6" align="center">
<asp:Button ID="BtnGuardar" CssClass="btn btn-primary" OnClick="BtnGuardar_Click" Style="margin-top: 5px;" runat="server" Text="Guardar" Width="170px" ValidationGroup="GrpGuardar" />
</div>
<div class="col-md-6" align="center">
<asp:Button ID="BtnEliminar" CssClass="btn btn-danger" OnClick="BtnEliminar_Click" Style="margin-top: 5px;" runat="server" Text="Eliminar" Width="170px" ValidationGroup="GrpGuardar" />
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript">
function Recalcula(i) {
var Cant = $("#C_GVCorteGasto_TxtCantidad_" + i).val();
var Precio = $("#C_GVCorteGasto_TxtPU_" + i).val();
$("#C_GVCorteGasto_LblImporte_" + i).text(formato_numero(Cant * Precio, 2, '.', ','));
}
function formato_numero(numero, decimales, separador_decimal, separador_miles) {
numero = parseFloat(numero);
if (isNaN(numero)) {
return "";
}
if (decimales !== undefined) {
// Redondeamos
numero = numero.toFixed(decimales);
}
// Convertimos el punto en separador_decimal
numero = numero.toString().replace(".", separador_decimal !== undefined ? separador_decimal : ",");
if (separador_miles) {
// Añadimos los separadores de miles
var miles = new RegExp("(-?[0-9]+)([0-9]{3})");
while (miles.test(numero)) {
numero = numero.replace(miles, "$1" + separador_miles + "$2");
}
}
return numero;
}
</script>
</asp:Content>

334
CGame/CorteGasto.aspx.cs Normal file
View File

@@ -0,0 +1,334 @@
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;
public partial class CGame_CorteGasto : ClsPaginas
{
#region PROPIEDADES
private int CveCorteGasto
{
get { return (ViewState["CveCorteGasto"] == null) ? 0 : Convert.ToInt32(ViewState["CveCorteGasto"]); }
set { ViewState["CveCorteGasto"] = value; }
}
private int CveOrdenCorteOpcion
{
get { return (ViewState["CveOrdenCorteOpcion"] == null) ? 0 : Convert.ToInt32(ViewState["CveOrdenCorteOpcion"]); }
set { ViewState["CveOrdenCorteOpcion"] = value; }
}
private DataTable DtCorteGastoDetalle
{
get { return DtCorteGastoDetalle = (DataTable)ViewState["DtCorteGastoDetalle"]; }
set { ViewState["DtCorteGastoDetalle"] = value; }
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
CveCorteGasto = Request["CveCorteGasto"] == null ? 0 : Request["CveCorteGasto"].ToString().ToEntero();
CveOrdenCorteOpcion = Request["CveOrdenCorte"] == null ? 0 : Request["CveOrdenCorte"].ToString().ToEntero();
CargaOrdenCorte();
CargaConceptos();
CargaDatos();
if (CveOrdenCorteOpcion > 0) { DdlOrdenCorte.SelectedValueExist(CveOrdenCorteOpcion); }
}
}
#region CARGAS
protected void CargaDatos()
{
if (CveCorteGasto > 0)
{
CargaCorteGasto();
CargaCorteGastoDetalle();
}
else
{
TxtFechaRegistro.Text = DateTime.Now.ToShortDateString();
txtFechaI.Text = DateTime.Now.ToShortDateString();
lblNombreUsuario.Text = UsuarioActual.Usuario;
UpDatosCorteGasto.Update();
UpDatosRegistro.Update();
}
}
protected void CargaOrdenCorte()
{
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetOrdenCorte(UsuarioActual.CveEmpresa))
{
DdlOrdenCorte.DataSource = ObjCGame.DtResultados.FiltraParametros("Disponible = 1");
DdlOrdenCorte.Items.Insert(0, new ListItem("Seleccione", "-1"));
DdlOrdenCorte.DataBind();
}
ObjCGame.Dispose();
UpDatosCorteGasto.Update();
}
protected void CargaConceptos()
{
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetConceptoGastoCorte(UsuarioActual.CveEmpresa, Estatus: 1))
{
GVCorteGasto.DataSource = ObjCGame.DtResultados;
GVCorteGasto.DataBind();
}
ObjCGame.Dispose();
UpCorteGasto.Update();
}
protected void CargaCorteGasto()
{
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetCorteGasto(UsuarioActual.CveEmpresa, CveCorteGasto: CveCorteGasto))
{
DdlOrdenCorte.SelectedValueExist(ObjCGame.DtResultados.Rows[0]["CveOrdenCorte"].ToString());
TxtFechaRegistro.Text = ObjCGame.DtResultados.Rows[0]["FechaIng"].ToString().ToDateTime().ToShortDateString();
lblNombreUsuario.Text = ObjCGame.DtResultados.Rows[0]["Usuario"].ToString();
TxtCuadro.Text = ObjCGame.DtResultados.Rows[0]["Cuadro"].ToString();
txtFechaI.Text= ObjCGame.DtResultados.Rows[0]["FechaCorteGasto"].ToString().ToDateTime().ToShortDateString();
}
ObjCGame.Dispose();
UpDatosCorteGasto.Update();
UpDatosRegistro.Update();
}
protected void CargaCorteGastoDetalle()
{
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetCorteGastoDetalle(CveCorteGasto))
{
DtCorteGastoDetalle = ObjCGame.DtResultados;
DtCorteGastoDetalle.AcceptChanges();
}
ObjCGame.Dispose();
foreach (DataRow Dt in DtCorteGastoDetalle.Rows)
{
foreach (GridViewRow Gv in GVCorteGasto.Rows)
{
if (Dt["CveConceptoGastoCorte"].ToEntero() == Gv.DataKey("CveConceptoGastoCorte").ToEntero())
{
Gv.FCTextBox("TxtCantidad").Text = Dt["Cantidad"].ToString().FormatoNumero();
Gv.FCTextBox("TxtPU").Text = Dt["PU"].ToString().FormatoNumero();
Gv.FCLabel("LblImporte").Text = (Dt["Cantidad"].ToString().ToDouble() * Dt["PU"].ToString().ToDouble()).ToString().FormatoNumero();
break;
}
}
}
UpCorteGasto.Update();
}
#endregion
#region "LIMPIA"
protected void Limpia()
{
TxtFechaRegistro.Text = DateTime.Now.ToShortDateString();
lblNombreUsuario.Text = UsuarioActual.Usuario;
TxtFechaRegistro.Text = DateTime.Now.ToShortDateString();
DdlOrdenCorte.SelectedIndex = 0;
UpDatosCorteGasto.Update();
UpDatosRegistro.Update();
GVCorteGasto.DataSource = null;
GVCorteGasto.DataBind();
CargaConceptos();
}
#endregion
#region BOTONES
protected void BtnGuardar_Click(object sender, EventArgs e)
{
if (DdlOrdenCorte.SelectedValue == "-1")
{
Alert("Tiene que seleccionar una orden de corte", TipoMensaje.MsgAdvertencia);
return;
}
ClsCGame ObjCGame = new ClsCGame();
ObjCGame.IniciaTransacSQL();
var Error = false;
var CveOrdenCorte = DdlOrdenCorte.SelectedValue.ToEntero();
var _CveCorteGasto = CveCorteGasto;
if (CveCorteGasto > 0)
{
if (ObjCGame.UpdateCorteGasto(CveCorteGasto, DdlOrdenCorte.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,txtFechaI.Text.ToDate(),TxtCuadro.Text.ToDouble()))
{
_CveCorteGasto = CveCorteGasto;
}
else
{
Error = true;
}
}
else
{
if (ObjCGame.AddCorteGasto(DdlOrdenCorte.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, txtFechaI.Text.ToDate(), TxtCuadro.Text.ToDouble()))
{
_CveCorteGasto = ObjCGame.CveCorteGasto;
}
else
{
Error = true;
}
}
foreach (GridViewRow Gv in GVCorteGasto.Rows)
{
int x = 0;
if (DtCorteGastoDetalle!=null)
{
foreach (DataRow Dt in DtCorteGastoDetalle.Rows)
{
if (Gv.DataKey("CveConceptoGastoCorte").ToEntero() == Dt["CveConceptoGastoCorte"].ToEntero())
{
x = 1;
if (Gv.FCTextBox("TxtCantidad").Text.ToString() == "" || Gv.FCTextBox("TxtPU").Text.ToString() == "")
{
if (ObjCGame.RemoveCorteGastoDetalle(Dt["CveCorteGastoDetalle"].ToEntero()) == false)
{
Error = true;
}
}
else
{
if (ObjCGame.UpdateCorteGastoDetalle(Dt["CveCorteGastoDetalle"].ToEntero(), _CveCorteGasto, Dt["CveConceptoGastoCorte"].ToEntero(), Gv.FCTextBox("TxtCantidad").Text.ToDouble(), Gv.FCTextBox("TxtPU").Text.ToDouble()) == false)
{
Error = true;
}
}
}
}
}
if (Gv.FCTextBox("TxtCantidad").Text.ToString() != "" && Gv.FCTextBox("TxtPU").Text.ToString() != "" && x == 0)
{
if (ObjCGame.AddCorteGastoDetalle(_CveCorteGasto, Gv.DataKey("CveConceptoGastoCorte").ToEntero(), Gv.FCTextBox("TxtCantidad").Text.ToString().ToDouble(), Gv.FCTextBox("TxtPU").Text.ToString().ToDouble()) == false)
{
Error = true;
}
}
}
if (Error)
{
ObjCGame.RollBack();
}
else
{
ObjCGame.Commit();
if (CveCorteGasto > 0)
{
Alert("Actualizado Correctamente");
}
else
{
if (CveOrdenCorte > 0)
{
Alert("Guardado Correctamente", TipoMensaje.MsgInformacion, $"document.location.href=\"/CGame/RepOrdenCorteDetalle.aspx?CveOrdenCorte={CveOrdenCorte}\"");
}
Limpia();
}
}
ObjCGame.Dispose();
}
#endregion
#region GRIDVIEW
protected void GVCorteGasto_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
//e.Row.FCTextBox("TxtCantidad").Attributes.Add("onKeyUp ", "Recalcula();");
//e.Row.FCTextBox("TxtPU").Attributes.Add("onKeyUp ", "Recalcula();");
//if (e.Row.DBCampo("CveConceptoGastoCorte").ToEntero() == 16) { e.Row.Visible = false; }
}
}
#endregion
#region TEXTCHANGE
//protected void TxtPU_TextChanged(object sender, EventArgs e)
//{
// GridViewRow gvRow = (GridViewRow)(((TextBox)sender).NamingContainer);
// if (gvRow.FCTextBox("TxtCantidad").Text != "" && gvRow.FCTextBox("TxtPU").Text != "")
// {
// gvRow.FCLabel("LblImporte").Text = "$" + (gvRow.FCTextBox("TxtCantidad").Text.ToDouble() * gvRow.FCTextBox("TxtPU").Text.ToDouble()).ToString().FormatoNumero();
// }
//}
//protected void TxtCantidad_TextChanged(object sender, EventArgs e)
//{
// GridViewRow gvRow = (GridViewRow)(((TextBox)sender).NamingContainer);
// if (gvRow.FCTextBox("TxtCantidad").Text != "" && gvRow.FCTextBox("TxtPU").Text != "")
// {
// gvRow.FCLabel("LblImporte").Text = "$" + (gvRow.FCTextBox("TxtCantidad").Text.ToDouble() * gvRow.FCTextBox("TxtPU").Text.ToDouble()).ToString().FormatoNumero();
// }
//}
#endregion
protected void GVCorteGasto_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
int index = e.Row.RowIndex;
e.Row.FCTextBox("TxtCantidad").Attributes.Add("onKeyUp ", "Recalcula(" + index + ");");
e.Row.FCTextBox("TxtPU").Attributes.Add("onKeyUp ", "Recalcula(" + index + ");");
}
}
protected void BtnEliminar_Click(object sender, EventArgs e)
{
if (CveCorteGasto > 0)
{
ClsCGame ObjCGame = new ClsCGame();
ObjCGame.IniciaTransacSQL();
bool Error = false;
if (!ObjCGame.RemoveCorteGastoDetalle(-1, CveCorteGasto))
{
Error = true;
}
if (!ObjCGame.RemoveCorteGasto(CveCorteGasto))
{
Error = true;
}
if (!Error)
{
ObjCGame.Commit();
Alert("Eliminado Correctamente",TipoMensaje.MsgInformacion, $"document.location.href=\"/CGame/CorteGasto.aspx\"");
Limpia();
}
else
{
ObjCGame.RollBack();
}
ObjCGame.Dispose();
}
else
{
Alert("Tiene que tener un corte de gasto seleccionada.", TipoMensaje.MsgAdvertencia);
}
}
}

644
CGame/Empaque.aspx Normal file
View File

@@ -0,0 +1,644 @@
<%@ Page Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="True" CodeFile="Empaque.aspx.cs" Inherits="Empaque" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Empaque
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnlEliminarProduccion" Visible="false" OnClick="LnlEliminarProduccion_Click" runat="server" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar el empaque?" data-btn-ok-label="si"><i class="fa fa-trash-o"></i>Eliminar Empaque</asp:LinkButton></li>
<li>
<asp:HyperLink ID="HplIrMovimiento" Visible="false" Target="_blank" runat="server"><i class="fa fa-archive"></i>Ir al Movimiento</asp:HyperLink></li>
</ContentTemplate>
</asp:UpdatePanel>
<li>
<asp:LinkButton ID="LnkPdf" OnClick="LnkPdf_Click" Visible="false" runat="server"> <i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton>
</li>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<div class="row">
<div class="col-md-6">
<asp:UpdatePanel ID="UpDatosProduccion" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet light smmallpadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Datos del Empaque</span>
</div>
<div class="tools">
<a href="javascript;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body form">
<div class="labeltruncate labeltext labelbold">
<%--linea 1--%>
<div class="row" style="padding-bottom: 0.6em;">
<label class="col-md-2">Folio:</label>
<label class="col-md-4">
<asp:Label runat="server" ID="lblFolio" Font-Bold="true"></asp:Label>
</label>
<b>
<asp:Label runat="server" ID="LblFecha" Text="Fecha:" class="col-md-2" /></b>
<div class="col-md-4" id="DivFecha" runat="server">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 80% !important; padding: 0px;">
<asp:TextBox ID="TxtFecha" runat="server" ClientIDMode="Static" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFecha" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFecha" runat="server" TargetControlID="TxtFecha" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFecha" TargetControlID="TxtFecha" PopupButtonID="ImgFecha" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CvFecha" runat="server" ControlToValidate="TxtFecha" Display="None" Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Entrega''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)."></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VcoFecha" runat="server" Enabled="True" HighlightCssClass="vco" TargetControlID="CvFecha" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
<%--linea 2--%>
<div class="row" style="padding-bottom: 0.6em;">
<label class="col-md-2">Huerta:</label>
<div class="col-md-10">
<asp:DropDownList ID="DdlHuerta" CssClass="select2me" OnSelectedIndexChanged="DdlHuerta_SelectedIndexChanged" AppendDataBoundItems="true" AutoPostBack="True" Style="width: 90%;" runat="server" DataTextField="Huerta" DataValueField="CveHuerta">
</asp:DropDownList>
</div>
</div>
<%--linea 3--%>
<div class="row" style="padding-bottom: 0.6em;">
<label class="col-md-2">Observación:</label>
<div class="col-md-10">
<asp:TextBox ID="TxtObservacion" MaxLength="500" CssClass="form-control input-sm" runat="server" Style="width: 370px; height: 40px;" TextMode="MultiLine" Rows="5" />
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="col-md-3">
<div class="portlet light xspadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Datos de Registro </span>
</div>
<div class="tools">
<a href="javascript;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<asp:UpdatePanel ID="UpDatosRegistro" runat="server" class="portlet-body form" UpdateMode="Conditional">
<ContentTemplate>
<table style="text-align: left">
<tr>
<td><b>F. Registro:</b></td>
<td>
<asp:Label ID="TxtFechaRegistro" ClientIDMode="Static" runat="server" Width="90px"></asp:Label>
</td>
</tr>
<tr>
<td><b>Capturó:</b></td>
<td>
<asp:Label ID="lblNombreUsuario" runat="server"></asp:Label></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="portlet light xspadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Entrada de Materia Prima</span>
</div>
<div class="tools">
<a href="javascript;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<asp:UpdatePanel ID="UpCorte" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GVCorte" runat="server" OnRowDataBound="GvCorte_RowDataBound" GridLines="None" ShowHeaderWhenEmpty="true" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" AutoGenerateColumns="False" data-sort="true"
DataKeyNames="CveCorte,CveHuerta,Huerta,Folio,Fecha,Peso,Observacion,Adjunto,TicketBascula,PesoMerma,CveMotivo,Motivo,FechaIng">
<Columns>
<asp:HyperLinkField DataTextField="FolioOC" ItemStyle-HorizontalAlign="Center" DataNavigateUrlFields="CveOrdenCorte" DataNavigateUrlFormatString="/CGame/RepOrdenCorteDetalle.aspx?CveOrdenCorte={0}" HeaderText="Folio OC" />
<asp:TemplateField HeaderText="Huerta" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblhuerta" runat="server" Text='<%# Eval("Huerta")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Motivo" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblmotivo" runat="server" Text='<%# Eval("Motivo")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Ticket Báscula" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblticketBascula" runat="server" Text='<%# Eval("TicketBascula")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Peso" HeaderStyle-HorizontalAlign="Left" HeaderText="Peso (Kg)" DataFormatString="{0:#,##0.##}" />
<asp:TemplateField HeaderText="Peso Merma (Kg)" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="lblpesoMerma" runat="server" Text='<%# Eval("PesoMerma")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Fecha" HeaderStyle-HorizontalAlign="Left" ItemStyle-Width="15%" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:CheckBox ID="ChkCorte" runat="server" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
<br />
<asp:UpdatePanel ID="UpIndicadores" runat="server" class="portlet-body form" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-2">
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding-top px;">
<div class="display" style="margin-bottom: 0px">
<div class="number">
<h4 class="font-black-haze">
<span data-counter="counterup" data-value="1349">
<b>
<asp:Label runat="server" Text="0" ID="LblPesoTotal"></asp:Label></span></b>
<asp:Label runat="server" ID="LblPor" Text=""></asp:Label>
</h4>
<small>Kilos</small>
</div>
</div>
</div>
</div>
<div class="col-md-2">
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding-top px;">
<div class="display" style="margin-bottom: 0px">
<div class="number">
<h4 class="font-black-haze">
<span data-counter="counterup" data-value="1349">
<b>
<asp:Label runat="server" Text="0" ID="LblPrimera"></asp:Label></span></b>
<asp:Label runat="server" ID="Label2" Text=""></asp:Label>
</h4>
<small>Primera</small>
</div>
</div>
</div>
</div>
<div class="col-md-1">
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding-top px;">
<div class="display" style="margin-bottom: 0px">
<div class="number">
<h4 class="font-black-haze">
<span data-counter="counterup" data-value="1349">
<b>
<asp:Label runat="server" Text="0" ID="LblPorcentajePrimera"></asp:Label></span></b>
<asp:Label runat="server" ID="Label3" Text="%"></asp:Label>
</h4>
<small>%Primera</small>
</div>
</div>
</div>
</div>
<div class="col-md-2">
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding-top px;">
<div class="display" style="margin-bottom: 0px">
<div class="number">
<h4 class="font-black-haze">
<span data-counter="counterup" data-value="1349">
<b>
<asp:Label runat="server" Text="0" ID="LblSegunda"></asp:Label></span></b>
<asp:Label runat="server" ID="Label4" Text=""></asp:Label>
</h4>
<small>Segunda</small>
</div>
</div>
</div>
</div>
<div class="col-md-1">
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding-top px;">
<div class="display" style="margin-bottom: 0px">
<div class="number">
<h4 class="font-black-haze">
<span data-counter="counterup" data-value="1349">
<b>
<asp:Label runat="server" Text="0" ID="LblPorcentajeSegunda"></asp:Label></span></b>
<asp:Label runat="server" ID="Label5" Text="%"></asp:Label>
</h4>
<small>%Segunda</small>
</div>
</div>
</div>
</div>
<div class="col-md-2">
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding-top px;">
<div class="display" style="margin-bottom: 0px">
<div class="number">
<h4 class="font-black-haze">
<span data-counter="counterup" data-value="1349">
<b>
<asp:Label runat="server" Text="0" ID="LblJugo"></asp:Label></span></b>
<asp:Label runat="server" ID="Label10" Text=""></asp:Label>
</h4>
<small>Jugo</small>
</div>
</div>
</div>
</div>
<div class="col-md-1">
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding-top px;">
<div class="display" style="margin-bottom: 0px">
<div class="number">
<h4 class="font-black-haze">
<span data-counter="counterup" data-value="1349">
<b>
<asp:Label runat="server" Text="0" ID="LblPorcentajeJugo"></asp:Label></span></b>
<asp:Label runat="server" ID="Label11" Text="%"></asp:Label>
</h4>
<small>%Jugo</small>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-2">
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding-top px;">
<div class="display" style="margin-bottom: 0px">
<div class="number">
<h4 class="font-black-haze">
<span data-counter="counterup" data-value="1349">
<b>
<asp:Label runat="server" Text="0" ID="LblMerma"></asp:Label></span></b>
<asp:Label runat="server" ID="Label6" Text=""></asp:Label>
</h4>
<small>Merma</small>
</div>
</div>
</div>
</div>
<div class="col-md-1">
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding-top px;">
<div class="display" style="margin-bottom: 0px">
<div class="number">
<h4 class="font-black-haze">
<span data-counter="counterup" data-value="1349">
<b>
<asp:Label runat="server" Text="0" ID="LblPorcentajeMerma"></asp:Label></span></b>
<asp:Label runat="server" ID="Label7" Text="%"></asp:Label>
</h4>
<small>%Merma</small>
</div>
</div>
</div>
</div>
<div class="col-md-2">
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding-top px;">
<div class="display" style="margin-bottom: 0px">
<div class="number">
<h4 class="font-black-haze">
<span data-counter="counterup" data-value="1349">
<b>
<asp:Label runat="server" Text="0" ID="LblPiso"></asp:Label></span></b>
<asp:Label runat="server" ID="Label8" Text=""></asp:Label>
</h4>
<small>En Piso</small>
</div>
</div>
</div>
</div>
<div class="col-md-1">
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding-top px;">
<div class="display" style="margin-bottom: 0px">
<div class="number">
<h4 class="font-black-haze">
<span data-counter="counterup" data-value="1349">
<b>
<asp:Label runat="server" Text="0" ID="LblPorcentajeEnPiso"></asp:Label></span></b>
<asp:Label runat="server" ID="Label9" Text="%"></asp:Label>
</h4>
<small>%En Piso</small>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<div class="row">
<div class="col-md-12">
<div class="portlet light xspadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Resultados</span>
</div>
<div class="tools">
<a href="javascript;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<asp:UpdatePanel ID="UpResultado" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="btn-group pull-right">
<asp:Button ID="LnkAgregarResultado" CssClass="btn green-haze btn-outline btn-circle btn-sm" OnClick="LnkAgregarResultado_Click" runat="server" Text="Agregar" />
</div>
<br />
<br />
<asp:GridView ID="GvResultado" runat="server" OnRowDataBound="GvResultado_RowDataBound" ShowHeader="true" GridLines="None" ShowHeaderWhenEmpty="true" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False"
DataKeyNames="CveProduccionResultado,CveOrdenProduccionDetalle,Cantidad,CvePS,CveTamaño,CveTipoEtiqueta,CveCalidad,CveTipoCaja,Peso,CveTipoEmpaque,CveTipoProducto,CveTipoMaduracion">
<Columns>
<asp:TemplateField HeaderText="Fruto" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblPS" runat="server" Text='<%# Eval("PS")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="LblCantidad" runat="server" Text='<%# Eval("Cantidad")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Peso" HeaderStyle-HorizontalAlign="Left" HeaderText="Peso (Kg)" DataFormatString="{0:#,##0.##}" />
<asp:BoundField DataField="PesoXCaja" HeaderStyle-HorizontalAlign="Left" HeaderText="Peso X Caja (Kg)" DataFormatString="{0:#,##0.##}" />
<asp:TemplateField HeaderText="Tipo Producción" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoProducto" runat="server" Text='<%# Eval("TipoProducto")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Variedad" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoMaduracion" runat="server" Text='<%# Eval("TipoMaduracion")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo Empaque" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoEmpaque" runat="server" Text='<%# Eval("TipoEmpaque")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tamaño" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTamaño" runat="server" Text='<%# Eval("Tamaño")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="PLU" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoEtiqueta" runat="server" Text='<%# Eval("CveTipoEtiqueta")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Calidad" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblCalidad" runat="server" Text='<%# Eval("Calidad")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Etiqueta" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoCaja" runat="server" Text='<%# Eval("TipoCaja")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Left" ItemStyle-Width="15%" HeaderText="Comandos">
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Editar" ID="LnkEditar" OnClick="LnkEditar_Click" CssClass="btn btn-circle btn-sm green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
<asp:LinkButton ID="imgD" runat="server" OnClick="LnkEliminar_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar el resultado?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<br />
<div class="row">
<div class="col-md-12" align="center">
<div class="col-md-4"></div>
<label class="col-md-1"><b>Merma (Kg):</b></label>
<div class="col-md-2">
<asp:TextBox ID="TxtMerma" runat="server" onblur="CargaTotales()" Width="100%"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FTBEMerma" TargetControlID="TxtMerma" FilterType="Numbers,Custom" ValidChars="." runat="server" />
<asp:RegularExpressionValidator ID="REVMerma" Display="None" runat="server" ControlToValidate="TxtMerma" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />Solo se pueden introducir un maximo de 4 decimales." ValidationExpression="((\d+)((\.\d{1,4})?))" ValidationGroup="GrpGuardar"></asp:RegularExpressionValidator>
<ajax:ValidatorCalloutExtender ID="VCEMerma" runat="server" HighlightCssClass="vco" TargetControlID="REVMerma"></ajax:ValidatorCalloutExtender>
<asp:Button Text="" Style="display: none" ClientIDMode="Static" ID="BtnCalcularGenerales" OnClick="BtnCalcularGenerales_Click" runat="server" />
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
<br />
<asp:UpdatePanel ID="UpSalida" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" id="DivSalida" runat="server">
<div class="col-md-12">
<div class="portlet light xspadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Salidas</span>
</div>
<div class="tools">
<a href="javascript;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<div class="row">
<div class="col-md-12" align="center">
<div class="col-md-4">
</div>
<label class="col-md-1"><b>Almacen:</b></label>
<div class="col-md-2">
<asp:DropDownList ID="DdlAlmacen" CssClass="select2me" AutoPostBack="true" OnSelectedIndexChanged="DdlAlmacen_SelectedIndexChanged" AppendDataBoundItems="true" Width="100%" runat="server" DataTextField="Almacen" DataValueField="CveAlmacen">
</asp:DropDownList>
</div>
</div>
</div>
<br />
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvPS.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvPS.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<div class="row">
<div class="col-md-12">
<asp:GridView ID="GvPS" runat="server" GridLines="None" OnRowCreated="GvPS_RowCreated" OnRowDataBound="GvPS_RowDataBound" CssClass="table table-hover table-striped ScrollAD mysmallbtn" data-sort="true" Width="70%" AutoGenerateColumns="False"
DataKeyNames="CvePS,CodigoPS,CveUnidadMedida">
<Columns>
<asp:TemplateField HeaderText="Producto" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblDescripcion" runat="server" Text='<%# Eval("CodigoPS")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:TextBox ID="TxtCantidad" runat="server"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FTBETCantidad" TargetControlID="TxtCantidad" FilterType="Numbers,Custom" ValidChars="." runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Existencia" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="LblExistencia" runat="server" Text='<%# Eval("Existencia")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel runat="server" ID="uppOpciones" class="portlet-body form" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-12" align="center">
<asp:Button ID="BtnGuardar" CssClass="btn btn-primary" OnClick="BtnGuardar_Click" Style="margin-top: 5px;" runat="server" Text="Guardar" Width="170px" ValidationGroup="GrpGuardar" />
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DivResultado" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalAdd" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Literal ID="ltlTipotitulo" Text="Resultado" runat="server"> </asp:Literal></h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCantidad" CssClass="form-control" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVCantidad" runat="server" ControlToValidate="TxtCantidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarModal"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCECantidad" runat="server" HighlightCssClass="vco" TargetControlID="RFVCantidad"></ajax:ValidatorCalloutExtender>
<ajax:FilteredTextBoxExtender ID="FTBETCantidad" TargetControlID="TxtCantidad" FilterType="Numbers,Custom" ValidChars="." runat="server" />
<label for="<%= TxtCantidad.ClientID.ToString()%>">Cantidad:</label>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtPeso" CssClass="form-control" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVPeso" runat="server" ControlToValidate="TxtPeso" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Peso''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarModal"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEPeso" runat="server" HighlightCssClass="vco" TargetControlID="RFVPeso"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtPeso.ClientID.ToString()%>">Peso (Kg):</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlPS" DataValueField="CvePS" DataTextField="PS" AppendDataBoundItems="true" runat="server" CssClass="form-control select2me" Width="200px" AutoPostBack="true" OnSelectedIndexChanged="DdlPS_SelectedIndexChanged"></asp:DropDownList>
<label for="<%= DdlPS.ClientID.ToString()%>">Fruto:</label>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlTipoProducto" DataValueField="CveTipoProducto" DataTextField="TipoProducto" runat="server" CssClass="form-control select2me" AppendDataBoundItems="true" Width="200px"></asp:DropDownList>
<label for="<%= DdlTipoProducto.ClientID.ToString()%>">Tipo de Producción:</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlTipoMaduracion" DataValueField="CveTipoMaduracion" DataTextField="TipoMaduracion" runat="server" CssClass="form-control select2me" AppendDataBoundItems="true" Width="200px"></asp:DropDownList>
<label for="<%= DdlTipoMaduracion.ClientID.ToString()%>">Variedad:</label>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlTipoEmpaque" DataValueField="CveTipoEmpaque" DataTextField="TipoEmpaque" runat="server" CssClass="form-control select2me" AppendDataBoundItems="true" Width="200px"></asp:DropDownList>
<label for="<%= DdlTipoEmpaque.ClientID.ToString()%>">Tipo de Empaque:</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlTamaño" DataValueField="CveTamaño" DataTextField="Tamaño" runat="server" CssClass="form-control select2me" AppendDataBoundItems="true" Width="200px"></asp:DropDownList>
<label for="<%= DdlTamaño.ClientID.ToString()%>">Tamaño:</label>
</div>
</div>
<div class="col-md-6">
<br />
<label for="<%= ChkTipoEtiqueta.ClientID.ToString()%>">PLU:</label>
<asp:CheckBox ID="ChkTipoEtiqueta" CssClass="make-switchsd" runat="server" />
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlCalidad" DataValueField="CveCalidad" DataTextField="Calidad" runat="server" CssClass="form-control select2me" AppendDataBoundItems="true" Width="200px"></asp:DropDownList>
<label for="<%= DdlCalidad.ClientID.ToString()%>">Calidad:</label>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlTipoCaja" DataValueField="CveTipoCaja" DataTextField="TipoCaja" runat="server" CssClass="form-control select2me" AppendDataBoundItems="true" Width="200px"></asp:DropDownList>
<label for="<%= DdlTipoCaja.ClientID.ToString()%>">Etiqueta:</label>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnOPADD" OnClick="BtnOPADD_Click" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="GrpGuardarModal" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript">
function ValidarCantidad(i) {
var Cant = ToDouble($("#C_GvPS_TxtCantidad_" + i).val());
var CantDisp = ToDouble($("#C_GvPS_LblExistencia_" + i).text());
if (Cant > CantDisp) {
$("#C_GvPS_TxtCantidad_" + i).val(formato_numero(CantDisp, 0, '.', ','));
}
}
function formato_numero(numero, decimales, separador_decimal, separador_miles) {
numero = parseFloat(numero);
if (isNaN(numero)) {
return "";
}
if (decimales !== undefined) {
// Redondeamos
numero = numero.toFixed(decimales);
}
// Convertimos el punto en separador_decimal
numero = numero.toString().replace(".", separador_decimal !== undefined ? separador_decimal : ",");
if (separador_miles) {
// Añadimos los separadores de miles
var miles = new RegExp("(-?[0-9]+)([0-9]{3})");
while (miles.test(numero)) {
numero = numero.replace(miles, "$1" + separador_miles + "$2");
}
}
return numero;
}
function CargaTotales() {
$('#BtnCalcularGenerales').click();
}
</script>
</asp:Content>

1338
CGame/Empaque.aspx.cs Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,318 @@
<%@ Page Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="True" CodeFile="EntradaMateriaPrima.aspx.cs" Inherits="CATCorte" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
a#C_GVCorte_LnkEditar_0 {
display: none;
}
a#C_GVCorte_imgD_0 {
display: none;
}
a#ctl00_C_GVCorte_ctl02_LnkPDF {
display: none;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Entrada de Materia Prima a Empaque
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkAgregarCorte" OnClick="LnkAgregarCort_Click" runat="server"><i class="fa fa-plus"></i>Agregar entrada de materia prima</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LnkAgregarBitacora" OnClick="LnkAgregarBitacora_Click" runat="server"><i class="fa fa-plus"></i>Agregar bitacora</asp:LinkButton>
</li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpFiltros" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" Text="Consultar" ValidationGroup="GrpFiltros" class="btn btn-primary" />
</div>
<div class="titlefiltros caption ">
<div class="row">
<div class="col-md-1" style="max-width: 70px">Estatus:</div>
<div class="col-md-2">
<asp:DropDownList ID="DdlEstatus" Width="100%" CssClass="select2me" AppendDataBoundItems="true" runat="server">
<asp:ListItem Text="Todos" Value="-1" Selected="True" />
<asp:ListItem Text="Pendiente" Value="1" />
<asp:ListItem Text="Surtido" Value="2" />
</asp:DropDownList>
</div>
<label class="col-md-1" style="max-width: 70px">Huerta:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlHuertaFiltro" runat="server" AppendDataBoundItems="true" DataTextField="Huerta" DataValueField="CveHuerta" CssClass="select2me" Width="100%">
</asp:DropDownList>
</div>
<div class="col-md-1" style="">Fecha Inicial:</div>
<div class="col-md-1">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="margin-top: -5px; padding: 5px 0px;">
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" Style="width: 80px;"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpFiltros"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpFiltros"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="col-md-1" style="margin-left: 25px">Fecha Final:</div>
<div class="col-md-1" style="margin-left: -10px">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="margin-top: -5px; padding: 5px 0px;">
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" Style="width: 80px;"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpFiltros"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpFiltros"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVCorte.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVCorte.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:UpdatePanel ID="upDatosCort" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GVCorte" runat="server" GridLines="None" OnRowDataBound="GvCorte_RowDataBound" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" AutoGenerateColumns="False" data-sort="true"
DataKeyNames="CveCorte,FolioOC,CveOrdenCorte,Fecha,Peso,Observacion,Adjunto,TicketBascula,PesoMerma,CveMotivo,Motivo,FechaIng,CveUsuario,Usuario,CveProduccion,CveFlete,CveEmpaque" EmptyDataText="No se han encontrado datos con los filtros seleccionados.">
<Columns>
<asp:HyperLinkField HeaderText="Folio OC" DataTextField="FolioOC" DataNavigateUrlFields="CveOrdenCorte" DataNavigateUrlFormatString="/CGame/RepOrdenCorteDetalle.aspx?CveOrdenCorte={0}" Target="_blank" ItemStyle-HorizontalAlign="Center" />
<%--<asp:HyperLinkField HeaderText="Folio OP" DataTextField="FolioOP" DataNavigateUrlFields="CveOrdenProduccion" DataNavigateUrlFormatString="/CGame/OrdenProduccion.aspx?CveOrdenProduccion={0}" Target="_blank" ItemStyle-HorizontalAlign="Center" />--%>
<asp:TemplateField HeaderText="Motivo" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblmotivo" runat="server" Text='<%# Eval("Motivo")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Ticket Báscula" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblticketBascula" runat="server" Text='<%# Eval("TicketBascula")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Peso" HeaderText="Peso Neto (Kg)" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="PesoMerma" HeaderText="Peso Merma (Kg)" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:TemplateField HeaderText="Empaque" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="lblEmpaque" runat="server" Text='<%# Eval("Empaque")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="EnPiso" HeaderText="En Piso" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:TemplateField HeaderText="Resultado Empaque" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="lblResultadoEmpaque" runat="server" Text='<%# Eval("FolioProduccion")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="ImporteEmpaque" HeaderText="Costo X Ton. Corrida (Ddl)" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="Fecha" ItemStyle-Width="15%" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText="Comandos">
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Editar" ID="LnkEditar" OnClick="LnkEditarCort_Click" CssClass="btn btn-circle btn-sm green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
<asp:LinkButton ID="imgD" runat="server" OnClick="LnkEliminarCort_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar el Corte?" data-btn-ok-label="si" />
<asp:LinkButton data-toggle="tooltip" ClientIDMode="AutoID" title="Generar PDF" ID="LnkPDF" OnClick="LnkPDF_Click" CssClass="btn btn-circle btn-xs blue " runat="server" Text="<i class='fa fa-ad-pdf'></i>"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<br />
<br />
<asp:UpdatePanel ID="UpBitacora" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-12">
<div class="portlet light bordered xspadding">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Bitacora</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
</div>
<div class="portlet-body">
<asp:GridView ID="GvBitacora" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" AutoGenerateColumns="False" data-sort="true">
<Columns>
<asp:BoundField DataField="FechaIng" ItemStyle-Width="15%" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="Comentario" HeaderText="Comentario" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Usuario" HeaderText="Usuario" ItemStyle-HorizontalAlign="Left" />
</Columns>
</asp:GridView>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DModalCorte" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog modal" runat="server" ID="UPModalCort" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Literal ID="ltlCorttitulo" Text="Entrada de materia prima" runat="server"> </asp:Literal></h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-6">
<div class="portlet light smmallpadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Datos de Entrada de Materia Prima</span>
</div>
<div class="tools">
<a href="javascript;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body form">
<div class="row">
<div class="col-md-2" style="text-align: left">Fecha:</div>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
<asp:TextBox ID="TxtFecha" CssClass="form-control input-sm ADSMaskDate" Style="width: 118px" runat="server"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="LnkCortfecha" class="btn default " Text=" <i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEECortfecha" runat="server" TargetControlID="TxtFecha" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEECortfecha" TargetControlID="TxtFecha" PopupButtonID="LnkCortfecha" PopupPosition="BottomRight" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RfvCortfecha" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario, por favor ingréselo." ValidationGroup="VGMCort"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoCortfecha" runat="server" HighlightCssClass="vco" TargetControlID="RfvCortfecha"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlEmpaque" DataValueField="CveEmpaque" DataTextField="Empaque" runat="server" CssClass="form-control select2me" AppendDataBoundItems="true" Width="250px"></asp:DropDownList>
<label for="<%= DdlEmpaque.ClientID.ToString()%>">Empaque:</label>
<asp:RequiredFieldValidator runat="server" Enabled="true" Display="None" ID="RFVEmpaque" ControlToValidate="DdlEmpaque" InitialValue="-1" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Empaque''</b> es necesario, por favor seleccione uno." ValidationGroup="VGMCort"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEEmpaque" runat="server" HighlightCssClass="vco" TargetControlID="RFVEmpaque" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlOrdenCorte" CssClass="form-control select2me " OnSelectedIndexChanged="DdlOrdenCorte_SelectedIndexChanged" AutoPostBack="true" AppendDataBoundItems="true" runat="server" DataTextField="FolioFechaHuerta" DataValueField="CveOrdenCorte" Style="width: 100%"></asp:DropDownList>
<label for="<%= DdlOrdenCorte.ClientID.ToString()%>">Folio OC:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlFlete" DataValueField="CveFlete" DataTextField="TipoFleteChoferCamionPlaca" runat="server" CssClass="form-control select2me" AppendDataBoundItems="true" Width="250px"></asp:DropDownList>
<label for="<%= DdlFlete.ClientID.ToString()%>">Flete:</label>
<asp:RequiredFieldValidator runat="server" Enabled="true" Display="None" ID="RFVFlete" ControlToValidate="DdlFlete" InitialValue="-1" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Flete''</b> es necesario, por favor seleccione uno." ValidationGroup="VGMCort"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEFlete" runat="server" HighlightCssClass="vco" TargetControlID="RFVFlete" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtPeso" CssClass="form-control " MaxLength="20" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvCortpeso" runat="server" ControlToValidate="TxtPeso" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Peso''</b> es necesario, por favor ingréselo." ValidationGroup="VGMCort"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoCortpeso" runat="server" HighlightCssClass="vco" TargetControlID="RfvCortpeso"></ajax:ValidatorCalloutExtender>
<ajax:FilteredTextBoxExtender ID="FIETTPeso" TargetControlID="TxtPeso" FilterType="Numbers,Custom" ValidChars="." runat="server" />
<label for="<%= TxtPeso.ClientID.ToString()%>">Peso Neto (Kg):</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtTicketBascula" MaxLength="100" CssClass="form-control" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvCortticketBascula" runat="server" ControlToValidate="TxtTicketBascula" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Ticket Bascula''</b> es necesario, por favor ingréselo." ValidationGroup="VGMCort"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoCortticketBascula" runat="server" HighlightCssClass="vco" TargetControlID="RfvCortticketBascula"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtTicketBascula.ClientID.ToString()%>">Ticket Báscula:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtPesoMerma" MaxLength="20" CssClass="form-control" runat="server"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FIETTPesoMerma" TargetControlID="TxtPesoMerma" FilterType="Numbers,Custom" ValidChars="." runat="server" />
<label for="<%= TxtPesoMerma.ClientID.ToString()%>">Peso de la Merma (Kg):</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlMotivo" CssClass="form-control select2me " AppendDataBoundItems="true" runat="server" DataTextField="Motivo" DataValueField="CveMotivo" Style="width: 100%"></asp:DropDownList>
<label for="<%= DdlMotivo.ClientID.ToString()%>">Motivo de la Merma:</label>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="row">
<div class="col-md-12">
<asp:TextBox ID="TxtModalAdjuntoArchivo" CssClass="ADSdropzone hidden" data-maxFile="1" runat="server"></asp:TextBox>
</div>
</div>
<br />
<div class="row">
<div class="col-md-12" align="center">
<asp:LinkButton ID="LnkDescargar" OnClick="LnkDescargar_Click" Visible="false" data-toggle="tooltip" data-placement="top" ToolTip="Descargar Adjunto" runat="server"><i class="fa fa-arrow-circle-down" style="color:green" aria-hidden="true"></i></asp:LinkButton>
</div>
</div>
</div>
</div>
<div class="form-group form-md-line-input input-iconright">
<label for="<%= TxtObservacion.ClientID.ToString()%>">Observación:</label>
<br />
<asp:TextBox ID="TxtObservacion" runat="server" Height="50" Width="860px" TextMode="MultiLine" CausesValidation="true" MaxLength="500"></asp:TextBox>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnCortADD" OnClick="BtnCortADD_Click" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="VGMCort" ></asp:Button>
<asp:Button ID="BtnCortEdit" OnClick="BtnCortEdit_Click" runat="server" Text="Actualizar" CssClass="btn btn-primary" ValidationGroup="VGMCort"></asp:Button>
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</div>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LnkDescargar" />
<%--<asp:PostBackTrigger ControlID="BtnCortADD" />--%>
</Triggers>
</asp:UpdatePanel>
</div>
<div id="DModalBitacora" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog modal" runat="server" ID="UpModalBitacora" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Literal ID="ltlCGamtitulo" Text="Agregar Bitacora" runat="server"> </asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<label for="<%= TxtComentario.ClientID.ToString()%>">Comentario:</label>
<asp:TextBox ID="TxtComentario" runat="server" MaxLength="500" Style="width: 580px; height: 100px;" TextMode="MultiLine" Rows="5"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVComentario" runat="server" ControlToValidate="TxtComentario" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Comentario''</b> es necesario, por favor ingréselo." ValidationGroup="VGMBitacora"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOComentario" runat="server" HighlightCssClass="vco" TargetControlID="RFVComentario"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnAddBitacora" OnClick="BtnAddBitacora_Click" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="VGMBitacora" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,450 @@
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.Web.UI;
public partial class CATCorte : ClsPaginas
{
#region Propiedades
private int CveCorte
{
get { return (ViewState["CveCorte"] == null) ? -1 : Convert.ToInt32(ViewState["CveCorte"]); }
set { ViewState["CveCorte"] = value; }
}
private int CveOrdenCorte
{
get { return (ViewState["CveOrdenCorte"] == null) ? -1 : Convert.ToInt32(ViewState["CveOrdenCorte"]); }
set { ViewState["CveOrdenCorte"] = value; }
}
private int Index
{
get { return (ViewState["Index"] == null) ? 0 : Convert.ToInt32(ViewState["Index"]); }
set { ViewState["Index"] = value; }
}
private String Adjunto
{
get { return (ViewState["Adjunto"] == null) ? "-1" : (String)(ViewState["Adjunto"]); }
set { ViewState["Adjunto"] = value; }
}
private int CveHuerta
{
get { return (ViewState["CveHuerta"] == null) ? 0 : Convert.ToInt32(ViewState["CveHuerta"]); }
set { ViewState["CveHuerta"] = value; }
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
CveOrdenCorte = Request["CveOrdenCorte"] == null ? -1 : Request["CveOrdenCorte"].ToString().ToEntero();
CveHuerta = Request["CveHuerta"] == null ? 0 : Request["CveHuerta"].ToString().ToEntero();
txtFechaI.Text = DateTime.Now.AddMonths(-1).ToShortDateString();
txtFechaF.Text = DateTime.Now.ToShortDateString();
CargaMotivo();
CargaOrdenCorte();
CargaHuerta();
CargaEmpaque();
CargaBitacora();
CargaFletes();
if (CveHuerta > 0) { DdlHuertaFiltro.SelectedValueExist(CveHuerta); }
CargaCorte();
if (CveOrdenCorte > 0) { Agregar(); }
}
}
#region Cargas
protected void CargaCorte()
{
ClsCGame ObjCort = new ClsCGame();
if (ObjCort.GetCorte(UsuarioActual.CveEmpresa, Estatus: DdlEstatus.SelectedValue.ToEntero(), CveHuerta: DdlHuertaFiltro.SelectedValue.ToEntero(), Opcion: 1,FechaI:txtFechaI.Text.ToDate(),FechaF:txtFechaF.Text.ToDate()))
{
GVCorte.DataSource = ObjCort.DtResultados;
}
ObjCort.Dispose();
GVCorte.DataBind();
upDatosCort.Update();
}
protected void CargaHuerta()
{
ClsCGame ObjCort = new ClsCGame();
if (ObjCort.GetHuerta(UsuarioActual.CveEmpresa))
{
DdlHuertaFiltro.DataSource = ObjCort.DtResultados;
DdlHuertaFiltro.Items.Insert(0, new ListItem("Todos", "-1"));
}
ObjCort.Dispose(); ;
DdlHuertaFiltro.DataBind();
UpFiltros.Update();
}
protected void CargaOrdenCorte(int CveOrdenCorte = -1)
{
DdlOrdenCorte.Items.Clear();
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetOrdenCorte(UsuarioActual.CveEmpresa))
{
if (CveOrdenCorte < 1)
{
DdlOrdenCorte.DataSource = ObjCGame.DtResultados.FiltraParametros("Disponible = 1");
}
else
{
DdlOrdenCorte.DataSource = ObjCGame.DtResultados.FiltraParametros(String.Format("Disponible = 1 OR CveOrdenCorte = {0}", CveOrdenCorte));
}
DdlOrdenCorte.Items.Insert(0, new ListItem("Seleccione", "-1"));
}
ObjCGame.Dispose();
DdlOrdenCorte.DataBind();
UPModalCort.Update();
}
protected void CargaMotivo()
{
ClsCGame ObjCort = new ClsCGame();
if (ObjCort.GetMotivoMerma(UsuarioActual.CveEmpresa))
{
DdlMotivo.DataSource = ObjCort.DtResultados;
DdlMotivo.Items.Insert(0, new ListItem("Seleccione", "-1"));
DdlMotivo.DataBind();
}
ObjCort.Dispose();
UPModalCort.Update();
}
private void CargaEmpaque()
{
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetEmpaques(UsuarioActual.CveEmpresa, -1, 1))
{
DdlEmpaque.DataSource = ObjCGame.DtResultados;
DdlEmpaque.Items.Insert(0, new ListItem("Seleccione", "-1"));
}
ObjCGame.Dispose();
DdlEmpaque.DataBind();
}
private void CargaBitacora()
{
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetBitacora(UsuarioActual.CveEmpresa))
{
GvBitacora.DataSource = ObjCGame.DtResultados;
}
ObjCGame.Dispose();
GvBitacora.DataBind();
UpBitacora.Update();
}
private void CargaFletes(int CveFlete = -1)
{
DdlFlete.Items.Clear();
if (DdlOrdenCorte.SelectedValue.ToEntero() != -1)
{
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetFlete(UsuarioActual.CveEmpresa, CveOrdenCorte: DdlOrdenCorte.SelectedValue.ToEntero()))
{
if (CveFlete < 1)
{
DdlFlete.DataSource = ObjCGame.DtResultados.FiltraParametros("Peso IS NULL");
}
else
{
DdlFlete.DataSource = ObjCGame.DtResultados.FiltraParametros(String.Format("Peso IS NULL OR CveFlete = {0}", CveFlete));
}
}
ObjCGame.Dispose();
}
DdlFlete.Items.Insert(0, new ListItem("Seleccione", "-1"));
DdlFlete.DataBind();
}
#endregion
#region Limpia Modal
protected void LimpiaCorte()
{
TxtFecha.Text = DateTime.Now.ToString();
TxtPeso.Text = "";
DdlOrdenCorte.SelectedIndex = 0;
TxtObservacion.Text = "";
TxtModalAdjuntoArchivo.Text = "";
TxtTicketBascula.Text = "";
TxtPesoMerma.Text = "";
DdlMotivo.SelectedIndex = 0;
DdlFlete.SelectedIndex = 0;
DdlEmpaque.SelectedIndex = 0;
UPModalCort.Update();
}
#endregion
#region Botones
protected void LnkEditarCort_Click(object sender, EventArgs e)
{
LimpiaCorte();
GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
CveCorte = gvRow.DataKey("CveCorte").ToEntero();
Index = gvRow.RowIndex;
CargaOrdenCorte(gvRow.DataKey("CveOrdenCorte").ToEntero());
DdlOrdenCorte.SelectedValueExist(gvRow.DataKey("CveOrdenCorte").ToEntero());
TxtFecha.Text = gvRow.DataKey("Fecha");
TxtPeso.Text = gvRow.DataKey("Peso");
TxtObservacion.Text = gvRow.DataKey("Observacion");
TxtTicketBascula.Text = gvRow.DataKey("TicketBascula");
Adjunto = gvRow.DataKey("Adjunto");
TxtPesoMerma.Text = gvRow.DataKey("PesoMerma");
TxtModalAdjuntoArchivo.Text = "";
DdlMotivo.SelectedValueExist(gvRow.DataKey("CveMotivo").ToEntero());
CargaFletes(gvRow.DataKey("CveFlete").ToEntero());
DdlFlete.SelectedValueExist(gvRow.DataKey("CveFlete").ToEntero());
DdlEmpaque.SelectedValueExist(gvRow.DataKey("CveEmpaque").ToEntero());
if (gvRow.DataKey("Adjunto").ToString() != "") { LnkDescargar.Visible = true; }
this.RegistraScript("$('#DModalCorte').modal();");
BtnCortADD.Visible = false;
BtnCortEdit.Visible = true;
UPModalCort.Update();
}
protected void LnkAgregarCort_Click(object sender, EventArgs e)
{
Agregar();
}
protected void Agregar()
{
this.RegistraScript("$('#DModalCorte').modal();");
LimpiaCorte();
if (CveOrdenCorte > 0) { DdlOrdenCorte.SelectedValueExist(CveOrdenCorte); }
BtnCortADD.Visible = true;
BtnCortEdit.Visible = false;
LnkDescargar.Visible = false;
UPModalCort.Update();
}
protected void LnkAgregarBitacora_Click(object sender, EventArgs e)
{
this.RegistraScript("$('#DModalBitacora').modal();");
TxtComentario.Text = "";
UpModalBitacora.Update();
}
protected void BtnCortADD_Click(object sender, EventArgs e)
{
if (Valida())
{
String Adjunto = "";
if (TxtModalAdjuntoArchivo.getfiles().Archivos.Count > 0)
{
Archivo ArchivoAdjunto = TxtModalAdjuntoArchivo.getfiles().Archivos[0];
Adjunto = DdlOrdenCorte.SelectedValue + "_" + ArchivoAdjunto.filenameO;
}
ClsCGame ObjCort = new ClsCGame();
ObjCort.IniciaTransacSQL();
bool Continuar = ObjCort.AddCorte(TxtFecha.Text.ToDate(), TxtPeso.Text.ToDouble(), TxtObservacion.Text, Adjunto, TxtTicketBascula.Text, TxtPesoMerma.Text.ToDouble(), DdlMotivo.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlOrdenCorte.SelectedValue.ToEntero(), DdlEmpaque.SelectedValue.ToEntero(), DdlFlete.SelectedValue.ToEntero());
Continuar = ObjCort.UpdateFleteImporte(DdlOrdenCorte.SelectedValue.ToEntero(), TxtPeso.Text.ToDouble(), DdlFlete.SelectedValue.ToEntero());
if (Continuar)
{
CveCorte = ObjCort.CveCorte;
ObjCort.Commit();
if (TxtModalAdjuntoArchivo.getfiles().Archivos.Count > 0)
{
GuardarAdjunto();
}
this.RegistraScript("$('#DModalCorte').modal('hide');");
if (CveOrdenCorte > 0)
{
Alert("La entrada de materia prima se ha agregado correctamente", TipoMensaje.MsgInformacion, $"document.location.href=\"/CGame/RepOrdenCorteDetalle.aspx?CveOrdenCorte={CveOrdenCorte}\"");
}
else
{
CargaCorte();
Alert("La entrada de materia prima se ha agregado correctamente");
}
}
else
{
ObjCort.RollBack();
}
ObjCort.Dispose();
UPModalCort.Update();
}
}
protected void BtnCortEdit_Click(object sender, EventArgs e)
{
if (Valida())
{
if (TxtModalAdjuntoArchivo.getfiles().Archivos.Count > 0)
{
Archivo ArchivoAdjunto = TxtModalAdjuntoArchivo.getfiles().Archivos[0];
Adjunto = DdlOrdenCorte.SelectedValue + "_" + ArchivoAdjunto.filenameO;
}
ClsCGame ObjCort = new ClsCGame();
ObjCort.IniciaTransacSQL();
bool Continuar = ObjCort.UpdateCorte(CveCorte, TxtFecha.Text.ToDate(), TxtPeso.Text.ToDouble(), TxtObservacion.Text, Adjunto, TxtTicketBascula.Text, TxtPesoMerma.Text.ToDouble(), DdlMotivo.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlOrdenCorte.SelectedValue.ToEntero(), DdlEmpaque.SelectedValue.ToEntero(), DdlFlete.SelectedValue.ToEntero());
Continuar = ObjCort.UpdateFleteImporte(DdlOrdenCorte.SelectedValue.ToEntero(), TxtPeso.Text.ToDouble(), DdlFlete.SelectedValue.ToEntero());
if (Continuar)
{
ObjCort.Commit();
if (TxtModalAdjuntoArchivo.getfiles().Archivos.Count > 0)
{
GuardarAdjunto();
}
this.RegistraScript("$('#DModalCorte').modal('hide');");
CargaCorte();
Alert("La entrada de materia prima se ha actualizado correctamente");
}
else
{
ObjCort.RollBack();
}
ObjCort.Dispose();
UPModalCort.Update();
}
}
protected void LnkEliminarCort_Click(object sender, EventArgs e)
{
GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
CveCorte = gvRow.DataKey("CveCorte").ToEntero();
ClsCGame ObjCort = new ClsCGame();
bool Continuar = ObjCort.RemoveCorte(CveCorte);
ObjCort.Dispose();
if (Continuar)
{
CargaCorte();
Alert("La entrada de materia prima ha eliminada");
}
}
protected void LnkDescargar_Click(object sender, EventArgs e)
{
string filename = GVCorte.Rows[Index].DataKey("Adjunto").ToString();
if (!String.IsNullOrEmpty(filename))
{
String rutaAplicacion = HttpContext.Current.Server.MapPath(HttpContext.Current.Request.ApplicationPath);
String Path = String.Format("{0}\\{1}", UsuarioActual.Empresa.Ruta, "AdjuntosCortes");
String ArchivoDestino = String.Format("{0}\\{1}", Path, GVCorte.Rows[Index].DataKey("Adjunto").ToString());
System.IO.FileInfo toDownload =
new System.IO.FileInfo(ArchivoDestino);
if (toDownload.Exists)
{
Response.ClearContent();
Response.ClearHeaders();
Response.AddHeader("Content-Disposition", "attachment; filename=" + filename);
Response.ContentType = "application/octet-stream";
Response.WriteFile(ArchivoDestino);
Response.Flush();
Response.Close();
Response.End();
HttpContext.Current.ApplicationInstance.CompleteRequest();
}
}
}
protected void BtnAddBitacora_Click(object sender, EventArgs e)
{
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.AddBitacora(TxtComentario.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
{
Alert("La bitacora fue agregada correctamente");
}
ObjCGame.Dispose();
this.RegistraScript("$('#DModalBitacora').modal('hide');");
CargaBitacora();
}
protected void LnkPDF_Click(object sender, EventArgs e)
{
GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
CveCorte = gvRow.DataKey("CveCorte").ToEntero();
GeneraPDF();
}
#endregion
#region AutopostBack
//protected void DdlClasificacion_SelectedIndexChanged(object sender, EventArgs e)
//{
// CargaPS();
//}
//protected void DdlTransportista_SelectedIndexChanged(object sender, EventArgs e)
//{
// CargaChofer();
//}
protected void DdlOrdenCorte_SelectedIndexChanged(object sender, EventArgs e)
{
CargaFletes();
}
#endregion
#region Validacion
public bool Valida()
{
if (DdlOrdenCorte.SelectedValue == "-2")
{
Alert("Tiene que seleccionar una orden de corte", ModExtensiones.TipoMensaje.MsgAdvertencia);
return false;
}
if (DdlMotivo.SelectedValue == "-1")
{
Alert("Tiene que seleccionar un motivo", ModExtensiones.TipoMensaje.MsgAdvertencia);
return false;
}
return true;
}
#endregion
#region GridView
protected void GvCorte_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
{
LinkButton lb = e.Row.FindControl("LnkPDF") as LinkButton;
ScriptManager.GetCurrent(this).RegisterPostBackControl(lb);
if (e.Row.FCLabel("lblResultadoEmpaque").Text == "")
{
e.Row.FCLabel("lblResultadoEmpaque").Text = "Sin Asignar";
}
else
{
String Css = "Texto";
String Liga = $"/CGame/Empaque.aspx?&CveProduccion={e.Row.DataKey("CveProduccion")}";

38
CGame/EstadoCuenta.aspx Normal file
View File

@@ -0,0 +1,38 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="EstadoCuenta.aspx.cs" Inherits="CGame_EstadoCuenta" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Estado de Cuenta
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpSaldo" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-6">
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvSaldo.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvSaldo.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GvSaldo" runat="server" GridLines="None" OnRowDataBound="GvSaldo_RowDataBound" ShowHeaderWhenEmpty="true" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False">
<Columns>
<asp:HyperLinkField HeaderText="Huerta" DataTextField="Huerta" DataNavigateUrlFields="CveHuerta" DataNavigateUrlFormatString="/CGame/EstadoCuentaDetalle.aspx?CveHuerta={0}" Target="_blank" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Saldo" HeaderText="Saldo" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
</Columns>
</asp:GridView>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,41 @@
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;
using System.Threading;
using Newtonsoft.Json.Linq;
public partial class CGame_EstadoCuenta : ClsPaginas
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
CargaDatos();
}
}
private void CargaDatos()
{
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetSaldo(UsuarioActual.CveEmpresa))
{
GvSaldo.DataSource = ObjCGame.DtResultados;
}
ObjCGame.Dispose();
GvSaldo.DataBind();
UpSaldo.Update();
}
protected void GvSaldo_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[1].Text = e.Row.Cells[1].Text.FormatoNumero();
}
}
}

View File

@@ -0,0 +1,279 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="EstadoCuentaDetalle.aspx.cs" Inherits="CGame_EstadoCuentaDetalle" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.Bold {
font-weight: bold;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Estado de Cuenta:
<asp:Label ID="LblHuerta" runat="server"></asp:Label>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpIndicadores" runat="server" class="portlet-body form" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-2">
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding-top px;">
<div class="display" style="margin-bottom: 0px">
<div class="number">
<h4 class="font-black-haze">
<span data-counter="counterup" data-value="1349">
<b>
<asp:Label runat="server" Text="0" ID="LblPesoTotal"></asp:Label></span></b>
<asp:Label runat="server" ID="LblPor" Text=""></asp:Label>
</h4>
<small>Kilos</small>
</div>
</div>
</div>
</div>
<div class="col-md-2">
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding-top px;">
<div class="display" style="margin-bottom: 0px">
<div class="number">
<h4 class="font-black-haze">
<span data-counter="counterup" data-value="1349">
<b>
<asp:Label runat="server" Text="0" ID="LblPrimera"></asp:Label></span></b>
<asp:Label runat="server" ID="Label2" Text=""></asp:Label>
</h4>
<small>Primera</small>
</div>
</div>
</div>
</div>
<div class="col-md-1">
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding-top px;">
<div class="display" style="margin-bottom: 0px">
<div class="number">
<h4 class="font-black-haze">
<span data-counter="counterup" data-value="1349">
<b>
<asp:Label runat="server" Text="0" ID="LblPorcentajePrimera"></asp:Label></span></b>
<asp:Label runat="server" ID="Label3" Text="%"></asp:Label>
</h4>
<small>%Primera</small>
</div>
</div>
</div>
</div>
<div class="col-md-2">
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding-top px;">
<div class="display" style="margin-bottom: 0px">
<div class="number">
<h4 class="font-black-haze">
<span data-counter="counterup" data-value="1349">
<b>
<asp:Label runat="server" Text="0" ID="LblSegunda"></asp:Label></span></b>
<asp:Label runat="server" ID="Label4" Text=""></asp:Label>
</h4>
<small>Segunda</small>
</div>
</div>
</div>
</div>
<div class="col-md-1">
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding-top px;">
<div class="display" style="margin-bottom: 0px">
<div class="number">
<h4 class="font-black-haze">
<span data-counter="counterup" data-value="1349">
<b>
<asp:Label runat="server" Text="0" ID="LblPorcentajeSegunda"></asp:Label></span></b>
<asp:Label runat="server" ID="Label5" Text="%"></asp:Label>
</h4>
<small>%Segunda</small>
</div>
</div>
</div>
</div>
<div class="col-md-2">
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding-top px;">
<div class="display" style="margin-bottom: 0px">
<div class="number">
<h4 class="font-black-haze">
<span data-counter="counterup" data-value="1349">
<b>
<asp:Label runat="server" Text="0" ID="LblMerma"></asp:Label></span></b>
<asp:Label runat="server" ID="Label6" Text=""></asp:Label>
</h4>
<small>Merma</small>
</div>
</div>
</div>
</div>
<div class="col-md-1">
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding-top px;">
<div class="display" style="margin-bottom: 0px">
<div class="number">
<h4 class="font-black-haze">
<span data-counter="counterup" data-value="1349">
<b>
<asp:Label runat="server" Text="0" ID="LblPorcentajeMerma"></asp:Label></span></b>
<asp:Label runat="server" ID="Label7" Text="%"></asp:Label>
</h4>
<small>%Merma</small>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-2"></div>
<div class="col-md-2">
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding-top px;">
<div class="display" style="margin-bottom: 0px">
<div class="number">
<h4 class="font-black-haze">
<span data-counter="counterup" data-value="1349">
<b>
<asp:Label runat="server" Text="0" ID="LblPiso"></asp:Label></span></b>
<asp:Label runat="server" ID="Label8" Text=""></asp:Label>
</h4>
<small>En Piso</small>
</div>
</div>
</div>
</div>
<div class="col-md-1">
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding-top px;">
<div class="display" style="margin-bottom: 0px">
<div class="number">
<h4 class="font-black-haze">
<span data-counter="counterup" data-value="1349">
<b>
<asp:Label runat="server" Text="0" ID="LblPorcentajeEnPiso"></asp:Label></span></b>
<asp:Label runat="server" ID="Label9" Text="%"></asp:Label>
</h4>
<small>%En Piso</small>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<asp:UpdatePanel ID="UpIngresos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet light smmallpadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Ingresos</span>
</div>
<div class="tools">
<a href="javascript;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body form">
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<asp:UpdatePanel ID="UpEgresos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet light smmallpadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Egresos</span>
</div>
<div class="tools">
<a href="javascript;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body form">
<div class="row">
<label class="col-md-2 Bold">Gastos de Corte:</label>
<div class="col-md-1">
<asp:HyperLink ID="HLTotGastosCorte" runat="server" Target="_blank"></asp:HyperLink>
</div>
</div>
<div class="row">
<label class="col-md-2 Bold">Huerta Empaque:</label>
<div class="col-md-1">
<asp:HyperLink ID="HLTotHuertaEmpaque" runat="server" Target="_blank"></asp:HyperLink>
</div>
</div>
<div class="row">
<label class="col-md-2 Bold">Empaque(Ddl):</label>
<div class="col-md-1">
<asp:HyperLink ID="HLTotEmpaque" runat="server" Target="_blank"></asp:HyperLink>
</div>
</div>
<div class="row">
<label class="col-md-2 Bold">PreEnfriado:</label>
<div class="col-md-1">
<asp:HyperLink ID="HLTotPreEnfriado" runat="server" Target="_blank"></asp:HyperLink>
</div>
</div>
<div class="row">
<label class="col-md-2 Bold">Materiales:</label>
<div class="col-md-1">
<asp:HyperLink ID="HLTotMateriales" runat="server" Target="_blank"></asp:HyperLink>
</div>
</div>
<div class="row">
<label class="col-md-2 Bold">Empaque USA:</label>
<div class="col-md-1">
<asp:HyperLink ID="HLTotEmpaqueUSA" runat="server" Target="_blank"></asp:HyperLink>
</div>
</div>
<div class="row">
<label class="col-md-2 Bold">Otros Gastos:</label>
<div class="col-md-1">
<asp:HyperLink ID="HLTotOtrosGastos" runat="server" Target="_blank"></asp:HyperLink>
</div>
</div>
<div class="row">
<label class="col-md-2 Bold">Total de Egresos:</label>
<div class="col-md-1">
<asp:Label ID="LblTotEgresos" runat="server"></asp:Label>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<asp:UpdatePanel ID="UpUtilidad" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet light smmallpadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Utilidades</span>
</div>
<div class="tools">
<a href="javascript;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body form">
<div class="row">
<label class="col-md-2 Bold">Utilidad Neta:</label>
<div class="col-md-1">
<asp:Label ID="LblUtilidadNeta" runat="server"></asp:Label>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,72 @@
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;
using System.Threading;
using Newtonsoft.Json.Linq;
public partial class CGame_EstadoCuentaDetalle : ClsPaginas
{
#region PROPIEDADES
private int CveHuerta
{
get { return (ViewState["CveHuerta"] == null) ? 0 : Convert.ToInt32(ViewState["CveHuerta"]); }
set { ViewState["CveHuerta"] = value; }
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
CveHuerta = Request["CveHuerta"] == null ? 0 : Request["CveHuerta"].ToString().ToEntero();
CargaDatos();
}
}
private void CargaDatos()
{
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetIngresosEgresos(UsuarioActual.CveEmpresa, CveHuerta))
{
if (ObjCGame.DtResultados.Rows.Count > 0)
{
LblHuerta.Text = ObjCGame.DtResultados.Rows[0]["Huerta"].ToString();
HLTotGastosCorte.Text = ObjCGame.DtResultados.Rows[0]["TotGastosCorte"].ToString().FormatoNumero();
HLTotHuertaEmpaque.Text = ObjCGame.DtResultados.Rows[0]["TotHuertaEmpaque"].ToString().FormatoNumero();
HLTotEmpaque.Text = ObjCGame.DtResultados.Rows[0]["TotEmpaque"].ToString().FormatoNumero();
HLTotPreEnfriado.Text = ObjCGame.DtResultados.Rows[0]["TotPreEnfriado"].ToString().FormatoNumero();
HLTotMateriales.Text = ObjCGame.DtResultados.Rows[0]["TotMateriales"].ToString().FormatoNumero();
HLTotEmpaqueUSA.Text = ObjCGame.DtResultados.Rows[0]["TotEmpaqueUSA"].ToString().FormatoNumero();
HLTotOtrosGastos.Text = ObjCGame.DtResultados.Rows[0]["TotOtrosGastos"].ToString().FormatoNumero();
LblTotEgresos.Text = ObjCGame.DtResultados.Rows[0]["TotEgresos"].ToString().FormatoNumero();
HLTotGastosCorte.NavigateUrl = String.Format("/CGame/RepCorteGasto.aspx?CveHuerta={0}&Modalidad={1}", CveHuerta,1);
HLTotHuertaEmpaque.NavigateUrl = String.Format("/CGame/Fletes.aspx?CveHuerta={0}&Tipo={1}", CveHuerta,1);
HLTotEmpaque.NavigateUrl = String.Format("/CGame/EntradaMateriaPrima.aspx?CveHuerta={0}", CveHuerta);
HLTotPreEnfriado.NavigateUrl = String.Format("/CGame/RepEmpaque.aspx?CveHuerta={0}&Modalidad={1}", CveHuerta, 2);
HLTotMateriales.NavigateUrl = String.Format("/CGame/RepEmpaque.aspx?CveHuerta={0}&Modalidad={1}", CveHuerta,1);
HLTotEmpaqueUSA.NavigateUrl = String.Format("/CGame/Fletes.aspx?CveHuerta={0}&Tipo={1}", CveHuerta, 2);
HLTotOtrosGastos.NavigateUrl = String.Format("/CGame/RepCorteGasto.aspx?CveHuerta={0}&Modalidad={1}", CveHuerta,2);
LblPesoTotal.Text = ObjCGame.DtResultados.Rows[0]["TotPeso"].ToString().FormatoNumero();
LblPrimera.Text = ObjCGame.DtResultados.Rows[0]["TotPrimera"].ToString().FormatoNumero();
LblPorcentajePrimera.Text = ObjCGame.DtResultados.Rows[0]["PorcentajePrimera"].ToString().FormatoNumero();
LblSegunda.Text = ObjCGame.DtResultados.Rows[0]["TotSegunda"].ToString().FormatoNumero();
LblPorcentajeSegunda.Text = ObjCGame.DtResultados.Rows[0]["PorcentajeSegunda"].ToString().FormatoNumero();
LblMerma.Text = ObjCGame.DtResultados.Rows[0]["TotMerma"].ToString().FormatoNumero();
LblPorcentajeMerma.Text = ObjCGame.DtResultados.Rows[0]["PorcentajeMerma"].ToString().FormatoNumero();
LblPiso.Text = ObjCGame.DtResultados.Rows[0]["TotEnPiso"].ToString().FormatoNumero();
LblPorcentajeEnPiso.Text = ObjCGame.DtResultados.Rows[0]["PorcentajeEnPiso"].ToString().FormatoNumero();
}
ObjCGame.Dispose();
UpEgresos.Update();
UpIndicadores.Update();
}
}
}

340
CGame/Fletes.aspx Normal file
View File

@@ -0,0 +1,340 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" EnableEventValidation="false" AutoEventWireup="true" CodeFile="Fletes.aspx.cs" Inherits="CGame_Fletes" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
a#C_GvFlete_LnkEditar_0 {
display: none;
}
a#C_GvFlete_imgD_0 {
display: none;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Fletes
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkAddFlete" OnClick="LnkAddFlete_Click" runat="server"><i class="fa fa-plus"></i>Agregar Flete</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LbkExportarExcel" OnClick="LbkExportarExcel_Click" runat="server"><i class="fa fa-ad-excel"></i>Exportar Excel</asp:LinkButton>
</li>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LbkExportarExcel" />
</Triggers>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpFiltros" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" Text="Consultar" ValidationGroup="GrpFiltros" class="btn btn-primary" />
<a href="javascript:;" class="expand"></a>
</div>
<div class="titlefiltros caption ">
<div class="row">
<div class="col-md-1" style="max-width: 70px">Tipo:</div>
<div class="col-md-2">
<asp:DropDownList ID="DdlFiltrosTipo" Width="100%" CssClass="select2me " runat="server" AppendDataBoundItems="true">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Text="Huerta Empaque" Value="1"></asp:ListItem>
<asp:ListItem Text="Empaque USA" Value="2"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-1" style="max-width: 85px">Tipo Flete:</div>
<div class="col-md-2">
<asp:DropDownList ID="DdlFiltrosTipoFlete" Width="100%" CssClass="select2me" runat="server" AppendDataBoundItems="true">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Text="Interno" Value="1"></asp:ListItem>
<asp:ListItem Text="Externo" Value="2"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-1" style="max-width: 85px">Fecha Inicio:</div>
<div class="col-md-2" style="max-width: 120px">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 90px !important; padding: 0px;">
<asp:TextBox ID="TxtFiltrosFechaInicio" CssClass="form-control input-sm ADSMaskDate" Style="width: 80px" runat="server"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="LBFiltrosCalendarioInicio" class="btn default " Text=" <i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFiltrosFechaInicio" runat="server" TargetControlID="TxtFiltrosFechaInicio" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFiltrosFechaInicio" TargetControlID="TxtFiltrosFechaInicio" PopupButtonID="LBFiltrosCalendarioInicio" PopupPosition="BottomRight" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFiltrosFechaInicio" runat="server" ControlToValidate="TxtFiltrosFechaInicio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpFiltros"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEFiltrosFechaInicio" runat="server" HighlightCssClass="vco" TargetControlID="RFVFiltrosFechaInicio"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="col-md-1" style="max-width: 70px">Fecha Fin:</div>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 90px !important; padding: 0px;">
<asp:TextBox ID="TxtFiltrosFechaFin" CssClass="form-control input-sm ADSMaskDate" Style="width: 80px" runat="server"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="LBFiltrosCalendarioFin" class="btn default " Text=" <i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFiltrosFechaFin" runat="server" TargetControlID="TxtFiltrosFechaFin" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFiltrosFechaFin" TargetControlID="TxtFiltrosFechaFin" PopupButtonID="LBFiltrosCalendarioFin" PopupPosition="BottomRight" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFiltrosFechaFin" runat="server" ControlToValidate="TxtFiltrosFechaFin" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpFiltros"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEFiltrosFechaFin" runat="server" HighlightCssClass="vco" TargetControlID="RFVFiltrosFechaFin"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
</div>
<div class="portlet-body" style="display: none;">
<div class="row">
<label class="col-md-1" style="max-width: 70px">Huerta:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlHuertaFiltro" runat="server" AppendDataBoundItems="true" DataTextField="Huerta" DataValueField="CveHuerta" CssClass="select2me" Width="100%">
</asp:DropDownList>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvFlete.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvFlete.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GvFlete" OnRowDataBound="GvFlete_RowDataBound" EmptyDataText="No se encontraron fletes con los filtros seleccionados" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD mysmallbtn" data-sort="true" Width="100%" AutoGenerateColumns="False"
DataKeyNames="CveFlete,CveAFTractor,CveAFRemolque,CveScat,CveChofer,CveFleteHuertaEmpaque,CveHuerta,CveOrdenProduccion,CveProveedor,Fecha,FechaIng,KmFin,KmInicio,Tipo,TipoFlete,Huerta,Folio,RazonSocial,Usuario,ConCruce,Adjunto,CveOrdenCorte,TipoEmpaque,Camion,Placa,Color,Chofer,Importe,CveEmpaque">
<Columns>
<asp:BoundField DataField="FolioOP" ItemStyle-Width="5%" HeaderText="O.P." ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="Folio" ItemStyle-Width="5%" HeaderText="O.C." ItemStyle-HorizontalAlign="Center" />
<asp:TemplateField HeaderText="Tipo" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipo" runat="server" Text='<%# Eval("Tipo")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo de Flete" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoFlete" runat="server" Text='<%# Eval("TipoFlete")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="DescripcionTractor" ItemStyle-Width="5%" HeaderText="Unidad" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="Peso" HeaderText="Peso(TON)" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="Importe" HeaderText="Importe" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="Fecha" ItemStyle-Width="15%" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:BoundField DataField="FechaIng" ItemStyle-Width="15%" HeaderText="Fecha de Ingreso" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:TemplateField HeaderText="Usuario" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblUsuario" runat="server" Text='<%# Eval("Usuario")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText="Comandos">
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Editar" ID="LnkEditar" OnClick="LnkEditarFlete_Click" CssClass="btn btn-circle btn-sm green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
<asp:LinkButton ID="imgD" runat="server" OnClick="LnkEliminarFlete_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar el flete?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DModalFlete" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalFleteAdd" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Literal ID="ltlMotititulo" Text="Flete" runat="server"> </asp:Literal></h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlTipo" CssClass="form-control select2me " AutoPostBack="true" OnSelectedIndexChanged="DdlTipo_SelectedIndexChanged" runat="server" AppendDataBoundItems="true" Style="width: 100%">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Text="Huerta Empaque" Value="1"></asp:ListItem>
<asp:ListItem Text="Empaque USA" Value="2"></asp:ListItem>
</asp:DropDownList>
<label for="<%= DdlTipo.ClientID.ToString()%>">Tipo:</label>
</div>
</div>
<div class="col-md-6" id="DivFecha" visible="false" runat="server">
<div class="row">
<div class="col-md-2" style="text-align: left">Fecha:</div>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
<asp:TextBox ID="TxtFecha" CssClass="form-control input-sm ADSMaskDate" Style="width: 118px" runat="server"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="LnkCortfecha" class="btn default " Text=" <i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEECortfecha" runat="server" TargetControlID="TxtFecha" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEECortfecha" TargetControlID="TxtFecha" PopupButtonID="LnkCortfecha" PopupPosition="BottomRight" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RfvCortfecha" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario, por favor ingréselo." ValidationGroup="VGMCort"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoCortfecha" runat="server" HighlightCssClass="vco" TargetControlID="RfvCortfecha"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlTipoFlete" CssClass="form-control select2me" AutoPostBack="true" OnSelectedIndexChanged="DdlTipoFlete_SelectedIndexChanged" runat="server" AppendDataBoundItems="true" Style="width: 47%">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Text="Interno" Value="1"></asp:ListItem>
<asp:ListItem Text="Externo" Value="2"></asp:ListItem>
</asp:DropDownList>
<label for="<%= DdlTipo.ClientID.ToString()%>">Tipo Flete:</label>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright" id="DivOrdenCorte" runat="server" visible="false">
<asp:DropDownList ID="DdlOrdenCorte" CssClass="form-control select2me" AppendDataBoundItems="true" OnSelectedIndexChanged="DdlOrdenCorte_SelectedIndexChanged" Style="width: 100%;" runat="server" AutoPostBack="true" DataTextField="FolioFechaHuerta" DataValueField="CveOrdenCorte">
</asp:DropDownList>
<label for="<%= DdlOrdenCorte.ClientID.ToString()%>">Folio OC:</label>
</div>
<div class="form-group form-md-line-input input-iconright" id="DivFleteHuertaEmpaque" runat="server" visible="false">
<asp:DropDownList ID="DdlFleteHuertaEmpaque" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="FolioFechaEmpaque" DataValueField="CveFleteHuertaEmpaque">
</asp:DropDownList>
<label for="<%= DdlFleteHuertaEmpaque.ClientID.ToString()%>">Flete:</label>
</div>
<div class="form-group form-md-line-input input-iconright" id="DivHuerta" runat="server" visible="false">
<asp:DropDownList ID="DdlHuerta" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="Huerta" DataValueField="CveHuerta">
</asp:DropDownList>
<label for="<%= DdlHuerta.ClientID.ToString()%>">Huerta:</label>
</div>
<div class="form-group form-md-line-input input-iconright" id="DivRemolque" runat="server" visible="false">
<asp:DropDownList ID="DdlRemolque" CssClass="form-control select2me " runat="server" AppendDataBoundItems="true" DataTextField="CodigoDescripcion" DataValueField="CveActivoFijo" Style="width: 100%"></asp:DropDownList>
<label for="<%= DdlRemolque.ClientID.ToString()%>">Remolque:</label>
</div>
<div class="form-group form-md-line-input input-iconright" id="DivTractor" runat="server" visible="false">
<asp:DropDownList ID="DdlTractor" CssClass="form-control select2me " runat="server" AppendDataBoundItems="true" DataTextField="CodigoDescripcion" DataValueField="CveActivoFijo" Style="width: 100%"></asp:DropDownList>
<label for="<%= DdlTractor.ClientID.ToString()%>">Tractor:</label>
</div>
<div class="form-group form-md-line-input input-iconright" id="DivChofer" runat="server" visible="false">
<asp:DropDownList ID="DdlChofer" CssClass="form-control select2me " runat="server" AppendDataBoundItems="true" DataTextField="Chofer" DataValueField="CveChofer" Style="width: 100%"></asp:DropDownList>
<label for="<%= DdlChofer.ClientID.ToString()%>">Chofer:</label>
</div>
<div class="form-group form-md-line-input input-iconright" id="DivProveedor" runat="server" visible="false">
<asp:DropDownList ID="DdlProveedor" CssClass="form-control select2me " runat="server" DataTextField="RazonSocial" AppendDataBoundItems="true" DataValueField="CveProveedor" Style="width: 100%"></asp:DropDownList>
<label for="<%= DdlProveedor.ClientID.ToString()%>">Proveedor:</label>
</div>
<div class="form-group form-md-line-input input-iconright" id="DivOrdenProduccion" runat="server" visible="false">
<asp:DropDownList ID="DdlOrdenProduccion" CssClass="form-control select2me " runat="server" DataTextField="FolioClienteFecha" AppendDataBoundItems="true" DataValueField="CveOrdenProduccion" Style="width: 100%"></asp:DropDownList>
<label for="<%= DdlOrdenProduccion.ClientID.ToString()%>">Orden de Producción:</label>
</div>
<div class="form-group form-md-line-input input-iconright" id="DivEmpaque" runat="server" visible="false">
<asp:DropDownList ID="DdlEmpaque" DataValueField="CveEmpaque" DataTextField="Empaque" runat="server" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%"></asp:DropDownList>
<label for="<%= DdlEmpaque.ClientID.ToString()%>">Empaque:</label>
</div>
<div class="form-group form-md-line-input input-iconright" id="DivTipoEmpaque" runat="server" visible="false">
<asp:DropDownList ID="DdlTipoEmpaque" CssClass="form-control select2me" runat="server" AppendDataBoundItems="true" Style="width: 100%">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Text="Full" Value="1"></asp:ListItem>
<asp:ListItem Text="Sencillo" Value="2"></asp:ListItem>
<asp:ListItem Text="TermoFull" Value="3"></asp:ListItem>
<asp:ListItem Text="TermoSencillo" Value="4"></asp:ListItem>
</asp:DropDownList>
<label for="<%= DdlTipoEmpaque.ClientID.ToString()%>">Tipo Empaque:</label>
</div>
<div class="form-group form-md-line-input input-iconright" id="DivTxtChofer" runat="server" visible="false">
<asp:TextBox ID="TxtChofer" CssClass="form-control" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVChofer" runat="server" ControlToValidate="TxtChofer" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Chofer''</b> es necesario, por favor ingréselo." ValidationGroup="VGFlete"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEChofer" runat="server" HighlightCssClass="vco" TargetControlID="RFVChofer"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtChofer.ClientID.ToString()%>">Chofer:</label>
</div>
<div class="form-group form-md-line-input input-iconright" id="DivCamion" runat="server" visible="false">
<asp:TextBox ID="TxtCamion" CssClass="form-control" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVCamion" runat="server" ControlToValidate="TxtCamion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Camión''</b> es necesario, por favor ingréselo." ValidationGroup="VGFlete"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCECamion" runat="server" HighlightCssClass="vco" TargetControlID="RFVCamion"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtCamion.ClientID.ToString()%>">Camión:</label>
</div>
<div class="form-group form-md-line-input input-iconright" id="DivColor" runat="server" visible="false">
<asp:TextBox ID="TxtColor" CssClass="form-control" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVColor" runat="server" ControlToValidate="TxtColor" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Color''</b> es necesario, por favor ingréselo." ValidationGroup="VGFlete"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEColor" runat="server" HighlightCssClass="vco" TargetControlID="RFVColor"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtColor.ClientID.ToString()%>">Color:</label>
</div>
<div class="form-group form-md-line-input input-iconright" id="DivPlaca" runat="server" visible="false">
<asp:TextBox ID="TxtPlaca" CssClass="form-control" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVPlaca" runat="server" ControlToValidate="TxtPlaca" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Placa''</b> es necesario, por favor ingréselo." ValidationGroup="VGFlete"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEPlaca" runat="server" HighlightCssClass="vco" TargetControlID="RFVPlaca"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtPlaca.ClientID.ToString()%>">Placa:</label>
</div>
<div class="form-group form-md-line-input input-iconright" id="DivKmInicio" runat="server" visible="false">
<asp:TextBox ID="TxtKmInicio" CssClass="form-control" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvKmInicio" runat="server" ControlToValidate="TxtKmInicio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Km. Inicio''</b> es necesario, por favor ingréselo." ValidationGroup="VGFlete"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoKmInicio" runat="server" HighlightCssClass="vco" TargetControlID="RfvKmInicio"></ajax:ValidatorCalloutExtender>
<ajax:FilteredTextBoxExtender ID="SoloNumeros1" runat="server" TargetControlID="TxtKmInicio" FilterType="Custom, Numbers" ValidChars="." />
<label for="<%= TxtKmInicio.ClientID.ToString()%>">Km. Inicio:</label>
</div>
<div class="form-group form-md-line-input input-iconright" id="DivKmFin" runat="server" visible="false">
<asp:TextBox ID="TxtKmFin" CssClass="form-control" runat="server"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="SoloNumeros2" runat="server" TargetControlID="TxtKmFin" FilterType="Custom, Numbers" ValidChars="." />
<label for="<%= TxtKmFin.ClientID.ToString()%>">Km. Fin:</label>
</div>
<div class="row" id="DivImporte" runat="server" visible="false">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtImporte" CssClass="form-control" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVImporte" runat="server" ControlToValidate="TxtImporte" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Importe''</b> es necesario, por favor ingréselo." ValidationGroup="VGFlete"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEImporte" runat="server" HighlightCssClass="vco" TargetControlID="RFVImporte"></ajax:ValidatorCalloutExtender>
<ajax:FilteredTextBoxExtender ID="SoloNumeros3" runat="server" TargetControlID="TxtImporte" FilterType="Custom, Numbers" ValidChars="." />
<label for="<%= TxtImporte.ClientID.ToString()%>">Importe:</label>
</div>
</div>
<div class="col-md-6" id="DivImporteCalcula" runat="server" visible="false">
<div class="form-group form-md-line-input input-iconright">
<label for="<%= ChkCalculaImporte.ClientID.ToString()%>">¿Calcular Atm.?</label>
<asp:CheckBox ID="ChkCalculaImporte" OnCheckedChanged="ChkCalculaImporte_CheckedChanged" AutoPostBack="true" runat="server" />
</div>
</div>
</div>
<div class="form-group form-md-line-input input-iconright" id="DivScat" runat="server" visible="false">
<asp:DropDownList ID="DdlScat" CssClass="form-control select2me " runat="server" AppendDataBoundItems="true" DataTextField="Scat" DataValueField="CveScat" Style="width: 100%"></asp:DropDownList>
<label for="<%= DdlTractor.ClientID.ToString()%>">Scat:</label>
</div>
<div class="form-group form-md-line-input input-iconright" id="DivConCruce" runat="server" visible="false">
<label for="<%= ChkConCruce.ClientID.ToString()%>">¿Con Cruce?</label>
<asp:CheckBox ID="ChkConCruce" runat="server" />
</div>
</div>
<div class="col-md-6" id="DivAdjunto" runat="server" visible="false">
<div class="row">
<div class="col-md-12">
<asp:TextBox ID="TxtModalAdjuntoArchivo" CssClass="ADSdropzone hidden" data-maxFile="1" runat="server"></asp:TextBox>
</div>
</div>
<br />
<div class="row">
<div class="col-md-12" align="center">
<asp:LinkButton ID="LnkDescargar" OnClick="LnkDescargar_Click" Visible="false" data-toggle="tooltip" data-placement="top" ToolTip="Descargar Adjunto" runat="server"><i class="fa fa-arrow-circle-down" style="color:green" aria-hidden="true"></i></asp:LinkButton>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnAddFlete" OnClick="BtnAddFlete_Click" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="VGFlete" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</div>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LnkDescargar" />
</Triggers>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

1013
CGame/Fletes.aspx.cs Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,295 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="GenerarOrdenCorte.aspx.cs" Inherits="CGame_GenerarOrdenCorte" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.modalBackground {
background-color: Black;
filter: alpha(opacity=90);
opacity: 0.8;
}
.modalPopup {
background-color: #FFFFFF;
padding-bottom: 10px;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Generar Orden de Corte
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" Text="Consultar" class="btn btn-primary" />
<a href="javascript:;" class="expand"></a>
</div>
<div class="titlefiltros caption">
<div class="row">
<label class="col-md-1 ">Folio:</label>
<div class="col-md-2">
<asp:TextBox ID="TxtFolio" runat="server" MaxLength="20"></asp:TextBox>
</div>
<label class="col-md-1 ">F. Entrega I.:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control" Text="01/09/2017" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<label class="col-md-1 ">F. Entrega F.:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control" Text="31/08/2018" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
<div class="portlet-body">
<div class="row">
<label class="col-md-1 ">Cliente:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlCliente" runat="server" AppendDataBoundItems="true" DataTextField="Cliente" DataValueField="CveCliente" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
</asp:DropDownList>
</div>
<label class="col-md-1 ">Tipo Empaque:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlTipoEmpaque" runat="server" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
<asp:ListItem Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Text="Cajas" Value="1"></asp:ListItem>
<asp:ListItem Text="Bins" Value="2"></asp:ListItem>
</asp:DropDownList>
</div>
<label class="col-md-1 ">Fruto:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlFruto" runat="server" DataValueField="CvePS" DataTextField="PS" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
</asp:DropDownList>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<asp:UpdatePanel runat="server" ID="UpAccion" class="portlet-body form" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-5" align="Left">
<b><asp:Label ID="LblCantTotal" runat="server" Text="Cantidad Total:"></asp:Label><asp:Label ID="LblTotalCantidad" ClientIDMode="Static" runat="server" Text="0.00"></asp:Label></b>
</div>
<div class="col-md-7" align="Left">
<asp:Button ID="BtnGenerarOC" OnClick="BtnGenerarOC_Click" runat="server" Text="Generar OC" CssClass="btn btn-primary" />
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvOrdenProduccionDetalle.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvOrdenProduccionDetalle.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:UpdatePanel ID="UpOrdenCorte" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvOrdenProduccionDetalle" OnRowDataBound="GvOrdenProduccionDetalle_RowDataBound" runat="server" GridLines="None" ShowHeaderWhenEmpty="true" CssClass="table table-hover table-striped SCrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False" data-heighterror="600"
DataKeyNames="CveOrdenProduccionDetalle,CveTipoEmpaque,CveTipoMaduracion,CveTipoProducto,Cantidad,CvePS,CveTamaño,CveTipoEtiqueta,CveCalidad,CveTipoCaja, Observaciones,PU,Instrucciones">
<Columns>
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:CheckBox ID="ChkOC" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="LblCantidad" runat="server" Text='<%# Eval("Restante")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:HyperLinkField HeaderText="Folio OP" DataTextField="Folio" DataNavigateUrlFields="CveOrdenProduccion" DataNavigateUrlFormatString="/CGame/OrdenProduccion.aspx?CveOrdenProduccion={0}" Target="_blank" ItemStyle-HorizontalAlign="Center" />
<asp:TemplateField HeaderText="Fruto" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblPS" runat="server" Text='<%# Eval("PS")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo Producción" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoProducto" runat="server" Text='<%# Eval("TipoProducto")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Variedad" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoMaduracion" runat="server" Text='<%# Eval("TipoMaduracion")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo Empaque" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoEmpaque" runat="server" Text='<%# Eval("TipoEmpaque")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tamaño" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTamaño" runat="server" Text='<%# Eval("Tamaño")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="PLU" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoEtiqueta" runat="server" Text='<%# Eval("CveTipoEtiqueta")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Calidad" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblCalidad" runat="server" Text='<%# Eval("Calidad")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Etiqueta" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoCaja" runat="server" Text='<%# Eval("TipoCaja")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Desglosar">
<ItemTemplate>
<asp:TextBox ID="TxtCantDividir" Width="60px" runat="server" />
<ajax:FilteredTextBoxExtender ID="SoloNumeros" runat="server" TargetControlID="TxtCantDividir" FilterType="Custom, Numbers" ValidChars="." />
<asp:LinkButton data-toggle="tooltip" data-placement="top" ToolTip="Aplicar Desglose" runat="server" ID="BtnDividir" Text="<i class='fa fa-check' style='color:green'></i>" OnClick="Dividir" Style="display: none;" CssClass="btn btn-default btn-circle btn-xs" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:HiddenField runat="server" ClientIDMode="Static" ID="HdnCantidad" />
</ContentTemplate>
</asp:UpdatePanel>
<div id="DivModalOC" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpOCAdd" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Literal ID="ltlTipotitulo" Text="Generar Orden de Corte" runat="server"> </asp:Literal></h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-2" style="text-align: left">Fecha:</div>
<div class="col-md-3">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 80% !important; padding: 0px;">
<asp:TextBox ID="TxtFechaCorte" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFechaCorte" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaCorte" runat="server" TargetControlID="TxtFechaCorte" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaCorte" TargetControlID="TxtFechaCorte" PopupButtonID="ImgFechaCorte" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CvFechaCorte" runat="server" ControlToValidate="TxtFechaCorte" Display="None" Operator="DataTypeCheck" Type="Date" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Corte''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)."></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VcoFechaCorte" runat="server" Enabled="True" HighlightCssClass="vco" TargetControlID="CvFechaCorte" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlHuerta" DataValueField="CveHuerta" DataTextField="Huerta" runat="server" CssClass="form-control select2me" AppendDataBoundItems="true" Width="50%"></asp:DropDownList>
<label for="<%= DdlHuerta.ClientID.ToString()%>">Huerta:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCuadro" CssClass="form-control" CausesValidation="true" runat="server" />
<asp:RequiredFieldValidator ID="RFVCuadro" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtCuadro" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuadro''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddOC"></asp:RequiredFieldValidator>
<ajax:FilteredTextBoxExtender ID="SoloNumeros3" runat="server" TargetControlID="TxtCuadro" FilterType="Custom, Numbers" ValidChars="." />
<label for="<%= TxtCuadro.ClientID.ToString()%>">Cuadro:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtPeso" CssClass="form-control" CausesValidation="true" runat="server" />
<asp:RequiredFieldValidator ID="RFVPeso" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtPeso" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Peso (TON)''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddOC"></asp:RequiredFieldValidator>
<ajax:FilteredTextBoxExtender ID="SoloNumeros2" runat="server" TargetControlID="TxtPeso" FilterType="Custom, Numbers" ValidChars="." />
<label for="<%= TxtPeso.ClientID.ToString()%>">Peso (Kg):</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<label for="<%= TxtObservacion.ClientID.ToString()%>">Observaciones:</label>
<br />
<asp:TextBox ID="TxtObservacion" runat="server" Height="50" Width="860px" TextMode="MultiLine" CausesValidation="true" MaxLength="500"></asp:TextBox>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnOrdenCorteAdd" OnClick="BtnOrdenCorteAdd_Click" CssClass="btn btn-primary" runat="server" Text="Guardar" ValidationGroup="GrpAddOC" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<!-- ModalPopupExtender -->
<asp:Button ID="BtnMostrarPanel" runat="server" Style="visibility: hidden; display: none;" />
<asp:Button ID="BtnCerrarPanel" runat="server" CssClass="btn btn-danger" Style="visibility: hidden; display: none;" />
<ajax:ModalPopupExtender ID="MPTipoOC" runat="server" PopupControlID="PanelTipoOC" TargetControlID="BtnMostrarPanel"
CancelControlID="BtnCerrarPanel" BackgroundCssClass="modalBackground">
</ajax:ModalPopupExtender>
<asp:Panel ID="PanelTipoOC" runat="server" CssClass="modalPopup" align="center" Style="display: none; padding: 10px;">
<asp:UpdatePanel ID="UpTipoOC" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div id="DivTipoOC" runat="server">
<p>
Tipo de Orden de Corte:
</p>
<asp:RadioButtonList ID="RblTipoOC" runat="server" CssClass="rbl" RepeatDirection="Vertical" RepeatLayout="Table">
<asp:ListItem Text="Normal" Value="1"></asp:ListItem>
<asp:ListItem Text="Extraordinaria" Value="2"></asp:ListItem>
</asp:RadioButtonList>
<asp:LinkButton ID="BtnTipoOC" OnClick="BtnTipoOC_Click" runat="server" CssClass="btn btn-success" Text="Aceptar" />
&nbsp;
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript">
function recorreGrilla() {
var table = document.getElementById("C_GvOrdenProduccionDetalle");
var totalLineas = table.rows.length - 1
var total = 0;
for (var r = 2; r <= totalLineas; r++) {
if (table.rows[r].cells[0].getElementsByTagName('span')[0].getElementsByTagName('input')[0].checked == true) {
total += ToDouble(table.rows[r].cells[1].innerText);
}
}
$("#LblTotalCantidad")[0].innerHTML = FormatoNumero(total);
}
function Dividir(t) {
$get("HdnCantidad").value = $get(t).value;
}
function LimitaCantidad(C, textbox, button) {
if (ToDouble(textbox.value) >= C) {
textbox.value = "";
}
if (parseFloat(textbox.value) > 0) {
$get(button).style.display = "";
}
else {
$get(button).style.display = "none";
}
}
</script>
</asp:Content>

View File

@@ -0,0 +1,492 @@
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 System.Text;
using DocumentFormat.OpenXml.Spreadsheet;
using System.Web.UI;
public partial class CGame_GenerarOrdenCorte : ClsPaginas
{
#region PROPIEDADES
private DataTable DtResultado
{
get { return DtResultado = (DataTable)ViewState["DtResultado"]; }
set { ViewState["DtResultado"] = value; }
}
private string Folio
{
get { return (ViewState["Folio"] == null) ? "" : (ViewState["Folio"]).ToString(); }
set { ViewState["Folio"] = value; }
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
CargaHuerta();
CargaCliente();
CargaPS();
LimpiaModal();
CargaOrdenProduccionDetalle();
MostrarPanel(true);
}
}
#region CARGAS
protected void CargaHuerta()
{
ClsCGame ObjCort = new ClsCGame();
if (ObjCort.GetHuerta(UsuarioActual.CveEmpresa))
{
DdlHuerta.DataSource = ObjCort.DtResultados;
DdlHuerta.Items.Insert(0, new ListItem("Seleccione", "-1"));
}
ObjCort.Dispose();
UpOCAdd.Update();
DdlHuerta.DataBind();
}
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"));
}
ObjCGame.Dispose();
DdlCliente.DataBind();
UPFiltros.Update();
}
protected void CargaPS()
{
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetPS(UsuarioActual.CveEmpresa, Estatus: 1))
{
DdlFruto.DataSource = ObjCGame.DtResultados;
DdlFruto.Items.Insert(0, new ListItem("Todos", "-1"));
}
ObjCGame.Dispose();
DdlFruto.DataBind();
UPFiltros.Update();
}
protected void CargaOrdenProduccionDetalle()
{
var Folio = "-1";
if (TxtFolio.Text != "") { Folio = TxtFolio.Text; }
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetGenerarOrdenCorte(-1, UsuarioActual.CveEmpresa, txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), DdlCliente.SelectedValue.ToEntero(), DdlTipoEmpaque.SelectedValue.ToEntero(), DdlFruto.SelectedValue.ToEntero(), Folio))
{
GvOrdenProduccionDetalle.DataSource = ObjCGame.DtResultados.FiltraParametros("Restante > 0 OR CveOrdenProduccionDetalle IS NULL");
DtResultado = ObjCGame.DtResultados.FiltraParametros("Restante > 0 OR CveOrdenProduccionDetalle IS NULL");
DtResultado.Columns.Add("Seleccion");
ObjCGame.Dispose();
}
GvOrdenProduccionDetalle.DataBind();
UpOrdenCorte.Update();
}
#endregion
#region LIMPIAS
protected void LimpiaModal()
{
TxtFechaCorte.Text = DateTime.Now.ToShortDateString();
DdlHuerta.SelectedIndex = 0;
TxtCuadro.Text = "";
TxtPeso.Text = "";
TxtObservacion.Text = "";
UpOCAdd.Update();
}
#endregion
#region BOTONES
protected void BtnGenerarOC_Click(object sender, EventArgs e)
{
GeneraOC();
}
private void GeneraOC()
{
var SiSelecciono = false;
foreach (GridViewRow GvRow in GvOrdenProduccionDetalle.Rows)
{
if (GvRow.FCCheckBox("ChkOC").Checked == true)
{
SiSelecciono = true;
}
}
if (SiSelecciono || RblTipoOC.SelectedValue.ToEntero()==2)
{
this.RegistraScript("recorreGrilla();", "recorre");
this.RegistraScript("$('#DivModalOC').modal();");
LimpiaModal();
UpAccion.Update();
}
else
{
Alert("Tiene que seleccionar al menos un producto.", TipoMensaje.MsgAdvertencia);
}
}
protected void BtnOrdenCorteAdd_Click(object sender, EventArgs e)
{
if (DdlHuerta.SelectedValue == "-1")
{
Alert("Tiene que seleccionar una huerta.", TipoMensaje.MsgAdvertencia);
return;
}
ClsCGame ObjCGame = new ClsCGame();
ObjCGame.IniciaTransacSQL();
var Error = false;
var CveOrdenCorte = 0;
if (ObjCGame.AddOrdenCorte(DdlHuerta.SelectedValue.ToEntero(), "", TxtFechaCorte.Text.ToDate(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtPeso.Text.ToDouble(), TxtCuadro.Text.ToEntero(), TxtObservacion.Text))
{
CveOrdenCorte = ObjCGame.CveOrdenCorte;
}
else
{
Error = true;
}
foreach (GridViewRow GvRow in GvOrdenProduccionDetalle.Rows)
{
if (GvRow.FCCheckBox("ChkOC").Checked == true)
{
if (ObjCGame.AddOrdenCorteDetalle(GvRow.FCLabel("LblCantidad").Text.ToEntero(), CveOrdenCorte, GvRow.DataKey("CveOrdenProduccionDetalle").ToEntero()) == false)
{
Error = true;
}
}
}
if (!Error)
{
if (ObjCGame.GetOrdenCorte(UsuarioActual.CveEmpresa, CveOrdenCorte: CveOrdenCorte))
{
Folio = ObjCGame.DtResultados.Rows[0]["FolioOC"].ToString();
}
ObjCGame.Commit();
EnviarCorreo(CveOrdenCorte);
Alert("Se genero la orden de corte correctamente con el folio <b>" + Folio + "</b>.", TipoMensaje.MsgInformacion);
this.RegistraScript("$('#DivModalOC').modal('hide');");
CargaOrdenProduccionDetalle();
this.RegistraScript("recorreGrilla();", "recorre");
}
else
{
ObjCGame.RollBack();
}
ObjCGame.Dispose();
}
#endregion
#region GRIDVIEW
protected void GvOrdenProduccionDetalle_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.RowIndex == 0)
{
e.Row.CssClass = "Totales";
e.Row.FCLabel("LblCantidad").Text = e.Row.DBCampo("Restante");
e.Row.Cells[0].Text = "";
e.Row.Cells[8].Text = "";
e.Row.Cells[11].Text = "";
}
else
{
e.Row.FCCheckBox("ChkOC").Attributes.Add("onchange", "recorreGrilla();");
e.Row.FCLinkButton("BtnDividir").Attributes.Add("onclick", String.Format("Dividir('{0}');", e.Row.FCTextBox("TxtCantDividir").ClientID));
e.Row.FCLinkButton("BtnDividir").CommandArgument = e.Row.RowIndex.ToString();
e.Row.FCTextBox("TxtCantDividir").Attributes.Add("onkeyup", String.Format("LimitaCantidad({0},this,'{1}');", e.Row.DBCampo("Restante"), e.Row.FCLinkButton("BtnDividir").ClientID));
if (e.Row.DataKey("CveTipoEtiqueta").ToEntero() == 1)
{
e.Row.FCLabel("LblTipoEtiqueta").Text = "Si";
}
else
{
e.Row.FCLabel("LblTipoEtiqueta").Text = "No";
}
}
}
}
#endregion
#region DIVIDIR
protected void Dividir(object sender, EventArgs e)
{
int Index = ((LinkButton)sender).CommandArgument.ToString().ToEntero();
int Cantidad = HdnCantidad.Value.ToEntero();
foreach (GridViewRow GvRow in GvOrdenProduccionDetalle.Rows)
{
if (GvRow.FCCheckBox("ChkOC").Checked == true)
{
DtResultado.Rows[GvRow.RowIndex]["Seleccion"] = 1;
}
else
{
DtResultado.Rows[GvRow.RowIndex]["Seleccion"] = 0;
}
}
DataRow Dr = DtResultado.Rows[Index];
DataRow DrNew = DtResultado.NewRow();
DrNew.ItemArray = Dr.ItemArray;
Dr["Restante"] = (Dr["Restante"].ToString().ToEntero() - Cantidad);
DrNew["Restante"] = Cantidad;
DrNew["Seleccion"] = 0;
DtResultado.Rows.InsertAt(DrNew, Index);
DtResultado.AcceptChanges();
GvOrdenProduccionDetalle.DataSource = DtResultado;
GvOrdenProduccionDetalle.DataBind();
foreach (GridViewRow GvRow in GvOrdenProduccionDetalle.Rows)
{
if (DtResultado.Rows[GvRow.RowIndex]["Seleccion"].ToEntero() == 1)
{
GvRow.FCCheckBox("ChkOC").Checked = true;
}
}
this.RegistraScript("recorreGrilla();");
}
#endregion
#region CORREO
private void MandaCorreo(String Para, String Asunto, String Body)
{
ClsSisMail Mail = new ClsSisMail();
Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body);
}
private string GeneraBody(int CveOrdenCorte)
{
ClsCGame ObjCGame = new ClsCGame();
ObjCGame.GetOrdenCorte(UsuarioActual.CveEmpresa, CveOrdenCorte: CveOrdenCorte);
StringBuilder strBody = new StringBuilder();
strBody.Append("<html xmlns=\"http://www.w3.org/1999/xhtml \"> ");
strBody.Append("<head> ");
strBody.Append(" <style type='text/css'> ");
strBody.Append(" body ");
strBody.Append(" { ");
strBody.Append(" margin:0px; ");
strBody.Append(" padding:0px 0px 0px 0px; ");
strBody.Append(" font-family: Verdana, Arial, Helvetica, sans-serif; ");
strBody.Append(" font-size: 10px; ");
strBody.Append(" background-color:#F0F0F0; ");
strBody.Append(" } ");
strBody.Append(" a.Texto ");
strBody.Append(" { ");
strBody.Append(" font-size:11px; ");
strBody.Append(" background-color:#F7F6F3; ");
strBody.Append(" text-decoration:none; ");
strBody.Append(" font-weight:bold; ");
strBody.Append(" } ");
strBody.Append(" .Texto ");
strBody.Append(" { ");
strBody.Append(" background-color:#F7F6F3; color:Black; font-family:Verdana; font-size:10px; text-align:center; vertical-align:middle; height:20px;");
strBody.Append(" } ");
strBody.Append(" .TextoAlterno ");
strBody.Append(" { ");
strBody.Append(" background-color:White; color:Black; font-family:Verdana; font-size:10px; text-align:center; ");
strBody.Append(" vertical-align:middle; height:20px;");
strBody.Append(" } ");
strBody.Append(" .BarraIdentidad ");
strBody.Append(" { ");
strBody.Append(" color:#FFFFFF; ");
strBody.Append(" background:#F0F0F0; ");
strBody.Append(" font-weight:bold; ");
strBody.Append(" font-size:19px; ");
strBody.Append(" font-style:oblique; ");
strBody.Append(" } ");
strBody.Append(" .Titulos ");
strBody.Append(" { ");
strBody.Append(" background-color: Gray;");
strBody.Append(" color:White; ");
strBody.Append(" font-family:Verdana; font-size:12px; text-align:center; ");
strBody.Append(" vertical-align:middle; font-weight:bold; height:30px; ");
strBody.Append(" text-decoration:none; ");
strBody.Append(" } ");
strBody.Append(" .Contenido2 ");
strBody.Append(" { ");
strBody.Append(" background-color: White;");
strBody.Append(" font-family:Verdana; font-size:12px; text-align:center; ");
strBody.Append(" vertical-align:middle; font-weight:bold; height:30px; ");
strBody.Append(" text-decoration:none; ");
strBody.Append(" } ");
strBody.Append(" .Verde {color: #00CC00;} ");
strBody.Append(" .Negro {color: #000000;} ");
strBody.Append(" .Rojo {color: #FF0000;} ");
strBody.Append(" </style> ");
strBody.Append("</head> ");
strBody.Append("<body> ");
strBody.Append("<div class='Contenido2' style='display: table!important'>");
strBody.AppendFormat(" <div id=\"C_divOC\" style=\"width: 550px\"> <fieldset> <legend><b>Datos {0}</b></legend> ", "de la orden de corte");
strBody.Append(" <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"> ");
strBody.Append(" <tr style=\"height: 22px\"> ");
strBody.AppendFormat(" <td style=\"width: 90px\"> Folio OC:</td><td colspan=\"3\"><a href=" + UrlSitio + "CGame/RepOrdenCorteDetalle.aspx?CveOrdenCorte=" + CveOrdenCorte.ToString() + "><b>" + ObjCGame.DtResultados.Rows[0]["FolioOC"].ToString() + "</b><a/></td> ");
strBody.AppendFormat(" <td style=\"width: 90px\"> F. Termino:</td><td colspan=\"3\"><b>{0}</b></td> ", ObjCGame.DtResultados.Rows[0]["FechaEntregaOC"].ToString().ToDate().ToShortDateString());
strBody.Append(" </tr> ");
strBody.Append(" <tr style=\"height: 22px\"> ");
strBody.AppendFormat(" <td>Huerta:</td><td><b>{0}</b></td><td>&nbsp;</td><td><b>&nbsp;</b></td> ", ObjCGame.DtResultados.Rows[0]["Huerta"]);
strBody.Append(" </tr> ");
strBody.Append(" <tr style=\"height: 22px\"> ");
strBody.AppendFormat(" <td>Cuadro:</td><td><b>{0}</b></td><td>&nbsp;</td><td><b>&nbsp;</b></td> ", ObjCGame.DtResultados.Rows[0]["Cuadro"]);
strBody.Append(" </tr> ");
strBody.Append(" <tr style=\"height: 22px\"> ");
strBody.AppendFormat(" <td>Peso (TON):</td><td><b>{0}</b></td><td>&nbsp;</td><td><b>&nbsp;</b></td> ", ObjCGame.DtResultados.Rows[0]["Peso"]);
strBody.Append(" </tr> ");
strBody.Append(" <tr style=\"height: 22px\"> ");
strBody.AppendFormat(" <td>Observaciones:</td><td><b>{0}</b></td><td>&nbsp;</td><td><b>&nbsp;</b></td> ", ObjCGame.DtResultados.Rows[0]["ObservacionesOC"]);
strBody.Append(" </tr> ");
strBody.Append(" <tr style=\"height: 22px\"> ");
strBody.AppendFormat(" <td>Solicita:</td><td><b>{0}</b></td><td>&nbsp;</td><td><b>&nbsp;</b></td> ", UsuarioActual.Nombre);
strBody.Append(" </tr> ");
strBody.Append(" </table> ");
strBody.Append(" </fieldset> ");
strBody.Append(" </div> ");
strBody.Append(" <div style='width: 550px'> ");
strBody.Append(" <fieldset> ");
strBody.Append(" <legend>Instrucciones del corte</legend> ");
strBody.Append(" <table width=\"1000px\"> <tr style='background-color:gray;color:White;font-family:Verdana;font-size:10px;text-align:center;vertical-align:middle;font-weight:bold;height:20px;text-decoration:none;'><th scope='col' style='width: 150px'>Folio OP</th><th scope='col' style='width: 50px'>Cantidad</th><th scope='col' style='width: 150px'>Fruto</th><th scope='col' style='width: 150px'>Tipo Producción</th><th scope='col' style='width: 150px'>Variedad</th><th scope='col' style='width: 150px'>Tipo Empaque</th><th scope='col' style='width: 150px'>Tamaño</th><th scope='col' style='width: 150px'>PLU</th><th scope='col' style='width: 150px'>Calidad</th><th scope='col' style='width: 150px'>Etiqueta</th><th scope='col' style='width: 150px'>Instrucciones</th><th scope='col' style='width: 150px'>Observaciones</th>");
strBody.Append(" </tr>");
DataTable DtOrdenCorteDetalle = new DataTable();
if (ObjCGame.GetOrdenCorteDetalle(UsuarioActual.CveEmpresa, CveOrdenCorte: CveOrdenCorte))
{
foreach (DataRow dr in ObjCGame.DtResultados.Rows)
{
var TipoEtiqueta = "";
if (Convert.ToBoolean(dr["CveTipoEtiqueta"]))
{
TipoEtiqueta = "Si";
}
else
{
TipoEtiqueta = "No";
}
strBody.AppendFormat("<tr class='Texto'><td align='center' style='width:100px;'>{0}</td><td align='center' style='width:50px;'>{1}</td><td align='left' style='width:100px;'>{2}</td><td align='left' style='width:100px;'>{3}</td><td align='left' style='width:100px;'>{4}</td><td align='left' style='width:100px;'>{5}</td><td align='left' style='width:100px;'>{6}</td><td align='left' style='width:100px;'>{7}</td><td align='left' style='width:100px;'>{8}</td><td align='left' style='width:100px;'>{9}</td><td align='left' style='width:100px;'>{10}</td><td align='left' style='width:100px;'>{11}</td></tr>", "<a href=" + UrlSitio + "CGame/OrdenProduccion.aspx?CveOrdenProduccion=" + dr["CveOrdenProduccion"].ToString() + ">" + dr["FolioOP"].ToString() + "<a/>", dr["Cantidad"].ToString().FormatoNumero(0), dr["PS"], dr["TipoProducto"], dr["TipoMaduracion"], dr["TipoEmpaque"], dr["Tamaño"], TipoEtiqueta, dr["Calidad"], dr["TipoCaja"], dr["Instrucciones"], dr["Observaciones"]);
}
}
strBody.Append(" </table> ");
strBody.Append(" </fieldset> ");
strBody.Append(" </div> ");
strBody.Append(" <br> ");
strBody.AppendFormat("<a href={0}CGame/RepOrdenCorteDetalle.aspx?CveOrdenCorte={1}> Ir a la Orden de Corte <a/>", UrlSitio, CveOrdenCorte);
strBody.Append("</div>");
strBody.Append("</body></html>");
ObjCGame.Dispose();
return strBody.ToString();
}
private void EnviarCorreo(int CveOrdenCorte)
{
var Asunto = "SIG - Se Genero una Orden de Corte con el folio:" + Folio;
//var Para = "julian@adsistemas.mx";
//var Para = "dany_pimi@hotmail.com";
var Para = "norberto@citrusgame.com.mx;";
var Body = GeneraBody(CveOrdenCorte);
try
{
var Hilo = new System.Threading.Thread(() => MandaCorreo(Para, Asunto, Body));
Hilo.Start();
}
catch (Exception ex)
{
Alert("Ocurrio un error al mandar el mail " + ex);
}
}
#endregion
#region TIPO DE OC
private void PresionarBotonModal(String Boton)
{
try
{
String script = $"document.getElementById(\"{Boton}\").click();";
System.Web.UI.Page Pag = (System.Web.UI.Page)(System.Web.HttpContext.Current.Handler);
ScriptManager.RegisterStartupScript(Pag, Pag.GetType(), Boton, script, true);
Pag = null;
}
catch (Exception ex)
{
throw;
}
}
protected void BtnTipoOC_Click(object sender, EventArgs e)
{
if (RblTipoOC.SelectedValue.ToEntero() ==0)
{
//Alert("Tiene que seleccionar un tipo de OC",TipoMensaje.MsgAdvertencia);
return;
}
PresionarBotonModal("C_BtnCerrarPanel");
if (RblTipoOC.SelectedValue.ToEntero() == 2)
{
GvOrdenProduccionDetalle.Visible = false;
LblCantTotal.Visible = false;
LblTotalCantidad.Visible = false;
UpAccion.Update();
UpOrdenCorte.Update();
GeneraOC();
}
}
private void MostrarPanel(Boolean AfterPageLoad = false)
{
if (AfterPageLoad)
{
RegistraScript("window.onload = function MuestraPanel() { document.getElementById(\"C_BtnMostrarPanel\").click(); }");
}
}
#endregion
protected void BtnConsultar_Click(object sender, EventArgs e)
{
CargaOrdenProduccionDetalle();
}
}

433
CGame/Liquidacion.aspx Normal file
View File

@@ -0,0 +1,433 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Liquidacion.aspx.cs" Inherits="CGame_Liquidacion" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Liquidación
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
<li>
<asp:LinkButton ID="LnkPdf" OnClick="LnkPdf_Click" runat="server"> <i class="fa fa-ad-pdf"></i> Generar Liquidación</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LnkExcel" OnClick="LnkExcel_Click" runat="server"><i class="fa fa-ad-excel"></i> Generar Liquidación</asp:LinkButton>
</li>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" Text="Consultar" class="btn btn-primary" ValidationGroup="Valida" />
<a href="javascript:;" class="expand"></a>
</div>
<div class="titlefiltros caption">
<div class="row">
<label class="col-md-1 ">Huerta:</label>
<div class="col-md-3">
<asp:DropDownList ID="DdlHuerta" runat="server" AppendDataBoundItems="true" DataTextField="Huerta" DataValueField="CveHuerta" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVHuerta" runat="server" ControlToValidate="DdlHuerta" Display="None" InitialValue="-1" ErrorMessage="El campo <b>''Huerta''</b> es requerido por la aplicación, por favor ingrese una huerta." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEHuerta" runat="server" HighlightCssClass="vco" TargetControlID="RFVHuerta" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<label class="col-md-1 ">Fecha Inicial:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control" Text="01/09/2017" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<label class="col-md-1 ">Fecha Final:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control" Text="31/08/2018" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
<div class="portlet-body">
<div class="row">
<label class="col-md-1 ">Comisión Citrus:</label>
<div class="col-md-2">
<asp:TextBox ID="TxtComisionCitrus" CssClass="form-control" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVComisionCitrus" runat="server" ControlToValidate="TxtComisionCitrus" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Comisión Citrus''</b> es necesario, por favor ingréselo." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEComisionCitrus" runat="server" HighlightCssClass="vco" TargetControlID="RFVComisionCitrus"></ajax:ValidatorCalloutExtender>
<ajax:FilteredTextBoxExtender ID="SoloNumeros2" runat="server" TargetControlID="TxtComisionCitrus" FilterType="Custom, Numbers" ValidChars="." />
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatosGenerales" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-4"></div>
<div class="col-md-2" align="center">
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding-top px;">
<div class="display" style="margin-bottom: 0px">
<div class="number">
<h4 class="font-black-haze">
<span data-counter="counterup" data-value="1349">
<b>
<asp:Label runat="server" Text="0" ID="LblPesoNeto"></asp:Label>Kg.</span></b>
</h4>
<small>Peso Neto</small>
</div>
</div>
</div>
</div>
<div class="col-md-2" align="center">
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding-top px;">
<div class="display" style="margin-bottom: 0px">
<div class="number">
<h4 class="font-black-haze">
<span data-counter="counterup" data-value="1349">
<b>
<asp:HyperLink ID="HplNumCortes" runat="server" Target="_blank"></asp:HyperLink></span></b>
</h4>
<small>Cortes</small>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="portlet light smmallpadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">PRIMERA</span>
</div>
<div class="tools">
<a href="javascript;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body form">
<div class="row">
<div class="col-md-6">
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding-top px;">
<div class="display" style="margin-bottom: 0px">
<div class="number">
<h4 class="font-black-haze">
<span data-counter="counterup" data-value="1349">
<b>
<asp:Label runat="server" Text="0" ID="LblPrimera"></asp:Label>Kg.</span></b>
</h4>
<small>Primera</small>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding-top px;">
<div class="display" style="margin-bottom: 0px">
<div class="number">
<h4 class="font-black-haze">
<span data-counter="counterup" data-value="1349">
<b>
<asp:Label runat="server" ID="LblPorcentajePrimera" Text=""></asp:Label>%</span></b>
</h4>
<small>%Primera</small>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<label class="col-md-2">
<b>Cantidad:</b>
</label>
<asp:Label CssClass="md-col-3" ID="LblCantidadPrimera" runat="server"></asp:Label>
</div>
<div class="row">
<label class="col-md-2">
<b>Peso:</b>
</label>
<asp:Label CssClass="md-col-3" ID="LblPesoPrimera" runat="server"></asp:Label>
</div>
<div class="row">
<label class="col-md-2">
<b>Importe:</b>
</label>
<asp:Label CssClass="md-col-3" ID="LblImportePrimera" runat="server"></asp:Label>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="portlet light smmallpadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">SEGUNDA</span>
</div>
<div class="tools">
<a href="javascript;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body form">
<div class="row">
<div class="col-md-6">
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding-top px;">
<div class="display" style="margin-bottom: 0px">
<div class="number">
<h4 class="font-black-haze">
<span data-counter="counterup" data-value="1349">
<b>
<asp:Label runat="server" Text="0" ID="LblSegunda"></asp:Label>Kg.</span></b>
</h4>
<small>Segunda</small>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding-top px;">
<div class="display" style="margin-bottom: 0px">
<div class="number">
<h4 class="font-black-haze">
<span data-counter="counterup" data-value="1349">
<b>
<asp:Label runat="server" ID="LblPorcentajeSegunda" Text=""></asp:Label>%</span></b>
</h4>
<small>%Segunda</small>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<label class="col-md-2">
<b>Cantidad:</b>
</label>
<asp:Label CssClass="md-col-3" ID="LblCantidadSegunda" runat="server"></asp:Label>
</div>
<div class="row">
<label class="col-md-2">
<b>Peso:</b>
</label>
<asp:Label CssClass="md-col-3" ID="LblPesoSegunda" runat="server"></asp:Label>
</div>
<div class="row">
<label class="col-md-2">
<b>Importe:</b>
</label>
<asp:Label CssClass="md-col-3" ID="LblImporteSegunda" runat="server"></asp:Label>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="portlet light smmallpadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">JUGO</span>
</div>
<div class="tools">
<a href="javascript;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body form">
<div class="row">
<div class="col-md-6">
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding-top px;">
<div class="display" style="margin-bottom: 0px">
<div class="number">
<h4 class="font-black-haze">
<span data-counter="counterup" data-value="1349">
<b>
<asp:Label runat="server" Text="0" ID="LblJugo"></asp:Label>Kg.</span></b>
</h4>
<small>Jugo</small>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding-top px;">
<div class="display" style="margin-bottom: 0px">
<div class="number">
<h4 class="font-black-haze">
<span data-counter="counterup" data-value="1349">
<b>
<asp:Label runat="server" ID="LblPorcentajeJugo" Text=""></asp:Label>%</span></b>
</h4>
<small>%Jugo</small>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<label class="col-md-2">
<b>Bins:</b>
</label>
<asp:Label CssClass="md-col-3" ID="LblCantidadJugo" runat="server"></asp:Label>
</div>
<div class="row">
<label class="col-md-2">
<b>Peso:</b>
</label>
<asp:Label CssClass="md-col-3" ID="LblPesoJugo" runat="server"></asp:Label>
</div>
<div class="row">
<label class="col-md-2">
<b>Importe:</b>
</label>
<asp:Label CssClass="md-col-3" ID="LblImporteJugo" runat="server"></asp:Label>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="portlet light smmallpadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">MERMA</span>
</div>
<div class="tools">
<a href="javascript;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body form">
<div class="row">
<div class="col-md-6">
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding-top px;">
<div class="display" style="margin-bottom: 0px">
<div class="number">
<h4 class="font-black-haze">
<span data-counter="counterup" data-value="1349">
<b>
<asp:Label runat="server" Text="0" ID="LblMerma"></asp:Label>Kg.</span></b>
</h4>
<small>Merma</small>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding-top px;">
<div class="display" style="margin-bottom: 0px">
<div class="number">
<h4 class="font-black-haze">
<span data-counter="counterup" data-value="1349">
<b>
<asp:Label runat="server" ID="LblPorcentajeMerma" Text=""></asp:Label>%</span></b>
</h4>
<small>%Merma</small>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div class="row">
<div class="col-md-6">
<div class="portlet light smmallpadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">GASTOS</span>
</div>
<div class="tools">
<a href="javascript;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body form">
<asp:UpdatePanel ID="UpGastos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvGastos" runat="server" GridLines="None" OnRowDataBound="GvGastos_RowDataBound" ShowHeaderWhenEmpty="true" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False">
<Columns>
<asp:BoundField DataField="Concepto" HeaderText="Concepto" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Importe" HeaderText="Importe" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
<div class="col-md-6">
<div class="portlet light smmallpadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">UTILIDAD</span>
</div>
<div class="tools">
<a href="javascript;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body form">
<asp:UpdatePanel ID="UpUtilidad" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<label class="col-md-2">
<b>Ingresos:</b>
</label>
<asp:HyperLink CssClass="md-col-3" ID="HlIngresos" runat="server"></asp:HyperLink>
</div>
<div class="row">
<label class="col-md-2">
<b>Costos:</b>
</label>
<asp:Label CssClass="md-col-3" ID="LblCostos" runat="server"></asp:Label>
</div>
<div class="row">
<label class="col-md-2">
<b>Retorno:</b>
</label>
<asp:Label CssClass="md-col-3" ID="LblRetorno" runat="server"></asp:Label>
</div>
<div class="row">
<label class="col-md-2">
<b>Precio en el árbol:</b>
</label>
<asp:Label CssClass="md-col-3" ID="LblPrecioArbol" runat="server"></asp:Label>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

445
CGame/Liquidacion.aspx.cs Normal file
View File

@@ -0,0 +1,445 @@
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_Liquidacion : ClsPaginas
{
#region PROPIEDADES
private DataTable DtIngresos
{
get { return DtIngresos = (DataTable)ViewState["DtIngresos"]; }
set { ViewState["DtIngresos"] = value; }
}
private DataTable DtEmpaque
{
get { return DtEmpaque = (DataTable)ViewState["DtEmpaque"]; }
set { ViewState["DtEmpaque"] = value; }
}
private DataTable DtGastosTotales
{
get { return DtGastosTotales = (DataTable)ViewState["DtGastosTotales"]; }
set { ViewState["DtGastosTotales"] = value; }
}
private DataTable DtPreEnfriado
{
get { return DtPreEnfriado = (DataTable)ViewState["DtPreEnfriado"]; }
set { ViewState["DtPreEnfriado"] = value; }
}
private DataTable DtCorte
{
get { return DtCorte = (DataTable)ViewState["DtCorte"]; }
set { ViewState["DtCorte"] = value; }
}
private DataTable DtCorte2
{
get { return DtCorte2 = (DataTable)ViewState["DtCorte2"]; }
set { ViewState["DtCorte2"] = value; }
}
private DataTable DtFleteHuertaEmpaque
{
get { return DtFleteHuertaEmpaque = (DataTable)ViewState["DtFleteHuertaEmpaque"]; }
set { ViewState["DtFleteHuertaEmpaque"] = value; }
}
private DataTable DtFleteEmpaqueUSA
{
get { return DtFleteEmpaqueUSA = (DataTable)ViewState["DtFleteEmpaqueUSA"]; }
set { ViewState["DtFleteEmpaqueUSA"] = value; }
}
private DataTable DtOtrosGastos
{
get { return DtOtrosGastos = (DataTable)ViewState["DtOtrosGastos"]; }
set { ViewState["DtOtrosGastos"] = value; }
}
private DataTable DtOtrosGastosAgrupados
{
get { return DtOtrosGastosAgrupados = (DataTable)ViewState["DtOtrosGastosAgrupados"]; }
set { ViewState["DtOtrosGastosAgrupados"] = value; }
}
private DataTable DtMateriales
{
get { return DtMateriales = (DataTable)ViewState["DtMateriales"]; }
set { ViewState["DtMateriales"] = value; }
}
private DataTable DtMaterialesAgrupados
{
get { return DtMaterialesAgrupados = (DataTable)ViewState["DtMaterialesAgrupados"]; }
set { ViewState["DtMaterialesAgrupados"] = value; }
}
private DataTable DtIngresosAgrupados
{
get { return DtIngresosAgrupados = (DataTable)ViewState["DtIngresosAgrupados"]; }
set { ViewState["DtIngresosAgrupados"] = value; }
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
InicializaValores();
}
}
protected void BtnConsultar_Click(object sender, EventArgs e)
{
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetLiquidacionIngresosHuerta(DdlHuerta.SelectedValue.ToEntero(), txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate()))
{
DtIngresos = ObjCGame.DtResultados.Copy();
}
if (ObjCGame.GetLiquidacionGastosAgrupadosHuerta(DdlHuerta.SelectedValue.ToEntero(), txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate()))
{
DtGastosTotales = ObjCGame.DtResultados.Copy();
}
if (ObjCGame.GetProduccion(UsuarioActual.CveEmpresa, CveHuerta: DdlHuerta.SelectedValue.ToEntero(), FechaI: txtFechaI.Text.ToDate(), FechaF: txtFechaF.Text.ToDate(), Opcion: 1))
{
DtEmpaque = ObjCGame.DtResultados.Copy();
}
if (ObjCGame.GetRepPreEnfriado(DdlHuerta.SelectedValue.ToEntero(), txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), UsuarioActual.CveEmpresa, true))
{
DtPreEnfriado = ObjCGame.DtResultados.Copy();
}
if (ObjCGame.GetRepCorte(DdlHuerta.SelectedValue.ToEntero(), txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), UsuarioActual.CveEmpresa))
{
DataTable DtCorteTemp = ObjCGame.DtResultados.Copy();
if (DtCorteTemp.Rows.Count > 0)
{
int NumColumna = 1, ColTotales = 0;
ColTotales = DtCorteTemp.Columns.Count;
for (int i = 0; i < ColTotales; i++)
{
if (i >= 2)
{
if (DtCorteTemp.Rows[0][DtCorteTemp.Columns[i].ColumnName].ToString().ToDouble() < 1)
{
DtCorteTemp.Columns.Remove(DtCorteTemp.Columns[i]);
i--;
ColTotales--;
}
else
{
DtCorteTemp.Columns.Add("Nom" + NumColumna);
DtCorteTemp.Rows[0]["Nom" + NumColumna] = DtCorteTemp.Columns[i].ColumnName;
DtCorteTemp.Columns[i].ColumnName = "Col" + NumColumna;
NumColumna++;
}
}
}
for (int i = NumColumna; i <= 20; i++)
{
DtCorteTemp.Columns.Add("Nom" + i);
DtCorteTemp.Rows[0]["Nom" + i] = "";
DtCorteTemp.Columns.Add("Col" + i);
DtCorteTemp.Rows[0]["Col" + i] = "";
}
}
string[] str1, str2;
str1 = new string[22] { "CveProduccion","Folio", "Nom1", "Col1", "Nom2", "Col2", "Nom3", "Col3", "Nom4", "Col4", "Nom5", "Col5", "Nom6", "Col6", "Nom7", "Col7", "Nom8", "Col8", "Nom9", "Col9", "Nom10", "Col10"};
str2 = new string[22] { "CveProduccion", "Folio", "Nom11", "Col11", "Nom12", "Col12", "Nom13", "Col13", "Nom14", "Col14", "Nom15", "Col15", "Nom16", "Col16", "Nom17", "Col17", "Nom18", "Col18", "Nom19", "Col19", "Nom20", "Col20" };
DtCorte = DtCorteTemp.FiltraParametros("", "", str1);
DtCorte2 = DtCorteTemp.FiltraParametros("", "", str2);
}
if (ObjCGame.GetRepFleteHuertaEmpaque(DdlHuerta.SelectedValue.ToEntero(), txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), UsuarioActual.CveEmpresa))
{
DtFleteHuertaEmpaque = ObjCGame.DtResultados.Copy();
}
if (ObjCGame.GetRepFleteEmpaqueUSA(DdlHuerta.SelectedValue.ToEntero(), txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), UsuarioActual.CveEmpresa))
{
DtFleteEmpaqueUSA = ObjCGame.DtResultados.Copy();
}
if (ObjCGame.GetRepOtrosGastos(DdlHuerta.SelectedValue.ToEntero(), txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), UsuarioActual.CveEmpresa))
{
DtOtrosGastos = ObjCGame.DtResultados.Copy();
}
if (ObjCGame.GetRepOtrosGastos(DdlHuerta.SelectedValue.ToEntero(), txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), UsuarioActual.CveEmpresa,Opcion:2))
{
DtOtrosGastosAgrupados = ObjCGame.DtResultados.Copy();
}
if (ObjCGame.GetRepMateriales(DdlHuerta.SelectedValue.ToEntero(), txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), UsuarioActual.CveEmpresa))
{
DtMateriales = ObjCGame.DtResultados.Copy();
}
if (ObjCGame.GetRepMateriales(DdlHuerta.SelectedValue.ToEntero(), txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), UsuarioActual.CveEmpresa,Opcion:2))
{
DtMaterialesAgrupados = ObjCGame.DtResultados.Copy();
}
if (ObjCGame.GetIngresosAgrupados(DdlHuerta.SelectedValue.ToEntero(), txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), UsuarioActual.CveEmpresa))
{
DtIngresosAgrupados= ObjCGame.DtResultados;
}
ObjCGame.Dispose();
double TotIngresosPri = 0, TotIngresosSeg = 0, TotIngresosJug = 0, TotPesoPri = 0, TotPesoSeg = 0, TotPesoJug = 0, TotCantidadPri = 0, TotCantidadSeg = 0, TotCantidadJug = 0, Merma = 0;
if (DtIngresos.Rows.Count > 0)
{
TotIngresosPri = DtIngresos.SUM("ImportePrimera");
TotIngresosSeg = DtIngresos.SUM("ImporteSegunda");
TotIngresosJug = DtIngresos.SUM("ImporteJugo");
TotPesoPri = DtIngresos.SUM("PesoPrimera");
TotPesoSeg = DtIngresos.SUM("PesoSegunda");
TotPesoJug = DtIngresos.SUM("PesoJugo");
TotCantidadPri = DtIngresos.SUM("CantidadPrimera");
TotCantidadSeg = DtIngresos.SUM("CantidadSegunda");
TotCantidadJug = DtIngresos.SUM("CantidadJugo");
Merma = DtIngresos.Rows[0]["Merma"].ToString().ToDouble();
LblPesoNeto.Text = DtIngresos.Rows[0]["PesoNeto"].ToString().FormatoNumero();
HplNumCortes.Text = DtIngresos.Rows[0]["NumCortes"].ToString().FormatoNumero(0);
if (DtGastosTotales.Rows.Count > 0)
{
//DtGastosTotales.Rows[DtGastosTotales.Rows.Count - 1]["Importe"] = 10 * (TotIngresosPri + TotIngresosSeg + TotIngresosJug) / 100;
DtGastosTotales.Rows[DtGastosTotales.Rows.Count - 1]["Importe"] = TxtComisionCitrus.Text.ToDouble();
}
}
HplNumCortes.NavigateUrl = $"/CGame/RepOrdenCorte.aspx?CveHuerta={DdlHuerta.SelectedValue}&FechaI={txtFechaI.Text}&FechaF={txtFechaF.Text}";
LblPrimera.Text = TotPesoPri.FormatoNumero();
LblPorcentajePrimera.Text = (TotPesoPri * 100 / (TotPesoPri + TotPesoSeg + TotPesoJug + Merma)).FormatoNumero();
LblCantidadPrimera.Text = TotCantidadPri.FormatoNumero();
LblPesoPrimera.Text = TotPesoPri.FormatoNumero();
LblImportePrimera.Text = TotIngresosPri.FormatoNumero();
LblSegunda.Text = TotPesoSeg.FormatoNumero();
LblPorcentajeSegunda.Text = (TotPesoSeg * 100 / (TotPesoPri + TotPesoSeg + TotPesoJug + Merma)).FormatoNumero();
LblCantidadSegunda.Text = TotCantidadSeg.FormatoNumero();
LblPesoSegunda.Text = TotPesoSeg.FormatoNumero();
LblImporteSegunda.Text = TotIngresosSeg.FormatoNumero();
LblJugo.Text = TotPesoJug.FormatoNumero();
LblPorcentajeJugo.Text = (TotPesoJug * 100 / (TotPesoPri + TotPesoSeg + TotPesoJug + Merma)).FormatoNumero();
LblCantidadJugo.Text = TotCantidadJug.FormatoNumero();
LblPesoJugo.Text = TotPesoJug.FormatoNumero();
LblImporteJugo.Text = TotIngresosJug.FormatoNumero();
LblMerma.Text = Merma.FormatoNumero();
LblPorcentajeMerma.Text = (Merma * 100 / (TotPesoPri + TotPesoSeg + TotPesoJug + Merma)).FormatoNumero();
HlIngresos.Text = (TotIngresosPri + TotIngresosSeg + TotIngresosJug).FormatoNumero();
HlIngresos.NavigateUrl = $"/CGame/RepIngresos.aspx?CveHuerta={DdlHuerta.SelectedValue}&FechaI={txtFechaI.Text}&FechaF={txtFechaF.Text}";
LblCostos.Text = (DtGastosTotales.SUM("Importe")).FormatoNumero();
LblRetorno.Text = ((TotIngresosPri + TotIngresosSeg + TotIngresosJug) - DtGastosTotales.SUM("Importe")).FormatoNumero();
LblPrecioArbol.Text = (((TotIngresosPri + TotIngresosSeg + TotIngresosJug) - DtGastosTotales.SUM("Importe")) / (TotPesoPri + TotPesoSeg + TotPesoJug + Merma)).FormatoNumero();
GvGastos.DataSource = DtGastosTotales;
GvGastos.DataBind();
UpDatosGenerales.Update();
UpGastos.Update();
UpUtilidad.Update();
}
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 LnkPdf_Click(object sender, EventArgs e)
{
GenerarPDF("PDF");
}
protected void LnkExcel_Click(object sender, EventArgs e)
{
GenerarPDF("EXCEL");
}
private void GenerarPDF(string Opcion)
{
if ((DtIngresos.Rows.Count > 0 || DtGastosTotales.Rows.Count > 0))
{
double TotIngresosPri = 0, TotIngresosSeg = 0, TotIngresosJug = 0, TotPesoPri = 0, TotPesoSeg = 0, TotPesoJug = 0, TotCantidadPri = 0, TotCantidadSeg = 0, TotCantidadJug = 0, Merma = 0,PesoNeto=0;
if (DtIngresos.Rows.Count > 0)
{
TotIngresosPri = DtIngresos.SUM("ImportePrimera");
TotIngresosSeg = DtIngresos.SUM("ImporteSegunda");
TotIngresosJug = DtIngresos.SUM("ImporteJugo");
TotPesoPri = DtIngresos.SUM("PesoPrimera");
TotPesoSeg = DtIngresos.SUM("PesoSegunda");
TotPesoJug = DtIngresos.SUM("PesoJugo");
TotCantidadPri = DtIngresos.SUM("CantidadPrimera");
TotCantidadSeg = DtIngresos.SUM("CantidadSegunda");
TotCantidadJug = DtIngresos.SUM("CantidadJugo");
Merma = DtIngresos.Rows[0]["Merma"].ToString().ToDouble();
PesoNeto = DtIngresos.Rows[0]["PesoNeto"].ToString().ToDouble();
}
System.IO.FileInfo Imagen = new System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta));
String logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa);
List<ReportParameter> para = new List<ReportParameter>();
para.Add(new ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa));
para.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre));
para.Add(new ReportParameter("FechaImpresion", DateTime.Now.ToString()));
para.Add(new ReportParameter("Huerta", DdlHuerta.SelectedItem.Text));
para.Add(new ReportParameter("TotPrecioPri", TotIngresosPri.FormatoNumero()));
para.Add(new ReportParameter("TotPrecioSeg", TotIngresosSeg.FormatoNumero()));
para.Add(new ReportParameter("TotPrecioJug", TotIngresosJug.FormatoNumero()));
para.Add(new ReportParameter("TotPesoPri", TotPesoPri.FormatoNumero(0)));
para.Add(new ReportParameter("TotPesoSeg", TotPesoSeg.FormatoNumero(0)));
para.Add(new ReportParameter("TotPesoJug", TotPesoJug.FormatoNumero(0)));
para.Add(new ReportParameter("Merma", Merma.FormatoNumero(0)));
para.Add(new ReportParameter("TotCantidadPri", TotCantidadPri.FormatoNumero()));
para.Add(new ReportParameter("TotCantidadSeg", TotCantidadSeg.FormatoNumero()));
para.Add(new ReportParameter("TotCantidadJug", TotCantidadJug.FormatoNumero()));
string PorcentajePesoPri = (TotPesoPri * 100 / (TotPesoPri + TotPesoSeg + TotPesoJug + Merma)).FormatoNumero();
string PorcentajePesoSeg = (TotPesoSeg * 100 / (TotPesoPri + TotPesoSeg + TotPesoJug + Merma)).FormatoNumero();
string PorcentajePesoJug = (TotPesoJug * 100 / (TotPesoPri + TotPesoSeg + TotPesoJug + Merma)).FormatoNumero();
string PorcentajeMerma = (Merma * 100 / (TotPesoPri + TotPesoSeg + TotPesoJug + Merma)).FormatoNumero();
para.Add(new ReportParameter("PorcentajePesoPri", PorcentajePesoPri));
para.Add(new ReportParameter("PorcentajePesoSeg", PorcentajePesoSeg));
para.Add(new ReportParameter("PorcentajePesoJug", PorcentajePesoJug));
para.Add(new ReportParameter("PorcentajeMerma", PorcentajeMerma));
para.Add(new ReportParameter("Fecha", $"Liquidación correspondiente al periodo del {txtFechaI.Text} al {txtFechaF.Text} ({HplNumCortes.Text} Cortes) de la huerta {DdlHuerta.SelectedItem.Text}"));
para.Add(new ReportParameter("PesoNeto", PesoNeto.FormatoNumero(0)));
para.Add(new ReportParameter("TotIngresos", (TotIngresosPri + TotIngresosSeg + TotIngresosJug).FormatoNumero()));
para.Add(new ReportParameter("TotGastos", (DtGastosTotales.SUM("Importe")).FormatoNumero()));
para.Add(new ReportParameter("Retorno", ((TotIngresosPri + TotIngresosSeg + TotIngresosJug) - DtGastosTotales.SUM("Importe")).FormatoNumero()));
para.Add(new ReportParameter("PrecioArbol", (((TotIngresosPri + TotIngresosSeg + TotIngresosJug) - DtGastosTotales.SUM("Importe")) / (TotPesoPri + TotPesoSeg + TotPesoJug + Merma)).FormatoNumero()));
DataTable DtGrafica1 = new DataTable();
DtGrafica1.Columns.Add("Concepto");
DtGrafica1.Columns.Add("Importe");
DtGrafica1.Columns.Add("Porcentaje");
DataRow DrGrafica1 = DtGrafica1.NewRow();
DrGrafica1["Concepto"] = "Primera";
DrGrafica1["Importe"] = TotPesoPri.FormatoNumero();
DrGrafica1["Porcentaje"] = PorcentajePesoPri;
DtGrafica1.Rows.Add(DrGrafica1);
DataRow Dr2Grafica1 = DtGrafica1.NewRow();
Dr2Grafica1["Concepto"] = "Segunda";
Dr2Grafica1["Importe"] = TotPesoSeg.FormatoNumero();
Dr2Grafica1["Porcentaje"] = PorcentajePesoSeg;
DtGrafica1.Rows.Add(Dr2Grafica1);
DataRow Dr3Grafica1 = DtGrafica1.NewRow();
Dr3Grafica1["Concepto"] = "Jugo";
Dr3Grafica1["Importe"] = TotPesoJug.FormatoNumero();
Dr3Grafica1["Porcentaje"] = PorcentajePesoJug;
DtGrafica1.Rows.Add(Dr3Grafica1);
DataRow Dr4Grafica1 = DtGrafica1.NewRow();
Dr4Grafica1["Concepto"] = "Merma";
Dr4Grafica1["Importe"] = TotPesoJug.FormatoNumero();
Dr4Grafica1["Porcentaje"] = PorcentajeMerma;
DtGrafica1.Rows.Add(Dr4Grafica1);
DataTable DtGrafica2 = new DataTable();
DtGrafica2.Columns.Add("Concepto");
DtGrafica2.Columns.Add("Importe");
DataRow DrGrafica2 = DtGrafica2.NewRow();
DrGrafica2["Concepto"] = "Ingresos";
DrGrafica2["Importe"] = (TotIngresosPri + TotIngresosSeg + TotIngresosJug).FormatoNumero();
DtGrafica2.Rows.Add(DrGrafica2);
DataRow Dr2Grafica2 = DtGrafica2.NewRow();
Dr2Grafica2["Concepto"] = "Gastos";
Dr2Grafica2["Importe"] = (DtGastosTotales.SUM("Importe")).FormatoNumero();
DtGrafica2.Rows.Add(Dr2Grafica2);
if (Imagen.Exists)
{
para.Add(new ReportParameter("LogoPath", logouri));
}
else
{
para.Add(new ReportParameter("LogoPath", ""));
}
List<ReportDataSource> lrds = new List<ReportDataSource>();
ReportDataSource rds5 = new ReportDataSource();
rds5.Name = "DataSet5"; rds5.Value = DtGastosTotales;
ReportDataSource rds6 = new ReportDataSource();
rds6.Name = "DataSet6"; rds6.Value = DtGrafica1;
ReportDataSource rds7 = new ReportDataSource();
rds7.Name = "DataSet7"; rds7.Value = DtGrafica2;
ReportDataSource rds8 = new ReportDataSource();
rds8.Name = "DataSet8"; rds8.Value = DtEmpaque;
ReportDataSource rds9 = new ReportDataSource();
rds9.Name = "DataSet9"; rds9.Value = DtPreEnfriado;
ReportDataSource rds10 = new ReportDataSource();
rds10.Name = "DataSet10"; rds10.Value = DtCorte;
ReportDataSource rds11 = new ReportDataSource();
rds11.Name = "DataSet11"; rds11.Value = DtFleteHuertaEmpaque;
ReportDataSource rds12 = new ReportDataSource();
rds12.Name = "DataSet12"; rds12.Value = DtFleteEmpaqueUSA;
ReportDataSource rds13 = new ReportDataSource();
rds13.Name = "DataSet13"; rds13.Value = DtOtrosGastos;
ReportDataSource rds14 = new ReportDataSource();
rds14.Name = "DataSet14"; rds14.Value = DtMateriales;
ReportDataSource rds15 = new ReportDataSource();
rds15.Name = "DataSet15"; rds15.Value = DtIngresosAgrupados;
ReportDataSource rds16 = new ReportDataSource();
rds16.Name = "DataSet16"; rds16.Value = DtMaterialesAgrupados;
ReportDataSource rds17 = new ReportDataSource();
rds17.Name = "DataSet17"; rds17.Value = DtOtrosGastosAgrupados;
ReportDataSource rds18 = new ReportDataSource();
rds18.Name = "DataSet18"; rds18.Value = DtCorte2;
lrds.Add(rds5);
lrds.Add(rds6);
lrds.Add(rds7);
lrds.Add(rds8);
lrds.Add(rds9);
lrds.Add(rds10);
lrds.Add(rds11);
lrds.Add(rds12);
lrds.Add(rds13);
lrds.Add(rds14);
lrds.Add(rds15);
lrds.Add(rds16);
lrds.Add(rds17);
lrds.Add(rds18);
ImprimirPDF("Empresas/Grales/Formatos/Liquidacion.rdlc", lrds, para, "Liquidacion", Opcion);
}
else
{
Alert("No se encontraron datos.", TipoMensaje.MsgAdvertencia);
}
}
protected void GvGastos_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
String Css = "Texto";
String Liga = "";
if (e.Row.DBCampo("Orden").ToEntero() == 5)
{
Liga = $"/CGame/RepPreEnfriado.aspx?&CveHuerta={DdlHuerta.SelectedValue}&FechaI={txtFechaI.Text}&FechaF={txtFechaF.Text}&Liquidado=1";
}
else if (e.Row.DBCampo("Orden").ToEntero() == 2)
{
Liga = $"/CGame/RepFletes.aspx?&CveHuerta={DdlHuerta.SelectedValue}&FechaI={txtFechaI.Text}&FechaF={txtFechaF.Text}&Tipo=1";
}
else if (e.Row.DBCampo("Orden").ToEntero() == 6)
{
Liga = $"/CGame/RepFletes.aspx?&CveHuerta={DdlHuerta.SelectedValue}&FechaI={txtFechaI.Text}&FechaF={txtFechaF.Text}&Tipo=2";
}
else if (e.Row.DBCampo("Orden").ToEntero() == 1)
{
Liga = $"/CGame/RepCorte.aspx?&CveHuerta={DdlHuerta.SelectedValue}&FechaI={txtFechaI.Text}&FechaF={txtFechaF.Text}";
}
else if (e.Row.DBCampo("Orden").ToEntero() == 3)
{
Liga = $"/CGame/RepMaquila.aspx?&CveHuerta={DdlHuerta.SelectedValue}&FechaI={txtFechaI.Text}&FechaF={txtFechaF.Text}";
}
else if (e.Row.DBCampo("Orden").ToEntero() == 4)
{
Liga = $"/CGame/RepMateriales.aspx?&CveHuerta={DdlHuerta.SelectedValue}&FechaI={txtFechaI.Text}&FechaF={txtFechaF.Text}";
}
else if (e.Row.DBCampo("Orden").ToEntero() == 7)
{
Liga = $"/CGame/RepOtrosGastos.aspx?&CveHuerta={DdlHuerta.SelectedValue}&FechaI={txtFechaI.Text}&FechaF={txtFechaF.Text}";

1227
CGame/OrdenProduccion.aspx Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,119 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="PopUpBuscarCorteGasto.aspx.cs" Inherits="CGame_PopUpBuscarProduccion" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Buscar Corte de Gasto
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table class="Widthall">
<tr>
<td class="Titulos" colspan="4">Filtros para búsqueda</td>
</tr>
<tr align="left">
<td class="text-right"><b>Folio:</b></td>
<td>
<asp:TextBox ID="TxtFolio" runat="server" MaxLength="90" Width="200px"></asp:TextBox></td>
</tr>
<tr align="left">
<td class="text-right"><b>Huerta:</b></td>
<td colspan="3">
<asp:DropDownList ID="DdlHuerta" runat="server" AppendDataBoundItems="true" DataTextField="Huerta" DataValueField="CveHuerta" Class="table-group-action-input form-control input-inline input-sm select2me" Width="565px">
</asp:DropDownList></td>
</tr>
<tr align="left">
<td class="text-right"><b>Fecha Inicial:</b></td>
<td>
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 80% !important; padding: 0px;">
<asp:TextBox ID="TxtFechaEntregaI" runat="server" ClientIDMode="Static" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFechaEntregaI" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaEntregaI" runat="server" TargetControlID="TxtFechaEntregaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaEntregaI" TargetControlID="TxtFechaEntregaI" PopupButtonID="ImgFechaEntregaI" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CvFechaEntregaI" runat="server" ControlToValidate="TxtFechaEntregaI" Display="None" Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Entrega Inicial''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)."></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VcoFechaEntregaI" runat="server" Enabled="True" HighlightCssClass="vco" TargetControlID="CvFechaEntregaI" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</td>
<td class="text-right"><b>Fecha Final:</b></td>
<td>
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 80% !important; padding: 0px;">
<asp:TextBox ID="TxtFechaEntregaF" runat="server" ClientIDMode="Static" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFechaEntregaF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaEntregaF" runat="server" TargetControlID="TxtFechaEntregaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaEntregaF" TargetControlID="TxtFechaEntregaF" PopupButtonID="ImgFechaEntregaF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CvFechaEntregaF" runat="server" ControlToValidate="TxtFechaEntregaF" Display="None" Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Entrega Final''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)."></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VcoFechaEntregaF" runat="server" Enabled="True" HighlightCssClass="vco" TargetControlID="CvFechaEntregaF" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</td>
</tr>
<tr>
<td style="text-align: center;" colspan="4">
<asp:Button ID="BtnBuscar" runat="server" OnClick="Consultar_Click" Text="Buscar" class="btn btn-primary" /></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<div id="TblBusqueda" runat="server" visible="False">
<div class="row">
<div class="col-md-12">Número de registros encontrados:&nbsp;<b><asp:Literal ID="LtlTotalRegistros" runat="server"></asp:Literal></b></div>
</div>
<div id="DivOrdenProduccion" style="overflow-y: auto; width: 760px; max-height: 200px;">
<asp:GridView ID="GvDatos" runat="server" GridLines="None" ShowHeaderWhenEmpty="true" OnRowDataBound="GvDatos_RowDataBound" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False"
DataKeyNames="CveCorteGasto">
<Columns>
<asp:TemplateField HeaderText="Folio OC" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="LblFolio" runat="server" Text='<%# Eval("Folio")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Huerta" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblHuerta" runat="server" Text='<%# Eval("Huerta")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Importe" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblImporte" runat="server" Text='<%# Eval("Importe")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="FechaCorteGasto" ItemStyle-Width="15%" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:TemplateField HeaderText="Usuario" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblUsuario" runat="server" Text='<%# Eval("Usuario")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script>
function Ir(v) {
gotourl('/CGame/CorteGasto.aspx?CveCorteGasto=' + v);
}
</script>
</asp:Content>

View File

@@ -0,0 +1,74 @@
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;
public partial class CGame_PopUpBuscarProduccion :ClsPaginas
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
((BaseMasterPage) this.Master).EsPopup = true;
TxtFechaEntregaI.Text = DateTime.Now.ToString();
TxtFechaEntregaF.Text = DateTime.Now.ToString();
CargaHuerta();
}
}
protected void CargaHuerta()
{
ClsCGame ObjCort = new ClsCGame();
if (ObjCort.GetHuerta(UsuarioActual.CveEmpresa))
{
DdlHuerta.DataSource = ObjCort.DtResultados;
DdlHuerta.Items.Insert(0, new ListItem("Todos", "-1"));
DdlHuerta.DataBind();
}
ObjCort.Dispose();
UPDatos.Update();
}
protected void Consultar_Click(object sender, EventArgs e)
{
String Folio;
if (TxtFolio.Text != "") { Folio = TxtFolio.Text; TxtFechaEntregaI.Text = MinFecha.ToShortDateString(); TxtFechaEntregaF.Text = MaxFecha.ToShortDateString(); } else { Folio = "-1"; }
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetCorteGasto(UsuarioActual.CveEmpresa,-1,-1,DdlHuerta.SelectedValue.ToEntero(),TxtFechaEntregaI.Text.ToDate(),TxtFechaEntregaF.Text.ToDate(),Opcion:2,Folio:Folio))
{
GvDatos.DataSource = ObjCGame.DtResultados;
GvDatos.DataBind();
LtlTotalRegistros.Text = ObjCGame.DtResultados.Rows.Count.ToString();
if (ObjCGame.DtResultados.Rows.Count < 1)
{
Alert("No se encontraron resultados con los filtros seleccionados", TipoMensaje.MsgAdvertencia);
}
else
{
TblBusqueda.Visible = true;
}
}
ObjCGame.Dispose();
UPDatos.Update();
}
#region GridView
protected void GvDatos_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.FCLabel("LblImporte").Text = String.Format("<div class='truncate' style='width:200px;'>{0}{1}</a></div>", "<a href='javascript:Ir("+"" + e.Row.DBCampo("CveCorteGasto") + ""+");'>", e.Row.DBCampo("Importe").FormatoNumero());
e.Row.FCLabel("LblFolio").Text = String.Format("<div class='truncate' style='width:200px;'>{0}{1}</a></div>", "<a href='javascript:Ir(" + "" + e.Row.DBCampo("CveCorteGasto") + "" + ");'>", e.Row.DBCampo("Folio"));
}
}
#endregion
}

View File

@@ -0,0 +1,114 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="PopUpBuscarEmpaque.aspx.cs" Inherits="CGame_PopUpBuscarProduccion" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Buscar Empaque
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table class="Widthall">
<tr>
<td class="Titulos" colspan="4">Filtros para búsqueda</td>
</tr>
<tr align="left">
<td class="text-right"><b>Folio:</b></td>
<td>
<asp:TextBox ID="TxtFolio" runat="server" MaxLength="90" Width="200px" autofocus></asp:TextBox></td>
</tr>
<tr align="left">
<td class="text-right"><b>Huerta:</b></td>
<td colspan="3">
<asp:DropDownList ID="DdlHuerta" runat="server" AppendDataBoundItems="true" DataTextField="Huerta" DataValueField="CveHuerta" Class="table-group-action-input form-control input-inline input-sm select2me" Width="565px">
</asp:DropDownList></td>
</tr>
<tr align="left">
<td class="text-right"><b>Fecha Inicial:</b></td>
<td>
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 80% !important; padding: 0px;">
<asp:TextBox ID="TxtFechaEntregaI" runat="server" ClientIDMode="Static" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFechaEntregaI" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaEntregaI" runat="server" TargetControlID="TxtFechaEntregaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaEntregaI" TargetControlID="TxtFechaEntregaI" PopupButtonID="ImgFechaEntregaI" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CvFechaEntregaI" runat="server" ControlToValidate="TxtFechaEntregaI" Display="None" Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Entrega Inicial''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)."></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VcoFechaEntregaI" runat="server" Enabled="True" HighlightCssClass="vco" TargetControlID="CvFechaEntregaI" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</td>
<td class="text-right"><b>Fecha Final:</b></td>
<td>
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 80% !important; padding: 0px;">
<asp:TextBox ID="TxtFechaEntregaF" runat="server" ClientIDMode="Static" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFechaEntregaF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaEntregaF" runat="server" TargetControlID="TxtFechaEntregaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaEntregaF" TargetControlID="TxtFechaEntregaF" PopupButtonID="ImgFechaEntregaF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CvFechaEntregaF" runat="server" ControlToValidate="TxtFechaEntregaF" Display="None" Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Entrega Final''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)."></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VcoFechaEntregaF" runat="server" Enabled="True" HighlightCssClass="vco" TargetControlID="CvFechaEntregaF" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</td>
</tr>
<tr>
<td style="text-align: center;" colspan="4">
<asp:Button ID="BtnBuscar" runat="server" OnClick="Consultar_Click" Text="Buscar" class="btn btn-primary" /></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<div id="TblBusqueda" runat="server" visible="False">
<div class="row">
<div class="col-md-12">Número de registros encontrados:&nbsp;<b><asp:Literal ID="LtlTotalRegistros" runat="server"></asp:Literal></b></div>
</div>
<div id="DivOrdenProduccion" style="overflow-y: auto; width: 760px; max-height: 200px;">
<asp:GridView ID="GvDatos" runat="server" GridLines="None" ShowHeaderWhenEmpty="true" OnRowDataBound="GvDatos_RowDataBound" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False"
DataKeyNames="CveProduccion">
<Columns>
<asp:TemplateField HeaderText="Folio" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="LblFolio" runat="server" Text='<%# Eval("Folio")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Huerta" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblHuerta" runat="server" Text='<%# Eval("Huerta")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Fecha" ItemStyle-Width="15%" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:TemplateField HeaderText="Usuario" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblUsuario" runat="server" Text='<%# Eval("Usuario")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script>
function Ir(v) {
gotourl('/CGame/Empaque.aspx?CveProduccion=' + v);
}
</script>
</asp:Content>

View File

@@ -0,0 +1,63 @@
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;
public partial class CGame_PopUpBuscarProduccion :ClsPaginas
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
((BaseMasterPage) this.Master).EsPopup = true;
TxtFechaEntregaI.Text = DateTime.Now.ToString();
TxtFechaEntregaF.Text = DateTime.Now.ToString();
CargaHuerta();
}
}
protected void CargaHuerta()
{
ClsCGame ObjCort = new ClsCGame();
if (ObjCort.GetHuerta(UsuarioActual.CveEmpresa))
{
DdlHuerta.DataSource = ObjCort.DtResultados;
DdlHuerta.Items.Insert(0, new ListItem("Todos", "-1"));
DdlHuerta.DataBind();
}
ObjCort.Dispose();
UPDatos.Update();
}
protected void Consultar_Click(object sender, EventArgs e)
{
String Folio;
if (TxtFolio.Text != "") { Folio = TxtFolio.Text; } else { Folio = "-1"; }
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetProduccion(UsuarioActual.CveEmpresa, Folio, -1, DdlHuerta.SelectedValue.ToEntero(), TxtFechaEntregaI.Text.ToDate(), TxtFechaEntregaF.Text.ToDate()))
{
GvDatos.DataSource = ObjCGame.DtResultados;
GvDatos.DataBind();
LtlTotalRegistros.Text = ObjCGame.DtResultados.Rows.Count.ToString();
if (ObjCGame.DtResultados.Rows.Count < 1)
{
Alert("No se encontraron resultados con los filtros seleccionados", TipoMensaje.MsgAdvertencia);
}
else
{
TblBusqueda.Visible = true;
}
}
ObjCGame.Dispose();
UPDatos.Update();
}
#region GridView
protected void GvDatos_RowDataBound(object sender, GridViewRowEventArgs e)

View File

@@ -0,0 +1,157 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PopUpBuscarOrdenProduccion.aspx.vb" Inherits="CGame_PopUpBuscarOrdenProduccion" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Buscar Orden de Producción
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table class="Widthall">
<tr>
<td class="Titulos" colspan="4">Filtros para búsqueda</td>
</tr>
<tr align="left">
<td class="text-right"><b>Folio:</b></td>
<td>
<asp:TextBox ID="TxtFolio" runat="server" MaxLength="20" Width="200px" autofocus></asp:TextBox></td>
<td class="text-right"><b>Estatus:</b></td>
<td>
<asp:DropDownList ID="DdlEstatus" runat="server" AppendDataBoundItems="true" DataTextField="Estatus" DataValueField="CveEstatus" CssClass="select2me" Width="200px">
</asp:DropDownList></td>
</tr>
<tr align="left">
<td class="text-right"><b>Cliente:</b></td>
<td colspan="3">
<asp:DropDownList ID="DdlCliente" runat="server" AppendDataBoundItems="true" DataTextField="Cliente" DataValueField="CveCliente" Class="table-group-action-input form-control input-inline input-sm select2me" Width="565px">
</asp:DropDownList></td>
</tr>
<tr align="left">
<td class="text-right"><b>F. Entrega I.:</b></td>
<td>
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 80% !important; padding: 0px;">
<asp:TextBox ID="TxtFechaEntregaI" runat="server" ClientIDMode="Static" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFechaEntregaI" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaEntregaI" runat="server" TargetControlID="TxtFechaEntregaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaEntregaI" TargetControlID="TxtFechaEntregaI" PopupButtonID="ImgFechaEntregaI" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CvFechaEntregaI" runat="server" ControlToValidate="TxtFechaEntregaI" Display="None" Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Entrega Inicial''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)."></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VcoFechaEntregaI" runat="server" Enabled="True" HighlightCssClass="vco" TargetControlID="CvFechaEntregaI" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</td>
<td class="text-right"><b>F. Entrega F.:</b></td>
<td>
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 80% !important; padding: 0px;">
<asp:TextBox ID="TxtFechaEntregaF" runat="server" ClientIDMode="Static" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFechaEntregaF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaEntregaF" runat="server" TargetControlID="TxtFechaEntregaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaEntregaF" TargetControlID="TxtFechaEntregaF" PopupButtonID="ImgFechaEntregaF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CvFechaEntregaF" runat="server" ControlToValidate="TxtFechaEntregaF" Display="None" Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Entrega Final''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)."></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VcoFechaEntregaF" runat="server" Enabled="True" HighlightCssClass="vco" TargetControlID="CvFechaEntregaF" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</td>
</tr>
<tr>
<td style="text-align: center;" colspan="4">
<asp:Button ID="BtnBuscar" runat="server" Text="Buscar" class="btn btn-primary" /></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvOP.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvOP.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<div id="TblBusqueda" runat="server" visible="False">
<div class="row">
<div class="col-md-12">Número de registros encontrados:&nbsp;<b><asp:Literal ID="LtlTotalRegistros" runat="server"></asp:Literal></b></div>
</div>
<div id="DivOrdenProduccion" style="overflow-y: auto; width: 760px; max-height: 200px;">
<asp:GridView ID="GvOP" runat="server" GridLines="None" ShowHeaderWhenEmpty="true" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False"
DataKeyNames="CveOrdenProduccion">
<Columns>
<asp:TemplateField HeaderText="Folio" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="LblFolio" runat="server" Text='<%# Eval("Folio")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<%-- <asp:TemplateField HeaderText="Cantidad" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="LblCantidad" runat="server" Text='<%# Eval("Cantidad")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Unidad de Medida" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblUnidadMedida" runat="server" Text='<%# Eval("UnidadMedida")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Producto o Servicio" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblPS" runat="server" Text='<%# Eval("PS")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>--%>
<asp:TemplateField HeaderText="Cliente" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblCliente" runat="server" Text='<%# Eval("Cliente")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Estatus" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblEstatus" runat="server" Text='<%# Eval("Estatus")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<%-- <asp:TemplateField HeaderText="Tamaño" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTamaño" runat="server" Text='<%# Eval("Tamaño")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo de Etiqueta" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoEtiqueta" runat="server" Text='<%# Eval("TipoEtiqueta")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Calidad" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblCalidad" runat="server" Text='<%# Eval("Calidad")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo de Caja" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoCaja" runat="server" Text='<%# Eval("TipoCaja")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>--%>
<asp:TemplateField HeaderText="Observaciones" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblObservaciones" runat="server" Text='<%# Eval("Observaciones")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script>
function Ir(v) {
gotourl('/CGame/OrdenProduccion.aspx?CveOrdenProduccion=' + v);
}
</script>
</asp:Content>

View File

@@ -0,0 +1,60 @@
Option Explicit On
Option Strict On
Imports Extensiones
Partial Class CGame_PopUpBuscarOrdenProduccion
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
CType(Me.Master, BaseMasterPage).EsPopup = True
TxtFechaEntregaI.Text = Now.AddDays(0).ToShortDateString
TxtFechaEntregaF.Text = Now.AddDays(0).ToShortDateString
CargaCliente()
CargaEstatus()
End If
End Sub
Private Sub CargaCliente()
Dim ObjOP As New ClsCGame
If ObjOP.GetCliente(-1, -1, UsuarioActual.CveEmpresa) Then
DdlCliente.DataSource = ObjOP.DtResultados
DdlCliente.Items.Insert(0, New ListItem("Todos", "-1"))
DdlCliente.DataBind()
End If
ObjOP.Dispose()
End Sub
Private Sub CargaEstatus()
Dim ObjOP As New ClsCGame
If ObjOP.GetEstatus(UsuarioActual.CveEmpresa, Estado:=1) Then
DdlEstatus.DataSource = ObjOP.DtResultados
DdlEstatus.Items.Insert(0, New ListItem("Todos", "-1"))
DdlEstatus.DataBind()
End If
End Sub
Protected Sub BtnBuscar_Click(sender As Object, e As System.EventArgs) Handles BtnBuscar.Click
Dim Folio As String
If TxtFolio.Text.Trim <> "" Then Folio = TxtFolio.Text Else Folio = "-1"
Dim ObjOP As New ClsCGame
If ObjOP.GetOrdenProduccion(-1, UsuarioActual.CveEmpresa, DdlEstatus.SelectedValue.ToEntero, Folio, TxtFechaEntregaI.Text.ToDate, TxtFechaEntregaF.Text.ToDate, DdlCliente.SelectedValue.ToEntero) Then
GvOP.DataSource = ObjOP.DtResultados
GvOP.DataBind()
LtlTotalRegistros.Text = ObjOP.DtResultados.Rows.Count.ToString
If Not ObjOP.DtResultados.Rows.Count > 0 Then
Alert("No se encontraron resultados con los filtros seleccionados", TipoMensaje.MsgAdvertencia)
Else
TblBusqueda.Visible = True
End If
End If
ObjOP.Dispose()
UPDatos.Update()
End Sub
Private Sub GvOP_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvOP.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.FCLabel("LblFolio").Text = String.Format("<div class='truncate' style='width:200px;'>{0}{1}</a></div>", "<a href='javascript:Ir(""" & e.Row.DBCampo("CveOrdenProduccion") & """);'>", e.Row.DBCampo("Folio"))
End If
End Sub
End Class

237
CGame/RepAvance.aspx Normal file
View File

@@ -0,0 +1,237 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepAvance.aspx.cs" Inherits="CGame_RepAvance" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Reporte de Avance
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
<%-- <asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkPdf" OnClick="LnkPdf_Click" runat="server"> <i class="fa fa-ad-pdf"></i> Generar Liquidación</asp:LinkButton>
</li>
</ContentTemplate>
</asp:UpdatePanel>--%>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" Text="Consultar" class="btn btn-primary" />
<a href="javascript:;" class="expand"></a>
</div>
<div class="titlefiltros caption">
<div class="row">
<label class="col-md-1 ">Folio:</label>
<div class="col-md-2">
<asp:TextBox ID="TxtFolio" runat="server" MaxLength="20"></asp:TextBox>
</div>
<label class="col-md-1 ">Fecha Inicial:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control" Text="01/09/2017" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<label class="col-md-1 ">Fecha Final:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control" Text="31/08/2018" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
<div class="portlet-body">
<div class="row">
<label class="col-md-1 ">Cliente:</label>
<div class="col-md-3">
<asp:DropDownList ID="DdlCliente" runat="server" AppendDataBoundItems="true" DataTextField="Cliente" DataValueField="CveCliente" Class="table-group-action-input form-control input-inline input-sm select2me" Width="70%">
</asp:DropDownList>
</div>
<label class="col-md-1 ">Estatus:</label>
<div class="col-md-3">
<asp:DropDownList ID="DdlEstatus" runat="server" AppendDataBoundItems="true" DataTextField="Estatus" DataValueField="CveEstatus" Class="table-group-action-input form-control input-inline input-sm select2me" Width="70%">
</asp:DropDownList>
</div>
<label class="col-md-1 ">Grupo:</label>
<div class="col-md-3">
<asp:DropDownList ID="DdlGrupo" runat="server" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-sm select2me" Width="70%">
<asp:ListItem Text="Orden de Producción" Value="1"></asp:ListItem>
<asp:ListItem Text="Estatus" Value="2"></asp:ListItem>
<asp:ListItem Text="Fruto" Value="3"></asp:ListItem>
<asp:ListItem Text="Cliente" Value="4"></asp:ListItem>
<asp:ListItem Text="Fecha Entrega" Value="5"></asp:ListItem>
<asp:ListItem Text="Fruto - Tipo Producción" Value="6"></asp:ListItem>
<asp:ListItem Text="Tamaño" Value="7"></asp:ListItem>
<asp:ListItem Text="Tipo de Empaque" Value="8"></asp:ListItem>
<asp:ListItem Text="Estatus - Tipo de Empaque" Value="9"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GvDatos" runat="server" GridLines="None" ShowHeaderWhenEmpty="true" OnRowDataBound="GvDatos_RowDataBound" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%"
AutoGenerateColumns="False">
<Columns>
<asp:TemplateField HeaderText="Folio" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="LblFolio" runat="server" Text='<%# Eval("Folio")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cliente" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblCliente" runat="server" Text='<%# Eval("Cliente")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fruto" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblPS" runat="server" Text='<%# Eval("PS")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo Producción" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoProducto" runat="server" Text='<%# Eval("TipoProducto")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Variedad" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoMaduracion" runat="server" Text='<%# Eval("TipoMaduracion")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="FEntrega" ItemStyle-Width="15%" HeaderText="Fecha Entrega" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:TemplateField HeaderText="Estatus" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblEstatus" runat="server" Text='<%# Eval("Estatus")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Solicitado" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="LblSolicitado" runat="server" Text='<%# Eval("Solicitado")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Avance" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="LblAvance" runat="server" Text='<%# Eval("Avance")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Resta" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="LblResta" runat="server" Text='<%# Eval("Resta")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="% Avance" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="LblPorcentajeAvance" runat="server" Text='<%# Eval("PorcentajeAvance")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="7%" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<%-- <div id="DivGeneraLiquidacion" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalAdd" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Literal ID="ltlTipotitulo" Text="Generar Liquidación" runat="server"> </asp:Literal></h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-6">
<label class="col-md-3 ">Fecha Inicial:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="TxtFIL" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="LnkFIL" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MDEFIL" runat="server" TargetControlID="TxtFIL" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFIL" TargetControlID="TxtFIL" PopupButtonID="LnkFIL" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CVFIL" runat="server" ControlToValidate="TxtFIL" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGeneraLiquidacion"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCEFIL" runat="server" HighlightCssClass="vco" TargetControlID="CVFIL" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="RFVFIL" runat="server" ControlToValidate="TxtFIL" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEFIL2" runat="server" HighlightCssClass="vco" TargetControlID="RFVFIL" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="col-md-6">
<label class="col-md-3 ">Fecha Final:</label>
<div class="col-md-1">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="TxtFFL" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="LnkFFL" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MDEFFL" runat="server" TargetControlID="TxtFFL" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFFL" TargetControlID="TxtFFL" PopupButtonID="LnkFFL" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CVFFL" runat="server" ControlToValidate="TxtFFL" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGeneraLiquidacion"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCEFFL" runat="server" HighlightCssClass="vco" TargetControlID="CVFFL" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="RFVFFL" runat="server" ControlToValidate="TxtFFL" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEFFL2" runat="server" HighlightCssClass="vco" TargetControlID="RFVFFL" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlHuerta" DataValueField="CveHuerta" DataTextField="Huerta" runat="server" CssClass="form-control select2me" AppendDataBoundItems="true" Width="200px"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVHuerta" runat="server" ControlToValidate="DdlHuerta" InitialValue="-1" Display="None" ErrorMessage="El campo <b>''Huerta''</b> es requerido por la aplicación, por favor ingrese una huerta." ValidationGroup="GrpGeneraLiquidacion"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEHuerta" runat="server" HighlightCssClass="vco" TargetControlID="RFVHuerta" Width="350px"></ajax:ValidatorCalloutExtender>
<label for="<%= DdlHuerta.ClientID.ToString()%>">Huerta:</label>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnGenerar" OnClick="BtnGenerar_Click" runat="server" Text="Generar" CssClass="btn btn-primary" ValidationGroup="GrpGeneraLiquidacion" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</div>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="BtnGenerar" />
</Triggers>
</asp:UpdatePanel>
</div>--%>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

313
CGame/RepAvance.aspx.cs Normal file
View File

@@ -0,0 +1,313 @@
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_RepAvance : ClsPaginas
{
#region PROPIEDADES
private int Opcion
{
get { return (ViewState["Opcion"] == null) ? 0 : Convert.ToInt32(ViewState["Opcion"]); }
set { ViewState["Opcion"] = value; }
}
private DataTable DtIngresosPrimera
{
get { return DtIngresosPrimera = (DataTable)ViewState["DtIngresosPrimera"]; }
set { ViewState["DtIngresosPrimera"] = value; }
}
private DataTable DtIngresosSegunda
{
get { return DtIngresosSegunda = (DataTable)ViewState["DtIngresosSegunda"]; }
set { ViewState["DtIngresosSegunda"] = value; }
}
private DataTable DtGastosPrimera
{
get { return DtGastosPrimera = (DataTable)ViewState["DtGastosPrimera"]; }
set { ViewState["DtGastosPrimera"] = value; }
}
private DataTable DtGastosSegunda
{
get { return DtGastosSegunda = (DataTable)ViewState["DtGastosSegunda"]; }
set { ViewState["DtGastosSegunda"] = value; }
}
private DataTable DtGastosTotales
{
get { return DtGastosTotales = (DataTable)ViewState["DtGastosTotales"]; }
set { ViewState["DtGastosTotales"] = value; }
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Opcion = Request["Opcion"] == null ? 0 : Request["Opcion"].ToString().ToEntero();
CargaClientes();
CargaEstatus();
if (Opcion > 0)
{
txtFechaI.Text = MinFecha.ToShortDateString();
txtFechaF.Text = MaxFecha.ToShortDateString();
Consulta();
}
}
}
protected void CargaClientes()
{
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetCliente(-1, -1, UsuarioActual.CveEmpresa))
{
DdlCliente.DataSource = ObjCGame.DtResultados;
DdlCliente.Items.Insert(0, new ListItem("Todos", "-1"));
ObjCGame.Dispose();
}
DdlCliente.DataBind();
UPFiltros.Update();
}
//protected void CargaHuertas()
//{
// ClsCGame ObjCGame = new ClsCGame();
// if (ObjCGame.GetHuerta(UsuarioActual.CveEmpresa,Estatus:1))
// {
// DdlHuerta.DataSource = ObjCGame.DtResultados;
// DdlHuerta.Items.Insert(0, new ListItem("Seleccione", "-1"));
// ObjCGame.Dispose();
// }
// DdlHuerta.DataBind();
// UPFiltros.Update();
//}
protected void CargaEstatus()
{
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetEstatus(UsuarioActual.CveEmpresa,-1,1))
{
DdlEstatus.DataSource = ObjCGame.DtResultados;
DdlEstatus.Items.Insert(0, new ListItem("Todos", "-1"));
ObjCGame.Dispose();
}
DdlEstatus.DataBind();
UPFiltros.Update();
}
protected void GvDatos_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.RowIndex == 0)
{
e.Row.CssClass = "Totales";
e.Row.FCLabel("LblFolio").Text = e.Row.DBCampo("Gpo").ToString();
e.Row.Cells[5].Text = "";
}
else if (e.Row.DBCampo("CveOrdenProduccion").ToString() == "")
{
e.Row.CssClass = "SubTotales";
e.Row.FCLabel("LblFolio").Text = e.Row.DBCampo("Gpo").ToString();
e.Row.Cells[5].Text = "";
if (DdlGrupo.SelectedValue.ToEntero() == 8)
{
if (e.Row.FCLabel("LblFolio").Text == "1")
{
e.Row.FCLabel("LblFolio").Text = "Caja";
}else
{
e.Row.FCLabel("LblFolio").Text = "Bins";
}
}
}
else
{
String Css = "Texto";
String Liga = $"/CGame/OrdenProduccion.aspx?&CveOrdenProduccion={e.Row.DBCampo("CveOrdenProduccion")}&Opcion={1}";
e.Row.FCLabel("LblFolio").Text = "<a class=" + "" + Css + "" + " href=" + "" + Liga + "" + ">" + e.Row.FCLabel("LblFolio").Text + "</a>";
}
if (e.Row.FCLabel("LblPorcentajeAvance").Text.ToDouble() <= 33)
{
e.Row.Cells[11].BackColor = System.Drawing.Color.Red;
}
if (e.Row.FCLabel("LblPorcentajeAvance").Text.ToDouble() > 33 && e.Row.FCLabel("LblPorcentajeAvance").Text.ToDouble() <= 66)
{
e.Row.Cells[11].BackColor = System.Drawing.Color.Yellow;
}
if (e.Row.FCLabel("LblPorcentajeAvance").Text.ToDouble() > 66)
{
e.Row.Cells[11].BackColor = System.Drawing.Color.Green;
}
e.Row.FCLabel("LblAvance").Text = e.Row.FCLabel("LblAvance").Text.FormatoNumero(0);
e.Row.FCLabel("LblResta").Text = e.Row.FCLabel("LblResta").Text.FormatoNumero(0);
e.Row.FCLabel("LblPorcentajeAvance").Text = e.Row.FCLabel("LblPorcentajeAvance").Text.FormatoNumero()+"%" ;
}
}
private void Consulta()
{
String Folio;
if (TxtFolio.Text != "") { Folio = TxtFolio.Text; } else { Folio = "-1"; }
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetRepAvance(UsuarioActual.CveEmpresa, -1, DdlCliente.SelectedValue.ToEntero(), Folio, DdlEstatus.SelectedValue.ToEntero(), txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(),DdlGrupo.SelectedValue.ToEntero()))
{
GvDatos.DataSource = ObjCGame.DtResultados;
ObjCGame.Dispose();
}
GvDatos.DataBind();
UPDatos.Update();
}
protected void BtnConsultar_Click(object sender, EventArgs e)
{
Consulta();
}
//protected void BtnGenerar_Click(object sender, EventArgs e)
//{
// GenerarPDF();
//}
//protected void GenerarPDF()
//{
// ClsCGame ObjCGame = new ClsCGame();
// if (ObjCGame.GetLiquidacionIngresosHuerta(DdlHuerta.SelectedValue.ToEntero(), TxtFIL.Text.ToDate(), TxtFFL.Text.ToDate(),1))
// {
// DtIngresosPrimera = ObjCGame.DtResultados.Copy();
// }
// if (ObjCGame.GetLiquidacionIngresosHuerta(DdlHuerta.SelectedValue.ToEntero(), TxtFIL.Text.ToDate(), TxtFFL.Text.ToDate(),2))
// {
// DtIngresosSegunda = ObjCGame.DtResultados.Copy();
// }
// if (ObjCGame.GetLiquidacionEgresosHuerta(DdlHuerta.SelectedValue.ToEntero(), TxtFIL.Text.ToDate(), TxtFFL.Text.ToDate(),1))
// {
// DtGastosPrimera = ObjCGame.DtResultados.Copy();
// }
// if (ObjCGame.GetLiquidacionEgresosHuerta(DdlHuerta.SelectedValue.ToEntero(), TxtFIL.Text.ToDate(), TxtFFL.Text.ToDate(), 2))
// {
// DtGastosSegunda = ObjCGame.DtResultados.Copy();
// }
// if (ObjCGame.GetLiquidacionGastosAgrupadosHuerta(DdlHuerta.SelectedValue.ToEntero(), TxtFIL.Text.ToDate(), TxtFFL.Text.ToDate()))
// {
// DtGastosTotales = ObjCGame.DtResultados.Copy();
// }
// ObjCGame.Dispose();
// if ((DtIngresosPrimera.Rows.Count > 0 || DtIngresosSegunda.Rows.Count > 0) || (DtGastosPrimera.Rows.Count > 0 || DtGastosSegunda.Rows.Count > 0))
// {
// double TotIngresosPrimera = 0, TotIngresosSegunda = 0, TotGastosPrimera = 0, TotGastosSegunda = 0, TotPesoPrimera = 0, TotPesoSegunda = 0, MermaPrimera = 0, MermaSegunda = 0, TotCantidadPrimera=0, TotCantidadSegunda=0;
// if (DtIngresosPrimera.Rows.Count > 0) { TotIngresosPrimera = DtIngresosPrimera.SUM("Importe"); TotPesoPrimera = DtIngresosPrimera.SUM("Peso"); MermaPrimera = DtIngresosPrimera.SUM("Merma"); TotCantidadPrimera = DtIngresosPrimera.SUM("Cantidad"); }
// if (DtIngresosSegunda.Rows.Count > 0) { TotIngresosSegunda = DtIngresosSegunda.SUM("Importe"); TotPesoSegunda = DtIngresosSegunda.SUM("Peso"); MermaSegunda = DtIngresosSegunda.SUM("Merma"); TotCantidadSegunda = DtIngresosSegunda.SUM("Cantidad"); }
// if (DtGastosPrimera.Rows.Count > 0) { TotGastosPrimera = DtGastosPrimera.Rows[0]["Importe"].ToString().ToDouble(); }
// if (DtGastosSegunda.Rows.Count > 0) { TotGastosSegunda = DtGastosSegunda.Rows[0]["Importe"].ToString().ToDouble(); }
// System.IO.FileInfo Imagen = new System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta));
// String logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa);
// List<ReportParameter> para = new List<ReportParameter>();
// para.Add(new ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa));
// para.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre));
// para.Add(new ReportParameter("FechaImpresion", DateTime.Now.ToString()));
// para.Add(new ReportParameter("Huerta", DdlHuerta.SelectedItem.Text));
// para.Add(new ReportParameter("UtilidadPrimera", (TotIngresosPrimera - TotGastosPrimera).FormatoNumero()));
// para.Add(new ReportParameter("UtilidadSegunda", (TotIngresosSegunda - TotGastosSegunda).FormatoNumero()));
// para.Add(new ReportParameter("Utilidad", ((TotIngresosPrimera - TotGastosPrimera) + (TotIngresosSegunda - TotGastosSegunda)).FormatoNumero()));
// para.Add(new ReportParameter("TotMermaPrimera", MermaPrimera.FormatoNumero()));
// para.Add(new ReportParameter("TotMermaSegunda", MermaSegunda.FormatoNumero()));
// para.Add(new ReportParameter("TotPrecioCortePrimera", TotIngresosPrimera.FormatoNumero()));
// para.Add(new ReportParameter("TotPrecioCorteSegunda", TotIngresosSegunda.FormatoNumero()));
// para.Add(new ReportParameter("TotCortePrimera", TotPesoPrimera.FormatoNumero(0)));
// para.Add(new ReportParameter("TotCorteSegunda", TotPesoSegunda.FormatoNumero(0)));
// para.Add(new ReportParameter("TotCantidadPrimera", TotCantidadPrimera.FormatoNumero(0)));
// para.Add(new ReportParameter("TotCantidadSegunda", TotCantidadSegunda.FormatoNumero(0)));
// para.Add(new ReportParameter("PorcentajeCortePri", (TotPesoPrimera * 100 / (TotPesoPrimera + TotPesoSegunda)).FormatoNumero(2)));
// para.Add(new ReportParameter("PorcentajeCorteSeg", (TotPesoSegunda * 100 / (TotPesoPrimera + TotPesoSegunda)).FormatoNumero(2)));
// para.Add(new ReportParameter("Fecha", $"Liquidación correspondiente del {TxtFIL.Text} al {TxtFFL.Text} ({DtIngresosPrimera.COUNT("CveOrdenCorte").ToString().FormatoNumero(0)} Cortes)"));
// para.Add(new ReportParameter("PesoNeto", (TotPesoPrimera + TotPesoSegunda).FormatoNumero()));
// para.Add(new ReportParameter("TotIngresos", (TotIngresosPrimera + TotIngresosSegunda).FormatoNumero()));
// para.Add(new ReportParameter("TotGastos", (TotGastosPrimera + TotGastosSegunda).FormatoNumero()));
// para.Add(new ReportParameter("Retorno",((TotIngresosPrimera + TotIngresosSegunda) - (TotGastosPrimera + TotGastosSegunda)).FormatoNumero()));
// para.Add(new ReportParameter("PrecioArbol", (((TotIngresosPrimera + TotIngresosSegunda) - (TotGastosPrimera + TotGastosSegunda)) /(TotPesoPrimera + TotPesoSegunda)).FormatoNumero()));
// DataTable DtGrafica1 = new DataTable();
// DtGrafica1.Columns.Add("Concepto");
// DtGrafica1.Columns.Add("Importe");
// DataRow DrGrafica1 = DtGrafica1.NewRow();
// DrGrafica1["Concepto"] = "Empacado";
// DrGrafica1["Importe"] = TotPesoPrimera.FormatoNumero();
// DtGrafica1.Rows.Add(DrGrafica1);
// DataRow Dr2Grafica1 = DtGrafica1.NewRow();
// Dr2Grafica1["Concepto"] = "Jugo";
// Dr2Grafica1["Importe"] = TotPesoSegunda.FormatoNumero();
// DtGrafica1.Rows.Add(Dr2Grafica1);
// DataTable DtGrafica2 = new DataTable();
// DtGrafica2.Columns.Add("Concepto");
// DtGrafica2.Columns.Add("Importe");
// DataRow DrGrafica2 = DtGrafica2.NewRow();
// DrGrafica2["Concepto"] = "Ingresos";
// DrGrafica2["Importe"] = (TotIngresosPrimera + TotIngresosSegunda).FormatoNumero();
// DtGrafica2.Rows.Add(DrGrafica2);
// DataRow Dr2Grafica2 = DtGrafica2.NewRow();
// Dr2Grafica2["Concepto"] = "Gastos";
// Dr2Grafica2["Importe"] = (TotGastosPrimera + TotGastosSegunda).FormatoNumero();
// DtGrafica2.Rows.Add(Dr2Grafica2);
// if (Imagen.Exists)
// {
// para.Add(new ReportParameter("LogoPath", logouri));
// }
// else
// {
// para.Add(new ReportParameter("LogoPath", ""));
// }
// List<ReportDataSource> lrds = new List<ReportDataSource>();
// ReportDataSource rds = new ReportDataSource();
// rds.Name = "DataSet1"; rds.Value = DtIngresosPrimera;
// ReportDataSource rds2 = new ReportDataSource();
// rds2.Name = "DataSet2"; rds2.Value = DtGastosPrimera;
// ReportDataSource rds3 = new ReportDataSource();
// rds3.Name = "DataSet3"; rds3.Value = DtIngresosSegunda;
// ReportDataSource rds4 = new ReportDataSource();
// rds4.Name = "DataSet4"; rds4.Value = DtGastosSegunda;
// ReportDataSource rds5 = new ReportDataSource();
// rds5.Name = "DataSet5"; rds5.Value = DtGastosTotales;
// ReportDataSource rds6 = new ReportDataSource();
// rds6.Name = "DataSet6"; rds6.Value = DtGrafica1;
// ReportDataSource rds7 = new ReportDataSource();
// rds7.Name = "DataSet7"; rds7.Value = DtGrafica2;
// lrds.Add(rds);
// lrds.Add(rds2);
// lrds.Add(rds3);
// lrds.Add(rds4);
// lrds.Add(rds5);
// lrds.Add(rds6);
// lrds.Add(rds7);
// ImprimirPDF("Empresas/Grales/Formatos/Liquidacion.rdlc", lrds, para, "Liquidacion", "PDF");
// }
// else
// {
// Alert("No se encontraron datos.", TipoMensaje.MsgAdvertencia);
// }

106
CGame/RepCorte.aspx Normal file
View File

@@ -0,0 +1,106 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepCorte.aspx.cs" Inherits="CGame_RepCorte" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Reporte de Cortes
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" id="idnecesaria">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" Text="Consultar" class="btn btn-primary" />
<a href="javascript:;" class="expand"></a>
</div>
<div class="titlefiltros caption">
<div class="row">
<label class="col-md-1 ">Huerta:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlHuerta" runat="server" AppendDataBoundItems="true" DataTextField="Huerta" DataValueField="CveHuerta" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
</asp:DropDownList>
</div>
<label class="col-md-1 ">Fecha Inicial:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<label class="col-md-1 ">Fecha Final:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
<div class="portlet-body">
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GvDatos" runat="server" GridLines="None" ShowHeaderWhenEmpty="true" EmptyDataText="No se han encontrado gastos de corte con los filtros seleccionados" OnRowDataBound="GvDatos_RowDataBound" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="99%" data-sort="true" AutoGenerateColumns="False">
<Columns>
<asp:HyperLinkField DataTextField="Folio" DataNavigateUrlFields="CveProduccion" DataNavigateUrlFormatString="/CGame/Empaque.aspx?CveProduccion={0}" ItemStyle-HorizontalAlign="Center" HeaderText="Folio" />
<asp:BoundField DataField="Col1" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" Visible="false" />
<asp:BoundField DataField="Col2" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" Visible="false" />
<asp:BoundField DataField="Col3" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" Visible="false" />
<asp:BoundField DataField="Col4" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" Visible="false" />
<asp:BoundField DataField="Col5" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" Visible="false" />
<asp:BoundField DataField="Col6" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" Visible="false" />
<asp:BoundField DataField="Col7" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" Visible="false" />
<asp:BoundField DataField="Col8" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" Visible="false" />
<asp:BoundField DataField="Col9" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" Visible="false" />
<asp:BoundField DataField="Col10" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" Visible="false" />
<asp:BoundField DataField="Col11" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" Visible="false" />
<asp:BoundField DataField="Col12" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" Visible="false" />
<asp:BoundField DataField="Col13" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" Visible="false" />
<asp:BoundField DataField="Col14" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" Visible="false" />
<asp:BoundField DataField="Col15" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" Visible="false" />
<asp:BoundField DataField="Col16" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" Visible="false" />
<asp:BoundField DataField="Col17" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" Visible="false" />
<asp:BoundField DataField="Col18" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" Visible="false" />
<asp:BoundField DataField="Col19" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" Visible="false" />
<asp:BoundField DataField="Col20" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" Visible="false" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

107
CGame/RepCorte.aspx.cs Normal file
View File

@@ -0,0 +1,107 @@
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_RepCorte : ClsPaginas
{
#region PROPIEDADES
private DataTable DtCorte
{
get { return DtCorte = (DataTable)ViewState["DtCorte"]; }
set { ViewState["DtCorte"] = value; }
}
#endregion
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.GetRepCorte(DdlHuerta.SelectedValue.ToEntero(), txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), UsuarioActual.CveEmpresa))
{
DtCorte = ObjCGame.DtResultados.Copy();
int NumColumna = 1, ColTotales = 0;
ColTotales = DtCorte.Columns.Count;
for (int i = 0; i < ColTotales; i++)
{
if (i >= 2)
{
if (DtCorte.Rows[0][DtCorte.Columns[i].ColumnName].ToString().ToDouble() < 1)
{
DtCorte.Columns.Remove(DtCorte.Columns[i]);
i--;
ColTotales--;
}
else
{
GvDatos.Columns[NumColumna].HeaderText = DtCorte.Columns[i].ColumnName;
GvDatos.Columns[NumColumna].Visible = true;
DtCorte.Columns.Add("Nom" + NumColumna);
DtCorte.Rows[0]["Nom" + NumColumna] = DtCorte.Columns[i].ColumnName;
DtCorte.Columns[i].ColumnName = "Col" + NumColumna;
NumColumna++;
}
}
}
for (int i = NumColumna; i <= 20; i++)
{
DtCorte.Columns.Add("Nom" + i);
DtCorte.Rows[0]["Nom" + i] = "";
DtCorte.Columns.Add("Col" + i);
DtCorte.Rows[0]["Col" + i] = "";
}
GvDatos.DataSource = DtCorte;
}
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)

135
CGame/RepCorteGasto.aspx Normal file
View File

@@ -0,0 +1,135 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepCorteGasto.aspx.cs" Inherits="CGame_RepCorteGasto" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Reporte de Gastos en Corte
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" id="idnecesaria">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" Text="Consultar" class="btn btn-primary" />
<a href="javascript:;" class="expand"></a>
</div>
<div class="titlefiltros caption">
<div class="row">
<label class="col-md-1 ">Grupo:</label>
<div class="col-md-3">
<asp:DropDownList ID="DdlGrupo" runat="server" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-sm select2me" Width="70%">
<asp:ListItem Text="Huerta" Value="1"></asp:ListItem>
<asp:ListItem Text="Huerta - Corte" Value="2"></asp:ListItem>
</asp:DropDownList>
</div>
<label class="col-md-1 ">Fecha Inicial:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control" Text="01/09/2017" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<label class="col-md-1 ">Fecha Final:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control" Text="31/08/2018" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
<div class="portlet-body" style="display: none;">
<div class="row">
<label class="col-md-1 ">Concepto:</label>
<div class="col-md-3">
<asp:DropDownList ID="DdlConcepto" runat="server" AppendDataBoundItems="true" DataTextField="ConceptoGastoCorte" DataValueField="CveConceptoGastoCorte" Class="table-group-action-input form-control input-inline input-sm select2me" Width="70%">
</asp:DropDownList>
</div>
<label class="col-md-1 ">Huerta:</label>
<div class="col-md-3">
<asp:DropDownList ID="DdlHuerta" runat="server" AppendDataBoundItems="true" DataTextField="Huerta" DataValueField="CveHuerta" Class="table-group-action-input form-control input-inline input-sm select2me" Width="70%">
</asp:DropDownList>
</div>
<label class="col-md-1 ">Modalidad:</label>
<div class="col-md-3">
<asp:DropDownList ID="DdlModalidad" runat="server" OnSelectedIndexChanged="DdlModalidad_SelectedIndexChanged" AutoPostBack="true" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-sm select2me" Width="70%">
<asp:ListItem Text="Gastos" Value="1"></asp:ListItem>
<asp:ListItem Text="Otros Gastos" Value="2"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div id="DivGastos" runat="server">
<div class="row">
<div class="col-md-7">
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda3" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda3','{0}')", GvGastos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda3','{0}')", GvGastos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GvGastos" runat="server" GridLines="None" OnRowDataBound="GvGastos_RowDataBound" EmptyDataText="No se encontraron gastos de corte con los filtroa especificados" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" AutoGenerateColumns="False">
<Columns>
<asp:BoundField DataField="ConceptoGastoCorte" HeaderText="Concepto" />
<asp:BoundField DataField="Cantidad" HeaderText="Cantidad" DataFormatString="{0:#,##0.##}" />
<asp:BoundField DataField="PU" HeaderText="PU" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="Total" HeaderText="Total" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Center" />
</Columns>
</asp:GridView>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpOtrosGastos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div id="DivOtrosGastos" runat="server" visible="false">
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda5" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda5','{0}')", GvOtrosGastos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda5','{0}')", GvOtrosGastos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GvOtrosGastos" runat="server" OnRowDataBound="GvOtrosGastos_RowDataBound" DataKeyNames="CveCompra" EmptyDataText="No se encontraron otros gastos con los filtroa especificados" GridLines="None" ShowHeaderWhenEmpty="true" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False">
<Columns>
<asp:BoundField DataField="RazonSocial" HeaderText="Proveedor" />
<asp:HyperLinkField HeaderText="Folio" DataTextField="SerieFolio" DataNavigateUrlFields="CveCompra" DataNavigateUrlFormatString="/Compras/Compras.aspx?CveCompra={0}" Target="_blank" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="Fecha" HeaderStyle-HorizontalAlign="Left" ItemStyle-Width="15%" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:BoundField DataField="SubTotal" HeaderText="Importe" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="Descripcion" HeaderText="Descripción" />
</Columns>
</asp:GridView>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

174
CGame/RepCorteGasto.aspx.cs Normal file
View File

@@ -0,0 +1,174 @@
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_RepCorteGasto : ClsPaginas
{
#region PROPIEDADES
private int CveHuerta
{
get { return (ViewState["CveHuerta"] == null) ? 0 : Convert.ToInt32(ViewState["CveHuerta"]); }
set { ViewState["CveHuerta"] = value; }
}
private int Modalidad
{
get { return (ViewState["Modalidad"] == null) ? 0 : Convert.ToInt32(ViewState["Modalidad"]); }
set { ViewState["Modalidad"] = value; }
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
InicializaValores();
}
}
private void InicializaValores()
{
CargaConceptos();
CargaHuerta();
txtFechaI.Text = DateTime.Now.ToShortDateString();
txtFechaF.Text = DateTime.Now.ToShortDateString();
CveHuerta = Request["CveHuerta"] == null ? 0 : Request["CveHuerta"].ToString().ToEntero();
Modalidad = Request["Modalidad"] == null ? 0 : Request["Modalidad"].ToString().ToEntero();
if (CveHuerta > 0)
{
DdlHuerta.SelectedValueExist(CveHuerta);
DdlGrupo.SelectedValue = "2";
DdlModalidad.SelectedValueExist(Modalidad);
txtFechaI.Text = MinFecha.ToShortDateString();
txtFechaF.Text = MaxFecha.ToShortDateString();
if (Modalidad == 2) { DivGastos.Visible = false; DivOtrosGastos.Visible = true; }
}
Consultar();
}
private void CargaConceptos()
{
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetConceptoGastoCorte(UsuarioActual.CveEmpresa, Estatus: 1))
{
DdlConcepto.DataSource = ObjCGame.DtResultados;
DdlConcepto.Items.Insert(0, new ListItem("Todos", "-1"));
ObjCGame.Dispose();
}
DdlConcepto.DataBind();
UPFiltros.Update();
}
private void CargaHuerta()
{
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetHuerta(UsuarioActual.CveEmpresa, Estatus: 1))
{
DdlHuerta.DataSource = ObjCGame.DtResultados;
DdlHuerta.Items.Insert(0, new ListItem("Todos", "-1"));
ObjCGame.Dispose();
}
DdlHuerta.DataBind();
UPFiltros.Update();
}
protected void BtnConsultar_Click(object sender, EventArgs e)
{
Consultar();
}
private void Consultar()
{
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetRepCorteGasto(UsuarioActual.CveEmpresa, DdlHuerta.SelectedValue.ToEntero(), DdlConcepto.SelectedValue.ToEntero(), txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), DdlGrupo.SelectedValue.ToEntero(),DdlModalidad.SelectedValue.ToEntero()))
{
if (DdlModalidad.SelectedValue.ToEntero() == 2) { GvOtrosGastos.DataSource = ObjCGame.DtResultados; } else { GvGastos.DataSource = ObjCGame.DtResultados; }
ObjCGame.Dispose();
}
if (DdlModalidad.SelectedValue.ToEntero() == 2) { GvOtrosGastos.DataBind(); } else { GvGastos.DataBind(); }
UpDatos.Update();
UpOtrosGastos.Update();
}
protected void GvGastos_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.RowIndex == 0)
{
e.Row.CssClass = "Totales";
e.Row.Cells[0].Text = "Total";
}
if (e.Row.RowIndex > 0 && DdlGrupo.SelectedValue.ToEntero() == 1)
{
if (e.Row.DBCampo("ConceptoGastoCorte").ToString() == "")
{
e.Row.CssClass = "SubTotales";
e.Row.Cells[0].Text = e.Row.DBCampo("Gpo").ToString();
}
}
else if (e.Row.RowIndex > 0 && DdlGrupo.SelectedValue.ToEntero() == 2)
{
if (e.Row.DBCampo("ConceptoGastoCorte").ToString() == "" && e.Row.DBCampo("Gpo").ToString() == e.Row.DBCampo("Huerta").ToString())
{
e.Row.CssClass = "SubTotales";
e.Row.Cells[0].Text = e.Row.DBCampo("Huerta").ToString();
}
else if (e.Row.DBCampo("ConceptoGastoCorte").ToString() == "")
{
e.Row.CssClass = "SubTotales2";
e.Row.Cells[0].Text = e.Row.DBCampo("Gpo").ToString();
}
}
}
}
protected void GvOtrosGastos_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.RowIndex == 0)
{
e.Row.CssClass = "Totales";
e.Row.Cells[0].Text = "Total";
}
if (e.Row.RowIndex > 0 && DdlGrupo.SelectedValue.ToEntero() == 1)
{
if (e.Row.DBCampo("RazonSocial").ToString() == "")
{
e.Row.CssClass = "SubTotales";
e.Row.Cells[0].Text = e.Row.DBCampo("Gpo").ToString();
}
}
else if (e.Row.RowIndex > 0 && DdlGrupo.SelectedValue.ToEntero() == 2)
{
if (e.Row.DBCampo("RazonSocial").ToString() == "" && e.Row.DBCampo("Gpo").ToString() == e.Row.DBCampo("Huerta").ToString())
{
e.Row.CssClass = "SubTotales";
e.Row.Cells[0].Text = e.Row.DBCampo("Huerta").ToString();
}
else if (e.Row.DBCampo("RazonSocial").ToString() == "")
{
e.Row.CssClass = "SubTotales2";
e.Row.Cells[0].Text = e.Row.DBCampo("Gpo").ToString();
}
}
}
}
protected void DdlModalidad_SelectedIndexChanged(object sender, EventArgs e)
{
if (DdlModalidad.SelectedValue.ToEntero() == 1)
{
DivGastos.Visible = true;
DivOtrosGastos.Visible = false;
}
else
{

202
CGame/RepEmpaque.aspx Normal file
View File

@@ -0,0 +1,202 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepEmpaque.aspx.cs" Inherits="CGame_RepEmpaque" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Reporte de Empaques
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
<li>
<asp:LinkButton ID="LnkPdf" OnClick="LnkPdf_Click" runat="server"> <i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="ImgExcel" OnClick="ImgExcel_Click" runat="server"><i class="fa fa-ad-excel"></i> Exporta Excel</asp:LinkButton>
</li>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" id="idnecesaria">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" OnClick="Consultar_Click" runat="server" Text="Consultar" class="btn btn-primary" />
<a href="javascript:;" class="expand"></a>
</div>
<div class="titlefiltros caption">
<div class="row">
<label class="col-md-1 ">Folio:</label>
<div class="col-md-2">
<asp:TextBox ID="TxtFolio" runat="server" MaxLength="20"></asp:TextBox>
</div>
<label class="col-md-1 ">Fecha Inicial:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<label class="col-md-1 ">Fecha Final:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
<div class="portlet-body">
<div class="row">
<label class="col-md-1 ">Huerta:</label>
<div class="col-md-3">
<asp:DropDownList ID="DdlHuerta" runat="server" AppendDataBoundItems="true" DataTextField="Huerta" DataValueField="CveHuerta" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
</asp:DropDownList>
</div>
<label class="col-md-1 ">Modalidad:</label>
<div class="col-md-3">
<asp:DropDownList ID="DdlModalidad" runat="server" OnSelectedIndexChanged="DdlModalidad_SelectedIndexChanged" AutoPostBack="true" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-sm select2me" Width="70%">
<asp:ListItem Text="Materiales" Value="1"></asp:ListItem>
<asp:ListItem Text="PreEnfriado" Value="2"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div id="DivGvDatos" runat="server">
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GvDatos" runat="server" GridLines="None" ShowHeaderWhenEmpty="true" EmptyDataText="No se han encontrado empaques con los filtros seleccionados" OnRowDataBound="GvDatos_RowDataBound" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False"
DataKeyNames="CveProduccion">
<Columns>
<asp:TemplateField HeaderText="Folio" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="LblFolio" runat="server" Text='<%# Eval("Folio")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Huerta" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblHuerta" runat="server" Text='<%# Eval("Huerta")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Importe" HeaderText="Importe" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="Corte" HeaderText="Corte" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="Unidades" HeaderText="Unidades" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="Primera" HeaderText="Primera" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="PorcentajePrimera" HeaderText="% Primera" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="Segunda" HeaderText="Segunda" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="PorcentajeSegunda" HeaderText="% Segunda" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="Jugo" HeaderText="Jugo" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="PorcentajeJugo" HeaderText="% Jugo" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="Merma" HeaderText="Merma" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="PorcentajeMerma" HeaderText="% Merma" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="En Piso" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="% En Piso" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="Fecha" ItemStyle-Width="15%" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<%-- <asp:BoundField DataField="FechaIng" ItemStyle-Width="15%" HeaderText="Fecha Ingreso" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:TemplateField HeaderText="Usuario" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblUsuario" runat="server" Text='<%# Eval("Usuario")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>--%>
<asp:HyperLinkField ItemStyle-Width="15%" Target="_blank" ItemStyle-HorizontalAlign="Center" />
</Columns>
</asp:GridView>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpPreEnfriado" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div id="DivGvPreEnfriado" runat="server">
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda2" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvPreEnfriado.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvPreEnfriado.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GvPreEnfriado" runat="server" GridLines="None" ShowHeaderWhenEmpty="true" OnRowDataBound="GvPreEnfriado_RowDataBound" EmptyDataText="No se han encontrado empaques con los filtros seleccionados" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False"
DataKeyNames="CveProduccion">
<Columns>
<asp:HyperLinkField HeaderText="Folio" DataTextField="Folio" DataNavigateUrlFields="CveProduccion" DataNavigateUrlFormatString="/CGame/Empaque.aspx?CveProduccion={0}" Target="_blank" ItemStyle-HorizontalAlign="Center" />
<asp:TemplateField HeaderText="Cantidad" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="LblCantidad" runat="server" Text='<%# Eval("Cantidad")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fruto" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblPS" runat="server" Text='<%# Eval("PS")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo Producción" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoProducto" runat="server" Text='<%# Eval("TipoProducto")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Variedad" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoMaduracion" runat="server" Text='<%# Eval("TipoMaduracion")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo Empaque" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoEmpaque" runat="server" Text='<%# Eval("TipoEmpaque")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tamaño" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTamaño" runat="server" Text='<%# Eval("Tamaño")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="PLU" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoEtiqueta" runat="server" Text='<%# Eval("CveTipoEtiqueta")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Calidad" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblCalidad" runat="server" Text='<%# Eval("Calidad")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Etiqueta" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoCaja" runat="server" Text='<%# Eval("TipoCaja")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Peso" HeaderText="Peso" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="ImportePreEnfriado" HeaderText="Importe" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:HyperLinkField ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center" Target="_blank" />
</Columns>
</asp:GridView>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

208
CGame/RepEmpaque.aspx.cs Normal file
View File

@@ -0,0 +1,208 @@
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_RepEmpaque : ClsPaginas
{
#region PROPIEDADES
private DataTable DtDatos
{
get { return DtDatos = (DataTable)ViewState["DtDatos"]; }
set { ViewState["DtDatos"] = value; }
}
private int CveHuerta
{
get { return (ViewState["CveHuerta"] == null) ? 0 : Convert.ToInt32(ViewState["CveHuerta"]); }
set { ViewState["CveHuerta"] = value; }
}
private int Modalidad
{
get { return (ViewState["Modalidad"] == null) ? 0 : Convert.ToInt32(ViewState["Modalidad"]); }
set { ViewState["Modalidad"] = value; }
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
txtFechaI.Text = DateTime.Now.ToString();
txtFechaF.Text = DateTime.Now.ToString();
CveHuerta = Request["CveHuerta"] == null ? 0 : Request["CveHuerta"].ToString().ToEntero();
Modalidad = Request["Modalidad"] == null ? 0 : Request["Modalidad"].ToString().ToEntero();
txtFechaI.Text = Request["FechaI"] == null ? DateTime.Now.ToString() : Request["FechaI"].ToString();
txtFechaF.Text = Request["FechaF"] == null ? DateTime.Now.ToString() : Request["FechaF"].ToString();
CargaHuerta();
if (CveHuerta > 0) { DdlHuerta.SelectedValueExist(CveHuerta); }
if (Modalidad > 0) { DdlModalidad.SelectedValueExist(Modalidad); }
CambioModalidad();
Consulta();
}
}
protected void CargaHuerta()
{
ClsCGame ObjCort = new ClsCGame();
if (ObjCort.GetHuerta(UsuarioActual.CveEmpresa))
{
DdlHuerta.DataSource = ObjCort.DtResultados;
DdlHuerta.Items.Insert(0, new ListItem("Todos", "-1"));
DdlHuerta.DataBind();
}
ObjCort.Dispose();
UPDatos.Update();
}
protected void Consultar_Click(object sender, EventArgs e)
{
Consulta();
}
private void Consulta()
{
String Folio;
if (TxtFolio.Text != "") { Folio = TxtFolio.Text; } else { Folio = "-1"; }
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetProduccion(UsuarioActual.CveEmpresa, Folio, -1, DdlHuerta.SelectedValue.ToEntero(), txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Opcion: 1, Modalidad: DdlModalidad.SelectedValue.ToEntero()))
{
if (DdlModalidad.SelectedValue.ToEntero() == 2) { GvPreEnfriado.DataSource = ObjCGame.DtResultados; } else { GvDatos.DataSource = ObjCGame.DtResultados; }
DtDatos = ObjCGame.DtResultados;
ObjCGame.Dispose();
}
if (DdlModalidad.SelectedValue.ToEntero() == 2) { GvPreEnfriado.DataBind(); } else { GvDatos.DataBind(); }
UPDatos.Update();
UpPreEnfriado.Update();
}
#region GridView
protected void GvDatos_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[13].Text = (e.Row.DBCampo("Corte").ToDouble() - e.Row.DBCampo("Unidades").ToDouble() - e.Row.DBCampo("Merma").ToDouble()).FormatoNumero();
e.Row.Cells[14].Text = ((e.Row.Cells[13].Text.ToDouble() * 100) / e.Row.DBCampo("Corte").ToDouble()).FormatoNumero();
if (e.Row.RowIndex == 0)
{
e.Row.Cells[0].Text = "Total";
e.Row.CssClass = "Totales";
e.Row.Cells[6].Text = ((e.Row.DBCampo("Primera").ToDouble()*100)/ (e.Row.DBCampo("Unidades").ToDouble() + e.Row.DBCampo("Merma").ToDouble())).FormatoNumero();
e.Row.Cells[8].Text = ((e.Row.DBCampo("Segunda").ToDouble() * 100) / (e.Row.DBCampo("Unidades").ToDouble() + e.Row.DBCampo("Merma").ToDouble())).FormatoNumero();
e.Row.Cells[10].Text = ((e.Row.DBCampo("Jugo").ToDouble() * 100) / (e.Row.DBCampo("Unidades").ToDouble() + e.Row.DBCampo("Merma").ToDouble())).FormatoNumero();
e.Row.Cells[12].Text = ((e.Row.DBCampo("Merma").ToDouble() * 100) / (e.Row.DBCampo("Unidades").ToDouble() + e.Row.DBCampo("Merma").ToDouble())).FormatoNumero();
}
else
{
String Css = "Texto";
String Liga = $"/CGame/Empaque.aspx?&CveProduccion={e.Row.DataKey("CveProduccion")}";
e.Row.FCLabel("LblFolio").Text = "<a class=" + "" + Css + "" + " href=" + "" + Liga + "" + ">" + e.Row.FCLabel("LblFolio").Text + "</a>";
e.Row.Cells[16].Text = "Ver Resultados";
String Liga2 = String.Format("/CGame/RepEmpaqueDetalle.aspx?&CveHuerta={0}&Folio={1}&FechaInicial={2}&FechaFinal={3}&CveProduccion={4}", e.Row.DBCampo("CveHuerta"), e.Row.DBCampo("Folio"), e.Row.DBCampo("FechaInicio").ToDate().ToShortDateString(), e.Row.DBCampo("FechaFin").ToDate().ToShortDateString(), e.Row.DBCampo("CveProduccion"));
e.Row.Cells[16].Text = "<a class=" + "" + Css + "" + " href=" + "" + Liga2 + "" + ">" + e.Row.Cells[16].Text + "</a>";
}
}
}
#endregion
protected void GenerarPDF(String Opcion)
{
String FechaF;
if (txtFechaF.Text == "" || txtFechaF.Text == "__/__/____") { FechaF = "-1"; } else { FechaF = $"&emsp;<b>Fecha Entrega Final:</b> {txtFechaF.Text}"; }
String FechaI;
if (txtFechaI.Text == "" || txtFechaI.Text == "__/__/____") { FechaI = "-1"; } else { FechaI = $"&emsp;<b>Fecha Entrega Inicial:</b> {txtFechaI.Text}"; }
String Huerta;
if (DdlHuerta.SelectedValue != "-1") { Huerta = $"&emsp;<b>Huerta:</b> {DdlHuerta.SelectedItem.Text}"; } else { Huerta = ""; }
String Folio;
if (TxtFolio.Text != "") { Folio = $"&emsp;<b>Folio:</b> {TxtFolio.Text}"; } else { Folio = ""; }
if (DtDatos.Rows.Count > 0)
{
DtDatos.Columns.Add("EnPiso");
foreach (DataRow Dt in DtDatos.Rows)
{
Dt["EnPiso"] = (Dt["Corte"].ToString().ToDouble() - Dt["Unidades"].ToString().ToDouble() - Dt["Merma"].ToString().ToDouble()).FormatoNumero();
}
System.IO.FileInfo Imagen = new System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta));
String logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa);
List<ReportParameter> para = new List<ReportParameter>();
para.Add(new ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa));
para.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre));
para.Add(new ReportParameter("FechaImpresion", DateTime.Now.ToString()));
para.Add(new ReportParameter("AgrupadoPor", $"<b>Agrupado Por:</b> {Folio}{Huerta}{FechaI}{FechaF}"));
if (Imagen.Exists)
{
para.Add(new ReportParameter("LogoPath", logouri));
}
else
{
para.Add(new ReportParameter("LogoPath", ""));
}
ImprimirPDF("Empresas/Grales/Formatos/RepEmpaque.rdlc", DtDatos, para, "Reporte de Empaque", Opcion);
}
else
{
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia);
}
}
protected void LnkPdf_Click(object sender, EventArgs e)
{
GenerarPDF("PDF");
}
protected void ImgExcel_Click(object sender, EventArgs e)
{
GenerarPDF("EXCEL");
}
protected void DdlModalidad_SelectedIndexChanged(object sender, EventArgs e)
{
CambioModalidad();
}
private void CambioModalidad()
{
if (DdlModalidad.SelectedValue.ToEntero() == 1)
{
DivGvDatos.Visible = true;
DivGvPreEnfriado.Visible = false;
LnkPdf.Visible = true;
}
else
{
DivGvDatos.Visible = false;
DivGvPreEnfriado.Visible = true;
LnkPdf.Visible = false;
}
UPDatos.Update();
UpPreEnfriado.Update();
}
protected void GvPreEnfriado_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("CveTipoEtiqueta").ToEntero() == 1)
{
e.Row.FCLabel("LblTipoEtiqueta").Text = "Si";
}
else
{
e.Row.FCLabel("LblTipoEtiqueta").Text = "No";
}

View File

@@ -0,0 +1,155 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepEmpaqueDetalle.aspx.cs" Inherits="CGame_RepEmpaque" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Reporte de Empaques Detalle
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
<%-- <li>
<asp:LinkButton ID="LnkPdf" OnClick="LnkPdf_Click" runat="server"> <i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="ImgExcel" OnClick="ImgExcel_Click" runat="server"><i class="fa fa-ad-excel"></i> Exporta Excel</asp:LinkButton>
</li>--%>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" id="idnecesaria">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" OnClick="Consultar_Click" runat="server" Text="Consultar" class="btn btn-primary" />
<a href="javascript:;" class="expand"></a>
</div>
<div class="titlefiltros caption">
<div class="row">
<label class="col-md-1 ">Folio:</label>
<div class="col-md-2">
<asp:TextBox ID="TxtFolio" runat="server" MaxLength="20"></asp:TextBox>
</div>
<label class="col-md-1 ">Fecha Inicial:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<label class="col-md-1 ">Fecha Final:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
<div class="portlet-body">
<div class="row">
<label class="col-md-1 ">Huerta:</label>
<div class="col-md-3">
<asp:DropDownList ID="DdlHuerta" runat="server" AppendDataBoundItems="true" DataTextField="Huerta" DataValueField="CveHuerta" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
</asp:DropDownList>
</div>
<%-- <label class="col-md-1 ">Modalidad:</label>
<div class="col-md-3">
<asp:DropDownList ID="DdlModalidad" runat="server" OnSelectedIndexChanged="DdlModalidad_SelectedIndexChanged" AutoPostBack="true" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-sm select2me" Width="70%">
<asp:ListItem Text="Materiales" Value="1"></asp:ListItem>
<asp:ListItem Text="PreEnfriado" Value="2"></asp:ListItem>
</asp:DropDownList>
</div>--%>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div id="DivGvDatos" runat="server">
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GvDatos" runat="server" GridLines="None" ShowHeaderWhenEmpty="true" EmptyDataText="No se han encontrado empaques con los filtros seleccionados" OnRowDataBound="GvDatos_RowDataBound" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False"
DataKeyNames="CveOrdenProduccion">
<Columns>
<asp:HyperLinkField HeaderText="Folio OP" DataTextField="Folio" DataNavigateUrlFields="CveOrdenProduccion" DataNavigateUrlFormatString="/CGame/OrdenProduccion.aspx?CveOrdenProduccion={0}" Target="_blank" ItemStyle-HorizontalAlign="Center" />
<asp:TemplateField HeaderText="Cantidad" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="LblCantidad" runat="server" Text='<%# Eval("Cantidad")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Peso" HeaderStyle-HorizontalAlign="Right" HeaderText="Peso" DataFormatString="{0:#,##0.##}" />
<asp:BoundField DataField="ImportePreEnfriado" HeaderStyle-HorizontalAlign="Right" HeaderText="PreEnfriado" DataFormatString="{0:#,##0.##}" />
<asp:TemplateField HeaderText="Fruto" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblPS" runat="server" Text='<%# Eval("PS")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo Producción" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoProducto" runat="server" Text='<%# Eval("TipoProducto")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Variedad" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoMaduracion" runat="server" Text='<%# Eval("TipoMaduracion")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo Empaque" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoEmpaque" runat="server" Text='<%# Eval("TipoEmpaque")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tamaño" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTamaño" runat="server" Text='<%# Eval("Tamaño")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="PLU" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoEtiqueta" runat="server" Text='<%# Eval("CveTipoEtiqueta")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Calidad" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblCalidad" runat="server" Text='<%# Eval("Calidad")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Etiqueta" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoCaja" runat="server" Text='<%# Eval("TipoCaja")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,90 @@
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_RepEmpaque : ClsPaginas
{
#region PROPIEDADES
private DataTable DtDatos
{
get { return DtDatos = (DataTable)ViewState["DtDatos"]; }
set { ViewState["DtDatos"] = value; }
}
private int CveProduccion
{
get { return (ViewState["CveProduccion"] == null) ? -1 : Convert.ToInt32(ViewState["CveProduccion"]); }
set { ViewState["CveProduccion"] = value; }
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
CargaHuerta();
txtFechaI.Text = Request["FechaInicial"] == null ? DateTime.Now.ToShortDateString() : Request["FechaInicial"].ToString().ToString();
txtFechaF.Text = Request["FechaFinal"] == null ? DateTime.Now.ToShortDateString() : Request["FechaFinal"].ToString().ToString();
DdlHuerta.SelectedValueExist(Request["CveHuerta"] == null ? -1 : Request["CveHuerta"].ToString().ToEntero());
TxtFolio.Text = Request["Folio"] == null ? "" : Request["Folio"].ToString().ToString();
CveProduccion = Request["CveProduccion"] == null ? -1 : Request["CveProduccion"].ToString().ToEntero();
Consulta();
}
}
protected void CargaHuerta()
{
ClsCGame ObjCort = new ClsCGame();
if (ObjCort.GetHuerta(UsuarioActual.CveEmpresa))
{
DdlHuerta.DataSource = ObjCort.DtResultados;
DdlHuerta.Items.Insert(0, new ListItem("Todos", "-1"));
DdlHuerta.DataBind();
}
ObjCort.Dispose();
UPDatos.Update();
}
protected void Consultar_Click(object sender, EventArgs e)
{
Consulta();
}
private void Consulta()
{
String Folio;
if (TxtFolio.Text != "") { Folio = TxtFolio.Text; } else { Folio = "-1"; }
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetRepProduccionResultadoDetalle(UsuarioActual.CveEmpresa, Folio, CveProduccion, DdlHuerta.SelectedValue.ToEntero(), txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate()))
{
GvDatos.DataSource = ObjCGame.DtResultados;
DtDatos = ObjCGame.DtResultados;
ObjCGame.Dispose();
}
GvDatos.DataBind();
CveProduccion = -1;
UPDatos.Update();
}
#region GridView
protected void GvDatos_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.DBCampo("CveOrdenProduccion").ToEntero() < 1)
{
e.Row.Cells[0].Text = "No Asignada";
}
if (e.Row.DBCampo("CveTipoEtiqueta").ToEntero() == 1)
{
e.Row.FCLabel("LblTipoEtiqueta").Text = "Si";
}

105
CGame/RepFletes.aspx Normal file
View File

@@ -0,0 +1,105 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepFletes.aspx.cs" Inherits="CGame_RepFletes" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Reporte de Fletes
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" id="idnecesaria">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" Text="Consultar" class="btn btn-primary" />
<a href="javascript:;" class="expand"></a>
</div>
<div class="titlefiltros caption">
<div class="row">
<label class="col-md-1 ">Huerta:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlHuerta" runat="server" AppendDataBoundItems="true" DataTextField="Huerta" DataValueField="CveHuerta" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
</asp:DropDownList>
</div>
<label class="col-md-1 ">Fecha Inicial:</label>
<div class="col-md-1">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 80px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<label class="col-md-1 ">Fecha Final:</label>
<div class="col-md-1">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 80px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<label class="col-md-1 ">Tipo:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlTipo" runat="server" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
<asp:ListItem Text="Huerta Empaque" Value="1"></asp:ListItem>
<asp:ListItem Text="Empaque USA" Value="2"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>
<div class="portlet-body">
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GvDatos" runat="server" GridLines="None" ShowHeaderWhenEmpty="true" EmptyDataText="No se han encontrado fletes con los filtros seleccionados" OnRowDataBound="GvDatos_RowDataBound" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="99%" data-sort="true" AutoGenerateColumns="False">
<Columns>
<asp:BoundField DataField="TipoFlete" ItemStyle-HorizontalAlign="Left" HeaderText="Tipo" />
<asp:BoundField DataField="FolioOC" ItemStyle-HorizontalAlign="Left" HeaderText="Folio OC" />
<asp:BoundField DataField="FolioOP" ItemStyle-HorizontalAlign="Left" HeaderText="Folio OP" />
<asp:BoundField DataField="RazonSocial" ItemStyle-HorizontalAlign="Left" HeaderText="Proveedor" />
<asp:BoundField DataField="Scat" ItemStyle-HorizontalAlign="Left" HeaderText="Scat" />
<asp:BoundField DataField="Remolque" ItemStyle-HorizontalAlign="Left" HeaderText="Remolque" />
<asp:BoundField DataField="Tracto" ItemStyle-HorizontalAlign="Left" HeaderText="Tracto" />
<asp:BoundField DataField="Chofer" ItemStyle-HorizontalAlign="Left" HeaderText="Chofer" />
<asp:BoundField DataField="Camion" ItemStyle-HorizontalAlign="Left" HeaderText="Camión" />
<asp:BoundField DataField="Placa" ItemStyle-HorizontalAlign="Left" HeaderText="Placa" />
<asp:BoundField DataField="FechaEmpaqueUSA" ItemStyle-Width="15%" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:BoundField DataField="FechaFleteHuertaEmpaque" ItemStyle-Width="15%" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:BoundField DataField="Importe" ItemStyle-HorizontalAlign="Right" HeaderText="Importe" DataFormatString="{0:N2}" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

94
CGame/RepFletes.aspx.cs Normal file
View File

@@ -0,0 +1,94 @@
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_RepFletes : 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();
DdlTipo.SelectedValueExist(Request["Tipo"] == null ? "-1" : Request["Tipo"].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 (DdlTipo.SelectedValue.ToEntero() == 1)
{
GvDatos.Columns[1].Visible = true;
GvDatos.Columns[2].Visible = false;
GvDatos.Columns[4].Visible = false;
GvDatos.Columns[10].Visible = false;
GvDatos.Columns[11].Visible = true;
if (ObjCGame.GetRepFleteHuertaEmpaque(DdlHuerta.SelectedValue.ToEntero(), txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), UsuarioActual.CveEmpresa))
{
GvDatos.DataSource = ObjCGame.DtResultados;
}
} else if (DdlTipo.SelectedValue.ToEntero() == 2)
{
GvDatos.Columns[1].Visible = false;
GvDatos.Columns[2].Visible = true;
GvDatos.Columns[4].Visible = true;
GvDatos.Columns[10].Visible = true;
GvDatos.Columns[11].Visible = false;
if (ObjCGame.GetRepFleteEmpaqueUSA(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("CveFlete").ToEntero() < 1)
{
e.Row.CssClass = "SubTotales";
e.Row.Cells[0].Text = e.Row.DBCampo("Folio");

View File

@@ -0,0 +1,175 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepFletesPendientes.aspx.cs" Inherits="CGame_RepFletesPendientes" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Reporte de Fletes Pendientes por Asignar
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" Text="Consultar" class="btn btn-primary" />
<a href="javascript:;" class="expand"></a>
</div>
<div class="titlefiltros caption">
<div class="row">
<label class="col-md-1 ">Modalidad:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlModalidad" runat="server" OnSelectedIndexChanged="DdlModalidad_SelectedIndexChanged" AutoPostBack="true" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
<asp:ListItem Text="Huerta Empaque" Value="1"></asp:ListItem>
<asp:ListItem Text="Empaque USA" Value="2"></asp:ListItem>
</asp:DropDownList>
</div>
<label class="col-md-1 ">Fecha Inicial:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control" Text="01/09/2017" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<label class="col-md-1 ">Fecha Final:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control" Text="31/08/2018" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
<div class="portlet-body">
<div class="row">
<label class="col-md-1 " id="DivLblOrdenCorte" runat="server">Orden de Corte:</label>
<div class="col-md-2" id="DivDdlOrdenCorte" runat="server">
<asp:DropDownList ID="DdlOrdenCorte" runat="server" AppendDataBoundItems="true" DataTextField="FolioFechaHuerta" DataValueField="CveOrdenCorte" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
</asp:DropDownList>
</div>
<label class="col-md-1 " id="DivLblEmpaque" runat="server">Empaque:</label>
<div class="col-md-2" id="DivDdlEmpaque" runat="server">
<asp:DropDownList ID="DdlEmpaque" runat="server" AppendDataBoundItems="true" DataTextField="Empaque" DataValueField="CveEmpaque" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
</asp:DropDownList>
</div>
<label class="col-md-1 " id="DivLblCliente" visible="false" runat="server">Cliente:</label>
<div class="col-md-3" id="DivDdlCliente" visible="false" runat="server">
<asp:DropDownList ID="DdlCliente" runat="server" AppendDataBoundItems="true" DataTextField="Cliente" DataValueField="CveCliente" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
</asp:DropDownList>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvFletes.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvFletes.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GvFletes" runat="server" GridLines="None" OnRowDataBound="GvFletes_RowDataBound" ShowHeaderWhenEmpty="true" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False" EmptyDataText="No se encontraron datos con los filtros seleccionados"
DataKeyNames="CveOrdenCorte">
<Columns>
<asp:TemplateField HeaderText="Folio OC" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="LblFolio" runat="server" Text='<%# Eval("Folio")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Huerta" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblHuerta" runat="server" Text='<%# Eval("Huerta")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Empaque" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblEmpaque" runat="server" Text='<%# Eval("Empaque")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cuadro" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblCuadro" runat="server" Text='<%# Eval("Cuadro")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Peso (TON)" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblPeso" runat="server" Text='<%# Eval("Peso")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Observaciones" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblObservaciones" runat="server" Text='<%# Eval("Observaciones")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="FechaFleteHuertaEmpaque" ItemStyle-Width="15%" HeaderText="Fecha Flete" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:BoundField DataField="FechaEntrega" ItemStyle-Width="15%" HeaderText="Fecha de Entrega" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:BoundField DataField="FechaIng" ItemStyle-Width="15%" HeaderText="Fecha Ingreso" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:TemplateField HeaderText="Usuario" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblUsuario" runat="server" Text='<%# Eval("Usuario")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:GridView ID="GvOP" runat="server" Visible="false" GridLines="None" OnRowDataBound="GvOP_RowDataBound" ShowHeaderWhenEmpty="true" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False" EmptyDataText="No se encontraron datos con los filtros seleccionados"
DataKeyNames="CveOrdenProduccion">
<Columns>
<asp:TemplateField HeaderText="Folio" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="LblFolio" runat="server" Text='<%# Eval("Folio")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cliente" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblCliente" runat="server" Text='<%# Eval("Cliente")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Estatus" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblEstatus" runat="server" Text='<%# Eval("Estatus")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Observaciones" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblObservaciones" runat="server" Text='<%# Eval("Observaciones")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="FEntrega" ItemStyle-Width="15%" HeaderText="Fecha de Entrega" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:BoundField DataField="FechaIng" ItemStyle-Width="15%" HeaderText="Fecha Ingreso" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:TemplateField HeaderText="Usuario" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblUsuario" runat="server" Text='<%# Eval("NombreUsuario")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,132 @@
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>";
}
}
}

121
CGame/RepIngresos.aspx Normal file
View File

@@ -0,0 +1,121 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepIngresos.aspx.cs" Inherits="CGame_RepIngresos" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Reporte de Ingresos
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" id="idnecesaria">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" Text="Consultar" class="btn btn-primary" />
<a href="javascript:;" class="expand"></a>
</div>
<div class="titlefiltros caption">
<div class="row">
<label class="col-md-1 ">Huerta:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlHuerta" runat="server" AppendDataBoundItems="true" DataTextField="Huerta" DataValueField="CveHuerta" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
</asp:DropDownList>
</div>
<label class="col-md-1 ">Fecha Inicial:</label>
<div class="col-md-1">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 80px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<label class="col-md-1 ">Fecha Final:</label>
<div class="col-md-1">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 80px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
<div class="portlet-body">
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<ajax:TabContainer ID="Tab" runat="server" ActiveTabIndex="0" Width="100%">
<ajax:TabPanel ID="TabIngresos" runat="server" HeaderText="Ingresos">
<ContentTemplate>
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GvDatos" runat="server" GridLines="None" ShowHeaderWhenEmpty="true" EmptyDataText="No se han encontrado ingresos con los filtros seleccionados" OnRowDataBound="GvDatos_RowDataBound" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="99%" data-sort="true" AutoGenerateColumns="False">
<Columns>
<asp:HyperLinkField DataTextField="Folio" DataNavigateUrlFields="CveOrdenCorte" DataNavigateUrlFormatString="/CGame/RepOrdenCorteDetalle.aspx?CveOrdenCorte={0}" HeaderText="Folio OC" />
<asp:BoundField DataField="CantidadPrimera" ItemStyle-HorizontalAlign="Right" HeaderText="Cantidad Primera" DataFormatString="{0:N2}" />
<asp:BoundField DataField="PesoPrimera" ItemStyle-HorizontalAlign="Right" HeaderText="Peso Primera" DataFormatString="{0:N2}" />
<asp:BoundField DataField="ImportePrimera" ItemStyle-HorizontalAlign="Right" HeaderText="Importe Primera" DataFormatString="{0:N2}" />
<asp:BoundField DataField="CantidadSegunda" ItemStyle-HorizontalAlign="Right" HeaderText="Cantidad Segunda" DataFormatString="{0:N2}" />
<asp:BoundField DataField="PesoSegunda" ItemStyle-HorizontalAlign="Right" HeaderText="Peso Segunda" DataFormatString="{0:N2}" />
<asp:BoundField DataField="ImporteSegunda" ItemStyle-HorizontalAlign="Right" HeaderText="Importe Segunda" DataFormatString="{0:N2}" />
<asp:BoundField DataField="CantidadJugo" ItemStyle-HorizontalAlign="Right" HeaderText="Cantidad Jugo" DataFormatString="{0:N2}" />
<asp:BoundField DataField="PesoJugo" ItemStyle-HorizontalAlign="Right" HeaderText="Peso Jugo" DataFormatString="{0:N2}" />
<asp:BoundField DataField="ImporteJugo" ItemStyle-HorizontalAlign="Right" HeaderText="Importe Jugo" DataFormatString="{0:N2}" />
<asp:BoundField DataField="ImporteTotal" ItemStyle-HorizontalAlign="Right" HeaderText="Importe Total" DataFormatString="{0:N2}" />
</Columns>
</asp:GridView>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabIngresosAgrupados" runat="server" HeaderText="Ingresos Agrupados">
<ContentTemplate>
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda2" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvIngresosAgrupados.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvIngresosAgrupados.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GvIngresosAgrupados" runat="server" GridLines="None" OnRowDataBound="GvIngresosAgrupados_RowDataBound" ShowHeaderWhenEmpty="true" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="99%" data-sort="true" AutoGenerateColumns="False">
<Columns>
<asp:BoundField DataField="PS" HeaderText="Fruto" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="TipoProducto" HeaderText="Tipo Producción" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="TipoMaduracion" HeaderText="Variedad" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="TipoCaja" HeaderText="Etiqueta" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Cantidad" HeaderText="Cantidad" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="Peso" HeaderText="Peso" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="Importe" HeaderText="Importe" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
</Columns>
</asp:GridView>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

101
CGame/RepIngresos.aspx.cs Normal file
View File

@@ -0,0 +1,101 @@
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_RepIngresos : 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.GetRepIngresos(DdlHuerta.SelectedValue.ToEntero(), txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), UsuarioActual.CveEmpresa))
{
GvDatos.DataSource = ObjCGame.DtResultados;
}
if (ObjCGame.GetIngresosAgrupados(DdlHuerta.SelectedValue.ToEntero(), txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), UsuarioActual.CveEmpresa))
{
GvIngresosAgrupados.DataSource = ObjCGame.DtResultados;
}
ObjCGame.Dispose();
GvDatos.DataBind();
GvIngresosAgrupados.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";
}
}
}
protected void GvIngresosAgrupados_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("CvePS").ToEntero() < 1)
{
if (e.Row.DBCampo("Tipo").ToEntero() == 1)
{
e.Row.Cells[0].Text = "Primera";
e.Row.CssClass = "SubTotales";
}
if (e.Row.DBCampo("Tipo").ToEntero() == 2)
{
e.Row.Cells[0].Text = "Segunda";
e.Row.CssClass = "SubTotales";
}
if (e.Row.DBCampo("Tipo").ToEntero() == 3)
{
e.Row.Cells[0].Text = "Jugo";

93
CGame/RepMaquila.aspx Normal file
View File

@@ -0,0 +1,93 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepMaquila.aspx.cs" Inherits="CGame_RepMaquila" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
Reporte de Maquila
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" id="idnecesaria">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" Text="Consultar" class="btn btn-primary" />
<a href="javascript:;" class="expand"></a>
</div>
<div class="titlefiltros caption">
<div class="row">
<label class="col-md-1 ">Huerta:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlHuerta" runat="server" AppendDataBoundItems="true" DataTextField="Huerta" DataValueField="CveHuerta" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
</asp:DropDownList>
</div>
<label class="col-md-1 ">Fecha Inicial:</label>
<div class="col-md-1">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 80px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<label class="col-md-1 ">Fecha Final:</label>
<div class="col-md-1">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 80px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
<div class="portlet-body">
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GvDatos" runat="server" GridLines="None" ShowHeaderWhenEmpty="true" EmptyDataText="No se han encontrado gastos de maquila con los filtros seleccionados" OnRowDataBound="GvDatos_RowDataBound" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="99%" data-sort="true" AutoGenerateColumns="False">
<Columns>
<asp:HyperLinkField DataTextField="Folio" DataNavigateUrlFields="CveProduccion" DataNavigateUrlFormatString="/CGame/Empaque.aspx?CveProduccion={0}" HeaderText="Folio EMP" />
<asp:BoundField DataField="CantidadPrimera" ItemStyle-HorizontalAlign="Right" HeaderText="Cantidad Primera" DataFormatString="{0:N2}" />
<asp:BoundField DataField="PesoPrimera" ItemStyle-HorizontalAlign="Right" HeaderText="Peso Primera" DataFormatString="{0:N2}" />
<asp:BoundField DataField="CantidadSegunda" ItemStyle-HorizontalAlign="Right" HeaderText="Cantidad Segunda" DataFormatString="{0:N2}" />
<asp:BoundField DataField="PesoSegunda" ItemStyle-HorizontalAlign="Right" HeaderText="Peso Segunda" DataFormatString="{0:N2}" />
<asp:BoundField DataField="CantidadJugo" ItemStyle-HorizontalAlign="Right" HeaderText="Cantidad Jugo" DataFormatString="{0:N2}" />
<asp:BoundField DataField="PesoJugo" ItemStyle-HorizontalAlign="Right" HeaderText="Peso Jugo" DataFormatString="{0:N2}" />
<asp:BoundField DataField="Importe" ItemStyle-HorizontalAlign="Right" HeaderText="Importe" DataFormatString="{0:N2}" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
</asp:Content>

65
CGame/RepMaquila.aspx.cs Normal file
View File

@@ -0,0 +1,65 @@
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_RepMaquila : 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.GetRepMaquila(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)

88
CGame/RepMateriales.aspx Normal file
View File

@@ -0,0 +1,88 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepMateriales.aspx.cs" Inherits="CGame_RepMateriales" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
Reporte de Materiales
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" id="idnecesaria">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" Text="Consultar" class="btn btn-primary" />
<a href="javascript:;" class="expand"></a>
</div>
<div class="titlefiltros caption">
<div class="row">
<label class="col-md-1 ">Huerta:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlHuerta" runat="server" AppendDataBoundItems="true" DataTextField="Huerta" DataValueField="CveHuerta" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
</asp:DropDownList>
</div>
<label class="col-md-1 ">Fecha Inicial:</label>
<div class="col-md-1">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 80px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<label class="col-md-1 ">Fecha Final:</label>
<div class="col-md-1">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 80px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
<div class="portlet-body">
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GvDatos" runat="server" GridLines="None" ShowHeaderWhenEmpty="true" EmptyDataText="No se han encontrado materiales con los filtros seleccionados" OnRowDataBound="GvDatos_RowDataBound" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="50%" data-sort="true" AutoGenerateColumns="False">
<Columns>
<asp:BoundField DataField="Concepto" ItemStyle-HorizontalAlign="Left" HeaderText="Concepto" />
<asp:BoundField DataField="Cantidad" ItemStyle-HorizontalAlign="Right" HeaderText="Cantidad" DataFormatString="{0:N2}" />
<asp:BoundField DataField="Importe" ItemStyle-HorizontalAlign="Right" HeaderText="Importe" DataFormatString="{0:N2}" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
</asp:Content>

View File

@@ -0,0 +1,74 @@
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");

134
CGame/RepOrdenCorte.aspx Normal file
View File

@@ -0,0 +1,134 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepOrdenCorte.aspx.cs" Inherits="CGame_RepOrdenCorte" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Reporte de Ordenes de Corte
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
<li>
<asp:LinkButton ID="LnkPdf" Visible="false" OnClick="LnkPdf_Click" runat="server"> <i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="ImgExcel" Visible="false" OnClick="ImgExcel_Click" runat="server"><i class="fa fa-ad-excel"></i> Exporta Excel</asp:LinkButton>
</li>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" OnClick="Consultar_Click" runat="server" Text="Consultar" class="btn btn-primary" />
<a href="javascript:;" class="expand"></a>
</div>
<div class="titlefiltros caption">
<div class="row">
<label class="col-md-1 ">Folio OC:</label>
<div class="col-md-2">
<asp:TextBox ID="TxtFolioOC" runat="server" MaxLength="20"></asp:TextBox>
</div>
<label class="col-md-1 ">Fecha Inicial:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<label class="col-md-1 ">Fecha Final:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
<div class="portlet-body">
<div class="row">
<label class="col-md-1 ">Huerta:</label>
<div class="col-md-3">
<asp:DropDownList ID="DdlHuerta" runat="server" AppendDataBoundItems="true" DataTextField="Huerta" DataValueField="CveHuerta" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
</asp:DropDownList>
</div>
<%-- <label class="col-md-1 ">Folio OP:</label>
<div class="col-md-3">
<asp:DropDownList ID="DdlOrdenProduccion" runat="server" AppendDataBoundItems="true" DataTextField="Folio" DataValueField="CveOrdenProduccion" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
</asp:DropDownList>
</div>--%>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GvDatos" runat="server" GridLines="None" OnRowDataBound="GvDatos_RowDataBound" ShowHeaderWhenEmpty="true" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False"
DataKeyNames="CveOrdenCorte">
<Columns>
<asp:TemplateField HeaderText="Folio OC" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="LblFolioOC" runat="server" Text='<%# Eval("FolioOC")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<%-- <asp:TemplateField HeaderText="Folio OP" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="LblFolioOP" runat="server" Text='<%# Eval("FolioOP")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>--%>
<asp:TemplateField HeaderText="Huerta" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblHuerta" runat="server" Text='<%# Eval("Huerta")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Primera" HeaderText="Primera" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="PorPrimera" HeaderText="% Primera" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="Segunda" HeaderText="Segunda" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="PorSegunda" HeaderText="% Segunda" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="Jugo" HeaderText="Jugo" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="PorJugo" HeaderText="% Jugo" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="Merma" HeaderText="Merma" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="PorMerma" HeaderText="% Merma)" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="DiferenciaPeso" Visible="false" HeaderText="Diferencia Peso(TON)" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="FechaEntregaOC" ItemStyle-Width="15%" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:BoundField DataField="FechaIng" ItemStyle-Width="15%" HeaderText="Fecha Ingreso" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:TemplateField HeaderText="Usuario" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblUsuario" runat="server" Text='<%# Eval("Usuario")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

135
CGame/RepOrdenCorte.aspx.cs Normal file
View File

@@ -0,0 +1,135 @@
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_RepOrdenCorte : ClsPaginas
{
#region PROPIEDADES
private DataTable DtDatos
{
get { return DtDatos = (DataTable)ViewState["DtDatos"]; }
set { ViewState["DtDatos"] = value; }
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
txtFechaI.Text = DateTime.Now.ToString();
txtFechaF.Text = DateTime.Now.ToString();
CargaHuerta();
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) { Consultar(); }
}
}
protected void CargaHuerta()
{
ClsCGame ObjCort = new ClsCGame();
if (ObjCort.GetHuerta(UsuarioActual.CveEmpresa))
{
DdlHuerta.DataSource = ObjCort.DtResultados;
DdlHuerta.Items.Insert(0, new ListItem("Todos", "-1"));
DdlHuerta.DataBind();
}
ObjCort.Dispose();
UPDatos.Update();
}
protected void Consultar_Click(object sender, EventArgs e)
{
Consultar();
}
private void Consultar()
{
String FolioOC, FechaI, FechaF;
if (TxtFolioOC.Text != "") { FolioOC = TxtFolioOC.Text; } else { FolioOC = "-1"; }
if (TxtFolioOC.Text != "") { FechaI = MinFecha.ToShortDateString(); FechaF = MaxFecha.ToShortDateString(); } else { FechaI = txtFechaI.Text; FechaF = txtFechaF.Text; }
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetOrdenCorte(UsuarioActual.CveEmpresa, -1, DdlHuerta.SelectedValue.ToEntero(), FolioOC, FechaI.ToDate(), FechaF.ToDate(), Opcion: 3))
{
GvDatos.DataSource = ObjCGame.DtResultados;
GvDatos.DataBind();
DtDatos = ObjCGame.DtResultados;
}
ObjCGame.Dispose();
UPDatos.Update();
}
protected void GenerarPDF(String Opcion)
{
String FechaF;
if (txtFechaF.Text == "" || txtFechaF.Text == "__/__/____") { FechaF = "-1"; } else { FechaF = $"&emsp;<b>Fecha Entrega Final:</b> {txtFechaF.Text}"; }
String FechaI;
if (txtFechaI.Text == "" || txtFechaI.Text == "__/__/____") { FechaI = "-1"; } else { FechaI = $"&emsp;<b>Fecha Entrega Inicial:</b> {txtFechaI.Text}"; }
String Huerta;
if (DdlHuerta.SelectedValue != "-1") { Huerta = $"&emsp;<b>Huerta:</b> {DdlHuerta.SelectedItem.Text}"; } else { Huerta = ""; }
String Folio;
if (TxtFolioOC.Text != "") { Folio = $"&emsp;<b>Folio:</b> {TxtFolioOC.Text}"; } else { Folio = ""; }
if (DtDatos.Rows.Count > 0)
{
System.IO.FileInfo Imagen = new System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta));
String logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa);
List<ReportParameter> para = new List<ReportParameter>();
para.Add(new ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa));
para.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre));
para.Add(new ReportParameter("FechaImpresion", DateTime.Now.ToString()));
para.Add(new ReportParameter("AgrupadoPor", $"<b>Agrupado Por:</b> {Folio}{Huerta}{FechaI}{FechaF}"));
if (Imagen.Exists)
{
para.Add(new ReportParameter("LogoPath", logouri));
}
else
{
para.Add(new ReportParameter("LogoPath", ""));
}
ImprimirPDF("Empresas/Grales/Formatos/RepEmpaque.rdlc", DtDatos, para, "Reporte de Empaque", Opcion);
}
else
{
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia);
}
}
protected void LnkPdf_Click(object sender, EventArgs e)
{
GenerarPDF("PDF");
}
protected void ImgExcel_Click(object sender, EventArgs e)
{
GenerarPDF("EXCEL");
}
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";
e.Row.Cells[3].Text = ((e.Row.Cells[2].Text.ToDouble() * 100)/ e.Row.DBCampo("PesoCompleto").ToDouble()).FormatoNumero();
e.Row.Cells[5].Text = ((e.Row.Cells[4].Text.ToDouble() * 100) / e.Row.DBCampo("PesoCompleto").ToDouble()).FormatoNumero();
e.Row.Cells[7].Text = ((e.Row.Cells[6].Text.ToDouble() * 100) / e.Row.DBCampo("PesoCompleto").ToDouble()).FormatoNumero();
e.Row.Cells[9].Text = (( e.Row.DBCampo("PesoCompleto").ToDouble() - e.Row.Cells[2].Text.ToDouble()- e.Row.Cells[4].Text.ToDouble() - e.Row.Cells[6].Text.ToDouble()) * 100/ e.Row.DBCampo("PesoCompleto").ToDouble()).FormatoNumero();
}
else
{
String Css = "Texto";

View File

@@ -0,0 +1,768 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepOrdenCorteDetalle.aspx.cs" Inherits="CGame_RepOrdenCorteDetalle" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
<style>
#chartdiv {
width: 100%;
height: 500px;
}
#chartdiv > div > div > svg > g:nth-child(15) > g:nth-child(1) {
visibility: hidden;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Orden de Corte
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkEditarOC" OnClick="LnkEditarOC_Click" runat="server">Editar OC</asp:LinkButton></li>
<li>
<asp:LinkButton ID="LnkFletes" OnClick="LnkFletes_Click" runat="server" Visible="false"><i class="fa fa-plus"></i>Agregar Flete</asp:LinkButton></li>
<li>
<asp:LinkButton ID="LnkGastos" OnClick="LnkGastos_Click" runat="server"><i class="fa fa-plus"></i>Agregar Gastos de Corte</asp:LinkButton></li>
<li>
<asp:LinkButton ID="LnkEntrada" OnClick="LnkEntrada_Click" runat="server"><i class="fa fa-plus"></i>Agregar Entrada de M.P.</asp:LinkButton></li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<div class="row">
<div class="col-md-6">
<asp:UpdatePanel ID="UPDatosOrden" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet light xspadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Datos de la Orden de Corte</span>
</div>
<div class="tools">
<a href="javascript;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body form">
<div class="labeltruncate labeltext labelbold">
<%--linea 1--%>
<div class="row" style="padding-bottom: 0.6em;">
<label class="col-md-2">Folio OC:</label>
<label class="col-md-4">
<asp:Label runat="server" ID="lblFolioOC" Font-Bold="true"></asp:Label>
</label>
<label class="col-md-2">Fecha Corte:</label>
<label class="col-md-4">
<asp:Label runat="server" ID="LblFecha" Text="" />
</label>
</div>
<%--linea 2--%>
<%-- <div class="row" style="padding-bottom: 0.6em;">
<label class="col-md-2">Folio OP:</label>
<label class="col-md-4">
<asp:HyperLink runat="server" ID="HplFolioOP" Font-Bold="true"></asp:HyperLink>
</label>
</div>--%>
<%--linea 3--%>
<div class="row" style="padding-bottom: 0.6em;">
<label class="col-md-2">Cuadro:</label>
<label class="col-md-4">
<asp:Label runat="server" ID="LblCuadro" Font-Bold="true"></asp:Label>
</label>
<label class="col-md-2">Peso (Kg):</label>
<label class="col-md-4">
<asp:Label runat="server" ID="LblPeso" Text="" />
</label>
</div>
<%--linea 4--%>
<div class="row" style="padding-bottom: 0.6em;">
<label class="col-md-2">Huerta:</label>
<label class="col-md-4">
<asp:Label runat="server" ID="LblHuerta" Text="" />
</label>
</div>
<%--linea 5--%>
<div class="row" runat="server" visible="false" id="DivObservacion" style="padding-bottom: 0.6em;">
<label class="col-md-2">Observación:</label>
<div class="col-md-10">
<asp:TextBox ID="TxtObservacion" MaxLength="500" CssClass="form-control input-sm" runat="server" Style="width: 370px; height: 40px;" TextMode="MultiLine" Rows="5" />
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="col-md-3">
<div class="portlet light xspadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">DATOS DEL REGISTRO </span>
</div>
<div class="tools">
<a href="javascript;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<asp:UpdatePanel ID="UpEstatus" runat="server" class="portlet-body form" UpdateMode="Conditional">
<ContentTemplate>
<table style="text-align: left">
<tr id="TrEstatus" runat="server" visible="false">
<td><b>Estatus:</b></td>
<td>
<asp:Label ID="LblMsgEstatus" runat="server" Text="" Font-Size="6pt" Font-Italic="True" ForeColor="Red"></asp:Label>
<asp:Label ID="LblEstatus" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td><b>F. Registro:</b></td>
<td>
<asp:Label ID="TxtFecha" ClientIDMode="Static" runat="server" Width="90px"></asp:Label>
</td>
</tr>
<tr>
<td><b>Capturó:</b></td>
<td>
<asp:Label ID="lblNombreUsuario" runat="server"></asp:Label></td>
</tr>
<tr>
<td><b>Primera:</b></td>
<td>
<asp:Label ID="LblPrimera" runat="server"></asp:Label></td>
</tr>
<tr>
<td><b>Segunda:</b></td>
<td>
<asp:Label ID="LblSegunda" runat="server"></asp:Label></td>
<tb></tb>
<td>
<asp:LinkButton ID="LnkModalGrafica" OnClick="LnkModalGrafica_Click" runat="server"><i class="fa fa-pie-chart" aria-hidden="true"></i></asp:LinkButton></td>
</tr>
<tr>
<td><b>Merma:</b></td>
<td>
<asp:Label ID="LblMerma" runat="server"></asp:Label></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
<ajax:TabContainer ID="Tab" runat="server" ActiveTabIndex="0" Width="100%">
<ajax:TabPanel ID="TabOC" runat="server" HeaderText="Productos Esperados">
<ContentTemplate>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GvDatos" OnRowDataBound="GvDatos_RowDataBound" runat="server" DataKeyNames="CveTipoEtiqueta,CveOrdenProduccion" GridLines="None" ShowHeaderWhenEmpty="true" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False">
<Columns>
<asp:TemplateField HeaderText="Folio OP" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="LblFolio" runat="server" Text='<%# Eval("FolioOP")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="LblCantidad" runat="server" Text='<%# Eval("Cantidad")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fruto" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblPS" runat="server" Text='<%# Eval("PS")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo Producción" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoProducto" runat="server" Text='<%# Eval("TipoProducto")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Variedad" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoMaduracion" runat="server" Text='<%# Eval("TipoMaduracion")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo Empaque" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoEmpaque" runat="server" Text='<%# Eval("TipoEmpaque")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tamaño" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTamaño" runat="server" Text='<%# Eval("Tamaño")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="PLU" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoEtiqueta" runat="server" Text='<%# Eval("CveTipoEtiqueta")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Calidad" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblCalidad" runat="server" Text='<%# Eval("Calidad")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Etiqueta" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoCaja" runat="server" Text='<%# Eval("TipoCaja")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Instrucciones" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblInstrucciones" runat="server" Text='<%# Eval("Instrucciones")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Observaciones" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblObservaciones" runat="server" Text='<%# Eval("Observaciones")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabFletes" runat="server" HeaderText="Huerta Empaque">
<ContentTemplate>
<asp:UpdatePanel ID="UpFletes" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<br />
<div class="row">
<div class="col-md-6">
<div class="col-md-2" style="text-align: left">F. Flete:</div>
<div class="col-md-1">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaFlete" CssClass="form-control input-sm ADSMaskDate" Style="width: 118px" runat="server"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="LnkFechaFlete" class="btn default " Text=" <i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaFlete" runat="server" TargetControlID="TxtFechaFlete" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEECortfecha" TargetControlID="TxtFechaFlete" PopupButtonID="LnkFechaFlete" PopupPosition="BottomRight" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RfvFechaFlete" runat="server" ControlToValidate="TxtFechaFlete" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario, por favor ingréselo." ValidationGroup="VGFechaFlete"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoFechaFlete" runat="server" HighlightCssClass="vco" TargetControlID="RfvFechaFlete"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
<div class="col-md-6">
<div class="col-md-2" style="text-align: left">Empaque:</div>
<div class="col-md-2">
<asp:DropDownList ID="DdlEmpaque" DataValueField="CveEmpaque" DataTextField="Empaque" runat="server" CssClass="form-control select2me" AppendDataBoundItems="true" Width="250px"></asp:DropDownList>
</div>
</div>
</div>
<br />
<div class="portlet light smmallpadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Interno</span>
</div>
<div class="tools">
<a href="javascript;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body form">
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda2" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvFleteInterno.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvFleteInterno.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GvFleteInterno" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD mysmallbtn" data-sort="true" Width="100%" EmptyDataText="Aun no hay fletes registrados..." AutoGenerateColumns="False">
<Columns>
<asp:TemplateField HeaderText="Remolque" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblDescripcionRemolque" runat="server" Text='<%# Eval("CodigoDescripcionRemolque")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tractor" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblDescripcionTractor" runat="server" Text='<%# Eval("CodigoDescripcionTractor")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Chofer" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblchofer" runat="server" Text='<%# Eval("Chofer")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Camion" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblcamion" runat="server" Text='<%# Eval("Camion")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Color" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblcolor" runat="server" Text='<%# Eval("Color")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Placa" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblplaca" runat="server" Text='<%# Eval("Placa")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Chofer" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblChofer" runat="server" Text='<%# Eval("Chofer")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Importe" HeaderText="Importe" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Fecha Flete" DataField="FechaFleteHuertaEmpaque" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:BoundField HeaderText="Usuario" DataField="Usuario" ItemStyle-Width="20%" />
</Columns>
</asp:GridView>
</div>
</div>
<br />
<div class="portlet light smmallpadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Externo</span>
</div>
<div class="tools">
<a href="javascript;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body form">
</div>
<asp:GridView ID="GvFleteExterno" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD mysmallbtn" data-sort="true" Width="100%" EmptyDataText="Aun no hay fletes registrados..." AutoGenerateColumns="False">
<Columns>
<asp:TemplateField HeaderText="Proveedor" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblRazonSocial" runat="server" Text='<%# Eval("RazonSocial")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Chofer" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblchofer" runat="server" Text='<%# Eval("Chofer")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Camion" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblcamion" runat="server" Text='<%# Eval("Camion")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Color" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblcolor" runat="server" Text='<%# Eval("Color")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Placa" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblplaca" runat="server" Text='<%# Eval("Placa")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Fecha Flete" DataField="FechaFleteHuertaEmpaque" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:BoundField HeaderText="Usuario" DataField="Usuario" ItemStyle-Width="20%" />
<asp:BoundField DataField="Importe" HeaderText="Importe" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
</Columns>
</asp:GridView>
</div>
<br />
<asp:UpdatePanel runat="server" ID="UPGuardaFechaFlete" class="portlet-body form" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-12" align="center">
<asp:Button ID="BtnAddFechaFlete" OnClick="BtnAddFechaFlete_Click" CssClass="btn btn-primary" Style="margin-top: 5px;" runat="server" Text="Asignar Flete" Width="170px" ValidationGroup="VGFechaFlete" />
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabGastos" runat="server" HeaderText="Gastos">
<ContentTemplate>
<asp:UpdatePanel ID="UpGastos" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<div class="row">
<div class="col-md-4">
</div>
<div class="col-md-4">
</div>
<div class="col-md-4">
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding-top px;">
<div class="display" style="margin-bottom: 0px">
<div class="number">
<h3 class="font-red-haze">
<span data-counter="counterup" data-value="1349">
<asp:Literal runat="server" Text="0" ID="LtlTotalOriginal"></asp:Literal></span>
<small class="font-red-haze">$</small>
</h3>
<small>TOTAL DE GASTOS</small>
</div>
<div class="icon">
<i class="fa fa-money"></i>
</div>
</div>
</div>
</div>
</div>
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda3" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda3','{0}')", GvGastos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda3','{0}')", GvGastos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GvGastos" runat="server" GridLines="None" OnRowDataBound="GvGastos_RowDataBound" ShowHeaderWhenEmpty="true" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" AutoGenerateColumns="False">
<Columns>
<asp:BoundField DataField="ConceptoGastoCorte" HeaderText="Concepto" />
<asp:BoundField DataField="Cantidad" HeaderText="Cantidad" DataFormatString="{0:#,##0.##}" />
<asp:BoundField DataField="PU" HeaderText="PU" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="Total" HeaderText="Total" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabOtrosGastos" runat="server" HeaderText="Otros Gastos">
<ContentTemplate>
<asp:UpdatePanel ID="UpOtrosGastos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda5" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda5','{0}')", GvOtrosGastos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda5','{0}')", GvOtrosGastos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GvOtrosGastos" runat="server" DataKeyNames="CveCompra" EmptyDataText="Aún no hay gastos registrados" GridLines="None" ShowHeaderWhenEmpty="true" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False">
<Columns>
<asp:BoundField DataField="RazonSocial" HeaderText="Proveedor" />
<asp:HyperLinkField HeaderText="Folio" DataTextField="SerieFolio" DataNavigateUrlFields="CveCompra" DataNavigateUrlFormatString="/Compras/Compras.aspx?CveCompra={0}" Target="_blank" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="Fecha" HeaderStyle-HorizontalAlign="Left" ItemStyle-Width="15%" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:BoundField DataField="SubTotal" HeaderText="Importe" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="Descripcion" HeaderText="Descripción" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabMateriaPrima" runat="server" HeaderText="Entrada Materia Prima">
<ContentTemplate>
<asp:UpdatePanel ID="UpMP" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda4" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda4','{0}')", GvMP.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda4','{0}')", GvMP.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GvMP" runat="server" OnRowDataBound="GvMP_RowDataBound" GridLines="None" DataKeyNames="CveProduccion" ShowHeaderWhenEmpty="true" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False">
<Columns>
<asp:TemplateField HeaderText="Motivo" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblmotivo" runat="server" Text='<%# Eval("Motivo")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Ticket Báscula" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblticketBascula" runat="server" Text='<%# Eval("TicketBascula")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Peso Neto (Kg)" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="lblpeso" runat="server" Text='<%# Eval("Peso")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Peso Merma (Kg)" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="lblpesoMerma" runat="server" Text='<%# Eval("PesoMerma")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="ImporteEmpaque" HeaderText="Importe" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:TemplateField HeaderText="Empaque" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="lblEmpaque" runat="server" Text='<%# Eval("FolioProduccion")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Fecha" ItemStyle-Width="15%" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabLiquidacion" runat="server" HeaderText="Liquidación Cajas">
<ContentTemplate>
<asp:UpdatePanel ID="UpLiquidacion" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<div class="portlet light smmallpadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Ingresos</span>
</div>
<div class="tools">
<a href="javascript;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body form">
<asp:GridView ID="GvLiquidacionIngresos" OnRowDataBound="GvIngresos_RowDataBound" runat="server" GridLines="None" ShowHeaderWhenEmpty="true" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False">
<Columns>
<asp:BoundField DataField="PS" HeaderText="Fruto" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Cantidad" HeaderText="Cantidad" DataFormatString="{0:#,##0.##}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="Importe" HeaderText="Importe" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="ImportePesos" HeaderText="Importe(Pesos)" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="Peso" HeaderText="Peso" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="TipoProducto" HeaderText="Tipo Producción" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="TipoMaduracion" HeaderText="Variedad" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Tamaño" HeaderText="Tamaño" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="TipoCaja" HeaderText="Etiqueta" ItemStyle-HorizontalAlign="Left" />
</Columns>
</asp:GridView>
</div>
</div>
<br />
<div class="row">
<div class="col-md-6">
<div class="portlet light smmallpadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Gastos</span>
</div>
<div class="tools">
<a href="javascript;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body form">
<asp:GridView ID="GvLiquidacionGastos" OnRowDataBound="GvLiquidacionGastos_RowDataBound" runat="server" GridLines="None" ShowHeaderWhenEmpty="true" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False">
<Columns>
<asp:BoundField DataField="Concepto" HeaderText="Cargo Fijo" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Importe" HeaderText="Importe" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="Moneda" HeaderText="Moneda" ItemStyle-HorizontalAlign="Left" />
</Columns>
</asp:GridView>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabLiquidacionBins" runat="server" HeaderText="Liquidación Bins">
<ContentTemplate>
<asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<div class="portlet light smmallpadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Ingresos</span>
</div>
<div class="tools">
<a href="javascript;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body form">
<asp:GridView ID="GvLiquidacionIngresosBins" OnRowDataBound="GvIngresosBins_RowDataBound" runat="server" GridLines="None" ShowHeaderWhenEmpty="true" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False">
<Columns>
<asp:BoundField DataField="PS" HeaderText="Fruto" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Cantidad" HeaderText="Cantidad" DataFormatString="{0:#,##0.##}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="Importe" HeaderText="Importe" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="ImportePesos" HeaderText="Importe(Pesos)" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="Peso" HeaderText="Peso" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="PesoPagado" HeaderText="Peso Pagado" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="Merma" HeaderText="Merma" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="TipoProducto" HeaderText="Tipo Producción" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="TipoMaduracion" HeaderText="Variedad" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Tamaño" HeaderText="Tamaño" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="TipoCaja" HeaderText="Etiqueta" ItemStyle-HorizontalAlign="Left" />
</Columns>
</asp:GridView>
</div>
</div>
<br />
<div class="row">
<div class="col-md-6">
<div class="portlet light smmallpadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Gastos</span>
</div>
<div class="tools">
<a href="javascript;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body form">
<asp:GridView ID="GvLiquidacionGastosBins" OnRowDataBound="GvLiquidacionGastosBins_RowDataBound" runat="server" GridLines="None" ShowHeaderWhenEmpty="true" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False">
<Columns>
<asp:BoundField DataField="Concepto" HeaderText="Cargo Fijo" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Importe" HeaderText="Importe" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="Moneda" HeaderText="Moneda" ItemStyle-HorizontalAlign="Left" />
</Columns>
</asp:GridView>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
<%-- <asp:GridView ID="GvEmpacado" runat="server" GridLines="None" ShowHeaderWhenEmpty="true" EmptyDataText="No se han encontrado empaques con los filtros seleccionados" OnRowDataBound="GvEmpacado_RowDataBound" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False">
<Columns>
<asp:HyperLinkField HeaderText="Folio EMP" DataTextField="FolioEmp" DataNavigateUrlFields="CveProduccion" DataNavigateUrlFormatString="/CGame/Empaque.aspx?CveProduccion={0}" Target="_blank" ItemStyle-HorizontalAlign="Center" />
<asp:HyperLinkField HeaderText="Folio OP" DataTextField="Folio" DataNavigateUrlFields="CveOrdenProduccion" DataNavigateUrlFormatString="/CGame/OrdenProduccion.aspx?CveOrdenProduccion={0}" Target="_blank" ItemStyle-HorizontalAlign="Center" />
<asp:TemplateField HeaderText="Cantidad" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="LblCantidad" runat="server" Text='<%# Eval("Cantidad")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Peso" HeaderStyle-HorizontalAlign="Right" HeaderText="Peso" DataFormatString="{0:N2}" />
<asp:BoundField DataField="ImportePreEnfriado" HeaderStyle-HorizontalAlign="Right" HeaderText="PreEnfriado" DataFormatString="{0:N2}" />
<asp:BoundField DataField="FleteHuertaEmpaque" HeaderStyle-HorizontalAlign="Right" HeaderText="Flete Huerta-Empaque" DataFormatString="{0:N2}" />
<asp:TemplateField HeaderText="Fruto" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblPS" runat="server" Text='<%# Eval("PS")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Variedad" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoMaduracion" runat="server" Text='<%# Eval("TipoMaduracion")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo Empaque" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoEmpaque" runat="server" Text='<%# Eval("TipoEmpaque")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tamaño" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTamaño" runat="server" Text='<%# Eval("Tamaño")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="PLU" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblTipoEtiqueta" runat="server" Text='<%# Eval("CveTipoEtiqueta")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Calidad" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblCalidad" runat="server" Text='<%# Eval("Calidad")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>--%>
<div id="DivModalGrafica" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UPModalProd" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<%-- <div class="modal-header ">
<h4 class="modal-title">
<asp:Literal ID="ltlProdtitulo" Text="Producto" runat="server"> </asp:Literal></h4>
</div>--%>
<div class="modal-body">
<div id="chartdiv"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div id="DivModalEditarOC" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalAdd" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Literal ID="ltlTipotitulo" Text="Editar OC" runat="server"> </asp:Literal></h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-2" style="text-align: left">Fecha:</div>
<div class="col-md-3">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100% !important; padding: 0px;">
<asp:TextBox ID="TxtFechaCorte" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFechaCorte" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaCorte" runat="server" TargetControlID="TxtFechaCorte" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaCorte" TargetControlID="TxtFechaCorte" PopupButtonID="ImgFechaCorte" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CvFechaCorte" runat="server" ControlToValidate="TxtFechaCorte" Display="None" Operator="DataTypeCheck" Type="Date" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Corte''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)."></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VcoFechaCorte" runat="server" Enabled="True" HighlightCssClass="vco" TargetControlID="CvFechaCorte" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlHuerta" DataValueField="CveHuerta" DataTextField="Huerta" runat="server" CssClass="form-control select2me" AppendDataBoundItems="true" Width="50%"></asp:DropDownList>
<label for="<%= DdlHuerta.ClientID.ToString()%>">Huerta:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtPeso" CssClass="form-control" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVPeso" runat="server" ControlToValidate="TxtPeso" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Peso (Kg)''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarModal"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEPeso" runat="server" HighlightCssClass="vco" TargetControlID="RFVPeso"></ajax:ValidatorCalloutExtender>
<ajax:FilteredTextBoxExtender ID="FTBETPeso" TargetControlID="TxtPeso" FilterType="Numbers" runat="server" />
<label for="<%= TxtPeso.ClientID.ToString()%>">Peso(Kg):</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCuadro" CssClass="form-control" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVCuadro" runat="server" ControlToValidate="TxtCuadro" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuadro''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarModal"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCECuadro" runat="server" HighlightCssClass="vco" TargetControlID="RFVCuadro"></ajax:ValidatorCalloutExtender>
<ajax:FilteredTextBoxExtender ID="FTBECuadro" TargetControlID="TxtCuadro" FilterType="Numbers" runat="server" />
<label for="<%= TxtCuadro.ClientID.ToString()%>">Cuadro:</label>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnEditarOC" OnClick="BtnEditarOC_Click" runat="server" Text="Actualizar" CssClass="btn btn-primary" ValidationGroup="GrpGuardarModal" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script src="https://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="https://www.amcharts.com/lib/3/pie.js"></script>
<script src="https://www.amcharts.com/lib/3/plugins/export/export.min.js"></script>
<script src="https://www.amcharts.com/lib/3/themes/light.js"></script>
<script>
function CargaHistorico(data) {
var chart = AmCharts.makeChart("chartdiv", {
"type": "pie",
"theme": "light",
"dataProvider":
data,
"valueField": "Valor",
"titleField": "Texto",
"outlineAlpha": 0.4,
"depth3D": 0,
"balloonText": "[[title]]<br><span style='font-size:14px'><b>[[value]]</b> ([[percents]]%)</span>",
"angle": 0,
"export": {
"enabled": true
}
});
}
</script>
</asp:Content>

View File

@@ -0,0 +1,504 @@
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;
using System.Threading;
using Newtonsoft.Json.Linq;
public partial class CGame_RepOrdenCorteDetalle : ClsPaginas
{
#region PROPIEDADES
private int CveOrdenCorte
{
get { return (ViewState["CveOrdenCorte"] == null) ? 0 : Convert.ToInt32(ViewState["CveOrdenCorte"]); }
set { ViewState["CveOrdenCorte"] = value; }
}
private int CveHuerta
{
get { return (ViewState["CveHuerta"] == null) ? 0 : Convert.ToInt32(ViewState["CveHuerta"]); }
set { ViewState["CveHuerta"] = value; }
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
TxtFechaFlete.Text = DateTime.Now.ToShortDateString();
CveOrdenCorte = Request["CveOrdenCorte"] == null ? 0 : Request["CveOrdenCorte"].ToString().ToEntero();
CargaDatos();
}
}
#region CARGAS
protected void CargaDatos()
{
if (CveOrdenCorte > 0)
{
CargaEmpaque();
CargaHuerta();
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetOrdenCorte(UsuarioActual.CveEmpresa, CveOrdenCorte: CveOrdenCorte))
{
if (ObjCGame.DtResultados.Rows.Count > 0)
{
DataRow dr = ObjCGame.DtResultados.Rows[0];
lblFolioOC.Text = dr["FolioOC"].ToString();
LblHuerta.Text = dr["Huerta"].ToString();
LblFecha.Text = dr["FechaEntregaOC"].ToString().ToDate().ToShortDateString();
TxtFecha.Text = dr["FechaIng"].ToString().ToDate().ToShortDateString();
lblNombreUsuario.Text = dr["Usuario"].ToString();
LblCuadro.Text = dr["Cuadro"].ToString();
LblPeso.Text = dr["Peso"].ToString();
CveHuerta = dr["CveHuerta"].ToEntero();
if (dr["Disponible"].ToEntero() == 0) { LnkGastos.Visible = false; LnkEntrada.Visible = false; }
if (ObjCGame.GetOrdenCorteDetalle(UsuarioActual.CveEmpresa, CveOrdenCorte: CveOrdenCorte))
{
GvDatos.DataSource = ObjCGame.DtResultados;
}
if (ObjCGame.GetCorte(UsuarioActual.CveEmpresa))
{
GvMP.DataSource = ObjCGame.DtResultados.FiltraParametros(String.Format("CveOrdenCorte = {0}", CveOrdenCorte));
}
if (ObjCGame.GetCorteGasto(UsuarioActual.CveEmpresa, CveOrdenCorte: CveOrdenCorte, Opcion: 1))
{
GvGastos.DataSource = ObjCGame.DtResultados;
}
if (ObjCGame.GetCorteGastoCompras(CveOrdenCorte))
{
GvOtrosGastos.DataSource = ObjCGame.DtResultados;
}
if (ObjCGame.GetFlete(UsuarioActual.CveEmpresa, CveOrdenCorte: CveOrdenCorte, TipoFlete: 1))
{
GvFleteInterno.DataSource = ObjCGame.DtResultados;
}
if (ObjCGame.GetFlete(UsuarioActual.CveEmpresa, CveOrdenCorte: CveOrdenCorte, TipoFlete: 2))
{
GvFleteExterno.DataSource = ObjCGame.DtResultados;
}
if (ObjCGame.GetCorteResumen(CveOrdenCorte))
{
if (ObjCGame.DtResultados.Rows.Count > 0)
{
LblPrimera.Text = ObjCGame.DtResultados.Rows[0]["Primera"].ToString().FormatoNumero() + " - " + ObjCGame.DtResultados.Rows[0]["PorPrimera"].ToString().FormatoNumero() + "%";
LblSegunda.Text = ObjCGame.DtResultados.Rows[0]["Segunda"].ToString().FormatoNumero() + " - " + ObjCGame.DtResultados.Rows[0]["PorSegunda"].ToString().FormatoNumero() + "%";
LblMerma.Text = ObjCGame.DtResultados.Rows[0]["Merma"].ToString().FormatoNumero() + " - " + ObjCGame.DtResultados.Rows[0]["PorMerma"].ToString().FormatoNumero() + "%";
}
}
if (ObjCGame.GetFleteHuertaEmpaque(UsuarioActual.CveEmpresa, CveOrdenCorte: CveOrdenCorte))
{
if (ObjCGame.DtResultados.FiltraParametros("CveFlete IS NULL").Rows.Count > 0)
{
if (LnkEntrada.Visible) { LnkFletes.Visible = true; }
}
}
//if (ObjCGame.GetEmpacado(CveOrdenCorte))
//{
// GvEmpacado.DataSource = ObjCGame.DtResultados;
//}
if (ObjCGame.GetLiquidacionIngresosOC(CveOrdenCorte,1))
{
GvLiquidacionIngresos.DataSource = ObjCGame.DtResultados;
}
if (ObjCGame.GetLiquidacionGastosOC(CveOrdenCorte,1))
{
GvLiquidacionGastos.DataSource = ObjCGame.DtResultados;
}
if (ObjCGame.GetLiquidacionIngresosOC(CveOrdenCorte,2))
{
GvLiquidacionIngresosBins.DataSource = ObjCGame.DtResultados;
}
if (ObjCGame.GetLiquidacionGastosOC(CveOrdenCorte,2))
{
GvLiquidacionGastosBins.DataSource = ObjCGame.DtResultados;
}
}
else
{
Alert("No se encontró la orden de corte especificada.", ModExtensiones.TipoMensaje.MsgAdvertencia);
}
}
if (!LnkEntrada.Visible) { BtnAddFechaFlete.Visible = false; TxtFechaFlete.Enabled = false; DdlEmpaque.Enabled = false; }
ObjCGame.Dispose();
GvDatos.DataBind();
GvGastos.DataBind();
GvOtrosGastos.DataBind();
GvMP.DataBind();
GvFleteInterno.DataBind();
GvFleteExterno.DataBind();
//GvEmpacado.DataBind();
GvLiquidacionIngresos.DataBind();
GvLiquidacionGastos.DataBind();
GvLiquidacionGastosBins.DataBind();
GvLiquidacionIngresosBins.DataBind();
UpFletes.Update();
UpAcciones.Update();
CargaTotalGastos();
UpMP.Update();
UPDatos.Update();
UPDatosOrden.Update();
UpLiquidacion.Update();
}
}
private void CargaEmpaque()
{
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetEmpaques(UsuarioActual.CveEmpresa, -1, 1))
{
DdlEmpaque.DataSource = ObjCGame.DtResultados;
DdlEmpaque.Items.Insert(0, new ListItem("Seleccione", "-1"));
}
ObjCGame.Dispose();
DdlEmpaque.DataBind();
}
private void CargaTotalGastos()
{
if (GvGastos.Rows.Count > 0)
{
LtlTotalOriginal.Text = GvGastos.Rows[0].Cells[3].Text.FormatoNumero();
}
UpGastos.Update();
}
protected void CargaHuerta()
{
ClsCGame ObjCort = new ClsCGame();
if (ObjCort.GetHuerta(UsuarioActual.CveEmpresa))
{
DdlHuerta.DataSource = ObjCort.DtResultados;
DdlHuerta.Items.Insert(0, new ListItem("Seleccione", "-1"));
}
ObjCort.Dispose();
DdlHuerta.DataBind();
UpModalAdd.Update();
}
#endregion
#region GRIDVIEWS
protected void GvMP_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.FCLabel("lblEmpaque").Text == "")
{
e.Row.FCLabel("lblEmpaque").Text = "Sin Asignar";
}
else
{
String Css = "Texto";
String Liga = $"/CGame/Empaque.aspx?&CveProduccion={e.Row.DataKey("CveProduccion")}";
e.Row.FCLabel("lblEmpaque").Text = "<a class=" + "" + Css + "" + " href=" + "" + Liga + "" + ">" + e.Row.FCLabel("lblEmpaque").Text + "</a>";
}
}
}
protected void GvDatos_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.DataKey("CveTipoEtiqueta").ToEntero() == 1)
{
e.Row.FCLabel("LblTipoEtiqueta").Text = "Si";
}
else
{
e.Row.FCLabel("LblTipoEtiqueta").Text = "No";
}
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>";
}
}
protected void GvGastos_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.DBCampo("Gpo").ToString() == "Total")
{
e.Row.CssClass = "Totales";
e.Row.Cells[0].Text = e.Row.DBCampo("Gpo");
}
else if (e.Row.DBCampo("CveCorteGasto").ToEntero() == 0)
{
e.Row.CssClass = "SubTotales";
e.Row.Cells[0].Text = e.Row.DBCampo("Gpo");
}
}
}
protected void GvEmpacado_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.RowIndex == 0)
{
e.Row.CssClass = "Totales";
e.Row.Cells[0].Text = "Total";
}
else if (e.Row.DBCampo("CveProduccion").ToEntero() <= 0)
{
e.Row.CssClass = "SubTotales";
e.Row.Cells[0].Text = e.Row.DBCampo("Gpo");
}
else
{
if (e.Row.DBCampo("CveTipoEtiqueta").ToEntero() == 1)
{
e.Row.FCLabel("LblTipoEtiqueta").Text = "Si";
}
else
{
e.Row.FCLabel("LblTipoEtiqueta").Text = "No";
}
}
}
}
protected void GvIngresos_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.RowIndex == 0)
{
e.Row.CssClass = "Totales";
e.Row.Cells[0].Text = "Total";
}
else if (e.Row.DBCampo("PS").ToString() == "")
{
e.Row.CssClass = "SubTotales";
e.Row.Cells[0].Text = e.Row.DBCampo("Folio");
String Css = "Texto";
String Liga = $"/CGame/OrdenProduccion.aspx?&CveOrdenProduccion={e.Row.DBCampo("CveOrdenProduccion")}";
e.Row.Cells[0].Text = "<a class=" + "" + Css + "" + " href=" + "" + Liga + "" + ">" + e.Row.Cells[0].Text + "</a>";
}
}
}
protected void GvLiquidacionGastos_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.RowIndex == 0)
{
e.Row.CssClass = "Totales";
e.Row.Cells[0].Text = "Total";
}
else if (e.Row.DBCampo("CveCargoFijo").ToEntero() <= 0)
{
e.Row.CssClass = "SubTotales";
e.Row.Cells[0].Text = e.Row.DBCampo("Folio");
}
}
}
protected void GvIngresosBins_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.RowIndex == 0)
{
e.Row.CssClass = "Totales";
e.Row.Cells[0].Text = "Total";
}
else if (e.Row.DBCampo("PS").ToString() == "")
{
e.Row.CssClass = "SubTotales";
e.Row.Cells[0].Text = e.Row.DBCampo("Folio");
String Css = "Texto";
String Liga = $"/CGame/OrdenProduccion.aspx?&CveOrdenProduccion={e.Row.DBCampo("CveOrdenProduccion")}";
e.Row.Cells[0].Text = "<a class=" + "" + Css + "" + " href=" + "" + Liga + "" + ">" + e.Row.Cells[0].Text + "</a>";
}
}
}
protected void GvLiquidacionGastosBins_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.RowIndex == 0)
{
e.Row.CssClass = "Totales";
e.Row.Cells[0].Text = "Total";
}
else if (e.Row.DBCampo("CveCargoFijo").ToEntero() <= 0)
{
e.Row.CssClass = "SubTotales";
e.Row.Cells[0].Text = e.Row.DBCampo("Folio");
}
}
}
#endregion
#region BTN'S
protected void LnkFletes_Click(object sender, EventArgs e)
{
Response.Redirect(String.Format("{0}{1}", "/CGame/Fletes.aspx?CveOrdenCorte=", CveOrdenCorte), true);
UpAcciones.Update();
}
protected void BtnAddFechaFlete_Click(object sender, EventArgs e)
{
if (DdlEmpaque.SelectedValue == "-1")
{
Alert("Tiene que seleccionar un empaque.", TipoMensaje.MsgAdvertencia);
return;
}
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.AddFleteHuertaEmpaque(CveOrdenCorte, DdlEmpaque.SelectedValue.ToEntero(), TxtFechaFlete.Text.ToDate(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
{
var Descripcion = "";
var Body = ObjCGame.GeneraCorreoFlete(CveOrdenCorte, UsuarioActual.CveEmpresa, UsuarioActual.Nombre, TxtFechaFlete.Text, DdlEmpaque.SelectedItem.Text);
if (ObjCGame.GetFleteHuertaEmpaque(UsuarioActual.CveEmpresa, CveOrdenCorte: CveOrdenCorte))
{
Descripcion = ObjCGame.DtResultados.Rows[0]["FolioFechaEmpaque"].ToString();
}
EnviarCorreo(CveOrdenCorte, Body, Descripcion);
Alert("La fecha del flete se asigno correctamente");
TxtFechaFlete.Text = DateTime.Now.ToShortDateString();
DdlEmpaque.SelectedIndex = 0;
LnkFletes.Visible = true;
UpAcciones.Update();
UpFletes.Update();
}
ObjCGame.Dispose();
}
protected void LnkGastos_Click(object sender, EventArgs e)
{
Response.Redirect(String.Format("{0}{1}", "/CGame/CorteGasto.aspx?CveOrdenCorte=", CveOrdenCorte), true);
UpAcciones.Update();
}
protected void LnkEntrada_Click(object sender, EventArgs e)
{
Response.Redirect(String.Format("{0}{1}", "/CGame/EntradaMateriaPrima.aspx?CveOrdenCorte=", CveOrdenCorte), true);
UpAcciones.Update();
}
protected void LnkModalGrafica_Click(object sender, EventArgs e)
{
RegistraScript("$('#DivModalGrafica').modal('show')");
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetCorteResumen(CveOrdenCorte))
{
DataTable Dt = new DataTable();
Dt.Columns.Add("Texto");
Dt.Columns.Add("Valor");
DataRow Row = null;
Row = Dt.NewRow();
Row["Texto"] = "Primera";
Row["Valor"] = ObjCGame.DtResultados.Rows[0]["Primera"].ToString();
Dt.Rows.Add(Row);
DataRow Row2 = null;
Row2 = Dt.NewRow();
Row2["Texto"] = "Segunda";
Row2["Valor"] = ObjCGame.DtResultados.Rows[0]["Segunda"].ToString();
Dt.Rows.Add(Row2);
DataRow Row3 = null;
Row3 = Dt.NewRow();
Row3["Texto"] = "Merma";
Row3["Valor"] = ObjCGame.DtResultados.Rows[0]["Merma"].ToString();
Dt.Rows.Add(Row3);
var query = from s in Dt.AsEnumerable()
select new
{
Texto = s["Texto"].ToString(),
Valor = s["Valor"].ToString().ToDouble()
};
var json = Newtonsoft.Json.JsonConvert.SerializeObject(query);
RegistraScript($"CargaHistorico({json})", "22");
}
ObjCGame.Dispose();
}
protected void LnkEditarOC_Click(object sender, EventArgs e)
{
TxtCuadro.Text = LblCuadro.Text;
TxtPeso.Text = LblPeso.Text;
DdlHuerta.SelectedValueExist(CveHuerta);
TxtFechaCorte.Text = LblFecha.Text;
RegistraScript("$('#DivModalEditarOC').modal('show')");
UpModalAdd.Update();
}
protected void BtnEditarOC_Click(object sender, EventArgs e)
{
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.UpdateOrdenCorte(CveOrdenCorte, DdlHuerta.SelectedValue.ToEntero(), lblFolioOC.Text, TxtFechaCorte.Text.ToDate(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtPeso.Text.ToDouble(), TxtCuadro.Text.ToEntero(), TxtObservacion.Text))
{
Alert("La orden de corte fue actualizada correctamente.");
RegistraScript("$('#DivModalEditarOC').modal('hide')");
CargaDatos();
}
ObjCGame.Dispose();
}
#endregion
#region CORREO
private void MandaCorreo(String Para, String Asunto, String Body)
{
ClsSisMail Mail = new ClsSisMail();
Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body);
}
private void EnviarCorreo(int CveOrdenCorte, String Body, String Descripcion)
{
var Asunto = "SIG - Solicitud de Flete Huerta Empaque " + Descripcion;
//var Para = "julian@adsistemas.mx";
//var Para = "dany_pimi@hotmail.com";
var Para = "norberto@citrusgame.com.mx";
try
{
var Hilo = new System.Threading.Thread(() => MandaCorreo(Para, Asunto, Body));
Hilo.Start();
}
catch (Exception ex)
{
Alert("Ocurrio un error al mandar el mail " + ex);
}
}
#endregion
}

View File

@@ -0,0 +1,130 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepOrdenProduccion.aspx.cs" Inherits="CGame_RepOrdenProduccion" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Reporte de Ordenes de Producción
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
<li>
<asp:LinkButton ID="LnkPdf" OnClick="LnkPdf_Click" runat="server"> <i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="ImgExcel" OnClick="ImgExcel_Click" runat="server"><i class="fa fa-ad-excel"></i> Exporta Excel</asp:LinkButton>
</li>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" OnClick="Consultar_Click" runat="server" Text="Consultar" class="btn btn-primary" />
<a href="javascript:;" class="expand"></a>
</div>
<div class="titlefiltros caption">
<div class="row">
<label class="col-md-1 ">Folio:</label>
<div class="col-md-2">
<asp:TextBox ID="TxtFolio" runat="server" MaxLength="20"></asp:TextBox>
</div>
<label class="col-md-1 ">F. Entrega I.:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<label class="col-md-1 ">F. Entrega F.:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
<div class="portlet-body">
<div class="row">
<label class="col-md-1 ">Cliente:</label>
<div class="col-md-3">
<asp:DropDownList ID="DdlCliente" runat="server" AppendDataBoundItems="true" DataTextField="Cliente" DataValueField="CveCliente" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
</asp:DropDownList>
</div>
<label class="col-md-1 ">Estatus:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlEstatus" runat="server" AppendDataBoundItems="true" DataTextField="Estatus" DataValueField="CveEstatus" CssClass="select2me" Width="100%">
</asp:DropDownList>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvOP.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvOP.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GvOP" runat="server" GridLines="None" OnRowDataBound="GvOP_RowDataBound" ShowHeaderWhenEmpty="true" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False" EmptyDataText="No se encontraron datos con los filtros seleccionados"
DataKeyNames="CveOrdenProduccion">
<Columns>
<asp:TemplateField HeaderText="Folio" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="LblFolio" runat="server" Text='<%# Eval("Folio")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cliente" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblCliente" runat="server" Text='<%# Eval("Cliente")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Estatus" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblEstatus" runat="server" Text='<%# Eval("Estatus")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Observaciones" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblObservaciones" runat="server" Text='<%# Eval("Observaciones")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="FEntrega" ItemStyle-Width="15%" HeaderText="Fecha de Entrega" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:BoundField DataField="FechaIng" ItemStyle-Width="15%" HeaderText="Fecha Ingreso" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:TemplateField HeaderText="Usuario" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LblUsuario" runat="server" Text='<%# Eval("NombreUsuario")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,158 @@
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_RepOrdenProduccion :ClsPaginas
{
#region PROPIEDADES
private DataTable DtDatos
{
get { return DtDatos = (DataTable)ViewState["DtDatos"]; }
set { ViewState["DtDatos"] = value; }
}
private int Opcion
{
get { return (ViewState["Opcion"] == null) ? 0 : Convert.ToInt32(ViewState["Opcion"]); }
set { ViewState["Opcion"] = value; }
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
CargaCliente();
CargaEstatus();
Opcion = Request["Opcion"] == null ? 0 : Request["Opcion"].ToString().ToEntero();
if (Opcion > 0)
{
txtFechaI.Text = MinFecha.ToShortDateString();
txtFechaF.Text = MaxFecha.ToShortDateString();
Consulta();
}
else
{
txtFechaI.Text = DateTime.Now.ToString();
txtFechaF.Text = DateTime.Now.ToString();
}
}
}
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 CargaEstatus()
{
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetEstatus(UsuarioActual.CveEmpresa))
{
DdlEstatus.DataSource = ObjCGame.DtResultados;
DdlEstatus.Items.Insert(0, new ListItem("Todos", "-1"));
DdlEstatus.DataBind();
}
ObjCGame.Dispose();
UPFiltros.Update();
}
protected void Consultar_Click(object sender, EventArgs e)
{
Consulta();
}
private void Consulta()
{
String Folio;
if (TxtFolio.Text != "") { Folio = TxtFolio.Text; } else { Folio = "-1"; }
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetOrdenProduccion(-1, UsuarioActual.CveEmpresa, DdlEstatus.SelectedValue.ToEntero(), Folio, txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), DdlCliente.SelectedValue.ToEntero()))
{
GvOP.DataSource = ObjCGame.DtResultados;
GvOP.DataBind();
DtDatos = ObjCGame.DtResultados;
if (ObjCGame.DtResultados.Rows.Count < 1)
{
Alert("No se encontraron resultados con los filtros seleccionados", TipoMensaje.MsgAdvertencia);
}
}
ObjCGame.Dispose();
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>";
}
}
protected void GenerarPDF(String Opcion)
{
String FechaF;
if (txtFechaF.Text==""||txtFechaF.Text== "__/__/____") { FechaF = "-1"; } else { FechaF = $"&emsp;<b>Fecha Entrega Final:</b> {txtFechaF.Text}"; }
String FechaI;
if (txtFechaI.Text == "" || txtFechaI.Text == "__/__/____") { FechaI = "-1"; } else { FechaI = $"&emsp;<b>Fecha Entrega Inicial:</b> {txtFechaI.Text}"; }
String Cliente;
if (DdlCliente.SelectedValue != "-1") { Cliente = $"&emsp;<b>Cliente:</b> {DdlCliente.SelectedItem.Text}"; } else { Cliente=""; }
String Estatus;
if (DdlEstatus.SelectedValue != "-1") { Estatus = $"&emsp;<b>Estatus:</b> {DdlEstatus.SelectedItem.Text}"; } else { Estatus = ""; }
String Folio;
if (TxtFolio.Text != "") { Folio = $"&emsp;<b>Folio:</b> {TxtFolio.Text}"; } else { Folio = ""; }
if (DtDatos.Rows.Count > 0)
{
System.IO.FileInfo Imagen = new System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta));
String logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa);
List<ReportParameter> para = new List<ReportParameter>();
para.Add(new ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa));
para.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre));
para.Add(new ReportParameter("FechaImpresion", DateTime.Now.ToString()));
para.Add(new ReportParameter("AgrupadoPor", $"<b>Agrupado Por:</b> {Folio}{Estatus}{Cliente}{FechaI}{FechaF}"));
if (Imagen.Exists)
{
para.Add(new ReportParameter("LogoPath", logouri));
}else
{
para.Add(new ReportParameter("LogoPath", ""));
}
ImprimirPDF("Empresas/Grales/Formatos/RepOP.rdlc", DtDatos, para, "Reporte de Orden de Produccion",Opcion);
}
else
{
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia);
}
}
protected void LnkPdf_Click(object sender, EventArgs e)
{
GenerarPDF("PDF");
}
protected void ImgExcel_Click(object sender, EventArgs e)
{
GenerarPDF("EXCEL");
}
}

View File

@@ -0,0 +1,91 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepOrdenProduccionXHuerta.aspx.cs" Inherits="CGame_RepOrdenProduccionXHuerta" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Reporte de Ordenes de Produccion X Huerta
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" Text="Consultar" class="btn btn-primary" ValidationGroup="Valida" />
<a href="javascript:;" class="expand"></a>
</div>
<div class="titlefiltros caption">
<div class="row">
<label class="col-md-1 ">Huerta:</label>
<div class="col-md-3">
<asp:DropDownList ID="DdlHuerta" runat="server" AppendDataBoundItems="true" DataTextField="Huerta" DataValueField="CveHuerta" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVHuerta" runat="server" ControlToValidate="DdlHuerta" Display="None" InitialValue="-1" ErrorMessage="El campo <b>''Huerta''</b> es requerido por la aplicación, por favor ingrese una huerta." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEHuerta" runat="server" HighlightCssClass="vco" TargetControlID="RFVHuerta" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<label class="col-md-1 ">Fecha Inicial:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control" Text="01/09/2017" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<label class="col-md-1 ">Fecha Final:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control" Text="31/08/2018" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
<div class="portlet-body">
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" GridLines="None" ShowHeaderWhenEmpty="true" OnRowDataBound="GvDatos_RowDataBound" EmptyDataText="No se encontraron datos con los filtros seleccionados." CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False">
<Columns>
<asp:HyperLinkField DataTextField="Folio" Target="_blank" HeaderText="Folio" DataNavigateUrlFields="CveOrdenProduccion" DataNavigateUrlFormatString="/CGame/OrdenProduccion.aspx?CveOrdenProduccion={0}" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="Cliente" HeaderText="Cliente" ItemStyle-HorizontalAlign="Left" />
<asp:HyperLinkField DataTextField="SerieFolio" Target="_blank" HeaderText="Folio Venta" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="Abreviatura" HeaderText="Moneda" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="TipoCambio" HeaderText="Tipo Cambio" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="Observaciones" HeaderText="Observaciones" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="FEntrega" ItemStyle-Width="15%" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:BoundField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="7%" HeaderText="Liquidado"/>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,66 @@
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;
}

87
CGame/RepOtrosGastos.aspx Normal file
View File

@@ -0,0 +1,87 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepOtrosGastos.aspx.cs" Inherits="CGame_RepOtrosGastos" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
Reporte de Otros Gastos
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" id="idnecesaria">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" Text="Consultar" class="btn btn-primary" />
<a href="javascript:;" class="expand"></a>
</div>
<div class="titlefiltros caption">
<div class="row">
<label class="col-md-1 ">Huerta:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlHuerta" runat="server" AppendDataBoundItems="true" DataTextField="Huerta" DataValueField="CveHuerta" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
</asp:DropDownList>
</div>
<label class="col-md-1 ">Fecha Inicial:</label>
<div class="col-md-1">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 80px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<label class="col-md-1 ">Fecha Final:</label>
<div class="col-md-1">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 80px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
<div class="portlet-body">
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GvDatos" runat="server" GridLines="None" ShowHeaderWhenEmpty="true" EmptyDataText="No se han encontrado otros gastos con los filtros seleccionados" OnRowDataBound="GvDatos_RowDataBound" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="50%" data-sort="true" AutoGenerateColumns="False">
<Columns>
<asp:BoundField DataField="Concepto" ItemStyle-HorizontalAlign="Left" HeaderText="Concepto" />
<asp:BoundField DataField="Importe" ItemStyle-HorizontalAlign="Right" HeaderText="Importe" DataFormatString="{0:N2}" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
</asp:Content>

View File

@@ -0,0 +1,76 @@
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_RepOtrosGastos : 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.GetRepOtrosGastos(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")}";

101
CGame/RepPreEnfriado.aspx Normal file
View File

@@ -0,0 +1,101 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepPreEnfriado.aspx.cs" Inherits="CGame_RepPreEnfriado" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Reporte de PreEnfriado
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" id="idnecesaria">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" Text="Consultar" class="btn btn-primary" />
<a href="javascript:;" class="expand"></a>
</div>
<div class="titlefiltros caption">
<div class="row">
<label class="col-md-1 ">Huerta:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlHuerta" runat="server" AppendDataBoundItems="true" DataTextField="Huerta" DataValueField="CveHuerta" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
</asp:DropDownList>
</div>
<label class="col-md-1 ">Fecha Inicial:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<label class="col-md-1 ">Fecha Final:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<label class="col-md-1 ">Liquidado:</label>
<div class="col-md-1">
<asp:CheckBox ID="ChkLiquidado" runat="server" CssClass="md-checksd2" />
</div>
</div>
</div>
</div>
<div class="portlet-body">
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GvDatos" runat="server" GridLines="None" ShowHeaderWhenEmpty="true" EmptyDataText="No se han encontrado cajas con importe de preenfriado con los filtros seleccionados" OnRowDataBound="GvDatos_RowDataBound" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False">
<Columns>
<asp:HyperLinkField HeaderText="Folio EMP" DataTextField="FolioEMP" DataNavigateUrlFields="CveProduccion" DataNavigateUrlFormatString="/CGame/Empaque.aspx?CveProduccion={0}" Target="_blank" ItemStyle-HorizontalAlign="Center" />
<asp:HyperLinkField HeaderText="Folio OP" DataTextField="FolioOP" DataNavigateUrlFields="CveOrdenProduccion" DataNavigateUrlFormatString="/CGame/OrdenProduccion.aspx?CveOrdenProduccion={0}" Target="_blank" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="Cantidad" ItemStyle-HorizontalAlign="Right" HeaderText="Cantidad" DataFormatString="{0:N2}" />
<asp:BoundField DataField="Peso" ItemStyle-HorizontalAlign="Right" HeaderText="Peso" DataFormatString="{0:N2}" />
<asp:BoundField DataField="ImportePreEnfriado" ItemStyle-HorizontalAlign="Right" HeaderText="PreEnfriado" DataFormatString="{0:N2}" />
<asp:BoundField DataField="PS" ItemStyle-HorizontalAlign="Left" HeaderText="Fruto" />
<asp:BoundField DataField="TipoProducto" ItemStyle-HorizontalAlign="Left" HeaderText="Tipo Producción" />
<asp:BoundField DataField="TipoMaduracion" ItemStyle-HorizontalAlign="Left" HeaderText="Variedad" />
<asp:BoundField DataField="TipoEmpaque" ItemStyle-HorizontalAlign="Left" HeaderText="Tipo Empaque" />
<asp:BoundField DataField="Tamaño" ItemStyle-HorizontalAlign="Left" HeaderText="Tamaño" />
<asp:BoundField DataField="Calidad" ItemStyle-HorizontalAlign="Left" HeaderText="Calidad" />
<asp:BoundField DataField="TipoCaja" ItemStyle-HorizontalAlign="Left" HeaderText="Etiqueta" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,73 @@
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_RepPreEnfriado : 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();
ChkLiquidado.Checked= Convert.ToBoolean(Request["Liquidado"] == null ? 0 : Request["Liquidado"].ToString().ToEntero());
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.GetRepPreEnfriado(DdlHuerta.SelectedValue.ToEntero(), txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(),UsuarioActual.CveEmpresa,ChkLiquidado.Checked))
{
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("CvePS").ToEntero() < 1)
{
e.Row.CssClass = "SubTotales";

BIN
CGame/vssver2.scc Normal file

Binary file not shown.