jj 30.11.2016
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
Module ModuleHelperMethods
|
||||
Imports DevExpress.XtraGrid
|
||||
Imports DevExpress.XtraGrid.Views.Grid
|
||||
|
||||
Module ModuleHelperMethods
|
||||
|
||||
Public Enum EnumFormatOptions
|
||||
[String] = 0
|
||||
@@ -252,7 +255,7 @@
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub OpenFormConstructor(id As Integer, Optional recordId As Integer = -1)
|
||||
@@ -370,7 +373,7 @@
|
||||
Catch ex As Exception
|
||||
MsgBox("Could not find Right manager: " & ex.Message, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
|
||||
|
||||
End Sub
|
||||
Public Sub OpenWindream_Files()
|
||||
Dim frm As New frmWD_Import_Doc_Record
|
||||
@@ -429,6 +432,69 @@
|
||||
Return Guid.NewGuid().ToString().GetHashCode().ToString("x")
|
||||
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)
|
||||
Try
|
||||
Dim ViewName As String = "VWTEMP_PMO_FORM" & FormId.ToString
|
||||
Dim EntitySQL As String
|
||||
|
||||
If GRID_TYPE = frmConstructor_Main.GridType.Grid Then
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> GridType = Grid", False)
|
||||
EntitySQL = "SELECT T.* FROM " & ViewName & " T"
|
||||
If IS_GEOData = True Then
|
||||
|
||||
EntitySQL &= " LEFT OUTER JOIN TBPMO_RECORD_GEODATA T1 ON T.[Record-ID] = T1.RECORD_ID"
|
||||
EntitySQL = EntitySQL.Replace("T.*", "T.*, T1.LATITUDE,T1.LONGITUDE,T1.LOCATION")
|
||||
End If
|
||||
Else 'Tiles und Carousel bekommen Quick View
|
||||
EntitySQL = QUICK_VIEW_SQL
|
||||
|
||||
If EntitySQL = String.Empty Then
|
||||
EntitySQL = "SELECT T.* FROM VWTEMP_PMO_FORM" & FormId.ToString & " T"
|
||||
If IS_SINGLE_RECORD = True Or FORM_TYPE = 5 Then
|
||||
|
||||
Else
|
||||
GRID_TYPE = frmConstructor_Main.GridType.Grid
|
||||
GridControlMain.MainView = grvwGrid
|
||||
VIEW_ID = 3
|
||||
End If
|
||||
' GridControlMain.MainView = grvwGrid
|
||||
Else
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Quick-View is configured", False)
|
||||
End If
|
||||
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
|
||||
ClassLogger.Add("Error in Get Entity SQL for User: " & vbNewLine & ex.Message, True)
|
||||
MsgBox("Error in Get Entity SQL for User: " & vbNewLine & ex.Message)
|
||||
End Try
|
||||
|
||||
Return EntitySQL
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Error in Get_Grid_Sql: " & vbNewLine & ex.Message, True)
|
||||
MsgBox("Error in Get_Grid_Sql: " & vbNewLine & ex.Message)
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Class SW
|
||||
Public label As String
|
||||
Public stopwatch As Stopwatch
|
||||
|
||||
Reference in New Issue
Block a user