8 -COMO CANCELAR DE MUCHAS PROMOCIONES _siguiente semana (Acciones inactivar), Proveedores abonar RNC remision generada ya existe
This commit is contained in:
@@ -22,18 +22,25 @@ Partial Class Ventas_CatPromociones
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
|
||||
If UsuarioActual.TienePermisoProceso(386) Then
|
||||
LnkAccInactivar.Visible = True
|
||||
End If
|
||||
|
||||
InicializaControles()
|
||||
OcultarMostrarInactivar(True)
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub InicializaControles()
|
||||
|
||||
|
||||
|
||||
CargarCentrosDeCosto(Nothing, Nothing, Nothing, LblSubProyecto)
|
||||
|
||||
GvDatos.Columns(6).HeaderText = LblSubProyecto.Text
|
||||
GvDatos.Columns(7).HeaderText = LblSubProyecto.Text
|
||||
|
||||
DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa)
|
||||
DdlSubProyecto.DataBind()
|
||||
@@ -95,4 +102,50 @@ Partial Class Ventas_CatPromociones
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub LnkAccInactivar_Click(sender As Object, e As EventArgs)
|
||||
OcultarMostrarInactivar(True)
|
||||
End Sub
|
||||
|
||||
Private Sub OcultarMostrarInactivar(Mostrar As Boolean)
|
||||
|
||||
GvDatos.Columns(0).Visible = Mostrar
|
||||
LnkInactivar.Visible = Mostrar
|
||||
UpInactivar.Update()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
Protected Sub LnkInactivar_Click(sender As Object, e As EventArgs)
|
||||
Dim ObjVentas As New ClsVentas
|
||||
ObjVentas.IniciaTransacSQL()
|
||||
Dim ErrorProceo As Boolean = False
|
||||
|
||||
Dim ContInactivadas As Integer = 0
|
||||
For Each GvRow As GridViewRow In GvDatos.Rows
|
||||
Dim Chk As CheckBox = GvRow.FCCheckBox("chk")
|
||||
Dim CvePromocion As Integer = GvRow.DataKey("CvePromocion").ToEntero
|
||||
|
||||
If Chk.Checked Then
|
||||
If ObjVentas.UpdatePromocionEstatus(CvePromocion, False, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
ContInactivadas = ContInactivadas + 1
|
||||
Else
|
||||
ErrorProceo = True
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
If ErrorProceo Then
|
||||
ObjVentas.RollBack()
|
||||
Else
|
||||
ObjVentas.Commit()
|
||||
Alert($"Se inactivaron {ContInactivadas} promociones.")
|
||||
OcultarMostrarInactivar(False)
|
||||
End If
|
||||
|
||||
|
||||
|
||||
ObjVentas.Dispose()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user