/
ivan
/
ModMas
Обзор
Документация
Войти
/
ivan
/
ModMas
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
ModuleMaster/handlers/multibin_upload.ashx
77 строк
2 KB
i.krivokon
Initial commit
13 мар 2026, 13:49
13 мар 2026, 13:49
00d9fb6
Код
Авторство
О чём код?
<%@ WebHandler Language="VB" Class="multibin_dataupload" %> Imports System Imports System.Web Imports System.IO Imports System.Data Imports System.Data.SqlClient Imports edGridNamespace Public Class multibin_dataupload : Implements IHttpHandler Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable Get Return False End Get End Property Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest Dim sr As New StreamReader(context.Request.InputStream) Dim tableName As String = sr.ReadLine Dim clearData As String = sr.ReadLine Dim data As String = sr.ReadToEnd Dim tl, upl As Integer Dim sql As New StringBuilder Dim sqlf As New sharedClasses.dbFunctions.SqlFunctions Dim result As Integer Dim lines() As String = data.Split(Chr(10)) For Each line As String In lines If line.Length > 10 Then Dim vals() As String = line.Split(vbTab) sql.AppendLine("insert into [Multi-bin].[dbo].[LTS] ") sql.AppendLine("(LTS, material, [description], qty, MRP, delivery_date, po, line, plant) ") sql.AppendLine("values ") sql.AppendLine("(") For Each value As String In vals sql.AppendLine("'" & value.Trim() & "',") Next sql = sql.Remove(sql.Length - 3, 1) sql.AppendLine(")") Result = sqlf.NonQuery(sql.ToString) End If Next Dim debug As Integer = 10 context.Response.ContentType = "text/plain" If data <> "" Then Try 'Call UploadDataToTable(data, tl, upl, clearData = "Y", "Multi-bin", "LTS") Catch ex As Exception context.Response.Write(ex.Message) End Try End If context.Response.Write(tl & "/" & upl) End Sub End Class