/
ivan
/
ModMas
Обзор
Документация
Войти
/
ivan
/
ModMas
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
ModuleMaster/fi/v.aspx.vb
113 строк
4 KB
i.krivokon
Initial commit
13 мар 2026, 13:49
13 мар 2026, 13:49
00d9fb6
Код
Авторство
О чём код?
Imports System.Data Imports System.Data.SqlClient Imports System.Net Imports System.IO 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 Dim tableId As String = "" 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 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 edTableToView.Message = "-" End If 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 If IsNumeric(tableId) Then edTableToView.TableId = tableId End If edTableToView.SubReport.Controls.Add(createSubreport(tableId)) End Sub Protected Sub Page_PreRender(sender As Object, e As System.EventArgs) Handles Me.PreRender graphForTable.SelectCondition = edTableToView.SelectConditionByFilters graphForTable.Visible = graphForTable.DrawGraph() If (Request.QueryString("tableId") IsNot Nothing) And graphForTable.Visible Then lnkGraphView.Visible = True lnkGraphView.Text = "View graph in a new window" lnkGraphView.NavigateUrl = "~/viewgraph.aspx?tableid=" & Request.QueryString("tableId") Else lnkGraphView.Visible = False End If If edTableToView.IsReadOnly Then edTableToView.CollectHeaderColumn(1) End If Title = edTableToView.TableDescription End Sub Private Function createSubreport(tid As String) As GridView Dim gv As New GridView Dim sqlf As New sharedClasses.dbFunctions.SqlFunctions Dim query As String = sqlf.GetScalar("SELECT isnull(SUBREPORT_QUERY,'') from usermodules.dbo.moduletables where id = " & tid) If query <> "" And Not (query.Contains("update") Or query.Contains("delete") Or query.Contains("exec") Or query.Contains("truncate") Or query.Contains("drop")) Then gv.DataSource = sqlf.GetData(query) Try gv.DataBind() Catch ex As Exception Return Nothing End Try End If Return gv End Function 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 GetGraphData(ByRef graphData As String) Handles edTableToView.RequestForGraphData graphData = graphForTable.GetHTMLGraph End Sub Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control) End Sub End Class