Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -309,8 +309,60 @@ Public Class ClsGenerales
|
||||
OnError("Ocurrió un error al agregar los motivos de cancelacion.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return retorno
|
||||
End Function
|
||||
|
||||
End Function
|
||||
Public Function AddMotivoCancelacionEmpresa(CveSATMotivoCancelacion As Integer, MotivoCancelacion As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
|
||||
Dim retorno As Boolean = False
|
||||
DataAdapter("PA_Gral_MotivosCancelacionAdd")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveSATMotivoCancelacion", SqlDbType.Int).Value = CveSATMotivoCancelacion
|
||||
.Add("@MotivoCancelacion", SqlDbType.VarChar).Value = MotivoCancelacion
|
||||
.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 agregar el motivo de cancelación.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return retorno
|
||||
End Function
|
||||
|
||||
Public Function UpdateMotivoCancelacionEmpresa(CveMotivoCancelacion As Integer, CveSATMotivoCancelacion As Integer, MotivoCancelacion As String, Estatus As Boolean, CveEmpresa As Integer) As Boolean
|
||||
Dim retorno As Boolean = False
|
||||
DataAdapter("PA_Gral_MotivosCancelacionUpdate")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveMotivoCancelacion", SqlDbType.Int).Value = CveMotivoCancelacion
|
||||
.Add("@CveSATMotivoCancelacion", SqlDbType.Int).Value = CveSATMotivoCancelacion
|
||||
.Add("@MotivoCancelacion", SqlDbType.VarChar).Value = MotivoCancelacion
|
||||
.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 actualizar el motivo de cancelación.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return retorno
|
||||
End Function
|
||||
|
||||
Public Function RemoveMotivoCancelacionEmpresa(CveMotivoCancelacion As Integer, CveEmpresa As Integer) As Boolean
|
||||
Dim retorno As Boolean = False
|
||||
DataAdapter("PA_Gral_MotivosCancelacionRemove")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveMotivoCancelacion", SqlDbType.Int).Value = CveMotivoCancelacion
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al eliminar el motivo de cancelación.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return retorno
|
||||
End Function
|
||||
|
||||
#Region " I N D I C A D O R E S Y G R A F I C A S"
|
||||
Public Function GetIndicadores(CveEmpresa As Integer) As DataSet
|
||||
'Dim Retorno As Boolean = False
|
||||
|
||||
@@ -10824,6 +10824,7 @@ Public Class ClsPaginas
|
||||
PaginaDict.Add("/Ventas/RepVencimientosCredito.aspx".ToUpper(), 146)
|
||||
PaginaDict.Add("/Ventas/CatMotivosDevoluciones.aspx".ToUpper(), 786)
|
||||
PaginaDict.Add("/Ventas/CatPSSubProyectosVendedores.aspx".ToUpper(), 787)
|
||||
PaginaDict.Add("/Ventas/CatMotivosCancelacion.aspx".ToUpper(), 788)
|
||||
|
||||
#End Region
|
||||
#Region "VIA"
|
||||
|
||||
98
Ventas/CatMotivosCancelacion.aspx
Normal file
98
Ventas/CatMotivosCancelacion.aspx
Normal file
@@ -0,0 +1,98 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatMotivosCancelacion.aspx.vb" Inherits="Ventas_CatMotivosCancelacion" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Catálogo de motivos de cancelación
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:UpdatePanel runat="server" ID="UpAgregar">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton runat="server" ID="LnkAgregar" data-toggle="tooltip" data-placement="left" title="Agregar un motivo" Text="<i class='fa fa-plus'></i>Agregar motivo" OnClick="LnkAgregar_Click"></asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel runat="server" ID="UpDatos" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="portlet light ">
|
||||
<div class="portlet-body">
|
||||
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right">
|
||||
<div style="margin-right: 15px">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<asp:GridView ID="GvDatos" runat="server" GridLines="None" Width="100%" DataKeyNames="CveMotivoCancelacion,CveSATMotivoCancelacion,MotivoCancelacion,Estatus" CssClass=" table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" OnRowDeleting="GvDatos_RowDeleting">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="MotivoCancelacion" HeaderText="Motivo" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="35%" />
|
||||
<asp:BoundField DataField="CodigoSATDescripcion" HeaderText="Motivo SAT" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="40%" />
|
||||
<asp:BoundField DataField="FechaIng" DataFormatString="{0:d}" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" />
|
||||
<asp:BoundField DataField="EstatusTexto" HeaderText="Estatus" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" />
|
||||
<asp:TemplateField HeaderText="Acciones" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" OnClick="imgE_Click" AlternateText="Editar" CommandArgument='<%# Eval("CveMotivoCancelacion")%>' CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Desea eliminar este registro?" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<div id="DivMotivo" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog" style="width: 450px;">
|
||||
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModal" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">
|
||||
<asp:Literal runat="server">Motivo de cancelación</asp:Literal></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlMotivoSAT" CssClass=" form-control input-sm select2me" runat="server" Width="100%" DataTextField="CodigoSATDescripcion" DataValueField="CveSATMotivoCancelacion">
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVMotivoSAT" runat="server" ControlToValidate="DdlMotivoSAT" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Motivo SAT''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<label for="DdlMotivoSAT">Motivo SAT:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtMotivo" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVMotivo" runat="server" ControlToValidate="TxtMotivo" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Motivo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<label for="TxtMotivo">Cancelación:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="ChkEstatus">Activo:</label>
|
||||
<asp:CheckBox ID="ChkEstatus" runat="server" CssClass="make-switchsd" data-size="small" Text=" " Checked="true" />
|
||||
<i></i>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="BtnGuardar" runat="server" class="btn btn-success" Text="Guardar" ValidationGroup="GrpGuardar" OnClick="BtnGuardar_Click" />
|
||||
<button id="Button3" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
103
Ventas/CatMotivosCancelacion.aspx.vb
Normal file
103
Ventas/CatMotivosCancelacion.aspx.vb
Normal file
@@ -0,0 +1,103 @@
|
||||
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
|
||||
|
||||
Partial Class Ventas_CatMotivosCancelacion
|
||||
Inherits ClsPaginas
|
||||
|
||||
Private Property CveMotivoCancelacion As Integer
|
||||
Get
|
||||
Return (IfNull(ViewState("CveMotivoCancelacion"), "-1", ViewState("CveMotivoCancelacion"))).ToString().ToEntero()
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveMotivoCancelacion") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CargaCombos()
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaCombos()
|
||||
DdlMotivoSAT.DataSource = GlobalDTSATMotivosCancelacion()
|
||||
DdlMotivoSAT.DataBind()
|
||||
|
||||
UpModal.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
LimpiaDatos()
|
||||
|
||||
Dim ObjGral As New ClsGenerales()
|
||||
If ObjGral.GetMotivosCancelacionEmpresa(UsuarioActual.CveEmpresa) Then
|
||||
GvDatos.DataSource = ObjGral.DtResultados.Copy()
|
||||
End If
|
||||
ObjGral.Dispose()
|
||||
GvDatos.DataBind()
|
||||
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As GridViewDeleteEventArgs)
|
||||
Dim GvRow As GridViewRow = GvDatos.Rows(e.RowIndex)
|
||||
|
||||
CveMotivoCancelacion = GvRow.DataKey("CveMotivoCancelacion").ToEntero()
|
||||
|
||||
Using ObjVentas As New ClsGenerales
|
||||
If ObjVentas.RemoveMotivoCancelacionEmpresa(CveMotivoCancelacion, 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)
|
||||
|
||||
CveMotivoCancelacion = GvRow.DataKey("CveMotivoCancelacion").ToEntero()
|
||||
TxtMotivo.Text = GvRow.DataKey("MotivoCancelacion")
|
||||
DdlMotivoSAT.SelectedValueExist(GvRow.DataKey("CveSATMotivoCancelacion"))
|
||||
ChkEstatus.Checked = CBool(GvRow.DataKey("Estatus"))
|
||||
|
||||
UpModal.Update()
|
||||
|
||||
RegistraScript("$('#DivMotivo').modal('show');")
|
||||
End Sub
|
||||
|
||||
Private Sub LimpiaDatos()
|
||||
CveMotivoCancelacion = -1
|
||||
TxtMotivo.Text = ""
|
||||
ChkEstatus.Checked = True
|
||||
End Sub
|
||||
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
|
||||
Dim Motivo As String = TxtMotivo.Text
|
||||
|
||||
Dim ObjVentas As New ClsGenerales
|
||||
If CveMotivoCancelacion = -1 Then
|
||||
If ObjVentas.AddMotivoCancelacionEmpresa(DdlMotivoSAT.SelectedValue.ToEntero(), Motivo, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
Alert("El motivo se agrego correctamente")
|
||||
End If
|
||||
Else
|
||||
If ObjVentas.UpdateMotivoCancelacionEmpresa(CveMotivoCancelacion, DdlMotivoSAT.SelectedValue.ToEntero(), 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
|
||||
Reference in New Issue
Block a user