726 lines
38 KiB
VB.net
726 lines
38 KiB
VB.net
Option Explicit On
|
|
Option Strict On
|
|
|
|
Imports System.Data
|
|
Imports System.Linq
|
|
Imports Extensiones
|
|
'Imports Telerik.Charting.Styles
|
|
Partial Class AF_CatClasificacionesCaracteristicas
|
|
Inherits ClsPaginas
|
|
|
|
#Region "Caracteristicas"
|
|
Private Property DTClasificacionesCaracteristicas As DataTable
|
|
Get
|
|
Return CType(ViewState("DTClasificacionesCaracteristicas"), DataTable)
|
|
End Get
|
|
Set(value As DataTable)
|
|
ViewState("DTClasificacionesCaracteristicas") = value
|
|
End Set
|
|
End Property
|
|
|
|
Private Property DTCaracteristicasOpciones As DataTable
|
|
Get
|
|
Return CType(ViewState("DTCaracteristicasOpciones"), DataTable)
|
|
End Get
|
|
Set(value As DataTable)
|
|
ViewState("DTCaracteristicasOpciones") = value
|
|
End Set
|
|
End Property
|
|
|
|
|
|
#End Region
|
|
|
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
|
If Not Page.IsPostBack Then
|
|
'Clasificaciones
|
|
ViewState("OrdenCL") = ""
|
|
CargaDatosCL()
|
|
|
|
'Características
|
|
ViewState("OrdenCA") = ""
|
|
'CargaSubTiposActivosFijosCA()
|
|
'CargaClasificacionesCA()
|
|
CargaDatosCA()
|
|
|
|
'Opciones
|
|
ViewState("OrdenOpciones") = ""
|
|
'CargaSubTiposActivosFijosOpciones()
|
|
'CargaClasificacionesOpciones()
|
|
'CargaCaracteristicas()
|
|
CargaDatosOpciones()
|
|
|
|
|
|
'Carga Globals para DT
|
|
CargaTiposActivosFijos()
|
|
CargaSubTiposActivosFijos()
|
|
''CargaCaracteristicasClasificaciones()
|
|
'CargaCaracteristicas()
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub CargaTiposActivosFijos()
|
|
'DdlTiposActivosFijosCL.DataSource = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa)
|
|
'DdlTiposActivosFijosCL.DataBind()
|
|
DdlTiposActivosFijosCA.DataSource = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa)
|
|
DdlTiposActivosFijosCA.DataBind()
|
|
DdlTiposActivosFijosOpciones.DataSource = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa)
|
|
DdlTiposActivosFijosOpciones.DataBind()
|
|
End Sub
|
|
Private Sub CargaSubTiposActivosFijos()
|
|
Dim ObjAF As New ClsAF
|
|
|
|
If ObjAF.GetSubTiposActivosFijos(UsuarioActual.CveEmpresa) Then
|
|
GlobalDTSubTipoActivoFijo(UsuarioActual.CveEmpresa) = ObjAF.DtResultados
|
|
Else
|
|
Alert("Ocurrio un error al obtener los SubTipos de Activos Fijos", TipoMensaje.MsgError)
|
|
End If
|
|
|
|
ObjAF.Dispose()
|
|
End Sub
|
|
#Region "CLASIFICACIONES"
|
|
Protected Sub LbAgregarCL_Click(sender As Object, e As System.EventArgs) Handles LbAgregarCL.Click
|
|
Dim ObjCaracteristicaClasificacion As New ClsAF
|
|
If ObjCaracteristicaClasificacion.AddClasificacionesCaracteristicas(TxtCaracteristicaClasificacionCL.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
|
'DdlSubTiposActivosFijosCL.SelectedIndex = 0
|
|
TxtCaracteristicaClasificacionCL.Text = ""
|
|
Alert("La Nueva Clasificación de Activo Fijo se guardó correctamente.", TipoMensaje.MsgInformacion)
|
|
UpTitulosCL.Update()
|
|
|
|
CargaSubTiposActivosFijos()
|
|
|
|
If ViewState("OrdenCL").ToString() <> String.Empty Then
|
|
CargaGrid(ViewState("OrdenCL").ToString(), 0)
|
|
Else
|
|
CargaGrid("", 0)
|
|
End If
|
|
End If
|
|
ObjCaracteristicaClasificacion.Dispose()
|
|
|
|
CargaClasificacionesCA()
|
|
End Sub
|
|
|
|
#Region "CARGA DATOS"
|
|
Public Sub CargaDatosCL()
|
|
If ViewState("OrdenCL").ToString() <> String.Empty Then
|
|
CargaGrid(ViewState("OrdenCL").ToString(), 0)
|
|
Else
|
|
CargaGrid("", 0)
|
|
End If
|
|
End Sub
|
|
'Protected Sub DdlTiposActivosFijosCL_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTiposActivosFijosCL.SelectedIndexChanged
|
|
' DdlSubTiposActivosFijosCL.Items.Clear()
|
|
' DdlSubTiposActivosFijosCL.DataSource = GlobalDTSubTipoActivoFijo(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveTipoActivoFijo = {0} AND CveEmpresa = {1}", DdlTiposActivosFijosCL.SelectedValue.ToEntero, UsuarioActual.CveEmpresa))
|
|
' DdlSubTiposActivosFijosCL.DataBind()
|
|
' DdlSubTiposActivosFijosCL.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
|
'End Sub
|
|
|
|
#End Region
|
|
|
|
#Region "-- G V --"
|
|
Protected Sub GvDatosCL_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatosCL.RowDataBound
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
If e.Row.RowIndex = 0 Then
|
|
'e.Row.Cells(0).Width = Unit.Pixel(200)
|
|
'e.Row.Cells(1).Width = Unit.Pixel(200)
|
|
e.Row.Cells(0).Width = Unit.Pixel(200)
|
|
e.Row.Cells(1).Width = Unit.Pixel(100)
|
|
e.Row.Cells(2).Width = Unit.Pixel(100)
|
|
e.Row.Cells(3).Width = Unit.Pixel(100)
|
|
e.Row.Cells(4).Width = Unit.Pixel(55)
|
|
e.Row.Cells(5).Width = Unit.Pixel(61)
|
|
End If
|
|
|
|
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
|
|
|
'If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
|
|
' e.Row.FCDropDownList("DdlTiposActivosFijosCL").DataSource = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa)
|
|
' e.Row.FCDropDownList("DdlTiposActivosFijosCL").DataBind()
|
|
' e.Row.FCDropDownList("DdlTiposActivosFijosCL").SelectedValue = e.Row.DBCampo("CveTipoActivoFijo")
|
|
|
|
' e.Row.FCDropDownList("DdlSubTiposActivosFijosCL").DataSource = GlobalDTSubTipoActivoFijo(UsuarioActual.CveEmpresa)
|
|
' e.Row.FCDropDownList("DdlSubTiposActivosFijosCL").DataBind()
|
|
' e.Row.FCDropDownList("DdlSubTiposActivosFijosCL").SelectedValue = e.Row.DBCampo("CveSubTipoActivoFijo")
|
|
'End If
|
|
End If
|
|
End Sub
|
|
Protected Sub GvDatosCL_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatosCL.RowDeleting
|
|
Dim ObjCaracteristicaClasificacion As New ClsAF
|
|
If ObjCaracteristicaClasificacion.RemoveClasificacionesCaracteristicas(GvDatosCL.DataKeys(e.RowIndex).Value.ToString.ToEntero, UsuarioActual.CveEmpresa) Then
|
|
GvDatosCL.EditIndex = -1
|
|
|
|
CargaSubTiposActivosFijos()
|
|
'CargaCaracteristicasClasificaciones()
|
|
|
|
Alert("La Clasificación se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
|
End If
|
|
|
|
ObjCaracteristicaClasificacion.Dispose()
|
|
|
|
If ViewState("OrdenCL").ToString() <> String.Empty Then
|
|
CargaGrid(ViewState("OrdenCL").ToString(), 0)
|
|
Else
|
|
CargaGrid("", 0)
|
|
End If
|
|
|
|
CargaClasificacionesCA()
|
|
End Sub
|
|
Protected Sub GvDatosCL_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatosCL.RowCancelingEdit
|
|
GvDatosCL.EditIndex = -1
|
|
If ViewState("OrdenCL").ToString() <> String.Empty Then
|
|
CargaGrid(ViewState("OrdenCL").ToString(), 0)
|
|
Else
|
|
CargaGrid("", 0)
|
|
End If
|
|
End Sub
|
|
Protected Sub GvDatosCL_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatosCL.RowUpdating
|
|
Dim ObjCaracteristicaClasificacion As New ClsAF
|
|
|
|
'Dim CveSubTiposActivosFijos As Integer = GvDatosCL.Rows(e.RowIndex).FCDropDownList("DdlSubTiposActivosFijosCL").SelectedValue.ToEntero
|
|
Dim CaracteristicaClasificacion As String = GvDatosCL.Rows(e.RowIndex).FCTextBox("TxtCaracteristicaClasificacionCL").Text.Trim
|
|
Dim Estatus As Boolean = GvDatosCL.Rows(e.RowIndex).FCCheckBox("ChkEstatusCL").Checked
|
|
Dim CveCaracteristicaClasificacion As Integer = GvDatosCL.Rows(e.RowIndex).DataKey("CveCaracteristicaClasificacion").ToString.ToEntero
|
|
|
|
If ObjCaracteristicaClasificacion.UpdateClasificacionesCaracteristicas(CaracteristicaClasificacion, Estatus, CveCaracteristicaClasificacion, UsuarioActual.CveEmpresa) Then
|
|
GvDatosCL.EditIndex = -1
|
|
|
|
CargaSubTiposActivosFijos()
|
|
'CargaCaracteristicasClasificaciones()
|
|
|
|
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
|
End If
|
|
|
|
ObjCaracteristicaClasificacion.Dispose()
|
|
|
|
If ViewState("OrdenCL").ToString() <> String.Empty Then
|
|
CargaGrid(ViewState("OrdenCL").ToString(), 0)
|
|
Else
|
|
CargaGrid("", 0)
|
|
End If
|
|
|
|
CargaClasificacionesCA()
|
|
End Sub
|
|
Protected Sub GvDatosCL_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatosCL.RowEditing
|
|
GvDatosCL.EditIndex = e.NewEditIndex
|
|
|
|
If ViewState("OrdenCL").ToString() <> String.Empty Then
|
|
CargaGrid(ViewState("OrdenCL").ToString(), 0)
|
|
Else
|
|
CargaGrid("", 0)
|
|
End If
|
|
End Sub
|
|
#End Region
|
|
|
|
#End Region
|
|
|
|
#Region "CARACTERISTICAS"
|
|
Protected Sub LbAgregarCA_Click(sender As Object, e As System.EventArgs) Handles LbAgregarCA.Click
|
|
|
|
If DdlTiposActivosFijosCA.SelectedValue.ToEntero < 0 And DdlSubTiposActivosFijosCA.SelectedValue.ToEntero < 0 Then
|
|
Alert("Debe seleccionar un ActivoFijo o un SubActivoFijo", TipoMensaje.MsgAdvertencia)
|
|
Exit Sub
|
|
End If
|
|
|
|
Dim ObjCaracteristicas As New ClsAF
|
|
If ObjCaracteristicas.AddCaracteristica(TxtCaracteristicaCA.Text.Trim, DdlClasificacionesCA.SelectedValue.ToEntero, DdlTiposActivosFijosCA.SelectedValue.ToEntero, DdlSubTiposActivosFijosCA.SelectedValue.ToEntero, DdlTipoCampoCA.SelectedValue.ToEntero, TxtLongitudCA.Text.Trim.ToEntero, DdlRequeridoCA.SelectedValue.ToEntero, TxtOrdenCA.Text.Trim.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
|
|
|
TxtCaracteristicaCA.Text = ""
|
|
TxtOrdenCA.Text = ""
|
|
TxtLongitudCA.Text = ""
|
|
Alert("La Nueva Característica de Activo Fijo se guardó correctamente.", TipoMensaje.MsgInformacion)
|
|
UpTitulosCA.Update()
|
|
ViewState("DTCatacteristica") = ObjCaracteristicas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
|
|
|
|
|
CargaSubTiposActivosFijos()
|
|
''CargaCaracteristicasClasificaciones()
|
|
'CargaCaracteristicas()
|
|
|
|
If ViewState("OrdenCA").ToString() <> String.Empty Then
|
|
CargaGrid(ViewState("OrdenCA").ToString(), 1)
|
|
Else
|
|
CargaGrid("", 1)
|
|
End If
|
|
End If
|
|
ObjCaracteristicas.Dispose()
|
|
End Sub
|
|
|
|
#Region " CARGA DATOS"
|
|
Public Sub CargaDatosCA()
|
|
If ViewState("OrdenCA").ToString() <> String.Empty Then
|
|
CargaGrid(ViewState("OrdenCA").ToString(), 1)
|
|
Else
|
|
CargaGrid("", 1)
|
|
End If
|
|
|
|
CargaClasificacionesCA()
|
|
End Sub
|
|
Private Sub CargaClasificacionesCA()
|
|
DdlClasificacionesCA.Items.Clear()
|
|
DdlClasificacionesCA.DataSource = GlobalDTAFCaracteristicasClasificaciones(UsuarioActual.CveEmpresa) '.FiltraParametros(String.Format("CveSubTipoActivoFijo = {0}", DdlSubTiposActivosFijosCA.SelectedValue.ToEntero))
|
|
DdlClasificacionesCA.DataBind()
|
|
UpdatePanel1.Update()
|
|
End Sub
|
|
Protected Sub DdlTiposActivosFijosCA_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTiposActivosFijosCA.SelectedIndexChanged
|
|
DdlSubTiposActivosFijosCA.Items.Clear()
|
|
DdlSubTiposActivosFijosCA.DataSource = GlobalDTSubTipoActivoFijo(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveTipoActivoFijo = {0} AND CveEmpresa = {1}", DdlTiposActivosFijosCA.SelectedValue.ToEntero, UsuarioActual.CveEmpresa))
|
|
DdlSubTiposActivosFijosCA.DataBind()
|
|
DdlSubTiposActivosFijosCA.Items.Insert(0, New ListItem("Todos", "-1"))
|
|
End Sub
|
|
Protected Sub DdlSubTiposActivosFijosCA_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlSubTiposActivosFijosCA.SelectedIndexChanged
|
|
'DdlClasificacionesCA.Items.Clear()
|
|
'DdlClasificacionesCA.DataSource = GlobalDTAFCaracteristicasClasificaciones '.FiltraParametros(String.Format("CveSubTipoActivoFijo = {0}", DdlSubTiposActivosFijosCA.SelectedValue.ToEntero))
|
|
'DdlClasificacionesCA.DataBind()
|
|
End Sub
|
|
#End Region
|
|
|
|
#Region "-- G V --"
|
|
Protected Sub GvDatosCA_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatosCA.RowDataBound
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
If e.Row.RowIndex = 0 Then
|
|
|
|
End If
|
|
e.Row.Cells(0).Width = Unit.Pixel(95) 'TipoActivoFijo
|
|
e.Row.Cells(1).Width = Unit.Pixel(100) 'SubTipoActivoFIjo
|
|
e.Row.Cells(2).Width = Unit.Pixel(110) 'Clasificacion
|
|
e.Row.Cells(3).Width = Unit.Pixel(120) 'Caracteristica
|
|
e.Row.Cells(4).Width = Unit.Pixel(70) 'Orden
|
|
e.Row.Cells(5).Width = Unit.Pixel(70) 'Longitud
|
|
e.Row.Cells(6).Width = Unit.Pixel(80) 'Tipo
|
|
e.Row.Cells(7).Width = Unit.Pixel(70) 'Requerido
|
|
e.Row.Cells(8).Width = Unit.Pixel(70) 'Estatus
|
|
e.Row.Cells(9).Width = Unit.Pixel(75) 'FechaIng
|
|
e.Row.Cells(10).Width = Unit.Pixel(75) 'Usuario
|
|
e.Row.Cells(11).Width = Unit.Pixel(55) '
|
|
e.Row.Cells(12).Width = Unit.Pixel(61) '
|
|
|
|
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
|
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
|
|
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Left
|
|
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Left
|
|
e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Left
|
|
|
|
'If e.Row.DBCampo("SubTipoActivoFijo").ToString = "" Then
|
|
' e.Row.FCLiteral("LtlSubTiposActivosFijosCA").Text = "Todos"
|
|
'End If
|
|
|
|
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
|
|
e.Row.FCDropDownList("DdlTiposActivosFijosCA").DataSource = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa)
|
|
e.Row.FCDropDownList("DdlTiposActivosFijosCA").DataBind()
|
|
e.Row.FCDropDownList("DdlTiposActivosFijosCA").SelectedValue = e.Row.DBCampo("CveTipoActivoFijo")
|
|
e.Row.FCDropDownList("DdlSubTiposActivosFijosCA").DataSource = GlobalDTSubTipoActivoFijo(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveTipoActivoFijo = {0} ", e.Row.FCDropDownList("DdlTiposActivosFijosCA").SelectedValue))
|
|
e.Row.FCDropDownList("DdlSubTiposActivosFijosCA").DataBind()
|
|
e.Row.FCDropDownList("DdlSubTiposActivosFijosCA").SelectedValue = e.Row.DBCampo("CveSubTipoActivoFijo")
|
|
e.Row.FCDropDownList("DdlSubTiposActivosFijosCA").Items.Insert(0, New ListItem("Todos", "-1"))
|
|
|
|
Dim ObjClasificacion As New ClsAF
|
|
If ObjClasificacion.GetCaracteristicasClasificaciones(UsuarioActual.CveEmpresa) Then
|
|
e.Row.FCDropDownList("DdlClasificacionesCA").DataSource = ObjClasificacion.DtResultados '.FiltraParametros("CveSubTipoActivoFijo = " & e.Row.FCDropDownList("DdlSubTiposActivosFijosCA").SelectedValue)
|
|
e.Row.FCDropDownList("DdlClasificacionesCA").DataBind()
|
|
e.Row.FCDropDownList("DdlClasificacionesCA").SelectedValue = e.Row.DBCampo("CveCaracteristicaClasificacion")
|
|
End If
|
|
|
|
e.Row.FCDropDownList("DdlTipoCampoCA").SelectedValue = e.Row.DBCampo("TipoCampo")
|
|
e.Row.FCDropDownList("DdlRequeridaCA").SelectedValue = If(e.Row.DBCampo("Requerida") = "True", "1", "0")
|
|
ObjClasificacion.Dispose()
|
|
End If
|
|
End If
|
|
End Sub
|
|
Protected Sub GvDatosCA_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatosCA.RowDeleting
|
|
Dim ObjCaracteristicas As New ClsAF
|
|
If ObjCaracteristicas.RemoveCaracteristica(GvDatosCA.DataKeys(e.RowIndex).Value.ToString.ToEntero, UsuarioActual.CveEmpresa) Then
|
|
GvDatosCA.EditIndex = -1
|
|
GlobalDTAFCaracteristicas(UsuarioActual.CveEmpresa) = Nothing
|
|
Alert("La Característica se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
|
End If
|
|
|
|
ObjCaracteristicas.Dispose()
|
|
|
|
If ViewState("OrdenCA").ToString() <> String.Empty Then
|
|
CargaGrid(ViewState("OrdenCA").ToString(), 1)
|
|
Else
|
|
CargaGrid("", 1)
|
|
End If
|
|
End Sub
|
|
Protected Sub GvDatosCA_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatosCA.RowCancelingEdit
|
|
GvDatosCA.EditIndex = -1
|
|
If ViewState("OrdenCA").ToString() <> String.Empty Then
|
|
CargaGrid(ViewState("OrdenCA").ToString(), 1)
|
|
Else
|
|
CargaGrid("", 1)
|
|
End If
|
|
End Sub
|
|
Protected Sub GvDatosCA_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatosCA.RowUpdating
|
|
|
|
Dim ObjCaracteristicas As New ClsAF
|
|
|
|
Dim CveTipoActivoFijo As Integer = GvDatosCA.Rows(e.RowIndex).FCDropDownList("DdlTiposActivosFijosCA").SelectedValue.ToEntero
|
|
Dim CveSubTipoActivoFijo As Integer = GvDatosCA.Rows(e.RowIndex).FCDropDownList("DdlSubTiposActivosFijosCA").SelectedValue.ToEntero
|
|
Dim CveCaracteristicaClasificacion As Integer = DirectCast(GvDatosCA.Rows(e.RowIndex).FindControl("DdlClasificacionesCA"), DropDownList).SelectedValue.ToEntero
|
|
Dim Caracteristica As String = DirectCast(GvDatosCA.Rows(e.RowIndex).FindControl("TxtCaracteristicaCA"), TextBox).Text.Trim
|
|
Dim TipoCampo As Integer = DirectCast(GvDatosCA.Rows(e.RowIndex).FindControl("DdlTipoCampoCA"), DropDownList).SelectedValue.ToEntero
|
|
Dim Longitud As Integer = DirectCast(GvDatosCA.Rows(e.RowIndex).FindControl("TxtLongitudCA"), TextBox).Text.Trim.ToEntero
|
|
Dim Requerida As Integer = DirectCast(GvDatosCA.Rows(e.RowIndex).FindControl("DdlRequeridaCA"), DropDownList).SelectedValue.ToEntero
|
|
Dim Orden As Integer = DirectCast(GvDatosCA.Rows(e.RowIndex).FindControl("TxtOrdenCA"), TextBox).Text.Trim.ToEntero
|
|
Dim Estatus As Boolean = GvDatosCA.Rows(e.RowIndex).FCCheckBox("ChkEstatusCA").Checked
|
|
Dim CveCaracteristica As Integer = GvDatosCA.DataKeys(e.RowIndex).Value.ToString.ToEntero
|
|
|
|
If ObjCaracteristicas.UpdateCaracteristica(CveCaracteristicaClasificacion, Caracteristica, CveTipoActivoFijo, CveSubTipoActivoFijo, TipoCampo, Longitud, CBool(Requerida), Orden, Estatus, UsuarioActual.CveEmpresa, CveCaracteristica) Then
|
|
GvDatosCA.EditIndex = -1
|
|
GlobalDTAFCaracteristicas(UsuarioActual.CveEmpresa) = Nothing
|
|
|
|
CargaSubTiposActivosFijos()
|
|
|
|
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
|
End If
|
|
|
|
ObjCaracteristicas.Dispose()
|
|
|
|
If ViewState("OrdenCA").ToString() <> String.Empty Then
|
|
CargaGrid(ViewState("OrdenCA").ToString(), 1)
|
|
Else
|
|
CargaGrid("", 1)
|
|
End If
|
|
|
|
End Sub
|
|
Protected Sub GvDatosCA_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatosCA.RowEditing
|
|
GvDatosCA.EditIndex = e.NewEditIndex
|
|
|
|
If ViewState("OrdenCA").ToString() <> String.Empty Then
|
|
CargaGrid(ViewState("OrdenCA").ToString(), 1)
|
|
Else
|
|
CargaGrid("", 1)
|
|
End If
|
|
End Sub
|
|
Protected Sub DdlTiposActivosFijosCA_SelectedIndexChanged1(sender As Object, e As EventArgs)
|
|
Dim ddl1 As DropDownList = CType(sender, DropDownList)
|
|
Dim gvr As GridViewRow = CType(ddl1.NamingContainer, GridViewRow)
|
|
Dim ddl As DropDownList = gvr.FCDropDownList("DdlSubTiposActivosFijosCA")
|
|
|
|
ddl.Items.Clear()
|
|
ddl.DataSource = GlobalDTSubTipoActivoFijo(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveTipoActivoFijo = {0} AND CveEmpresa = {1}", ddl1.SelectedValue.ToEntero, UsuarioActual.CveEmpresa))
|
|
ddl.DataBind()
|
|
ddl.Items.Insert(0, New ListItem("Todos", "-1"))
|
|
End Sub
|
|
#End Region
|
|
|
|
#End Region
|
|
|
|
#Region "OPCIONES"
|
|
Protected Sub LbAgregarOpciones_Click(sender As Object, e As System.EventArgs) Handles LbAgregarOpciones.Click
|
|
Dim ObjCaracteristicas As New ClsAF
|
|
If ObjCaracteristicas.AddCaracteristicasOpciones(TxtOpcion.Text, DdlCaracteristicaOpciones.SelectedValue.ToEntero, TxtOrdenOpciones.Text.Trim.ToEntero, UsuarioActual.CveUsuario) Then
|
|
|
|
''Limpia datos
|
|
TxtOpcion.Text = ""
|
|
TxtOrdenOpciones.Text = ""
|
|
Alert("La Nueva Opción de Activo Fijo se guardó correctamente.", TipoMensaje.MsgInformacion)
|
|
UpTitulosOpciones.Update()
|
|
End If
|
|
ObjCaracteristicas.Dispose()
|
|
|
|
CargaDatosGridOpciones()
|
|
'CargaSubTiposActivosFijosCA()
|
|
End Sub
|
|
|
|
#Region "CARGA DATOS"
|
|
Public Sub CargaDatosOpciones()
|
|
CargaDatosGridOpciones()
|
|
'CargaDdlClasificacionesOpiones()
|
|
End Sub
|
|
Private Sub CargaDatosGridOpciones()
|
|
Dim ObjCaracteristicas As New ClsAF
|
|
If ObjCaracteristicas.GetCaracteristicasOpciones(-1, UsuarioActual.CveEmpresa) Then
|
|
ViewState("DTCatacteristicaOpciones") = ObjCaracteristicas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
|
'GlobalDTAFCaracteristicas = ObjCaracteristicas.DtResultados
|
|
Else
|
|
Me.GvDatosOpciones.DataSource = Nothing
|
|
End If
|
|
|
|
ObjCaracteristicas.Dispose()
|
|
|
|
If ViewState("OrdenOpciones").ToString() <> String.Empty Then
|
|
CargaGrid(ViewState("OrdenOpciones").ToString(), 2)
|
|
Else
|
|
CargaGrid("", 2)
|
|
End If
|
|
End Sub
|
|
'Private Sub CargaDdlClasificacionesOpiones()
|
|
' DdlClasificacionesOpciones.DataSource = GlobalDTAFCaracteristicasClasificaciones
|
|
' DdlClasificacionesOpciones.DataBind()
|
|
' DdlClasificacionesOpciones.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
|
'End Sub
|
|
Protected Sub DdlTiposActivosFijosOpciones_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTiposActivosFijosOpciones.SelectedIndexChanged
|
|
DdlSubTiposActivosFijosOpciones.Items.Clear()
|
|
DdlSubTiposActivosFijosOpciones.DataSource = GlobalDTSubTipoActivoFijo(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveTipoActivoFijo = {0} AND CveEmpresa = {1}", DdlTiposActivosFijosOpciones.SelectedValue.ToEntero, UsuarioActual.CveEmpresa))
|
|
DdlSubTiposActivosFijosOpciones.DataBind()
|
|
DdlSubTiposActivosFijosOpciones.Items.Insert(0, New ListItem("Todos", "-1"))
|
|
|
|
FiltraCaracteristicas()
|
|
End Sub
|
|
Protected Sub DdlSubTiposActivosFijosOpciones_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlSubTiposActivosFijosOpciones.SelectedIndexChanged
|
|
'DdlClasificacionesOpciones.Items.Clear()
|
|
|
|
'Dim Filtro = If(DdlSubTiposActivosFijosOpciones.SelectedValue.ToEntero > 0, String.Format("CveSubTipoActivoFijo = {0}", DdlSubTiposActivosFijosOpciones.SelectedValue.ToEntero), String.Format("CveTipoActivoFijo = {0}", DdlTiposActivosFijosOpciones.SelectedValue.ToEntero))
|
|
|
|
'DdlClasificacionesOpciones.DataSource = GlobalDTAFCaracteristicasClasificaciones '.FiltraParametros(Filtro)
|
|
'DdlClasificacionesOpciones.DataBind()
|
|
'DdlClasificacionesOpciones.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
|
|
|
FiltraCaracteristicas()
|
|
End Sub
|
|
'Protected Sub DdlClasificacionesOpciones_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlClasificacionesOpciones.SelectedIndexChanged
|
|
' FiltraCaracteristicas()
|
|
'End Sub
|
|
Private Sub FiltraCaracteristicas()
|
|
DdlCaracteristicaOpciones.Items.Clear()
|
|
'Dim Filtro = String.Format("CveCaracteristicaClasificacion = {0} AND ", DdlClasificacionesOpciones.SelectedValue.ToEntero)
|
|
Dim Filtro = If(DdlSubTiposActivosFijosOpciones.SelectedValue.ToEntero > 0, String.Format("CveSubTipoActivoFijo = {0}", DdlSubTiposActivosFijosOpciones.SelectedValue.ToEntero), String.Format("CveTipoActivoFijo = {0}", DdlTiposActivosFijosOpciones.SelectedValue.ToEntero))
|
|
DdlCaracteristicaOpciones.DataSource = GlobalDTAFCaracteristicas(UsuarioActual.CveEmpresa).FiltraParametros(Filtro)
|
|
DdlCaracteristicaOpciones.DataBind()
|
|
DdlCaracteristicaOpciones.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
|
End Sub
|
|
'Private Sub CargaClasificacionesOpciones()
|
|
' Dim ObjCaracteristicaClasificacionCl As New ClsAF
|
|
' If ObjCaracteristicaClasificacionCl.GetSubTiposActivosFijos(UsuarioActual.CveEmpresa) Then
|
|
' DdlClasificacionesOpciones.DataSource = ObjCaracteristicaClasificacionCl.DtResultados.FiltraParametros("CveSubTipoActivoFijo = " & DdlSubTiposActivosFijosOpciones.SelectedItem.ToEntero)
|
|
' DdlClasificacionesOpciones.DataBind()
|
|
' End If
|
|
' ObjCaracteristicaClasificacionCl.Dispose()
|
|
'End Sub
|
|
'Private Sub CargaCaracteristicas()
|
|
' Dim ObjCaracteristicaClasificacionCl As New ClsAF
|
|
' If ObjCaracteristicaClasificacionCl.GetCaracteristicasOpciones(DdlCaracteristicaOpciones.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
|
' DdlClasificacionesOpciones.DataSource = ObjCaracteristicaClasificacionCl.DtResultados '.FiltraParametros("CveSubTipoActivoFijo = " & DdlSubTiposActivosFijosOpciones.SelectedItem.ToEntero)
|
|
' DdlClasificacionesOpciones.DataBind()
|
|
' End If
|
|
' ObjCaracteristicaClasificacionCl.Dispose()
|
|
'End Sub
|
|
#End Region
|
|
|
|
#Region "-- G V --"
|
|
Protected Sub GvDatosOpciones_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatosOpciones.RowDataBound
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
If e.Row.RowIndex = 0 Then
|
|
e.Row.Cells(0).Width = Unit.Pixel(170) 'TipoActivoFijo
|
|
e.Row.Cells(1).Width = Unit.Pixel(170) 'SubTipoActivoFIjo
|
|
'e.Row.Cells(2).Width = Unit.Pixel(100) 'Clasificacion
|
|
e.Row.Cells(2).Width = Unit.Pixel(170) 'Caracteristica
|
|
e.Row.Cells(3).Width = Unit.Pixel(97) 'Opcion
|
|
e.Row.Cells(4).Width = Unit.Pixel(80) 'Orden
|
|
'e.Row.Cells(4).Width = Unit.Pixel(50) 'Longitud
|
|
'e.Row.Cells(5).Width = Unit.Pixel(70) 'Tipo
|
|
'e.Row.Cells(6).Width = Unit.Pixel(50) 'Requerido
|
|
e.Row.Cells(5).Width = Unit.Pixel(80) 'Estatus
|
|
e.Row.Cells(6).Width = Unit.Pixel(81) 'FechaIng
|
|
e.Row.Cells(7).Width = Unit.Pixel(81) 'Usuario
|
|
e.Row.Cells(8).Width = Unit.Pixel(55) '
|
|
e.Row.Cells(9).Width = Unit.Pixel(61) '
|
|
End If
|
|
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
|
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
|
|
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Left
|
|
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Left
|
|
e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Left
|
|
|
|
'If e.Row.DBCampo("SubTipoActivoFijo").ToString = "" Then
|
|
' e.Row.FCLiteral("LtlSubTiposActivosFijosOpciones").Text = "Todos"
|
|
'End If
|
|
|
|
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
|
|
e.Row.FCDropDownList("DdlTiposActivosFijosOpciones").DataSource = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa)
|
|
e.Row.FCDropDownList("DdlTiposActivosFijosOpciones").DataBind()
|
|
e.Row.FCDropDownList("DdlTiposActivosFijosOpciones").SelectedValue = e.Row.DBCampo("CveTipoActivoFijo")
|
|
e.Row.FCDropDownList("DdlSubTiposActivosFijosOpciones").DataSource = GlobalDTSubTipoActivoFijo(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveTipoActivoFijo = {0} ", e.Row.FCDropDownList("DdlTiposActivosFijosOpciones").SelectedValue))
|
|
e.Row.FCDropDownList("DdlSubTiposActivosFijosOpciones").DataBind()
|
|
e.Row.FCDropDownList("DdlSubTiposActivosFijosOpciones").Items.Insert(0, New ListItem("Todos", "-1"))
|
|
e.Row.FCDropDownList("DdlSubTiposActivosFijosOpciones").SelectedValue = e.Row.DBCampo("CveSubTipoActivoFijo")
|
|
|
|
e.Row.FCDropDownList("DdlCaracteristicasOpciones").DataSource = GlobalDTAFCaracteristicas(UsuarioActual.CveEmpresa)
|
|
e.Row.FCDropDownList("DdlCaracteristicasOpciones").DataBind()
|
|
FiltraCaracteristicas1(e.Row.FCDropDownList("DdlTiposActivosFijosOpciones"), e.Row.FCDropDownList("DdlSubTiposActivosFijosOpciones"), e.Row.FCDropDownList("DdlCaracteristicasOpciones"))
|
|
e.Row.FCDropDownList("DdlCaracteristicasOpciones").SelectedValue = e.Row.DBCampo("CveCaracteristica")
|
|
'Dim ObjClasificacion As New ClsAF
|
|
|
|
|
|
'If ObjClasificacion.GetCaracteristicasOpciones(-1, UsuarioActual.CveEmpresa) Then
|
|
' e.Row.FCDropDownList("DdlCaracteristicasOpciones").DataSource = ObjClasificacion.DtResultados
|
|
' e.Row.FCDropDownList("DdlCaracteristicasOpciones").DataBind()
|
|
' e.Row.FCDropDownList("DdlCaracteristicasOpciones").SelectedValue = e.Row.DBCampo("CveCaracteristica")
|
|
'End If
|
|
'e.Row.FCDropDownList("DdlTipoCampoOpciones").SelectedValue = e.Row.DBCampo("TipoCampo")
|
|
'e.Row.FCDropDownList("DdlRequeridaOpciones").SelectedValue = If(e.Row.DBCampo("Requerida") = "True", "1", "0")
|
|
'ObjClasificacion.Dispose()
|
|
End If
|
|
End If
|
|
End Sub
|
|
Protected Sub GvDatosOpciones_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatosOpciones.RowDeleting
|
|
Dim ObjCaracteristicas As New ClsAF
|
|
|
|
If ObjCaracteristicas.RemoveCaracteristicasOpciones(GvDatosOpciones.Rows(e.RowIndex).DataKey("CveCaracteristicaOpcion").ToString.ToEntero, UsuarioActual.CveEmpresa) Then
|
|
GvDatosOpciones.EditIndex = -1
|
|
|
|
CargaDatosOpciones()
|
|
'ViewState("DTCatacteristicaOpciones") = ObjCaracteristicas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
|
|
|
|
|
'GlobalDTAFCaracteristicas = ObjCaracteristicas.DtResultados
|
|
Alert("La Opción se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
|
End If
|
|
|
|
ObjCaracteristicas.Dispose()
|
|
|
|
If ViewState("OrdenOpciones").ToString() <> String.Empty Then
|
|
CargaGrid(ViewState("OrdenOpciones").ToString(), 2)
|
|
Else
|
|
CargaGrid("", 2)
|
|
End If
|
|
End Sub
|
|
Protected Sub GvDatosOpciones_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatosOpciones.RowCancelingEdit
|
|
GvDatosOpciones.EditIndex = -1
|
|
If ViewState("OrdenOpciones").ToString() <> String.Empty Then
|
|
CargaGrid(ViewState("OrdenOpciones").ToString(), 2)
|
|
Else
|
|
CargaGrid("", 2)
|
|
End If
|
|
End Sub
|
|
Protected Sub GvDatosOpciones_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatosOpciones.RowUpdating
|
|
Dim ObjCaracteristicas As New ClsAF
|
|
|
|
Dim CaracteristicaOpcion = GvDatosOpciones.Rows(e.RowIndex).FCTextBox("TxtCaracteristicaOpciones").Text
|
|
Dim Orden = GvDatosOpciones.Rows(e.RowIndex).FCTextBox("TxtOrdenOpciones").Text.ToEntero
|
|
Dim Estatus As Boolean = GvDatosOpciones.Rows(e.RowIndex).FCCheckBox("ChkEstatusOpciones").Checked
|
|
Dim CveCaracteristicaOpcion = GvDatosOpciones.Rows(e.RowIndex).DataKey("CveCaracteristicaOpcion").ToString.ToEntero
|
|
Dim CveCaracteristica = GvDatosOpciones.Rows(e.RowIndex).FCDropDownList("DdlCaracteristicasOpciones").SelectedValue.ToEntero
|
|
|
|
If ObjCaracteristicas.UpdateCaracteristicasOpciones(CveCaracteristica, CaracteristicaOpcion, Orden, Estatus, CveCaracteristicaOpcion, UsuarioActual.CveEmpresa) Then
|
|
GvDatosOpciones.EditIndex = -1
|
|
ViewState("DTCatacteristicaOpciones") = ObjCaracteristicas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
|
|
|
CargaSubTiposActivosFijos()
|
|
|
|
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
|
End If
|
|
|
|
ObjCaracteristicas.Dispose()
|
|
|
|
If ViewState("OrdenOpciones").ToString() <> String.Empty Then
|
|
CargaGrid(ViewState("OrdenOpciones").ToString(), 2)
|
|
Else
|
|
CargaGrid("", 2)
|
|
End If
|
|
|
|
End Sub
|
|
Protected Sub GvDatosOpciones_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatosOpciones.RowEditing
|
|
GvDatosOpciones.EditIndex = e.NewEditIndex
|
|
|
|
If ViewState("OrdenOpciones").ToString() <> String.Empty Then
|
|
CargaGrid(ViewState("OrdenOpciones").ToString(), 2)
|
|
Else
|
|
CargaGrid("", 2)
|
|
End If
|
|
End Sub
|
|
|
|
Protected Sub DdlTiposActivosFijosOpciones_SelectedIndexChanged1(sender As Object, e As EventArgs)
|
|
Dim ddlT As DropDownList = CType(sender, DropDownList)
|
|
Dim gvr As GridViewRow = CType(ddlT.NamingContainer, GridViewRow)
|
|
Dim ddlST As DropDownList = gvr.FCDropDownList("DdlSubTiposActivosFijosOpciones")
|
|
Dim ddlC As DropDownList = gvr.FCDropDownList("DdlCaracteristicasOpciones")
|
|
|
|
ddlST.Items.Clear()
|
|
ddlST.DataSource = GlobalDTSubTipoActivoFijo(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveTipoActivoFijo = {0} AND CveEmpresa = {1}", ddlT.SelectedValue.ToEntero, UsuarioActual.CveEmpresa))
|
|
ddlST.DataBind()
|
|
ddlST.Items.Insert(0, New ListItem("Todos", "-1"))
|
|
|
|
FiltraCaracteristicas1(ddlT, ddlST, ddlC)
|
|
End Sub
|
|
Protected Sub DdlSubTiposActivosFijosOpciones_SelectedIndexChanged1(sender As Object, e As EventArgs)
|
|
Dim ddlST As DropDownList = CType(sender, DropDownList)
|
|
Dim gvr As GridViewRow = CType(ddlST.NamingContainer, GridViewRow)
|
|
Dim ddlT As DropDownList = gvr.FCDropDownList("DdlTiposActivosFijosOpciones")
|
|
Dim ddlC As DropDownList = gvr.FCDropDownList("DdlCaracteristicasOpciones")
|
|
|
|
FiltraCaracteristicas1(ddlT, ddlST, ddlC)
|
|
End Sub
|
|
Private Sub FiltraCaracteristicas1(ddlT As DropDownList, ddlST As DropDownList, ddlC As DropDownList)
|
|
ddlC.Items.Clear()
|
|
'Dim Filtro = String.Format("CveCaracteristicaClasificacion = {0} AND ", DdlClasificacionesOpciones.SelectedValue.ToEntero)
|
|
Dim Filtro = If(ddlST.SelectedValue.ToEntero > 0, String.Format("CveSubTipoActivoFijo = {0}", ddlST.SelectedValue.ToEntero), String.Format("CveTipoActivoFijo = {0}", ddlT.SelectedValue.ToEntero))
|
|
ddlC.DataSource = GlobalDTAFCaracteristicas(UsuarioActual.CveEmpresa).FiltraParametros(Filtro)
|
|
ddlC.DataBind()
|
|
ddlC.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
|
End Sub
|
|
#End Region
|
|
|
|
Public Function FncTipoCampo(TipoCampo As Integer) As String
|
|
Dim Retorno As String = ""
|
|
Select Case TipoCampo
|
|
Case 0 : Retorno = "Texto"
|
|
Case 1 : Retorno = "Listado"
|
|
Case 2 : Retorno = "Radio"
|
|
Case 3 : Retorno = "Fecha"
|
|
Case 4 : Retorno = "Multiline"
|
|
Case 5 : Retorno = "Checkbox"
|
|
Case 6 : Retorno = "Numerico"
|
|
Case 7 : Retorno = "1"
|
|
End Select
|
|
Return Retorno
|
|
End Function
|
|
#End Region
|
|
|
|
#Region "O R D E N A M I E N T O"
|
|
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
|
|
Dim Orden As String = ""
|
|
Dim Campo As String = ""
|
|
Dim gvi As Integer = 0
|
|
Dim Literal As Literal = Nothing
|
|
Const OrdenInicial As String = ""
|
|
Dim Arg(2) As String
|
|
|
|
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
|
|
Campo = Arg(0)
|
|
gvi = Arg(1).ToEntero
|
|
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
|
|
Campo = Campo.Substring(0, Campo.Length - 1)
|
|
If ViewState(String.Format("O{0}", Campo, gvi)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo, gvi)).ToString = String.Format("{0} DESC", Campo) Then
|
|
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
|
|
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
|
|
Else
|
|
ViewState(String.Format("O{0}", Campo, gvi)) = String.Format("{0} DESC", Campo)
|
|
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
|
|
End If
|
|
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo, gvi)).ToString
|
|
ViewState("Orden") = Orden
|
|
CargaGrid(Orden, gvi)
|
|
End Sub
|
|
|
|
Private Sub CargaGrid(Orden As String, gvi As Integer)
|
|
If gvi = 0 Then
|
|
If Orden <> String.Empty Then
|
|
GvDatosCL.DataSource = GlobalDTAFCaracteristicasClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros(Nothing, Orden)
|
|
Else
|
|
GvDatosCL.DataSource = GlobalDTAFCaracteristicasClasificaciones(UsuarioActual.CveEmpresa)
|
|
End If
|
|
GvDatosCL.DataBind()
|
|
UpDatosCL.Update()
|
|
ElseIf gvi = 1 Then
|
|
If Orden <> String.Empty Then
|
|
GvDatosCA.DataSource = GlobalDTAFCaracteristicas(UsuarioActual.CveEmpresa).FiltraParametros(Nothing, Orden)
|
|
Else
|
|
GvDatosCA.DataSource = GlobalDTAFCaracteristicas(UsuarioActual.CveEmpresa)
|
|
End If
|
|
GvDatosCA.DataBind()
|
|
UpDatosCA.Update()
|
|
ElseIf gvi = 2 Then
|
|
If Orden <> String.Empty Then
|
|
Dim DV As New DataView(CType(ViewState("DTCatacteristicaOpciones"), DataTable), "", Orden, DataViewRowState.CurrentRows)
|
|
GvDatosOpciones.DataSource = DV.ToTable()
|
|
DV.Dispose()
|
|
Else
|
|
GvDatosOpciones.DataSource = CType(ViewState("DTCatacteristicaOpciones"), DataTable)
|
|
End If
|
|
GvDatosOpciones.DataBind()
|
|
UpDatosOpciones.Update()
|
|
End If
|
|
End Sub
|
|
#End Region
|
|
End Class |