/
ivan
/
ModMas
Обзор
Документация
Войти
/
ivan
/
ModMas
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
ModuleMaster/multibin/gettolist.ashx
93 строки
4 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 p_date As String = .QueryString("DATE") Dim p_mrp As String = .QueryString("MRP") Dim flag As String = .QueryString("flag") If IsNothing(p_mrp) Then p_mrp = "" End If If IsNothing(p_date) Then p_date = "" End If sql.AppendLine("declare @date varchar(10) ") sql.AppendLine("set @date = '" + p_date + "' ") sql.AppendLine("declare @mrp varchar(3) ") sql.AppendLine("set @mrp = '" + p_mrp + "' ") sql.AppendLine("select distinct * ") sql.AppendLine("from ") sql.AppendLine("( ") sql.AppendLine(" ") sql.AppendLine("select ") sql.AppendLine("[UserModules].[user].[to].[to] ") sql.AppendLine(",[UserModules].[user].[REPLENISHMENT].[MATERIAL] ") sql.AppendLine(",[UserModules].[user].[REPLENISHMENT].[SOURCE_BIN] ") sql.AppendLine(",[UserModules].[user].[REPLENISHMENT].[BIN_STOCK_ID] ") sql.AppendLine(",[UserModules].[user].[LTS].[MRP] ") sql.AppendLine(" ") sql.AppendLine("from [UserModules].[user].[to] ") sql.AppendLine(" ") sql.AppendLine("left join ") sql.AppendLine("[UserModules].[user].[REPLENISHMENT] ") sql.AppendLine("on [UserModules].[user].[to].[TO] = [UserModules].[user].[REPLENISHMENT].[TO] ") sql.AppendLine(" ") sql.AppendLine("left join [UserModules].[user].[lts] ") sql.AppendLine("on [UserModules].[user].[lts].LTS = [UserModules].[user].[REPLENISHMENT].LTS ") sql.AppendLine("and [UserModules].[user].[lts].material = [UserModules].[user].[REPLENISHMENT].material ") sql.AppendLine(" ") sql.AppendLine(" ") sql.AppendLine("where [UserModules].[user].[lts].[DELIVERY_DATE] like '%' + @date + '%' ") Select Case flag Case "0" sql.AppendLine("and [UserModules].[user].[to].[1_CONFIRM] = 'N' ") Case "1" sql.AppendLine("and [UserModules].[user].[to].[1_CONFIRM] = 'Y' ") sql.AppendLine("and [UserModules].[user].[to].[2_CONFIRM] = 'N' ") End Select sql.AppendLine("and [UserModules].[user].[REPLENISHMENT].[BIN_LOCK_FLAG] = 'Y'") sql.AppendLine("and [UserModules].[user].[to].[to] is not null and [UserModules].[user].[to].[to] <> '' ") sql.AppendLine("and [UserModules].[user].[lts].[MRP] like '%' + @mrp + '%' ") sql.AppendLine(" ") sql.AppendLine(") final ") 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