Initial commit
This commit is contained in:
32
BMS/DataAccess/AssemblyInfo.vb
Normal file
32
BMS/DataAccess/AssemblyInfo.vb
Normal file
@@ -0,0 +1,32 @@
|
||||
Imports System
|
||||
Imports System.Reflection
|
||||
Imports System.Runtime.InteropServices
|
||||
|
||||
' General Information about an assembly is controlled through the following
|
||||
' set of attributes. Change these attribute values to modify the information
|
||||
' associated with an assembly.
|
||||
|
||||
' Review the values of the assembly attributes
|
||||
|
||||
<Assembly: AssemblyTitle("")>
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("")>
|
||||
<Assembly: AssemblyProduct("")>
|
||||
<Assembly: AssemblyCopyright("")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
<Assembly: CLSCompliant(True)>
|
||||
|
||||
'The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
<Assembly: Guid("C2AC1549-B8D2-4A10-A0C5-AE32C85F9A5E")>
|
||||
|
||||
' Version information for an assembly consists of the following four values:
|
||||
'
|
||||
' Major Version
|
||||
' Minor Version
|
||||
' Build Number
|
||||
' Revision
|
||||
'
|
||||
' You can specify all the values or you can default the Build and Revision Numbers
|
||||
' by using the '*' as shown below:
|
||||
|
||||
<Assembly: AssemblyVersion("2.0.*")>
|
||||
7
BMS/DataAccess/DataAccess.vbdoc
Normal file
7
BMS/DataAccess/DataAccess.vbdoc
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<appSettings>
|
||||
<!-- VBdocman .NET config file for current project.-->
|
||||
<!-- Example: <add key="settingName" value="settingValue"/> -->
|
||||
</appSettings>
|
||||
</configuration>
|
||||
118
BMS/DataAccess/DataAccess.vbproj
Normal file
118
BMS/DataAccess/DataAccess.vbproj
Normal file
@@ -0,0 +1,118 @@
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectType>Local</ProjectType>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{21B54F51-D2B2-459E-895C-540AD4A8704F}</ProjectGuid>
|
||||
<SccProjectName>SAK</SccProjectName>
|
||||
<SccLocalPath>SAK</SccLocalPath>
|
||||
<SccAuxPath>SAK</SccAuxPath>
|
||||
<SccProvider>SAK</SccProvider>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ApplicationIcon>
|
||||
</ApplicationIcon>
|
||||
<AssemblyKeyContainerName>
|
||||
</AssemblyKeyContainerName>
|
||||
<AssemblyName>DataAccess</AssemblyName>
|
||||
<AssemblyOriginatorKeyFile>
|
||||
</AssemblyOriginatorKeyFile>
|
||||
<AssemblyOriginatorKeyMode>None</AssemblyOriginatorKeyMode>
|
||||
<DefaultClientScript>JScript</DefaultClientScript>
|
||||
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
|
||||
<DefaultTargetSchema>IE50</DefaultTargetSchema>
|
||||
<DelaySign>false</DelaySign>
|
||||
<OutputType>Library</OutputType>
|
||||
<OptionCompare>Binary</OptionCompare>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
<OptionStrict>Off</OptionStrict>
|
||||
<RootNamespace>DataAccess</RootNamespace>
|
||||
<StartupObject>
|
||||
</StartupObject>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<MyType>Windows</MyType>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DocumentationFile>DataAccess.xml</DocumentationFile>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>
|
||||
</DefineConstants>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<Optimize>false</Optimize>
|
||||
<RegisterForComInterop>false</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>false</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<WarningLevel>1</WarningLevel>
|
||||
<NoWarn>42016,42017,42018,42019,42032</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DocumentationFile>DataAccess.xml</DocumentationFile>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>
|
||||
</DefineConstants>
|
||||
<DefineDebug>false</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<DebugSymbols>false</DebugSymbols>
|
||||
<Optimize>true</Optimize>
|
||||
<RegisterForComInterop>false</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>false</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<WarningLevel>1</WarningLevel>
|
||||
<NoWarn>42016,42017,42018,42019,42032</NoWarn>
|
||||
<DebugType>none</DebugType>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System">
|
||||
<Name>System</Name>
|
||||
</Reference>
|
||||
<Reference Include="System.Data">
|
||||
<Name>System.Data</Name>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml">
|
||||
<Name>System.XML</Name>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Import Include="Microsoft.VisualBasic" />
|
||||
<Import Include="System" />
|
||||
<Import Include="System.Collections" />
|
||||
<Import Include="System.Data" />
|
||||
<Import Include="System.Diagnostics" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AssemblyInfo.vb">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Job.vb">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Common\Common.vbproj">
|
||||
<Project>{A1E2756A-4E32-40BB-B449-9BDA1C15DE84}</Project>
|
||||
<Name>Common</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="My Project\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.VisualBasic.targets" />
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>
|
||||
</PreBuildEvent>
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
58
BMS/DataAccess/DataAccess.vbproj.user
Normal file
58
BMS/DataAccess/DataAccess.vbproj.user
Normal file
@@ -0,0 +1,58 @@
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<LastOpenVersion>7.10.3077</LastOpenVersion>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ReferencePath>
|
||||
</ReferencePath>
|
||||
<CopyProjectDestinationFolder>
|
||||
</CopyProjectDestinationFolder>
|
||||
<CopyProjectUncPath>
|
||||
</CopyProjectUncPath>
|
||||
<CopyProjectOption>0</CopyProjectOption>
|
||||
<ProjectView>ProjectFiles</ProjectView>
|
||||
<ProjectTrust>0</ProjectTrust>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<EnableASPDebugging>false</EnableASPDebugging>
|
||||
<EnableASPXDebugging>false</EnableASPXDebugging>
|
||||
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
|
||||
<EnableSQLServerDebugging>false</EnableSQLServerDebugging>
|
||||
<RemoteDebugEnabled>false</RemoteDebugEnabled>
|
||||
<RemoteDebugMachine>
|
||||
</RemoteDebugMachine>
|
||||
<StartAction>Project</StartAction>
|
||||
<StartArguments>
|
||||
</StartArguments>
|
||||
<StartPage>
|
||||
</StartPage>
|
||||
<StartProgram>
|
||||
</StartProgram>
|
||||
<StartURL>
|
||||
</StartURL>
|
||||
<StartWorkingDirectory>
|
||||
</StartWorkingDirectory>
|
||||
<StartWithIE>true</StartWithIE>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<EnableASPDebugging>false</EnableASPDebugging>
|
||||
<EnableASPXDebugging>false</EnableASPXDebugging>
|
||||
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
|
||||
<EnableSQLServerDebugging>false</EnableSQLServerDebugging>
|
||||
<RemoteDebugEnabled>false</RemoteDebugEnabled>
|
||||
<RemoteDebugMachine>
|
||||
</RemoteDebugMachine>
|
||||
<StartAction>Project</StartAction>
|
||||
<StartArguments>
|
||||
</StartArguments>
|
||||
<StartPage>
|
||||
</StartPage>
|
||||
<StartProgram>
|
||||
</StartProgram>
|
||||
<StartURL>
|
||||
</StartURL>
|
||||
<StartWorkingDirectory>
|
||||
</StartWorkingDirectory>
|
||||
<StartWithIE>true</StartWithIE>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
10
BMS/DataAccess/DataAccess.vbproj.vspscc
Normal file
10
BMS/DataAccess/DataAccess.vbproj.vspscc
Normal file
@@ -0,0 +1,10 @@
|
||||
""
|
||||
{
|
||||
"FILE_VERSION" = "9237"
|
||||
"ENLISTMENT_CHOICE" = "NEVER"
|
||||
"PROJECT_FILE_RELATIVE_PATH" = ""
|
||||
"NUMBER_OF_EXCLUDED_FILES" = "0"
|
||||
"ORIGINAL_PROJECT_FILE_PATH" = ""
|
||||
"NUMBER_OF_NESTED_PROJECTS" = "0"
|
||||
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
|
||||
}
|
||||
367
BMS/DataAccess/Job.vb
Normal file
367
BMS/DataAccess/Job.vb
Normal file
@@ -0,0 +1,367 @@
|
||||
|
||||
#Region "Includes"
|
||||
|
||||
Imports System.Data.SqlClient
|
||||
Imports Common.Common
|
||||
|
||||
#End Region
|
||||
|
||||
Public Class Job
|
||||
|
||||
Public Shared Sub SendNotification(ByVal common As Common.Common, ByVal programmId As Integer, ByVal ds As DataSet, ByVal errorMessage As String, ByVal jobId As Integer, ByVal jobType As JobType)
|
||||
Try
|
||||
'get all notifications to a programm
|
||||
Dim subject As String, message As String = "", receiver As String
|
||||
Dim dr As DataRow
|
||||
|
||||
If ds.Tables.Count > 0 Then
|
||||
For Each dr In ds.Tables(0).Rows
|
||||
subject = dr("Titel").ToString().Replace("##PROG_NAME##", dr("ProgrammName"))
|
||||
message = dr("Meldung").ToString()
|
||||
|
||||
If (dr("IsMitFehlerText")) Then
|
||||
message += Environment.NewLine & Environment.NewLine & "Fehlermeldung:" & Environment.NewLine & errorMessage
|
||||
End If
|
||||
message = message.Replace("##PROG_NAME##", dr("ProgrammName"))
|
||||
message += Environment.NewLine & Environment.NewLine
|
||||
receiver = dr("eMail")
|
||||
|
||||
Select Case CInt(dr("BenachrichtigungTypId"))
|
||||
Case NotificationType.File
|
||||
SendToFile(dr("NotiParamValue"), subject, message)
|
||||
Case NotificationType.Mail
|
||||
common.SendMail(receiver, subject, message)
|
||||
Case Else
|
||||
Throw New Exception("Der Benachrichtigungs-Typ " & dr("BenachrichtigungTypId") & " ist unbekannt")
|
||||
End Select
|
||||
Next
|
||||
|
||||
'write log
|
||||
common.Log(common.SERVICE_DISPLAY_NAME, "Sending Notification (ProgrammId: " + programmId.ToString() + ", JobId: " + jobId.ToString() + ", Message: " + message + ") on " + DateTime.Now.ToString("G"), EventLogEntryType.Information)
|
||||
|
||||
DataAccess.Job.SetNotificationCounter(common.DSN, jobId, jobType, False)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Throw ex
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Public Shared Sub SendToFile(ByVal filePath As String, ByVal subject As String, ByVal message As String)
|
||||
Try
|
||||
Dim fs As New System.IO.FileStream(filePath, IO.FileMode.Append, IO.FileAccess.Write)
|
||||
Dim writer As New System.IO.StreamWriter(fs)
|
||||
|
||||
writer.BaseStream.Seek(0, IO.SeekOrigin.End)
|
||||
writer.WriteLine("Datum: " & DateTime.Now)
|
||||
writer.WriteLine("Betreff: " & subject)
|
||||
writer.WriteLine("Meldung: " & message)
|
||||
writer.WriteLine("-------------------------------------------")
|
||||
|
||||
writer.Close()
|
||||
|
||||
Catch ex As Exception
|
||||
Throw ex
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Public Shared Sub SetNextExecDateTime(ByVal dsn As String, ByVal jobId As Integer)
|
||||
Dim sqlConn As New SqlConnection(dsn)
|
||||
Try
|
||||
Dim sqlCom As New SqlCommand
|
||||
|
||||
sqlConn.Open()
|
||||
|
||||
sqlCom.CommandType = CommandType.StoredProcedure
|
||||
sqlCom.Connection = sqlConn
|
||||
sqlCom.CommandText = "SetNextStartDate"
|
||||
|
||||
sqlCom.Parameters.Add(New SqlParameter("@JobId", jobId))
|
||||
sqlCom.ExecuteNonQuery()
|
||||
|
||||
sqlConn.Close()
|
||||
|
||||
SetNextStartDateCalculated(dsn, jobId, False)
|
||||
Catch ex As Exception
|
||||
If sqlConn.State = ConnectionState.Open Then
|
||||
sqlConn.Close()
|
||||
End If
|
||||
Throw ex
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
'Sets, if a NextStartDate is calculated or not
|
||||
Public Shared Sub SetNextStartDateCalculated(ByVal dsn As String, ByVal jobId As Integer, ByVal resetFlag As Boolean)
|
||||
Dim sqlConn As New SqlConnection(dsn)
|
||||
Try
|
||||
Dim sqlCom As New SqlCommand
|
||||
|
||||
sqlConn.Open()
|
||||
|
||||
sqlCom.CommandType = CommandType.StoredProcedure
|
||||
sqlCom.Connection = sqlConn
|
||||
sqlCom.CommandText = "SetNextStartDateCalculated"
|
||||
|
||||
sqlCom.Parameters.Add(New SqlParameter("@JobId", jobId))
|
||||
sqlCom.Parameters.Add(New SqlParameter("@ResetFlag", resetFlag))
|
||||
sqlCom.ExecuteNonQuery()
|
||||
|
||||
sqlConn.Close()
|
||||
Catch ex As Exception
|
||||
If sqlConn.State = ConnectionState.Open Then
|
||||
sqlConn.Close()
|
||||
End If
|
||||
Throw ex
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
'sets the counter state if an error occured
|
||||
Public Shared Sub SetNotificationCounter(ByVal dsn As String, ByVal jobId As Integer, ByVal jobTypId As JobType, ByVal resetCounter As Boolean)
|
||||
Dim sqlConn As New SqlConnection(dsn)
|
||||
Try
|
||||
Dim sqlCom As New SqlCommand
|
||||
|
||||
sqlConn.Open()
|
||||
|
||||
sqlCom.CommandType = CommandType.StoredProcedure
|
||||
sqlCom.Connection = sqlConn
|
||||
sqlCom.CommandText = "SetNotificationCounter"
|
||||
|
||||
sqlCom.Parameters.Add(New SqlParameter("@JobId", jobId))
|
||||
sqlCom.Parameters.Add(New SqlParameter("@JobTypId", CInt(jobTypId)))
|
||||
sqlCom.Parameters.Add(New SqlParameter("@Reset", resetCounter))
|
||||
sqlCom.ExecuteNonQuery()
|
||||
|
||||
sqlConn.Close()
|
||||
Catch ex As Exception
|
||||
If sqlConn.State = ConnectionState.Open Then
|
||||
sqlConn.Close()
|
||||
End If
|
||||
Throw ex
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Public Shared Sub GetNotifications(ByVal common As Common.Common, ByVal programmId As Integer, ByRef notifications As DataSet)
|
||||
Dim sqlConn As New SqlConnection(common.DSN)
|
||||
Try
|
||||
Dim sqlCom As New SqlCommand
|
||||
Dim da As New SqlDataAdapter
|
||||
Dim ds As New DataSet
|
||||
|
||||
sqlConn.Open()
|
||||
|
||||
sqlCom.CommandType = CommandType.StoredProcedure
|
||||
sqlCom.Connection = sqlConn
|
||||
sqlCom.CommandText = "GetNotifications"
|
||||
|
||||
sqlCom.Parameters.Add(New SqlParameter("@ProgrammId", programmId))
|
||||
|
||||
da.SelectCommand = sqlCom
|
||||
da.Fill(notifications)
|
||||
|
||||
sqlConn.Close()
|
||||
Catch ex As Exception
|
||||
If sqlConn.State = ConnectionState.Open Then
|
||||
sqlConn.Close()
|
||||
End If
|
||||
Throw ex
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
' gets all jobs, that taked to long to execute... (Jobs.MaxLaufzeit)
|
||||
Public Shared Sub GetFailedExecJobs(ByVal common As Common.Common, ByVal programmId As Integer, ByRef failedExecjobs As DataSet)
|
||||
Dim sqlConn As New SqlConnection(common.DSN)
|
||||
Try
|
||||
Dim sqlCom As New SqlCommand
|
||||
Dim da As New SqlDataAdapter
|
||||
Dim ds As New DataSet
|
||||
|
||||
sqlConn.Open()
|
||||
|
||||
sqlCom.CommandType = CommandType.StoredProcedure
|
||||
sqlCom.Connection = sqlConn
|
||||
sqlCom.CommandText = "GetFailedExecutionJobs"
|
||||
|
||||
sqlCom.Parameters.Add(New SqlParameter("@ProgrammId", programmId))
|
||||
|
||||
da.SelectCommand = sqlCom
|
||||
da.Fill(failedExecjobs)
|
||||
|
||||
sqlConn.Close()
|
||||
Catch ex As Exception
|
||||
If sqlConn.State = ConnectionState.Open Then
|
||||
sqlConn.Close()
|
||||
End If
|
||||
Throw ex
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
'Gets all bad start jobs of a program
|
||||
Public Shared Sub GetFailedStartJobs(ByVal common As Common.Common, ByVal programmId As Integer, ByRef failedStartjobs As DataSet)
|
||||
Dim sqlConn As New SqlConnection(common.DSN)
|
||||
Try
|
||||
Dim sqlCom As New SqlCommand
|
||||
Dim da As New SqlDataAdapter
|
||||
Dim ds As New DataSet
|
||||
|
||||
sqlConn.Open()
|
||||
|
||||
sqlCom.CommandType = CommandType.StoredProcedure
|
||||
sqlCom.Connection = sqlConn
|
||||
sqlCom.CommandText = "GetFailedStartJobs"
|
||||
|
||||
sqlCom.Parameters.Add(New SqlParameter("@ProgrammId", programmId))
|
||||
sqlCom.Parameters.Add(New SqlParameter("@MaxStartDuration", common.MaximalStartDuration))
|
||||
|
||||
da.SelectCommand = sqlCom
|
||||
da.Fill(failedStartjobs)
|
||||
|
||||
sqlConn.Close()
|
||||
Catch ex As Exception
|
||||
If sqlConn.State = ConnectionState.Open Then
|
||||
sqlConn.Close()
|
||||
End If
|
||||
Throw ex
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
'sets start or end datetime of a run-job
|
||||
Public Shared Sub SetJobLastRun(ByVal dsn As String, ByVal jobId As Integer, ByVal jobLastRun As LastRun)
|
||||
Dim sqlConn As New SqlConnection(dsn)
|
||||
Try
|
||||
Dim sqlCom As New SqlCommand
|
||||
|
||||
sqlConn.Open()
|
||||
|
||||
sqlCom.CommandType = CommandType.StoredProcedure
|
||||
sqlCom.Connection = sqlConn
|
||||
sqlCom.CommandText = "SetJobLastRun"
|
||||
|
||||
sqlCom.Parameters.Add(New SqlParameter("@JobId", jobId))
|
||||
sqlCom.Parameters.Add(New SqlParameter("@LastRunType", CInt(jobLastRun)))
|
||||
sqlCom.ExecuteNonQuery()
|
||||
|
||||
sqlConn.Close()
|
||||
Catch
|
||||
If sqlConn.State = ConnectionState.Open Then
|
||||
sqlConn.Close()
|
||||
End If
|
||||
Throw
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
'Sets if currently job is running in db
|
||||
Public Shared Sub SetIsRunning(ByVal dsn As String, ByVal programmId As Integer, ByVal isRunning As Boolean)
|
||||
Dim sqlConn As New SqlConnection(dsn)
|
||||
Try
|
||||
Dim sqlCom As New SqlCommand
|
||||
|
||||
sqlConn.Open()
|
||||
|
||||
sqlCom.CommandType = CommandType.StoredProcedure
|
||||
sqlCom.Connection = sqlConn
|
||||
sqlCom.CommandText = "SetJobIsRunning"
|
||||
|
||||
sqlCom.Parameters.Add(New SqlParameter("@ProgrammId", programmId))
|
||||
sqlCom.Parameters.Add(New SqlParameter("@IsRunning", isRunning))
|
||||
sqlCom.ExecuteNonQuery()
|
||||
|
||||
sqlConn.Close()
|
||||
Catch
|
||||
If sqlConn.State = ConnectionState.Open Then
|
||||
sqlConn.Close()
|
||||
End If
|
||||
Throw
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Public Shared Function CheckIsRunning(ByVal dsn As String, ByVal programmId As Integer) As Object
|
||||
Dim sqlConn As New SqlConnection(dsn)
|
||||
Try
|
||||
Dim sqlCom As New SqlCommand
|
||||
|
||||
sqlConn.Open()
|
||||
|
||||
sqlCom.CommandType = CommandType.StoredProcedure
|
||||
sqlCom.Connection = sqlConn
|
||||
sqlCom.CommandText = "CheckIsRunning"
|
||||
|
||||
sqlCom.Parameters.Add(New SqlParameter("@ProgrammId", programmId))
|
||||
Dim sqlParam As SqlParameter = sqlCom.Parameters.Add("@IsRunning", SqlDbType.Bit)
|
||||
sqlParam.Direction = ParameterDirection.Output
|
||||
|
||||
sqlCom.ExecuteNonQuery()
|
||||
|
||||
sqlConn.Close()
|
||||
Return sqlParam.Value
|
||||
Catch
|
||||
If sqlConn.State = ConnectionState.Open Then
|
||||
sqlConn.Close()
|
||||
End If
|
||||
Throw
|
||||
End Try
|
||||
End Function
|
||||
|
||||
'Gets a start parameter from db
|
||||
Public Shared Sub GetStartParameter(ByVal dsn As String, ByVal jobId As Integer, ByVal startParameterType As StartParameterType, ByRef parameterValue As String)
|
||||
Dim sqlConn As New SqlConnection(dsn)
|
||||
Try
|
||||
Dim sqlCom As New SqlCommand
|
||||
Dim da As New SqlDataAdapter
|
||||
Dim ds As New DataSet
|
||||
|
||||
sqlConn.Open()
|
||||
|
||||
sqlCom.CommandType = CommandType.StoredProcedure
|
||||
sqlCom.Connection = sqlConn
|
||||
sqlCom.CommandText = "GetStartParameter"
|
||||
|
||||
sqlCom.Parameters.Add(New SqlParameter("@JobId", CInt(jobId)))
|
||||
sqlCom.Parameters.Add(New SqlParameter("@StartParameterTypId", CInt(startParameterType)))
|
||||
|
||||
da.SelectCommand = sqlCom
|
||||
da.Fill(ds)
|
||||
|
||||
sqlConn.Close()
|
||||
|
||||
If ds.Tables.Count > 0 Then
|
||||
If ds.Tables(0).Rows.Count > 0 Then
|
||||
parameterValue = ds.Tables.Item(0).Rows(0).Item(0)
|
||||
End If
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
If sqlConn.State = ConnectionState.Open Then
|
||||
sqlConn.Close()
|
||||
End If
|
||||
Throw ex
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
|
||||
'Loads all active jobs from database
|
||||
Public Shared Sub LoadJobs(ByVal common As Common.Common, ByVal jobType As JobType, ByVal ds As DataSet)
|
||||
Dim sqlConn As New SqlConnection(common.DSN)
|
||||
Try
|
||||
Dim sqlCom As New SqlCommand
|
||||
Dim da As New SqlDataAdapter
|
||||
|
||||
sqlConn.Open()
|
||||
|
||||
sqlCom.CommandType = CommandType.StoredProcedure
|
||||
sqlCom.Connection = sqlConn
|
||||
sqlCom.CommandText = "GetJobs"
|
||||
|
||||
sqlCom.Parameters.Add(New SqlParameter("@JobTypId", CInt(jobType)))
|
||||
|
||||
da.SelectCommand = sqlCom
|
||||
da.Fill(ds)
|
||||
|
||||
sqlConn.Close()
|
||||
Catch ex As Exception
|
||||
If sqlConn.State = ConnectionState.Open Then
|
||||
sqlConn.Close()
|
||||
End If
|
||||
Throw ex
|
||||
End Try
|
||||
End Sub
|
||||
End Class
|
||||
BIN
BMS/DataAccess/bin/Common.dll
Normal file
BIN
BMS/DataAccess/bin/Common.dll
Normal file
Binary file not shown.
22
BMS/DataAccess/bin/Common.xml
Normal file
22
BMS/DataAccess/bin/Common.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0"?>
|
||||
<doc>
|
||||
<assembly>
|
||||
<name>
|
||||
Common
|
||||
</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="M:Common.Settings.GetSettingValue(System.String)">
|
||||
<summary>Gets the first matching value of a property</summary>
|
||||
<param name="propertyName"></param>
|
||||
<returns></returns>
|
||||
</member><member name="M:Common.Settings.SetSettingsValue(System.String,System.String)">
|
||||
<summary>Sets the first matching value of a property</summary>
|
||||
<param name="xpath"></param>
|
||||
<param name="value"></param>
|
||||
</member><member name="M:Common.Settings.GetDecryptedDSN">
|
||||
<summary>Return the descripted dsn string</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
||||
BIN
BMS/DataAccess/bin/DataAccess.dll
Normal file
BIN
BMS/DataAccess/bin/DataAccess.dll
Normal file
Binary file not shown.
11
BMS/DataAccess/bin/DataAccess.xml
Normal file
11
BMS/DataAccess/bin/DataAccess.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0"?>
|
||||
<doc>
|
||||
<assembly>
|
||||
<name>
|
||||
DataAccess
|
||||
</name>
|
||||
</assembly>
|
||||
<members>
|
||||
|
||||
</members>
|
||||
</doc>
|
||||
BIN
BMS/DataAccess/bin/ZpCryptography.dll
Normal file
BIN
BMS/DataAccess/bin/ZpCryptography.dll
Normal file
Binary file not shown.
11
BMS/DataAccess/bin/ZpCryptography.xml
Normal file
11
BMS/DataAccess/bin/ZpCryptography.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0"?>
|
||||
<doc>
|
||||
<assembly>
|
||||
<name>
|
||||
ZpCryptography
|
||||
</name>
|
||||
</assembly>
|
||||
<members>
|
||||
|
||||
</members>
|
||||
</doc>
|
||||
5
BMS/DataAccess/mssccprj.scc
Normal file
5
BMS/DataAccess/mssccprj.scc
Normal file
@@ -0,0 +1,5 @@
|
||||
SCC = This is a Source Code Control file
|
||||
|
||||
[DataAccess.vbproj]
|
||||
SCC_Aux_Path = "\\SERVER01\DATEN\SourceSave\EDOKA4.0"
|
||||
SCC_Project_Name = "$/BMS/DataAccess", STCAAAAA
|
||||
9
BMS/DataAccess/obj/DataAccess.vbproj.FileList.txt
Normal file
9
BMS/DataAccess/obj/DataAccess.vbproj.FileList.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
bin\DataAccess.dll
|
||||
bin\DataAccess.xml
|
||||
bin\Common.dll
|
||||
bin\ZpCryptography.dll
|
||||
bin\ZpCryptography.xml
|
||||
bin\Common.xml
|
||||
obj\Release\ResolveAssemblyReference.cache
|
||||
obj\Release\DataAccess.dll
|
||||
obj\Release\DataAccess.xml
|
||||
@@ -0,0 +1,9 @@
|
||||
C:\Data\Edoka_FW3\BMS\DataAccess\bin\DataAccess.dll
|
||||
C:\Data\Edoka_FW3\BMS\DataAccess\bin\DataAccess.xml
|
||||
C:\Data\Edoka_FW3\BMS\DataAccess\bin\Common.dll
|
||||
C:\Data\Edoka_FW3\BMS\DataAccess\bin\ZpCryptography.dll
|
||||
C:\Data\Edoka_FW3\BMS\DataAccess\bin\ZpCryptography.xml
|
||||
C:\Data\Edoka_FW3\BMS\DataAccess\bin\Common.xml
|
||||
C:\Data\Edoka_FW3\BMS\DataAccess\obj\Release\ResolveAssemblyReference.cache
|
||||
C:\Data\Edoka_FW3\BMS\DataAccess\obj\Release\DataAccess.dll
|
||||
C:\Data\Edoka_FW3\BMS\DataAccess\obj\Release\DataAccess.xml
|
||||
BIN
BMS/DataAccess/obj/Release/DataAccess.dll
Normal file
BIN
BMS/DataAccess/obj/Release/DataAccess.dll
Normal file
Binary file not shown.
11
BMS/DataAccess/obj/Release/DataAccess.xml
Normal file
11
BMS/DataAccess/obj/Release/DataAccess.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0"?>
|
||||
<doc>
|
||||
<assembly>
|
||||
<name>
|
||||
DataAccess
|
||||
</name>
|
||||
</assembly>
|
||||
<members>
|
||||
|
||||
</members>
|
||||
</doc>
|
||||
BIN
BMS/DataAccess/obj/Release/ResolveAssemblyReference.cache
Normal file
BIN
BMS/DataAccess/obj/Release/ResolveAssemblyReference.cache
Normal file
Binary file not shown.
BIN
BMS/DataAccess/vssver.scc
Normal file
BIN
BMS/DataAccess/vssver.scc
Normal file
Binary file not shown.
Reference in New Issue
Block a user