RepLienas carga por venta

This commit is contained in:
Oscar Irigoyen
2022-10-05 17:02:37 -07:00
parent ead901254c
commit 9636641f6c
3 changed files with 31 additions and 24 deletions

View File

@@ -7,11 +7,18 @@ using System.Web.UI;
using System.IO;
using ListItem = System.Web.UI.WebControls.ListItem;
using System.Web.UI;
public partial class Ventas_RepLineasAdicionales : ClsPaginas
{
#region PROPIEDADES
private int CveLineaAdicional
{
get { return (ViewState["CveLineaAdicional"] == null) ? 0 : int.Parse(ViewState["CveLineaAdicional"].ToString()); }
set { ViewState["CveLineaAdicional"] = (int)value; }
}
private int CveVenta
{
get { return (ViewState["CveVenta"] == null) ? 0 : int.Parse(ViewState["CveVenta"].ToString()); }
@@ -33,18 +40,18 @@ public partial class Ventas_RepLineasAdicionales : ClsPaginas
ViewState["DTDatosGvLineasAdicionales"] = new DataTable();
}
return (DataTable)ViewState["DTDatosGvLineasAdicionales"];
}
}
set { ViewState["DTDatosGvLineasAdicionales"] = (DataTable)value; }
}
private string Comprobante
private string LineaAdicionalComprobante
{
get {
get {
if(ViewState["LineaAdicionalComprobante"] == null)
{
{
ViewState["LineaAdicionalComprobante"] = "";
}
}
return ViewState["LineaAdicionalComprobante"].ToString();
}
@@ -135,9 +142,10 @@ public partial class Ventas_RepLineasAdicionales : ClsPaginas
UpLineasAdicionales.Update();
}
protected void LnkCargarComprobante_Click(object sender, EventArgs e)
{
{
GridViewRow GvRow = (GridViewRow) ((LinkButton) sender).NamingContainer;
CveLineaAdicional = GvRow.DataKey("CveLineaAdicional").ToString().ToEntero();
CveVenta = GvRow.DataKey("CveVenta").ToString().ToEntero();
@@ -167,9 +175,9 @@ public partial class Ventas_RepLineasAdicionales : ClsPaginas
catch
{
errorCargaComprobante = true;
}
}
}
//borrar archivo anterior
if((!errorCargaComprobante) && LineaAdicionalComprobante.Length > 0)
{
@@ -204,12 +212,12 @@ public partial class Ventas_RepLineasAdicionales : ClsPaginas
fiNuevo = new FileInfo(RutaArchivoTemp);
if (fiNuevo.Exists)
{
{
try
{
{
if (File.Exists($@"{df.FullName}\{CveVenta}{fiNuevo.Extension}"))
{
{
File.Delete($@"{df.FullName}\{CveVenta}{fiNuevo.Extension}");
}
@@ -220,7 +228,7 @@ public partial class Ventas_RepLineasAdicionales : ClsPaginas
{
errorCargaComprobante = true;
}
if (!errorCargaComprobante)
{
ClsVentas objVentas = new ClsVentas();
@@ -287,9 +295,9 @@ public partial class Ventas_RepLineasAdicionales : ClsPaginas
}
if (e.Row.DataKey("CveLineaAdicionalEstatus").ToEntero() == 2)
{
{
e.Row.FCLinkButton("LnkCargarComprobante").Visible = false;
}
}
if (e.Row.DataKey("LineaAdicionalComprobante").Length > 0 && e.Row.DataKey("CveVenta").ToEntero() > 0 )
{
@@ -304,7 +312,7 @@ public partial class Ventas_RepLineasAdicionales : ClsPaginas
}
}
}
protected void LnkDescargaComprobante_Click(object sender, EventArgs e)
{
GridViewRow GvRow = (GridViewRow)((LinkButton)sender).NamingContainer;