/
ivan
/
ModMas
Обзор
Документация
Войти
/
ivan
/
ModMas
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
ModuleMaster/purchasing/mat_comparison_data_upload.aspx.vb
102 строки
3 KB
i.krivokon
Initial commit
13 мар 2026, 13:49
13 мар 2026, 13:49
00d9fb6
Код
Авторство
О чём код?
Imports System.Data Imports System.Data.SqlClient Imports BulkUpload Imports sharedClasses.dbFunctions Partial Class mat_comparison_data_upload Inherits System.Web.UI.Page Private savePath As String = Server.MapPath("") & "\UploadedFiles\" Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load Dim userid As String = "" If Not IsNothing(Request.QueryString("OrchUserLogin")) Then userid = Request.QueryString("OrchUserLogin") End If Dim tableId As String = "" If Not IsNothing(Request.QueryString("tableId")) Then tableId = Request.QueryString("tableId") End If edTableToView.IsReadOnly = True edTableToView.UserName = userid.ToUpper Dim sqlf As New SqlFunctions Try edTableToView.TableId = tableId Catch ex As Exception End Try Try If FileUpload1.HasFile Then CommonFunctions.SaveFile(FileUpload1, savePath) Dim bu As New BulkUpload.BulkUpload(savePath & "SOP_UPLOAD.TXT") 'FileUpload1.FileName) sqlf.NonQuery("TRUNCATE TABLE UserModules.[user].zrmmc31130") Dim loader As New SqlBulkCopy("Data Source=serkweb.serk.lan;Initial Catalog=UserModules;Persist Security Info=True;User ID=*******;Password=**************", SqlBulkCopyOptions.Default) Using loader loader.DestinationTableName = "[user].zrmmc31130" bu.Read() loader.WriteToServer(bu) End Using End If Catch ex As Exception End Try End Sub Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control) End Sub Protected Sub filterChanged() Handles edTableToView.GridFilterChanged End Sub Private Sub DataSelected(dt As DataTable) Handles edTableToView.DataSelected End Sub Protected Sub Page_PreRender(sender As Object, e As System.EventArgs) Handles Me.PreRender 'ClientScript.RegisterStartupScript(Me.GetType(), "CreateGridHeader", "<script>CreateGridHeader('DataDiv', 'editableGrid1_GridView1', 'HeaderDiv');</script>") If edTableToView.IsReadOnly Then edTableToView.CollectHeaderColumn(1) End If Title = edTableToView.TableDescription End Sub Protected Sub UpdateUserInfo(ByRef com As SqlCommand) Handles edTableToView.NewRecordSaving Try com.Parameters("@CHANGED_BY").Value = Request.QueryString("orchuserlogin") Catch ex As Exception End Try End Sub Protected Sub Page_SaveStateComplete(sender As Object, e As EventArgs) Handles Me.SaveStateComplete edTableToView.CreateGroupingText() End Sub Protected Sub edTableToView_PreRender(sender As Object, e As System.EventArgs) Handles edTableToView.PreRender End Sub Protected Sub DataUpload(sender As Object, e As EventArgs) Handles edTableToView.ActionRequest Dim CommandName As String = CType(e, CommandEventArgs).CommandName Dim CommandArgument As String = CType(e, CommandEventArgs).CommandArgument If CommandName = "DATA_UPLOAD" Then End If End Sub Private Sub UploadFile() End Sub End Class