From 1ba2988430399b4949f60576df4d733d558bb6be Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 17 Jul 2024 19:36:25 -0700 Subject: [PATCH] --Catalogo de motivos de devolucion --- App_Code/ClsVentas.vb | 4 +- Ventas/CatMotivosDevoluciones.aspx | 93 +++++++++++++++++++++++++++ Ventas/CatMotivosDevoluciones.aspx.vb | 93 +++++++++++++++++++++++++++ 3 files changed, 188 insertions(+), 2 deletions(-) create mode 100644 Ventas/CatMotivosDevoluciones.aspx create mode 100644 Ventas/CatMotivosDevoluciones.aspx.vb diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index c6e67d0a9..4323620af 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -2803,13 +2803,13 @@ Public Class ClsVentas Return Retorno End Function - Public Function GetMotivoDevolucion(CveMotivoDevolucion As Integer, Estatus As Boolean, CveEmpresa As Integer) As Boolean + Public Function GetMotivoDevolucion(CveMotivoDevolucion As Integer, Estatus As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentasMotivosDevolucionGet") With SqlAdapter.SelectCommand.Parameters .Add("@CveMotivoDevolucion", SqlDbType.Int).Value = CveMotivoDevolucion - .Add("@Estatus", SqlDbType.Bit).Value = Estatus + .Add("@Estatus", SqlDbType.Int).Value = Estatus .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa End With diff --git a/Ventas/CatMotivosDevoluciones.aspx b/Ventas/CatMotivosDevoluciones.aspx new file mode 100644 index 000000000..5ac986d50 --- /dev/null +++ b/Ventas/CatMotivosDevoluciones.aspx @@ -0,0 +1,93 @@ +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatMotivosDevoluciones.aspx.vb" Inherits="Ventas_CatMotivosDevoluciones" %> + + + + + + + Catálogo de motivos de devolución + + + + + + +
  • + +
  • +
    +
    +
    + + + + + + + <%--Seccion lista resultados--%> +
    +
    +
    +
    +
    +
    + " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> +
    +
    + + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    + +
    + + + diff --git a/Ventas/CatMotivosDevoluciones.aspx.vb b/Ventas/CatMotivosDevoluciones.aspx.vb new file mode 100644 index 000000000..1b8e30360 --- /dev/null +++ b/Ventas/CatMotivosDevoluciones.aspx.vb @@ -0,0 +1,93 @@ + +Option Explicit On +Option Strict On + +Imports Extensiones + +Partial Class Ventas_CatMotivosDevoluciones + Inherits ClsPaginas + + Private Property CveMotivoDevolucion As Integer + Get + Return (IfNull(ViewState("CveMotivoDevolucion"), "-1", ViewState("CveMotivoDevolucion"))).ToString().ToEntero() + End Get + Set(value As Integer) + ViewState("CveMotivoDevolucion") = value + End Set + End Property + + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + If Not Page.IsPostBack Then + CargaDatos() + End If + End Sub + + Private Sub CargaDatos() + LimpiaDatos() + + Using ObjVentas As New ClsVentas + If ObjVentas.GetMotivoDevolucion(-1, -1, UsuarioActual.CveEmpresa) Then + GvDatos.DataSource = ObjVentas.DtResultados.Copy() + End If + End Using + GvDatos.DataBind() + + UpDatos.Update() + End Sub + + Protected Sub GvDatos_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) + Dim GvRow As GridViewRow = GvDatos.Rows(e.RowIndex) + + CveMotivoDevolucion = GvRow.DataKey("CveMotivoDevolucion").ToEntero() + + Using ObjVentas As New ClsVentas + If ObjVentas.RemoveMotivoDevolucion(CveMotivoDevolucion, UsuarioActual.CveEmpresa) Then + Alert("Se eliminó correctamente") + End If + End Using + + CargaDatos() + End Sub + Protected Sub imgE_Click(sender As Object, e As EventArgs) + Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow) + + CveMotivoDevolucion = GvRow.DataKey("CveMotivoDevolucion").ToEntero() + TxtMotivo.Text = GvRow.DataKey("MotivoDevolucion") + ChkEstatus.Checked = CBool(GvRow.DataKey("Estatus")) + + UpModal.Update() + + RegistraScript("$('#DivMotivo').modal('show');") + End Sub + + Private Sub LimpiaDatos() + CveMotivoDevolucion = -1 + TxtMotivo.Text = "" + ChkEstatus.Checked = True + End Sub + Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) + Dim Motivo As String = TxtMotivo.Text + + 'AGREGAR + Dim ObjVentas As New ClsVentas + If CveMotivoDevolucion = -1 Then + If ObjVentas.AddMotivoDevolucion(Motivo, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + Alert("El motivo se agrego correctamente") + End If + Else + If ObjVentas.UpdateMotivoDevolucion(CveMotivoDevolucion, Motivo, ChkEstatus.Checked, UsuarioActual.CveEmpresa) Then + Alert("El motivo se actualizó correctamente") + End If + End If + ObjVentas.Dispose() + + RegistraScript("$('#DivMotivo').modal('hide');") + + CargaDatos() + End Sub + Protected Sub LnkAgregar_Click(sender As Object, e As EventArgs) + LimpiaDatos() + + RegistraScript("$('#DivMotivo').modal('show');") + End Sub +End Class