Cambios Exportaciones

This commit is contained in:
Luis Carlos Quijada
2025-07-02 13:29:51 -06:00
parent 8285fc5edd
commit 7f629642d4
2 changed files with 21 additions and 2 deletions

View File

@@ -120,12 +120,13 @@ Public Class ClsExportaciones
End Sub End Sub
#Region "EXPORTACIONES" #Region "EXPORTACIONES"
Public Function GetExportacion(Optional CveExportacion As Integer = -1, Optional CveEmpresa As Integer = -1, Optional FechaInicio As Date = MinFecha, Optional FechaFin As Date = MaxFecha) As Boolean Public Function GetExportacion(Optional CveExportacion As Integer = -1, Optional CveEmpresa As Integer = -1, Optional EsExportacion As Integer = 1, Optional FechaInicio As Date = MinFecha, Optional FechaFin As Date = MaxFecha) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Exp_ExportacionesRep") DataAdapter("PA_Exp_ExportacionesRep")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CveExportacion", SqlDbType.Int).Value = CveExportacion .Add("@CveExportacion", SqlDbType.Int).Value = CveExportacion
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@EsExportacion", SqlDbType.Bit).Value = EsExportacion
.Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
.Add("@FechaFin", SqlDbType.Date).Value = FechaFin .Add("@FechaFin", SqlDbType.Date).Value = FechaFin
End With End With

View File

@@ -1,11 +1,13 @@
using DocumentFormat.OpenXml.Wordprocessing; using DocumentFormat.OpenXml.Wordprocessing;
using Extensiones; using Extensiones;
using HigLabo.Core;
using StackExchange.Redis; using StackExchange.Redis;
using System; using System;
using System.Activities; using System.Activities;
using System.Activities.Expressions; using System.Activities.Expressions;
using System.Activities.Statements; using System.Activities.Statements;
using System.Collections.Generic; using System.Collections.Generic;
using System.EnterpriseServices.Internal;
using System.Linq; using System.Linq;
using System.Web; using System.Web;
using System.Web.UI; using System.Web.UI;
@@ -13,6 +15,7 @@ using System.Web.UI.WebControls;
using static Microsoft.EntityFrameworkCore.DbLoggerCategory; using static Microsoft.EntityFrameworkCore.DbLoggerCategory;
using static Stimulsoft.Report.Export.DeflaterHuffman; using static Stimulsoft.Report.Export.DeflaterHuffman;
public partial class Export_RepExportaciones : ClsPaginas public partial class Export_RepExportaciones : ClsPaginas
{ {
#region Propiedades #region Propiedades
@@ -21,18 +24,33 @@ public partial class Export_RepExportaciones : ClsPaginas
get { return (ViewState["CveExportacion"] == null) ? -1 : Convert.ToInt32(ViewState["CveExportacion"]); } get { return (ViewState["CveExportacion"] == null) ? -1 : Convert.ToInt32(ViewState["CveExportacion"]); }
set { ViewState["CveExportacion"] = value; } set { ViewState["CveExportacion"] = value; }
} }
private bool EsImportacion
{
get{ return (ViewState["EsImportacion"] == null) ? false : Boolean.Parse(ViewState["EsImportacion"].ToString()); }
set { ViewState["EsImportacion"] = value; }
}
#endregion #endregion
protected void Page_Load(object sender, EventArgs e) protected void Page_Load(object sender, EventArgs e)
{ {
if (!IsPostBack) if (!IsPostBack)
{ {
EsImportacion = false;
if (Request["Opcion"] != null)
{
if (Request["Opcion"] == "I")
EsImportacion = true;
}
LtlPeriodoseleccionado.Text = EsImportacion ? "Importaciones" : "Exportaciones";
CargaExportaciones(); CargaExportaciones();
} }
} }
protected void CargaExportaciones() protected void CargaExportaciones()
{ {
ClsExportaciones Exportaciones = new ClsExportaciones(); ClsExportaciones Exportaciones = new ClsExportaciones();
if (Exportaciones.GetExportacion(-1, UsuarioActual.CveEmpresa)) int EsExportacion = EsImportacion ? 0 : 1; // 0 = importación, 1 = exportación
if (Exportaciones.GetExportacion(-1, UsuarioActual.CveEmpresa, EsExportacion))
{ {
GVExportaciones.DataSource = Exportaciones.DtResultados; GVExportaciones.DataSource = Exportaciones.DtResultados;
GVExportaciones.DataBind(); GVExportaciones.DataBind();