/
ivan
/
ModMas
Обзор
Документация
Войти
/
ivan
/
ModMas
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
ModuleMaster/smd/ibitestreport.aspx.vb
176 строк
6 KB
i.krivokon
Initial commit
13 мар 2026, 13:49
13 мар 2026, 13:49
00d9fb6
Код
Авторство
О чём код?
Imports System.Data Imports System.Data.SqlClient Partial Class Xml_viewTable Inherits System.Web.UI.Page Private sqlf As New sharedClasses.dbFunctions.SqlFunctions Private a As sharedClasses.Auth.auth Private Sub authorize(mode As String) a = New sharedClasses.Auth.auth(mode, IIf(Request.UserHostAddress = "::1", "106.109.72.69", Request.UserHostAddress)) End Sub Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load UpdateData() Dim userid As String = "" If Not IsNothing(Request.QueryString("OrchUserLogin")) Then userid = Request.QueryString("OrchUserLogin") End If If Not IsNothing(Request.QueryString("u")) Then userid = Request.QueryString("u") End If If userid = "" Then authorize("SSO") userid = a.userId edTableToView.Message = "By SSO: " & a.userId End If Dim tableId As String = "" If Not IsNothing(Request.QueryString("tableId")) Then tableId = Request.QueryString("tableId") End If If Not IsNothing(Request.QueryString("t")) Then tableId = Request.QueryString("t") End If edTableToView.IsReadOnly = True edTableToView.UserName = userid.ToUpper End Sub Private Sub UpdateData() Dim sqlf As New sharedClasses.dbFunctions.SqlFunctions Dim sql As New StringBuilder sql.AppendLine("MERGE UserModules.[user].[IBI_TEST_REPORT] as TARGET ") sql.AppendLine(" USING UserModules.[user].VI_IBI_TEST_RESULTS as SOURCE ") sql.AppendLine(" ON TARGET.O2_ID = source.id ") sql.AppendLine(" WHEN MATCHED THEN ") sql.AppendLine(" UPDATE SET END_DATE = source.end_Date, ") sql.AppendLine(" end_TIME = source.end_time, ") sql.AppendLine(" RF = source.rf, ") sql.AppendLine(" sound = source.sound, ") sql.AppendLine(" hdmi= source.hdmi, ") sql.AppendLine(" comp= source.comp, ") sql.AppendLine(" scart = source.scart, ") sql.AppendLine(" usb= source.usb, ") sql.AppendLine(" lan= source.lan, ") sql.AppendLine(" ci_card= source.ci, ") sql.AppendLine(" headphone= source.headphone, ") sql.AppendLine(" vibro_test= source.vibro, ") sql.AppendLine(" total_defect= source.result, ") sql.AppendLine(" remark= source.remark ") sql.AppendLine(" WHEN NOT MATCHED THEN ") sql.AppendLine(" INSERT ([O2_ID] ") sql.AppendLine(" ,[MODEL] ") sql.AppendLine(" ,[PBA_CODE] ") sql.AppendLine(" ,[LOT_SIZE] ") sql.AppendLine(" ,[SHIFT] ") sql.AppendLine(" ,[START_DATE] ") sql.AppendLine(" ,[START_TIME] ") sql.AppendLine(" ,[END_DATE] ") sql.AppendLine(" ,[END_TIME] ") sql.AppendLine(" ,[LINE] ") sql.AppendLine(" ,[RF] ") sql.AppendLine(" ,[SOUND] ") sql.AppendLine(" ,[HDMI] ") sql.AppendLine(" ,[COMP] ") sql.AppendLine(" ,[SCART] ") sql.AppendLine(" ,[USB] ") sql.AppendLine(" ,[LAN] ") sql.AppendLine(" ,[CI_CARD] ") sql.AppendLine(" ,[HEADPHONE] ") sql.AppendLine(" ,[VIBRO_TEST] ") sql.AppendLine(" ,[RESPONSIBLE] ") sql.AppendLine(" ,[IMAGE] ") sql.AppendLine(" ,[TOTAL_DEFECT] ") sql.AppendLine(" ,[BAR_CODE] ") sql.AppendLine(" ,[REMARK]) ") sql.AppendLine(" VALUES ([ID] ") sql.AppendLine(" ,[MODEL] ") sql.AppendLine(" ,[PBA_CODE] ") sql.AppendLine(" ,[LOT_SIZE] ") sql.AppendLine(" ,[SHIFT] ") sql.AppendLine(" ,[START_DATE] ") sql.AppendLine(" ,[START_TIME] ") sql.AppendLine(" ,[END_DATE] ") sql.AppendLine(" ,[END_TIME] ") sql.AppendLine(" ,[LINE] ") sql.AppendLine(" ,[RF] ") sql.AppendLine(" ,[SOUND] ") sql.AppendLine(" ,[HDMI] ") sql.AppendLine(" ,[COMP] ") sql.AppendLine(" ,[SCART] ") sql.AppendLine(" ,[USB] ") sql.AppendLine(" ,[LAN] ") sql.AppendLine(" ,[CI] ") sql.AppendLine(" ,[HEADPHONE] ") sql.AppendLine(" ,[VIBRO] ") sql.AppendLine(" ,[RESPONSE] ") sql.AppendLine(" ,[IMAGE] ") sql.AppendLine(" ,[RESULT] ") sql.AppendLine(" ,[LABEL] ") sql.AppendLine(" ,[REMARK]) ") sql.AppendLine(" ; ") sqlf.NonQuery(sql.ToString) sql.Clear() sql.AppendLine(" MERGE UserModules.[user].IBI_TEST_REPORT T1 ") sql.AppendLine(" USING GMESData.[dbo].[TB_TBS_PM_PROC_PRGS] T2 ") sql.AppendLine(" ON T1.BAR_CODE collate Cyrillic_General_CI_AI ") sql.AppendLine(" = T2.PRODC_MAGT_NO collate Cyrillic_General_CI_AI ") sql.AppendLine(" AND (T1.PO is null or T1.PO = '') ") sql.AppendLine(" and T1.start_date >= '2015-01-01' ") sql.AppendLine(" WHEN MATCHED THEN ") sql.AppendLine(" UPDATE SET PO = T2.PO_NO ; ") sqlf.NonQuery(sql.ToString) 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 Page_Unload(sender As Object, e As EventArgs) Handles Me.Unload End Sub End Class