This commit is contained in:
2023-03-22 15:46:32 +01:00
parent 60c739833f
commit 9a9fe72b4f
13 changed files with 1818 additions and 396 deletions

View File

@@ -478,13 +478,13 @@ Module ModuleHelperMethods
End Function
Public Function Get_Grid_Sql(ConstructorId As Integer, FormId As Integer, ConstructorDetailID As Integer, ByRef GRID_TYPE As frmConstructor_Main.GridType, UserGuid As Integer, QUICK_VIEW_SQL As String,
IS_SINGLE_RECORD As Boolean, FORM_TYPE As Integer, ByRef VIEW_ID As Integer, ByRef GridControlMain As GridControl, ByRef grvwGrid As GridView, Optional ByRef IS_GEOData As Boolean = False)
IS_SINGLE_RECORD As Boolean, FORM_TYPE As Integer, ByRef VIEW_ID As Integer, ByRef GridControlMain As GridControl, ByRef grvwGrid As GridView, Optional ByRef IS_GEOData As Boolean = False, Optional ByRef NODEVAV As Boolean = False)
Try
Dim ViewName As String = "VWPMO_ENTITY_TABLE" & FormId.ToString
CURRENT_VIEWNAME = ViewName
Dim EntitySQL As String
If GRID_TYPE = frmConstructor_Main.GridType.Grid Then
If GRID_TYPE = frmConstructor_Main.GridType.Grid Or NODEVAV Then
LOGGER.Debug("GridType = Grid", False)
EntitySQL = "SELECT T.* FROM " & ViewName & " T"
If IS_GEOData = True Then
@@ -511,6 +511,44 @@ Module ModuleHelperMethods
End If
Try
Dim sql = String.Format("SELECT COUNT(*) FROM TBPMO_CONSTRUCTOR_USER_SQL WHERE USER_ID = {0} AND CONSTR_DET_ID = {1} AND SQL_COMMAND IS NOT NULL AND SQL_COMMAND <> ''", USER_GUID, ConstructorDetailID)
Dim exists = ClassDatabase.Execute_Scalar(sql)
If exists = 1 Then
sql = String.Format("SELECT SQL_COMMAND FROM TBPMO_CONSTRUCTOR_USER_SQL WHERE USER_ID = {0} AND CONSTR_DET_ID = {1}", USER_GUID, ConstructorDetailID)
Dim result = ClassDatabase.Execute_Scalar(sql)
If Not IsNothing(result) Then
' result = result.ToUpper.Replace("@RECORDID", RECORD_ID)
result = result.ToUpper.Replace("@USER_ID", UserGuid)
EntitySQL = EntitySQL & " " & result.ToString
CURRENT_ENTITYSQL_WHERE = result
Else
CURRENT_ENTITYSQL_WHERE = ""
End If
Else
CURRENT_ENTITYSQL_WHERE = ""
End If
Catch ex As Exception
LOGGER.Warn("Error in Get Entity SQL for User: " & vbNewLine & ex.Message)
MsgBox("Error in Get Entity SQL for User: " & vbNewLine & ex.Message)
End Try
Return EntitySQL
Catch ex As Exception
LOGGER.Warn("Error in Get_Grid_Sql: " & vbNewLine & ex.Message)
MsgBox("Error in Get_Grid_Sql: " & vbNewLine & ex.Message)
Return Nothing
End Try
End Function
Public Function Get_Grid_Sql_NODE_NAV(ConstructorId As Integer, FormId As Integer, ConstructorDetailID As Integer, UserGuid As Integer)
Try
Dim ViewName As String = "VWPMO_ENTITY_TABLE" & FormId.ToString
CURRENT_VIEWNAME = ViewName
Dim EntitySQL As String
EntitySQL = "SELECT T.* FROM " & ViewName & " T"
Try
Dim sql = String.Format("SELECT COUNT(*) FROM TBPMO_CONSTRUCTOR_USER_SQL WHERE USER_ID = {0} AND CONSTR_DET_ID = {1} AND SQL_COMMAND IS NOT NULL AND SQL_COMMAND <> ''", USER_GUID, ConstructorDetailID)
Dim exists = ClassDatabase.Execute_Scalar(sql)