149 lines
4.5 KiB
VB.net
149 lines
4.5 KiB
VB.net
Option Explicit On
|
|
Option Strict On
|
|
|
|
Imports Extensiones
|
|
Partial Class Gral_CatClasificacionesComprobaciones
|
|
Inherits ClsPaginas
|
|
|
|
Property CveClasificacion As Integer
|
|
|
|
Get
|
|
|
|
If ViewState("CveClasificacion") Is Nothing Then
|
|
Return -1
|
|
Else
|
|
Return ViewState("CveClasificacion").ToString.ToEntero
|
|
End If
|
|
|
|
End Get
|
|
|
|
Set(value As Integer)
|
|
ViewState("CveClasificacion") = value
|
|
End Set
|
|
|
|
End Property
|
|
|
|
Property Actualizar As Boolean
|
|
Get
|
|
|
|
If ViewState("Actualizar") Is Nothing Then
|
|
Return False
|
|
Else
|
|
Return Boolean.Parse(ViewState("Actualizar").ToString)
|
|
End If
|
|
|
|
End Get
|
|
Set(value As Boolean)
|
|
ViewState("Actualizar") = value
|
|
End Set
|
|
|
|
End Property
|
|
|
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
|
If Not Page.IsPostBack Then
|
|
CargaDropDownList()
|
|
CargaGridClasificaciones()
|
|
End If
|
|
End Sub
|
|
|
|
|
|
|
|
#Region " C L A S I F I C A C I O N E S"
|
|
Protected Sub CargaDropDownList()
|
|
|
|
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, UsoClasificacion:=-1).FiltraParametros("", Orderby:="Clasificacion") 'GlobalDTProveedorClasificacion(UsuarioActual.CveEmpresa)
|
|
DdlClasificacion.DataBind()
|
|
DdlClasificacion.Items.Insert(0, New ListItem("Todos", "-1"))
|
|
|
|
End Sub
|
|
|
|
|
|
Protected Sub CargaGridClasificaciones()
|
|
|
|
Dim ObjClasificaciones As New ClsClasificaciones()
|
|
If ObjClasificaciones.GetClasificacionesComprobaciones(UsuarioActual.CveEmpresa, 2, DdlEstadosComprobaciones.SelectedValue.ToEntero) Then
|
|
GvClasificaciones.DataSource = ObjClasificaciones.DtResultados
|
|
GvClasificaciones.DataBind()
|
|
End If
|
|
ObjClasificaciones.Dispose()
|
|
UpDatos.Update()
|
|
|
|
End Sub
|
|
Private Sub LbAgregarClasificacion_Click(sender As Object, e As EventArgs) Handles LbAgregarClasificacion.Click
|
|
|
|
|
|
Dim ObjClasificaciones As New ClsClasificaciones()
|
|
|
|
|
|
|
|
If ObjClasificaciones.AddClasificacionesComprobaciones(DdlClasificacion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlTipoComprobacion.SelectedValue.ToEntero) Then
|
|
Alert("La clasificación se actualizo correctamente.")
|
|
|
|
UpDatos.Update()
|
|
|
|
RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalClasificaciones"))
|
|
End If
|
|
|
|
|
|
ObjClasificaciones.Dispose()
|
|
CargaGridClasificaciones()
|
|
|
|
End Sub
|
|
|
|
Public Sub ActualizaModalClasif(sender As Object, e As EventArgs)
|
|
|
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
|
Actualizar = True
|
|
|
|
DdlClasificacion.SelectedValueExist(GvRow.DataKey("CveClasificacion"))
|
|
CveClasificacion = GvRow.DataKey("CveClasificacion").ToString.ToEntero
|
|
RegistraScript(String.Format("$('#{0}').modal();", "ModalClasificaciones"))
|
|
|
|
DdlTipoComprobacion.SelectedValueExist(GvRow.DataKey("TipoComprobacion"))
|
|
|
|
UpModalClasificaciones.Update()
|
|
|
|
End Sub
|
|
#End Region
|
|
|
|
|
|
|
|
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
|
|
CargaGridClasificaciones()
|
|
End Sub
|
|
|
|
Protected Sub LnkAgregarClasificacion_Click(sender As Object, e As EventArgs)
|
|
|
|
Actualizar = False
|
|
|
|
DdlClasificacion.SelectedValueExist("-1")
|
|
CveClasificacion = -1
|
|
|
|
RegistraScript(String.Format("$('#{0}').modal('show');", "ModalClasificaciones"))
|
|
|
|
DdlTipoComprobacion.SelectedValueExist("-1")
|
|
|
|
UpModalClasificaciones.Update()
|
|
|
|
End Sub
|
|
|
|
Protected Sub LnkEliminar_Click(sender As Object, e As EventArgs)
|
|
|
|
|
|
Dim ObjClasificaciones As New ClsClasificaciones()
|
|
|
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
|
|
|
Dim CveClasificacionEliminar As Integer = GvRow.DataKey("CveClasificacion").ToString.ToEntero
|
|
Dim TipoComprobacionEliminar As Integer = GvRow.DataKey("TipoComprobacion").ToString.ToEntero
|
|
|
|
If ObjClasificaciones.RemoveClasificacionesComprobaciones(CveClasificacionEliminar, UsuarioActual.CveEmpresa, TipoComprobacionEliminar) Then
|
|
Alert("La clasificación se elimino correctamente.")
|
|
End If
|
|
|
|
ObjClasificaciones.Dispose()
|
|
CargaGridClasificaciones()
|
|
UpDatos.Update()
|
|
|
|
End Sub
|
|
End Class |