43 lines
1.4 KiB
VB.net
43 lines
1.4 KiB
VB.net
Option Explicit On
|
|
Option Strict On
|
|
|
|
Imports Extensiones
|
|
Imports System.Data
|
|
Imports Newtonsoft.Json
|
|
|
|
|
|
Partial Class Ashx_SIGWeb
|
|
Inherits System.Web.UI.Page
|
|
|
|
ReadOnly Property UsuarioActual() As Usuario
|
|
Get
|
|
UsuarioActual = DirectCast(Session("UsuarioSIG"), Usuario)
|
|
End Get
|
|
End Property
|
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
|
Dim retorno As String = ""
|
|
Dim DTPS = DirectCast(Application("GlobalDTProductosServicios"), DataTable)
|
|
If DTPS IsNot Nothing Then
|
|
|
|
Dim usuario As Usuario = UsuarioActual
|
|
Dim CveEmpresa As String
|
|
If IsNothing(usuario) Then
|
|
Context.Response.Write("")
|
|
Else
|
|
CveEmpresa = usuario.CveEmpresa.ToString
|
|
DTPS = DTPS.FiltraParametros(String.Format("CveEmpresa={0} AND PSCodigo LIKE '%{1}%'", CveEmpresa, Request("Name")), "PS", {"CvePS", "PS"})
|
|
If DTPS.Rows.Count > 0 Then
|
|
DTPS.Columns("CvePS").ColumnName = "id"
|
|
DTPS.Columns("PS").ColumnName = "text"
|
|
retorno = JsonConvert.SerializeObject(DTPS).ToString
|
|
Context.Response.Write(retorno)
|
|
Else
|
|
Context.Response.Write("[]")
|
|
End If
|
|
|
|
End If
|
|
End If
|
|
End Sub
|
|
|
|
End Class
|