From a6bfb26cb246c9bca7226f5dae68078cbb9c43c9 Mon Sep 17 00:00:00 2001 From: SLopez Date: Tue, 15 Jul 2025 15:58:41 -0700 Subject: [PATCH] CRUD completo de la tabla Exp_ExportacionesDescargas --- App_Code/ClsExportaciones.vb | 76 +++++++++++++ Export/ExpDetalle.aspx | 132 ++++++++++++++++++++++ Export/ExpDetalle.aspx.cs | 210 +++++++++++++++++++++++++++++++++-- 3 files changed, 406 insertions(+), 12 deletions(-) diff --git a/App_Code/ClsExportaciones.vb b/App_Code/ClsExportaciones.vb index facc2c19b..9f5563032 100644 --- a/App_Code/ClsExportaciones.vb +++ b/App_Code/ClsExportaciones.vb @@ -35,6 +35,7 @@ Public Class ClsExportaciones Public Property CveExportacion As Integer Public Property CveExportacionDetalle As Integer + Public Property CveExportacionDescarga As Integer #End Region @@ -419,6 +420,81 @@ Public Class ClsExportaciones End Function #End Region +#Region "DESCARGAS" + Public Function GetDescargas(CveEmpresa As Integer, Optional CveExportacion As Integer = -1, Optional CveExportacionDescarga As Integer = -1, Optional CveExportacionDetalle As Integer = -1, Optional CveImportacionDetalle As Integer = -1) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Exp_ExportacionesDescargaGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveExportacion", SqlDbType.Int).Value = CveExportacion + .Add("@CveExportacionDescarga", SqlDbType.Int).Value = CveExportacionDescarga + .Add("@CveExportacionDetalle", SqlDbType.Int).Value = CveExportacionDetalle + .Add("@CveImportacionDetalle", SqlDbType.Int).Value = CveImportacionDetalle + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las Descargas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function AddDescarga(CveExportacionDetalle As Integer, CveImportacionDetalle As Integer, Cantidad As Decimal, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Exp_ExportacionesDescargaAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveExportacionDetalle", SqlDbType.Int).Value = CveExportacionDetalle + .Add("@CveImportacionDetalle", SqlDbType.Int).Value = CveImportacionDetalle + .Add("@Cantidad", SqlDbType.Decimal).Value = Cantidad + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + + .Add("@CveExportacionDescarga", SqlDbType.Int).Direction = ParameterDirection.Output + End With + Try + SqlAdapter.Fill(Data) + CveExportacionDescarga = SqlAdapter.SelectCommand.Parameters("@CveExportacionDescarga").Value.ToString.ToEntero + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al guardar la Descarga.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function UpdateDescarga(CveExportacionDescarga As Integer, CveExportacionDetalle As Integer, CveImportacionDetalle As Integer, Cantidad As Decimal) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Exp_ExportacionesDescargaUpdate") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveExportacionDescarga", SqlDbType.Int).Value = CveExportacionDescarga + .Add("@CveExportacionDetalle", SqlDbType.Int).Value = CveExportacionDetalle + .Add("@CveImportacionDetalle", SqlDbType.Int).Value = CveImportacionDetalle + .Add("@Cantidad", SqlDbType.Decimal).Value = Cantidad + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar la Descarga.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function RemoveDescarga(CveExportacionDescarga As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Exp_ExportacionesDescargaRemove") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveExportacionDescarga", SqlDbType.Int).Value = CveExportacionDescarga + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar la Descarga.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function +#End Region + #Region "AGENTES" Public Function GetAgentes(Optional CveAgente As Integer = -1, Optional CveEmpresa As Integer = -1) As Boolean Dim Retorno As Boolean = False diff --git a/Export/ExpDetalle.aspx b/Export/ExpDetalle.aspx index 47880c56a..c5d3fd8b5 100644 --- a/Export/ExpDetalle.aspx +++ b/Export/ExpDetalle.aspx @@ -744,6 +744,54 @@ + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

@@ -877,6 +925,90 @@ +