From 7fbba457ad395576da2aa02ff369c5144d9e1b14 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Tue, 16 Jul 2024 19:47:09 -0700 Subject: [PATCH] --Clase motivo devolucion --- App_Code/ClsPaginas.vb | 2 +- App_Code/ClsVentas.vb | 81 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+), 1 deletion(-) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 01fa99917..0a0732109 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -10776,7 +10776,7 @@ Public Class ClsPaginas PaginaDict.Add("/Ventas/FacturacionGlobal.aspx".ToUpper(), 546) PaginaDict.Add("/Ventas/RepComisionesSMS.aspx".ToUpper(), 1347) PaginaDict.Add("/Ventas/RepVencimientosCredito.aspx".ToUpper(), 146) - + PaginaDict.Add("/Ventas/CatMotivosDevoluciones.aspx".ToUpper(), 786) #End Region diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 7d26e4509..a41e71f4e 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -2757,6 +2757,87 @@ Public Class ClsVentas +#End Region + +#Region " M O T I V O S -- D E V O L U C I O N" + + Public Function AddMotivoDevolucion(Motivo As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_VentasMotivosDevolucionAdd") + + With SqlAdapter.SelectCommand.Parameters + .Add("@Motivo", SqlDbType.VarChar).Value = Motivo + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al tratar de agregar el motivo de devolucion. ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function + + + Public Function UpdateMotivoDevolucion(CveMotivoDevolución As Integer, Motivo As String, Estatus As Boolean, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_VentasMotivosDevolucionUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveMotivoDevolución", SqlDbType.Int).Value = CveMotivoDevolución + .Add("@Motivo", SqlDbType.VarChar).Value = Motivo + .Add("@Estatus", SqlDbType.Bit).Value = Estatus + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al tratar de actualizar el motivo de devolución. ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function + + Public Function GetMotivoDevolucion(CveMotivoDevolución As Integer, Estatus As Boolean, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_VentasMotivosDevolucionGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveMotivoDevolución", SqlDbType.Int).Value = CveMotivoDevolución + .Add("@Estatus", SqlDbType.Bit).Value = Estatus + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al tratar de obtener el motivo de devolución. ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function + + Public Function RemoveMotivoDevolucion(CveMotivoDevolución As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_VentasMotivosDevolucionRemove") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveMotivoDevolución", SqlDbType.Int).Value = CveMotivoDevolución + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al tratar de obtener el motivo de devolución. ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function #End Region Public Function GetPrecios(CveClasificacion As Integer, CvePS As Integer, CveEmpresa As Integer, CveSubProyecto As Integer) As Boolean