Public Class ClassCommonQueries
    Public Function FNDD_CHECK_USER_MODULE(Username As String, Optional ClientId As Integer = 1) As String
        Return String.Format("SELECT * FROM [dbo].[FNDD_CHECK_USER_MODULE] ('{0}','ZF',{1})", Username, ClientId)
    End Function

    Public Function FNDD_MODULE_INIT(Username As String) As String
        Return String.Format("SELECT * FROM [dbo].[FNZF_GET_MODULE_INFO] ('{0}')", Username)
    End Function

    Public Function FNIDB_GET_SEARCH_PROFILES(UserId As Integer, UserLanguage As String) As String
        Return String.Format("SELECT * FROM [dbo].[FNIDB_GET_SEARCH_PROFILES] ({0},'{1}')", UserId, UserLanguage)
    End Function
    Public Function IDB_CATALOG() As String
        Return String.Format("SELECT * FROM TBIDB_CATALOG")
    End Function
    Public Function DOCRESULT_TODAY() As String
        Return $"SELECT * FROM VWIDB_DOCRESULT_{IIf(My.Application.User.Language = "de-DE", "DE", "EN")} WHERE CONVERT(DATE,[Added when]) = CONVERT(DATE,GetDate())"
    End Function
    Public Function DOCRESULT_DocID(DocID As Long) As String
        Return $"SELECT * FROM VWIDB_DOCRESULT_{IIf(My.Application.User.Language = "de-DE", "DE", "EN")} WHERE DocID = {DocID}"
    End Function
    Public Function DOCRESULT_TODAY_ME() As String
        Return $"SELECT * FROM VWIDB_DOCRESULT_{IIf(My.Application.User.Language = "de-DE", "DE", "EN")} WHERE CONVERT(DATE,[Added when]) = CONVERT(DATE,GetDate()) AND [Added who] = '{My.Application.User.UserName}'"
    End Function
End Class
