/
ivan
/
ModMas
Обзор
Документация
Войти
/
ivan
/
ModMas
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
ModuleMaster/handlers/capa_catalog.ashx
62 строки
2 KB
i.krivokon
Initial commit
13 мар 2026, 13:49
13 мар 2026, 13:49
00d9fb6
Код
Авторство
О чём код?
<%@ WebHandler Language="VB" Class="slideshow" %> Imports sharedClasses.dbFunctions Public Class slideshow : Implements IHttpHandler Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest Dim sqlf As New SqlFunctions Dim com As New Data.SqlClient.SqlCommand Dim tid = context.Request.QueryString("tid") Dim rowid = context.Request.QueryString("rowid") Dim field = context.Request.QueryString("field") Dim value As String = context.Request.QueryString("value") Dim secondary_field As String Dim secondary_value As String Dim result As Integer If Right(field, 2).Equals("TT") Or Right(field, 4).Equals("CAPA") Then If Right(field, 2).Equals("TT") Then secondary_field = Left(field, 4) + "CAPA" If value = "" Then secondary_value = "" Else secondary_value = Math.Round(28800 / Convert.ToDecimal(value)).ToString End If Else secondary_field = Left(field, 4) + "TT" If value = "" Then secondary_value = "" Else secondary_value = Math.Round(28800 / Convert.ToDecimal(value), 1).ToString End If End If result = sqlf.NonQuery("update [UserModules].[user].[PRODUCTION_TT] set " + field + " = '" + value + "', " + secondary_field + " = '" + secondary_value.ToString + "' where [group] = (select [group] from [UserModules].[user].[PRODUCTION_TT] where id = " + rowid + " and [group]<>'')") result = sqlf.NonQuery("update [UserModules].[user].[PRODUCTION_TT] set " + field + " = '" + value + "', " + secondary_field + " = '" + secondary_value.ToString + "' where id = " + rowid) End If context.Response.ContentType = "content/text" If result > 0 Then context.Response.Write("ok") Else context.Response.Write("ng") End If End Sub Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable Get Return False End Get End Property End Class