Files
SIG/MQ/CatTipoOrdenTrabajo.aspx.vb
2024-02-13 23:48:14 -07:00

74 lines
1.8 KiB
VB.net

Option Strict On
Imports System.Data
Imports System.Linq
Imports Extensiones
Partial Class AF_CatTipoOrdenTrabajo
Inherits ClsPaginas
Protected Property CveOperador As Integer
Get
If ViewState("CveOperador") Is Nothing Then
Return -1
Else
Return ViewState("CveOperador").ToString.ToEntero
End If
End Get
Set(value As Integer)
ViewState("CveOperador") = 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()
Dim ObjAF As New ClsAF
If ObjAF.GetTiposServicios(-1, -1, -1, UsuarioActual.CveEmpresa) Then
GvDatos.DataSource = ObjAF.DtResultados
Else
GvDatos.DataSource = Nothing
End If
ObjAF.Dispose()
GvDatos.DataBind()
UpDatos.Update()
End Sub
'Protected Sub LnkGvActualizar_Click(sender As Object, e As EventArgs)
' Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
' Dim CveTipoServicio = GvRow.DataKey("CveTipoServicio").ToEntero
' Response.Redirect($"./TipoOrdenTrabajo.aspx?CveTipoServicio={CveTipoServicio}", True)
'End Sub
Private Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.Cells(2).Text = $"<a target='_blank' href='TipoOrdenTrabajo.aspx?CveTipoServicio={e.Row.DataKey("CveTipoServicio").ToString}' class='btn btn-circle btn-sm green' ><i class='fa fa-pencil'></i></a>"
End If
End Sub
End Class