diff --git a/Ventas/RepLineasAdicionales.aspx b/Ventas/RepLineasAdicionales.aspx
index 4a65fdc2b..4c38cc00b 100644
--- a/Ventas/RepLineasAdicionales.aspx
+++ b/Ventas/RepLineasAdicionales.aspx
@@ -3,12 +3,7 @@
-
+
@@ -16,10 +11,7 @@
-
-
-
-
+
@@ -57,35 +49,13 @@
- Fecha Inicio:
-
- Fecha Fin:
-
-
-
-
-
-
-
-
+
Estatus:
+
@@ -93,24 +63,14 @@
-
-
-
+
@@ -130,38 +90,34 @@
+ OnRowCommand ="GvLineasAdicionales_RowCommand"
+ OnRowDataBound="GvLineasAdicionales_RowDataBound">
-
-
-
-
-
+
+
+
-
+
<%----%>
-
+
-
-
-
+
+
+
diff --git a/Ventas/RepLineasAdicionales.aspx.cs b/Ventas/RepLineasAdicionales.aspx.cs
index f6266c005..c154e960b 100644
--- a/Ventas/RepLineasAdicionales.aspx.cs
+++ b/Ventas/RepLineasAdicionales.aspx.cs
@@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.IO;
using ListItem = System.Web.UI.WebControls.ListItem;
-using DocumentFormat.OpenXml.Spreadsheet;
using System.Web.UI;
public partial class Ventas_RepLineasAdicionales : ClsPaginas
@@ -91,8 +90,8 @@ public partial class Ventas_RepLineasAdicionales : ClsPaginas
DdlClientes.SelectedText = "Todos";
DdlClientes.SelectedValue = "-1";
- txtFechaI.Text = DateTime.Now.FirstDayOfMonth().ToShortDateString();
- txtFechaF.Text = DateTime.Now.AddMonths(3).ToString("dd/MM/yyyy");
+ //txtFechaI.Text = DateTime.Now.FirstDayOfMonth().ToShortDateString();
+ //txtFechaF.Text = DateTime.Now.AddMonths(3).ToString("dd/MM/yyyy");
}
@@ -111,7 +110,7 @@ public partial class Ventas_RepLineasAdicionales : ClsPaginas
int CveProveedor = DdlProveedor.SelectedValue.ToEntero() > 0 ? DdlProveedor.SelectedValue.ToEntero() : -1;
- if(objVentas.GetLineasAdicionales(-1,DdlClientes.SelectedValue.ToEntero(),CveProveedor, TipoLinea, -1,txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), DdlEstatus.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa)){
+ if(objVentas.GetLineasAdicionales(-1,DdlClientes.SelectedValue.ToEntero(),CveProveedor, TipoLinea, -1, MinFecha, MaxFecha, DdlEstatus.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa)){
GvLineasAdicionales.DataSource = objVentas.DtResultados;
if( objVentas.DtResultados.Rows.Count > 0)
@@ -273,14 +272,12 @@ public partial class Ventas_RepLineasAdicionales : ClsPaginas
gvTemp.Columns[8].Visible = false;
gvTemp.ExportToExcelx( TipoLinea == 1 ? "RepLienasAdicionales":"RepPO");
}
-
-
-
+
protected void GvLineasAdicionales_RowDataBound(object sender, GridViewRowEventArgs e)
{
if(e.Row.RowType == DataControlRowType.DataRow)
{
- if(e.Row.DataKey("CveLineaAdicionalEstatus").ToEntero().Contiene(1) && e.Row.DataKey("CveVenta").ToEntero() > 0)
+ if(e.Row.DataKey("CveVenta").ToEntero() > 0)
{
e.Row.FCLinkButton("LnkCambiarEstatus").Visible = true;
}
@@ -321,4 +318,31 @@ public partial class Ventas_RepLineasAdicionales : ClsPaginas
Response.End();
}
}
+
+ protected void GvLineasAdicionales_RowCommand(object sender, GridViewCommandEventArgs e)
+ {
+
+ GridViewRow GvRow = (GridViewRow)((LinkButton)e.CommandSource).NamingContainer;
+ int CveLineaAdicionalActualzarEstatus = GvRow.DataKey("CveLineaAdicional").ToString().ToEntero();
+ int CveVenta = GvRow.DataKey("CveVenta").ToString().ToEntero();
+
+ bool errorCambioEstatus = false;
+ int cveestatus = e.CommandArgument.ToEntero() + 2; //pasar al siguiente estatus
+
+ ClsVentas objVentas = new ClsVentas();
+
+ if (!objVentas.UpdateLineasAdicionales(CveLineaAdicionalActualzarEstatus, "-1", -1, -1, -1, -1, -1, MinFecha, 100, -1, UsuarioActual.CveEmpresa, CveVenta: CveVenta, CveLineaAdicionalEstatus: cveestatus))
+ {
+ errorCambioEstatus = true;
+ }
+
+
+ objVentas.Dispose();
+ if (!errorCambioEstatus)
+ {
+ CargaDatos();
+ }
+
+
+ }
}
\ No newline at end of file