jj: fix unique constraint for TBPM_FILES_USER_NOT_INDEXED

This commit is contained in:
Jonathan Jenne
2018-06-05 13:20:04 +02:00
parent c596fcdc6e
commit 5797341a73
4 changed files with 108 additions and 43 deletions

View File

@@ -16963,7 +16963,7 @@ Namespace DD_DMSLiteDataSetTableAdapters
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")> _
Private Sub InitCommandCollection()
Me._commandCollection = New Global.System.Data.SqlClient.SqlCommand(2) {}
Me._commandCollection = New Global.System.Data.SqlClient.SqlCommand(3) {}
Me._commandCollection(0) = New Global.System.Data.SqlClient.SqlCommand()
Me._commandCollection(0).Connection = Me.Connection
Me._commandCollection(0).CommandText = "SELECT USR_NAME, PROFIL_ID, FILE_PATH FROM TBPM_FILES_USER_NOT_INDEXED"
@@ -16981,6 +16981,15 @@ Namespace DD_DMSLiteDataSetTableAdapters
Me._commandCollection(2).Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@User", Global.System.Data.SqlDbType.VarChar, 50, Global.System.Data.ParameterDirection.Input, 0, 0, "USR_NAME", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._commandCollection(2).Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@PROFIL_ID", Global.System.Data.SqlDbType.Int, 4, Global.System.Data.ParameterDirection.Input, 0, 0, "PROFIL_ID", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._commandCollection(2).Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@FILE_PATH", Global.System.Data.SqlDbType.VarChar, 500, Global.System.Data.ParameterDirection.Input, 0, 0, "FILE_PATH", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._commandCollection(3) = New Global.System.Data.SqlClient.SqlCommand()
Me._commandCollection(3).Connection = Me.Connection
Me._commandCollection(3).CommandText = "SELECT COUNT(*) AS Expr1"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"FROM TBPM_FILES_USER_NOT_INDEXED"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"WHE"& _
"RE (USR_NAME = @USERNAME) AND (PROFIL_ID = @PROFIL_ID) AND (FILE_PATH = @"& _
"FILE_PATH)"
Me._commandCollection(3).CommandType = Global.System.Data.CommandType.Text
Me._commandCollection(3).Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@USERNAME", Global.System.Data.SqlDbType.VarChar, 50, Global.System.Data.ParameterDirection.Input, 0, 0, "USR_NAME", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._commandCollection(3).Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@PROFIL_ID", Global.System.Data.SqlDbType.Int, 4, Global.System.Data.ParameterDirection.Input, 0, 0, "PROFIL_ID", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._commandCollection(3).Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@FILE_PATH", Global.System.Data.SqlDbType.VarChar, 500, Global.System.Data.ParameterDirection.Input, 0, 0, "FILE_PATH", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
End Sub
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
@@ -17132,6 +17141,47 @@ Namespace DD_DMSLiteDataSetTableAdapters
End Try
Return returnValue
End Function
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0"), _
Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _
Public Overloads Overridable Function FileExists(ByVal USERNAME As String, ByVal PROFIL_ID As Global.System.Nullable(Of Integer), ByVal FILE_PATH As String) As Global.System.Nullable(Of Integer)
Dim command As Global.System.Data.SqlClient.SqlCommand = Me.CommandCollection(3)
If (USERNAME Is Nothing) Then
command.Parameters(0).Value = Global.System.DBNull.Value
Else
command.Parameters(0).Value = CType(USERNAME,String)
End If
If (PROFIL_ID.HasValue = true) Then
command.Parameters(1).Value = CType(PROFIL_ID.Value,Integer)
Else
command.Parameters(1).Value = Global.System.DBNull.Value
End If
If (FILE_PATH Is Nothing) Then
command.Parameters(2).Value = Global.System.DBNull.Value
Else
command.Parameters(2).Value = CType(FILE_PATH,String)
End If
Dim previousConnectionState As Global.System.Data.ConnectionState = command.Connection.State
If ((command.Connection.State And Global.System.Data.ConnectionState.Open) _
<> Global.System.Data.ConnectionState.Open) Then
command.Connection.Open
End If
Dim returnValue As Object
Try
returnValue = command.ExecuteScalar
Finally
If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then
command.Connection.Close
End If
End Try
If ((returnValue Is Nothing) _
OrElse (returnValue.GetType Is GetType(Global.System.DBNull))) Then
Return New Global.System.Nullable(Of Integer)()
Else
Return New Global.System.Nullable(Of Integer)(CType(returnValue,Integer))
End If
End Function
End Class
'''<summary>