/
ivan
/
ModMas
Обзор
Документация
Войти
/
ivan
/
ModMas
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
ModuleMaster/pc/pallet_receive.ashx
56 строк
2 KB
i.krivokon
Initial commit
13 мар 2026, 13:49
13 мар 2026, 13:49
00d9fb6
Код
Авторство
О чём код?
<%@ WebHandler Language="VB" Class="getsqldata" %> 'Imports System 'Imports System.Web 'Imports Newtonsoft.Json Public Class getsqldata : Implements IHttpHandler Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest context.Response.ContentType = "text/plain" With context.Request Dim sql As New StringBuilder Dim pallet_no As String = .QueryString("pallet_no") Dim qty As String = .QueryString("qty") Dim result As Integer = 0 If qty <> "" Then sql.AppendLine("insert into [UserModules].[user].PALLET_STOCK") sql.AppendLine("(pallet_no, qty, [datetime]) ") sql.AppendLine("values ('" & pallet_no & "', '" & qty & "', getdate()) ") Dim sqlf As New sharedClasses.dbFunctions.SqlFunctions Dim dt As Data.DataTable = Nothing result = sqlf.NonQuery(sql.ToString) End If Try If result > 0 Then context.Response.Write("[{""msg"":""ok""}]") Else If qty = "" Then context.Response.Write("[{""msg"":""Qty can't be empty""}]") Else context.Response.Write("[{""msg"":""Error during saving to DB""}]") End If End If Catch ex As Exception context.Response.Write("[{""msg"":""Connection problem. Try-Catch triggered""}]") End Try End With End Sub Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable Get Return False End Get End Property End Class