/
ivan
/
ModMas
Обзор
Документация
Войти
/
ivan
/
ModMas
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
ModuleMaster/multibin/kitting_su.ashx
63 строки
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 line As String = .QueryString("Line") Dim su As String = .QueryString("su") Dim po As String = .QueryString("po") sql.AppendLine("select ") sql.AppendLine(" ") sql.AppendLine("l.[po] as PO ") sql.AppendLine(",s.Material ") sql.AppendLine(",s.qty as Available ") sql.AppendLine(",l.[qty] as Requested ") sql.AppendLine(",l.[qty] - m.gi as Remain ") sql.AppendLine(" ") sql.AppendLine("from [Multi-bin].[dbo].[Stock] s ") sql.AppendLine(" ") sql.AppendLine("left join [Multi-bin].[dbo].[LTS] l ") sql.AppendLine("on s.material = l.material ") sql.AppendLine(" ") sql.AppendLine("left join [Multi-bin].[dbo].[Monitoring] m ") sql.AppendLine("on l.po = m.PO ") sql.AppendLine("and l.material = m.Material ") sql.AppendLine(" ") sql.AppendLine("where s.su = '" & su & "' ") sql.AppendLine("and s.zone = 'Kitting' ") sql.AppendLine("and s.bin = '" & line & "' ") sql.AppendLine("and l.po = '" & po & "' ") Dim sqlf As New sharedClasses.dbFunctions.SqlFunctions Dim dt As Data.DataTable = Nothing dt = sqlf.GetData(sql.ToString) Try context.Response.Write(JsonConvert.SerializeObject(dt, Formatting.None)) Catch ex As Exception context.Response.Write("") End Try End With End Sub Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable Get Return False End Get End Property End Class