diff --git a/App_Code/ClsExportaciones.vb b/App_Code/ClsExportaciones.vb index c7317a75b..72509a08e 100644 --- a/App_Code/ClsExportaciones.vb +++ b/App_Code/ClsExportaciones.vb @@ -120,12 +120,13 @@ Public Class ClsExportaciones End Sub #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 DataAdapter("PA_Exp_ExportacionesRep") With SqlAdapter.SelectCommand.Parameters .Add("@CveExportacion", SqlDbType.Int).Value = CveExportacion .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@EsExportacion", SqlDbType.Bit).Value = EsExportacion .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio .Add("@FechaFin", SqlDbType.Date).Value = FechaFin End With diff --git a/Export/RepExportaciones.aspx.cs b/Export/RepExportaciones.aspx.cs index 7a71cc001..474c146de 100644 --- a/Export/RepExportaciones.aspx.cs +++ b/Export/RepExportaciones.aspx.cs @@ -1,11 +1,13 @@ using DocumentFormat.OpenXml.Wordprocessing; using Extensiones; +using HigLabo.Core; using StackExchange.Redis; using System; using System.Activities; using System.Activities.Expressions; using System.Activities.Statements; using System.Collections.Generic; +using System.EnterpriseServices.Internal; using System.Linq; using System.Web; using System.Web.UI; @@ -13,6 +15,7 @@ using System.Web.UI.WebControls; using static Microsoft.EntityFrameworkCore.DbLoggerCategory; using static Stimulsoft.Report.Export.DeflaterHuffman; + public partial class Export_RepExportaciones : ClsPaginas { #region Propiedades @@ -21,18 +24,33 @@ public partial class Export_RepExportaciones : ClsPaginas get { return (ViewState["CveExportacion"] == null) ? -1 : Convert.ToInt32(ViewState["CveExportacion"]); } set { ViewState["CveExportacion"] = value; } } + + private bool EsImportacion + { + get{ return (ViewState["EsImportacion"] == null) ? false : Boolean.Parse(ViewState["EsImportacion"].ToString()); } + set { ViewState["EsImportacion"] = value; } + } #endregion protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { + EsImportacion = false; + + if (Request["Opcion"] != null) + { + if (Request["Opcion"] == "I") + EsImportacion = true; + } + LtlPeriodoseleccionado.Text = EsImportacion ? "Importaciones" : "Exportaciones"; CargaExportaciones(); } } protected void CargaExportaciones() { 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.DataBind();