/
ivan
/
ModMas
Обзор
Документация
Войти
/
ivan
/
ModMas
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
ModuleMaster/handlers/slideshow.ashx
59 строк
2 KB
i.krivokon
Initial commit
13 мар 2026, 13:49
13 мар 2026, 13:49
00d9fb6
Код
Авторство
О чём код?
<%@ WebHandler Language="VB" Class="slideshow" %> Imports System.Web.Script.Serialization Imports sharedClasses.dbFunctions Imports System.Data Public Class slideshow : Implements IHttpHandler Private Class Answer Public refresh As String Public position As String Public Sub New(ByVal context As HttpContext) Dim sqlf As New SqlFunctions Dim dt As DataTable = Nothing Dim id = context.Request.QueryString("id") position = context.Request.QueryString("position") If position = "" Then 'Starting new slideshow dt = sqlf.GetData("SELECT * FROM UserModules.[user].slide_show_url WHERE enable='Y' and slide_show_id = " & id & " ORDER by cast(position as integer)") refresh = dt.Rows(0).Item(4).ToString position = dt.Rows(0).Item(10).ToString Else 'Resuming existing If IsNumeric(position) Then dt = sqlf.GetData("SELECT * FROM UserModules.[user].slide_show_url WHERE enable='Y' and slide_show_id = " & id & " AND cast(position as integer) > " & position & " ORDER by cast(position as integer)") If dt.Rows.Count > 0 Then 'Continue slideshow refresh = dt.Rows(0).Item(4).ToString position = dt.Rows(0).Item(10).ToString Else 'Start from the biginning dt = sqlf.GetData("SELECT * FROM UserModules.[user].slide_show_url WHERE enable='Y' and slide_show_id = " & id & " ORDER by cast(position as integer)") refresh = dt.Rows(0).Item(4).ToString position = dt.Rows(0).Item(10).ToString End If End If End If End Sub End Class Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest Dim json As Answer = New Answer(context) Dim serializer As New JavaScriptSerializer() Dim serializedResult = serializer.Serialize(json) context.Response.ContentType = "application/json" context.Response.Write(serializedResult) End Sub Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable Get Return False End Get End Property End Class