Version 20180904

This commit is contained in:
2018-09-08 22:59:18 +02:00
parent d74444b027
commit e92be16b24
838 changed files with 395696 additions and 0 deletions

34
DAL_SQLServer/Crypto.vb Normal file
View File

@@ -0,0 +1,34 @@
Module Crypto
Public Function EncryptText(ByVal strText As String, ByVal strPwd As String)
Dim i As Integer, c As Integer
Dim strBuff As String
strPwd = UCase$(strPwd)
If Len(strPwd) Then
For i = 1 To Len(strText)
c = Asc(Mid$(strText, i, 1))
c = c + Asc(Mid$(strPwd, (i Mod Len(strPwd)) + 1, 1))
strBuff = strBuff & Chr(c And &HFF)
Next i
Else
strBuff = strText
End If
EncryptText = strBuff
End Function
Public Function DecryptText(ByVal strText As String, ByVal strPwd As String)
Dim i As Integer, c As Integer
Dim strBuff As String
strPwd = UCase$(strPwd)
If Len(strPwd) Then
For i = 1 To Len(strText)
c = Asc(Mid$(strText, i, 1))
c = c - Asc(Mid$(strPwd, (i Mod Len(strPwd)) + 1, 1))
strBuff = strBuff & Chr(c And &HFF)
Next i
Else
strBuff = strText
End If
DecryptText = strBuff
End Function
End Module

View File

@@ -0,0 +1,104 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{A5D551F4-5069-4BE7-A3B5-391759A81295}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>DAL_SQLServer</RootNamespace>
<AssemblyName>DAL_SQLServer</AssemblyName>
<FileAlignment>512</FileAlignment>
<MyType>Windows</MyType>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\Debug\</OutputPath>
<DocumentationFile>DAL_SQLServer.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DocumentationFile>DAL_SQLServer.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
</PropertyGroup>
<PropertyGroup>
<OptionExplicit>On</OptionExplicit>
</PropertyGroup>
<PropertyGroup>
<OptionCompare>Binary</OptionCompare>
</PropertyGroup>
<PropertyGroup>
<OptionStrict>Off</OptionStrict>
</PropertyGroup>
<PropertyGroup>
<OptionInfer>On</OptionInfer>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
</ItemGroup>
<ItemGroup>
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Data" />
<Import Include="System.Diagnostics" />
<Import Include="System.Linq" />
<Import Include="System.Xml.Linq" />
<Import Include="System.Threading.Tasks" />
</ItemGroup>
<ItemGroup>
<Compile Include="clsdb.vb" />
<Compile Include="Crypto.vb" />
<Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Application.myapp</DependentUpon>
</Compile>
<Compile Include="My Project\Resources.Designer.vb">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="My Project\Settings.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="My Project\Resources.resx">
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
<CustomToolNamespace>My.Resources</CustomToolNamespace>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="My Project\Application.myapp">
<Generator>MyApplicationCodeGenerator</Generator>
<LastGenOutput>Application.Designer.vb</LastGenOutput>
</None>
<None Include="My Project\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<CustomToolNamespace>My</CustomToolNamespace>
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
</Project>

View File

@@ -0,0 +1,13 @@
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:4.0.30319.42000
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<MySubMain>false</MySubMain>
<SingleInstance>false</SingleInstance>
<ShutdownMode>0</ShutdownMode>
<EnableVisualStyles>true</EnableVisualStyles>
<AuthenticationMode>0</AuthenticationMode>
<ApplicationType>1</ApplicationType>
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
</MyApplicationData>

View File

@@ -0,0 +1,35 @@
Imports System
Imports System.Reflection
Imports System.Runtime.InteropServices
' Allgemeine Informationen über eine Assembly werden über die folgenden
' Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
' die einer Assembly zugeordnet sind.
' Werte der Assemblyattribute überprüfen
<Assembly: AssemblyTitle("DAL_SQLServer")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("DAL_SQLServer")>
<Assembly: AssemblyCopyright("Copyright © 2018")>
<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(False)>
'Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird.
<Assembly: Guid("edbb5355-3b23-4334-b2e5-f6e8a1be4203")>
' Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
'
' Hauptversion
' Nebenversion
' Buildnummer
' Revision
'
' Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
' übernehmen, indem Sie "*" eingeben:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.0.0.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")>

View File

@@ -0,0 +1,62 @@
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:4.0.30319.42000
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
Namespace My.Resources
'This class was auto-generated by the StronglyTypedResourceBuilder
'class via a tool like ResGen or Visual Studio.
'To add or remove a member, edit your .ResX file then rerun ResGen
'with the /str option, or rebuild your VS project.
'''<summary>
''' A strongly-typed resource class, for looking up localized strings, etc.
'''</summary>
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
Friend Module Resources
Private resourceMan As Global.System.Resources.ResourceManager
Private resourceCulture As Global.System.Globalization.CultureInfo
'''<summary>
''' Returns the cached ResourceManager instance used by this class.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
Get
If Object.ReferenceEquals(resourceMan, Nothing) Then
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("DAL_SQLServer.Resources", GetType(Resources).Assembly)
resourceMan = temp
End If
Return resourceMan
End Get
End Property
'''<summary>
''' Overrides the current thread's CurrentUICulture property for all
''' resource lookups using this strongly typed resource class.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Friend Property Culture() As Global.System.Globalization.CultureInfo
Get
Return resourceCulture
End Get
Set(ByVal value As Global.System.Globalization.CultureInfo)
resourceCulture = value
End Set
End Property
End Module
End Namespace

View File

@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,73 @@
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:4.0.30319.42000
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
Namespace My
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Partial Friend NotInheritable Class MySettings
Inherits Global.System.Configuration.ApplicationSettingsBase
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings)
#Region "My.Settings Auto-Save Functionality"
#If _MyType = "WindowsForms" Then
Private Shared addedHandler As Boolean
Private Shared addedHandlerLockObject As New Object
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
If My.Application.SaveMySettingsOnExit Then
My.Settings.Save()
End If
End Sub
#End If
#End Region
Public Shared ReadOnly Property [Default]() As MySettings
Get
#If _MyType = "WindowsForms" Then
If Not addedHandler Then
SyncLock addedHandlerLockObject
If Not addedHandler Then
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
addedHandler = True
End If
End SyncLock
End If
#End If
Return defaultInstance
End Get
End Property
End Class
End Namespace
Namespace My
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
Friend Module MySettingsProperty
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
Friend ReadOnly Property Settings() As Global.DAL_SQLServer.My.MySettings
Get
Return Global.DAL_SQLServer.My.MySettings.Default
End Get
End Property
End Module
End Namespace

View File

@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

869
DAL_SQLServer/clsdb.vb Normal file
View File

@@ -0,0 +1,869 @@
Imports System.Data.SqlClient
Imports System.Data.SqlTypes
Imports System.IO
Public Class clsDB
#Region "Deklarationen"
Dim m_connectionstring As String
Dim m_actuser As String
Property ActUser As String
Get
Return m_actuser
End Get
Set(value As String)
m_actuser = value
End Set
End Property
Property Connectionstring As String
Get
Return m_connectionstring
End Get
Set(value As String)
m_connectionstring = value
End Set
End Property
Dim m_encrypted As Boolean
Property Encrypted As Boolean
Get
Return m_encrypted
End Get
Set(value As Boolean)
m_encrypted = value
End Set
End Property
Sub New()
Me.Connectionstring = Me.Connectionstring
End Sub
Dim m_startuppath As String
Property Startuppath As String
Get
Return m_startuppath
End Get
Set(value As String)
m_startuppath = value
End Set
End Property
Dim m_auswertungsverzeichnis As String
Property Auswertungsverzeichnis As String
Get
Return m_auswertungsverzeichnis
End Get
Set(value As String)
m_auswertungsverzeichnis = value
End Set
End Property
Dim m_mandant As Integer
Property Mandant As Integer
Get
Return m_mandant
End Get
Set(value As Integer)
m_mandant = value
End Set
End Property
Public dsDaten As New DataSet
Public dssql As New DataSet
Public dadaten As SqlDataAdapter
#End Region
#Region "Allgemein Get / Save"
Public Sub Dispose()
dsDaten.Dispose()
dssql.Dispose()
End Sub
Public Function Get_Option(ByVal nr As Integer) As String
Try
Dim dad As New SqlDataAdapter
Dim sql As String = "Select Inhalt from options where nroption=" + nr.ToString + " and mandant=" + Mandant.ToString + " and aktiv=1"
Dim data As New DataTable
dad = New SqlDataAdapter(sql, Me.Connectionstring)
dad.Fill(data)
Dim s As String
s = data.Rows(0).Item(0).ToString.Replace("&Startup&", Me.Startuppath + Me.Auswertungsverzeichnis)
Return s
dad.Dispose()
data.Dispose()
Catch ex As Exception
Dim a As Integer = 1
End Try
End Function
Public Function Get_Datavalue(sql As String, Optional args As String = "") As String
Try
Try
dsDaten.Clear()
dsDaten.Tables.Clear()
If sql <> "" Then
sql = sql.Replace("&ARGS&", args)
dadaten = New SqlDataAdapter(sql, Me.Connectionstring)
End If
Dim dt As New DataTable
dadaten.Fill(dt)
Return dt.Rows(0).Item(0)
Catch ex As Exception
Dim a As Integer = 1
End Try
Catch ex As Exception
Dim a As Integer = 1
End Try
End Function
Public Sub Get_Tabledata(ByVal tablename As String, Optional wherestatement As String = "", Optional SQL As String = "", Optional args As String = "", Optional SP As Boolean = False, Optional SP_Params As DataTable = Nothing)
If SP = True Then
End If
Try
dsDaten.Clear()
dsDaten.Tables.Clear()
dadaten = New SqlDataAdapter(SQL, Me.Connectionstring)
If SP = True Then
Dim sqlcmd As New SqlCommand
Dim sqlconnect As New SqlConnection
sqlconnect.ConnectionString = Me.Connectionstring
sqlcmd.CommandType = CommandType.StoredProcedure
sqlcmd.CommandText = tablename
For Each r As DataRow In SP_Params.Rows
sqlcmd.Parameters.Add(r("Paramname"), SqlDbType.VarChar)
sqlcmd.Parameters(sqlcmd.Parameters.Count - 1).Value = r("Paramvalue")
Next
sqlcmd.Connection = sqlconnect
Try
dadaten.SelectCommand = sqlcmd
dadaten.Fill(dsDaten, tablename)
Exit Sub
Catch ex As Exception
sqlconnect.Open()
sqlcmd.ExecuteNonQuery()
sqlconnect.Close()
End Try
End If
If SQL <> "" Then
SQL = SQL.Replace("&ARGS&", args)
dadaten = New SqlDataAdapter(SQL, Me.Connectionstring)
Else
dadaten = New SqlDataAdapter("select * from [" + tablename + "] " + wherestatement, Me.Connectionstring)
End If
'dadaten = New SqlDataAdapter("select * from " + tablename + " " + wherestatement, Me.Connectionstring)
dadaten.Fill(dsDaten, tablename)
If encrypted = True Then
For Each r As DataRow In dsDaten.Tables(0).Rows
For Each c As DataColumn In dsDaten.Tables(0).Columns
Select Case UCase(c.ColumnName)
Case "NAME", "VORNAME", "STRASSE", "PLZ", "ORT", "TELP", "PATIENT", "BEHANDLER"
r(c.ColumnName) = Crypto.DecryptText(r(c.ColumnName), Globals.encryptkey)
End Select
Next
Next
End If
Catch ex As Exception
Dim a As Integer = 1
End Try
End Sub
Public Sub Update_Data()
Dim cb As New SqlCommandBuilder(dadaten)
dadaten.Update(dsDaten, dsDaten.Tables(0).TableName)
End Sub
Dim da As SqlDataAdapter
Dim qb As New SqlCommandBuilder
Public daten As New DataSet
Public Function Get_Tabledata_for_Update(ByVal Tablename As String, Optional StoredProc As Boolean = False, Optional is_SQL_String As Boolean = False) As DataTable
Dim sqlconnect As New SqlConnection
Dim ds As New DataSet
ds.Tables.Clear()
sqlconnect.ConnectionString = Me.Connectionstring
sqlconnect.Open()
da = New SqlDataAdapter("", sqlconnect)
Dim sqlcmd As New SqlCommand
sqlcmd.Connection = sqlconnect
If StoredProc = True Then
sqlcmd.CommandType = CommandType.StoredProcedure
sqlcmd.CommandText = Tablename
Else
sqlcmd.CommandType = CommandType.Text
sqlcmd.CommandText = "Select * from " + Tablename
End If
If is_SQL_String = True Then
sqlcmd.CommandText = Tablename
End If
' sqlcmd.CommandType = CommandType.StoredProcedure
' sqlcmd.CommandText = "Berufsliste"
da.SelectCommand = sqlcmd
da.Fill(daten, "Daten")
qb = New SqlCommandBuilder(da)
End Function
Public Sub Update_Tabeldata()
da.Update(daten, "Daten")
End Sub
Public Sub Exec_Prod(ByVal Procedure As String)
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
scmCmdToExecute.CommandText = Procedure
Dim conn As New SqlConnection(Me.Connectionstring)
scmCmdToExecute.CommandType = CommandType.StoredProcedure
scmCmdToExecute.Connection = conn
Try
scmCmdToExecute.Connection.Open()
scmCmdToExecute.ExecuteNonQuery()
Return
Catch ex As Exception
MsgBox(ex.Message)
Finally
scmCmdToExecute.Connection.Close()
End Try
End Sub
Public Sub Exec_SQL(ByVal SQL As String)
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
scmCmdToExecute.CommandText = SQL
Dim conn As New SqlConnection(Me.Connectionstring)
scmCmdToExecute.CommandType = CommandType.Text
scmCmdToExecute.Connection = conn
Try
scmCmdToExecute.Connection.Open()
scmCmdToExecute.ExecuteNonQuery()
Return
Catch ex As Exception
MsgBox(ex.Message)
Finally
scmCmdToExecute.Connection.Close()
End Try
End Sub
Public Function updatedata(ByVal Tablename As String, ByVal sourcetable As DataTable, Optional StoredProc As Boolean = False, Optional is_SQL_String As Boolean = False) As DataSet
Dim sqlconnect As New SqlConnection
Dim ds As New DataSet
Dim qb As New SqlCommandBuilder
ds.Tables.Clear()
sqlconnect.ConnectionString = Me.Connectionstring
sqlconnect.Open()
Dim da As New SqlDataAdapter("", sqlconnect)
Dim sqlcmd As New SqlCommand
sqlcmd.Connection = sqlconnect
If StoredProc = True Then
sqlcmd.CommandType = CommandType.StoredProcedure
sqlcmd.CommandText = Tablename
Else
sqlcmd.CommandType = CommandType.Text
sqlcmd.CommandText = "Select * from " + Tablename
End If
If is_SQL_String = True Then
sqlcmd.CommandText = Tablename
End If
' sqlcmd.CommandType = CommandType.StoredProcedure
' sqlcmd.CommandText = "Berufsliste"
da.SelectCommand = sqlcmd
da.Fill(ds, "Daten")
qb = New SqlCommandBuilder(da)
For Each c As DataColumn In sourcetable.Columns
ds.Tables(0).Rows(0).Item(c.ColumnName) = sourcetable.Rows(0).Item(c.ColumnName)
Next
da.Update(ds, "Daten")
End Function
Public Function Insert_New_Entry(Table As String, Optional KeyName As String = "", Optional getdbkey As Boolean = False, Optional sqlstring As String = "") As DataTable
Dim dbkey As Integer = 0
If getdbkey Then
dsDaten.Tables.Clear()
Get_Tabledata("firmaap", "", sqlstring, "", False)
dbkey = dsDaten.Tables(0).Rows(0).Item(0) + 1
End If
Dim sqlconnect As New SqlConnection
Dim ds As New DataSet
ds.Tables.Clear()
sqlconnect.ConnectionString = Me.Connectionstring
Dim da As New SqlDataAdapter("", sqlconnect)
Dim sqlcmd As New SqlCommand
sqlcmd.Connection = sqlconnect
Dim sql As String
sqlcmd.CommandText = "Insert into " + Table + " (" + KeyName + ",aktiv,erstellt_am,mutiert_am,mutierer) values(" + dbkey.ToString + ",1,getdate(),getdate()," + ActUser.ToString + ")"
sqlconnect.Open()
sqlcmd.ExecuteNonQuery()
sqlconnect.Close()
Dim data As New DataTable
dsDaten.Tables.Clear()
Get_Tabledata(Table, "", "Select top 1 * from " + Table + " order by " + KeyName + " desc")
Return dsDaten.Tables(0)
End Function
Public Function Insert_New_Entry_autokey(Table As String, Optional KeyName As String = "", Optional getdbkey As Boolean = False, Optional sqlstring As String = "") As DataTable
Dim dbkey As Integer = 0
If getdbkey Then
dsDaten.Tables.Clear()
Get_Tabledata("firmaap", "", sqlstring, "", False)
dbkey = dsDaten.Tables(0).Rows(0).Item(0) + 1
End If
Dim sqlconnect As New SqlConnection
Dim ds As New DataSet
ds.Tables.Clear()
sqlconnect.ConnectionString = Me.Connectionstring
Dim da As New SqlDataAdapter("", sqlconnect)
Dim sqlcmd As New SqlCommand
sqlcmd.Connection = sqlconnect
Dim sql As String
sqlcmd.CommandText = "Insert into " + Table + " (aktiv,erstellt_am,mutiert_am,mutierer) values(1,getdate(),getdate()," + ActUser.ToString + ")"
sqlconnect.Open()
sqlcmd.ExecuteNonQuery()
sqlconnect.Close()
Dim data As New DataTable
dsDaten.Tables.Clear()
Get_Tabledata(Table, "", "Select top 1 * from " + Table + " order by " + KeyName + " desc")
Return dsDaten.Tables(0)
End Function
Public Sub Copy_Behandlung(ByVal behandlugnsnr As String, typ As String)
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
scmCmdToExecute.CommandText = "dbo.[sp_copy_behandlung]"
Dim conn As New SqlConnection(Me.Connectionstring)
scmCmdToExecute.CommandType = CommandType.StoredProcedure
scmCmdToExecute.Connection = conn
Try
scmCmdToExecute.Parameters.Add(New SqlParameter("@behandlungsnr", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, behandlugnsnr))
scmCmdToExecute.Parameters.Add(New SqlParameter("@typ", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, typ))
scmCmdToExecute.Connection.Open()
scmCmdToExecute.ExecuteNonQuery()
Return
Catch ex As Exception
MsgBox(ex.Message)
Finally
scmCmdToExecute.Connection.Close()
End Try
End Sub
#End Region
#Region "Spalten"
Public Sub Generate_SpaltenData(ByVal tablename As String)
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
Dim dttable As New DataTable(tablename)
scmCmdToExecute.CommandText = "dbo.[sp_update_spalten]"
Dim conn As New SqlConnection(Me.Connectionstring)
scmCmdToExecute.CommandType = CommandType.StoredProcedure
scmCmdToExecute.Connection = conn
Try
scmCmdToExecute.Parameters.Add(New SqlParameter("@Tablename", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, tablename))
scmCmdToExecute.Connection.Open()
scmCmdToExecute.ExecuteNonQuery()
Return
Catch ex As Exception
MsgBox(ex.Message)
Finally
scmCmdToExecute.Connection.Close()
End Try
End Sub
Public Function Get_Spaltendata()
Try
Dim dbRow As DataRow
Dim dsPartner As New DataSet
dadaten = New SqlDataAdapter("select * from Spalten where aktiv=1", Me.Connectionstring)
dadaten.Fill(dsDaten, "Daten")
Catch ex As Exception
End Try
End Function
Public Function Get_SQL(ByVal nr As Integer) As String
Try
If Globals.SQLStatements.Rows.Count = 0 Then
dssql.Clear()
dadaten = New SqlDataAdapter("select * from sql_statements", Me.Connectionstring)
dadaten.Fill(dssql, "SQLStatements")
Globals.SQLStatements = dssql.Tables(0).Copy
End If
For Each r As DataRow In Globals.SQLStatements.Rows
If r(0) = nr Then
Return r(1)
Exit Function
End If
Next
Catch
End Try
End Function
#End Region
#Region "Suche"
Public Function Search(ByVal Type As String, ByVal Searchstring As String) As Integer
Select Case Type
Case "Patient"
If IsNumeric(Searchstring) Then
Get_Tabledata("privat", " where nrprivat=" + Searchstring + " order by name, vorname, ort")
If dsDaten.Tables(0).Rows.Count = 0 Then
MsgBox("Keine Daten mit der Nr. " + Searchstring + " gefunden.", vbExclamation)
Return -1
End If
Else
Get_Tabledata("privat", " where name like '" + Searchstring + "%'" + " order by name, vorname, ort")
If dsDaten.Tables(0).Rows.Count = 0 Then
MsgBox("Keine Daten mit dem Suchbegriff " + Searchstring + " gefunden.", vbExclamation)
Return -1
End If
End If
If dsDaten.Tables(0).Rows.Count = 1 Then
Return (dsDaten.Tables(0).Rows(0).Item("nrprivat"))
Else
Dim f As New frmPrivatSelect
f.Text = "Patient-Suche"
f.TreeView1.Nodes.Clear()
For Each r As DataRow In dsDaten.Tables(0).Rows
Dim tn As New TreeNode
tn.Text = r("nrprivat").ToString + " " + r("Name") + " " + r("vorname") + ", " + r("PLZ") + " " + r("ort")
tn.Tag = r("nrprivat")
f.TreeView1.Nodes.Add(tn)
Next
f.TreeView1.SelectedNode = f.TreeView1.Nodes(0)
f.StartPosition = FormStartPosition.CenterParent
f.ShowDialog()
If f.DialogResult = DialogResult.OK Then
Return f.TreeView1.SelectedNode.Tag
Else
Return -1
End If
End If
Return -1
Case "Firma"
If IsNumeric(Searchstring) Then
Get_Tabledata("firma", " where nrfirma=" + Searchstring + " order by name1, name2, ort")
If dsDaten.Tables(0).Rows.Count = 0 Then
MsgBox("Keine Daten mit der Nr. " + Searchstring + " gefunden.", vbExclamation)
Return -1
End If
Else
Get_Tabledata("firma", " where name1 like '" + Searchstring + "%'" + " order by name1, name2, ort")
If dsDaten.Tables(0).Rows.Count = 0 Then
MsgBox("Keine Daten mit dem Suchbegriff " + Searchstring + " gefunden.", vbExclamation)
Return -1
End If
End If
If dsDaten.Tables(0).Rows.Count = 1 Then
Return (dsDaten.Tables(0).Rows(0).Item("nrfirma"))
Else
Dim f As New frmPrivatSelect
f.Text = "Firmensuche"
f.TreeView1.Nodes.Clear()
For Each r As DataRow In dsDaten.Tables(0).Rows
Dim tn As New TreeNode
tn.Text = r("nrfirma").ToString + " " + r("Name1") + " " + r("name2") + ", " + r("PLZ") + " " + r("ort")
tn.Tag = r("nrfirma")
f.TreeView1.Nodes.Add(tn)
Next
f.TreeView1.SelectedNode = f.TreeView1.Nodes(0)
f.StartPosition = FormStartPosition.CenterParent
f.ShowDialog()
If f.DialogResult = DialogResult.OK Then
Return f.TreeView1.SelectedNode.Tag
Else
Return -1
End If
End If
Return -1
End Select
End Function
#End Region
#Region "Log"
Public Function WriteLog(ByVal Entry As String, ByVal logtype As Integer)
Try
Dim conn As New SqlConnection(Me.Connectionstring)
Dim sql As String
sql = "Insert Log (Eintrag,logtype ) values('" + Entry + "'," + logtype.ToString + ")"
Dim cm As New SqlCommand(sql, conn)
conn.Open()
cm.ExecuteNonQuery()
conn.Close()
conn.Dispose()
cm.Dispose()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Function
#End Region
#Region "Utils"
Public Function Get_DBKey(ByVal Tablename As String) As Integer
Select Case Tablename
Case "Privat"
Me.Get_Tabledata("NewKeyPrivat", "", Me.Get_SQL(15))
Case "Firma"
Me.Get_Tabledata("NewKeyFirma", "", Me.Get_SQL(28))
Case "Leistung"
Me.Get_Tabledata("NewKeyLeistung", "", Me.Get_SQL(17))
Case "Behandlung"
Me.Get_Tabledata("NewKeyBehandlung", "", Me.Get_SQL(18))
Case "Zahlung"
Me.Get_Tabledata("NewKeyZahlung", "", Me.Get_SQL(20))
Case "Recall"
Me.Get_Tabledata("NewKeyRecall", "", Me.Get_SQL(31))
Case "Tarif"
Me.Get_Tabledata("Tarif", "", "Select top 1 nrtarif+1 from tarif order by nrtarif desc")
End Select
Return Me.dsDaten.Tables(0).Rows(0).Item(0)
End Function
#End Region
#Region "Tarife / Leistungen"
Public Function Get_Tarife() As DataTable
Dim found As Boolean = False
For Each t As DataTable In IntTables.Inttables.Tables
If t.TableName = "Tarife" Then
found = True
End If
Next
If Not found Then
Me.Get_Tabledata("Tarife", "order by nummervon")
IntTables.Inttables.Tables.Add(dsDaten.Tables(0).Copy)
End If
found = False
For Each t As DataTable In IntTables.Inttables.Tables
If t.TableName = "Tarifgrp" Then
found = True
End If
Next
If Not found Then
Me.Get_Tabledata("Tarifgrp", "order by tarifvon")
IntTables.Inttables.Tables.Add(dsDaten.Tables(0).Copy)
End If
found = False
For Each t As DataTable In IntTables.Inttables.Tables
If t.TableName = "Tarpaket" Then
found = True
End If
Next
If Not found Then
Me.Get_Tabledata("Tarpaket", "order by paketbezeichnung")
IntTables.Inttables.Tables.Add(dsDaten.Tables(0).Copy)
End If
If Not found Then
End If
found = False
For Each t As DataTable In IntTables.Inttables.Tables
If t.TableName = "paketpos" Then
found = True
End If
Next
If Not found Then
Me.Get_Tabledata("paketpos", "order by nrpaket")
IntTables.Inttables.Tables.Add(dsDaten.Tables(0).Copy)
End If
found = False
For Each t As DataTable In IntTables.Inttables.Tables
If t.TableName = "Dentotar" Then
found = True
End If
Next
If Not found Then
Me.Get_Tabledata("Dentotar", "", Get_SQL(23))
IntTables.Inttables.Tables.Add(dsDaten.Tables(0).Copy)
End If
End Function
Public Function Get_Tarif() As DataTable
Dim found As Boolean = False
For Each t As DataTable In IntTables.Inttables.Tables
If t.TableName = "Tarif" Then
found = True
Exit Function
End If
Next
If Not found Then
Me.Get_Tabledata("Tarif", "", Get_SQL(16))
IntTables.Inttables.Tables.Add(dsDaten.Tables(0).Copy)
End If
End Function
Public Sub Recalc_Leistungen(ByVal nrbehandlung As Integer, taxpunktwert As Double)
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
scmCmdToExecute.CommandText = "dbo.[sp_recalc_leistungen]"
Dim conn As New SqlConnection(Me.Connectionstring)
scmCmdToExecute.CommandType = CommandType.StoredProcedure
scmCmdToExecute.Connection = conn
Try
scmCmdToExecute.Parameters.Add(New SqlParameter("@nrbehandlung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, nrbehandlung))
scmCmdToExecute.Parameters.Add(New SqlParameter("@taxpunktwert", SqlDbType.Float, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, taxpunktwert))
scmCmdToExecute.Connection.Open()
scmCmdToExecute.ExecuteNonQuery()
Return
Catch ex As Exception
MsgBox(ex.Message)
Finally
scmCmdToExecute.Connection.Close()
End Try
End Sub
#End Region
#Region "Leistung"
Public Function delete_leistung(ByVal nrleistung As Integer)
Get_Tabledata("Leistung", "where nrleistung=" + nrleistung.ToString, "")
dsDaten.Tables(0).Rows(0).Item("Aktiv") = 0
dsDaten.Tables(0).Rows(0).Item("mutiert_am") = Now
dsDaten.Tables(0).Rows(0).Item("mutierer") = ActUser
Update_Data()
End Function
Public Function Get_Leistung(ByVal nrleistung As Integer)
Get_Tabledata("Leistung", "where nrleistung=" + nrleistung.ToString, "")
End Function
#End Region
#Region "Auswertungen"
Public Function get_reportdata(ByVal Reportnr As Integer, ByVal Parameter As String) As String
Get_Tabledata("Auswertung", "where Auswertungnr=" + Reportnr.ToString, "", "")
Dim sql As String
Dim typ As String
sql = dsDaten.Tables(0).Rows(0).Item("sql")
typ = dsDaten.Tables(0).Rows(0).Item("sqltype")
If Parameter <> "" Then sql = sql + " " + Parameter
Dim Filename As String = My.Settings.TempPath + "\" + dsDaten.Tables(0).Rows(0).Item("BEZEICHNUNG") + ".FRX"
dsDaten.Clear()
Select Case UCase(typ)
Case "SQL"
Get_Tabledata("Auswertungsdaten", "", sql, "")
Return Filename
End Select
End Function
Public Function Get_ReportNr(ByVal Report As String) As Integer
Try
Get_Tabledata("Auswertung", "where es_typ='" + Report + "'")
Return dsDaten.Tables(0).Rows(0).Item(0)
Catch ex As Exception
Return 0
End Try
End Function
Public Function Get_ReportNr_by_ESTypnr(ByVal ESTypNr As String) As Integer
Try
Get_Tabledata("ESTyp", "where nrestyp=" + ESTypNr)
Get_Tabledata("Auswertung", "where es_typ='" + dsDaten.Tables(0).Rows(0).Item("estyp") + "'")
Return dsDaten.Tables(0).Rows(0).Item(0)
Catch ex As Exception
Return 0
End Try
End Function
#End Region
#Region "Fakturierung"
Public Sub Rechnung_buchen(ByVal Type As Integer, ByVal Rechnungsnummer As String, rate As String, behandlungsnummer As String, ByVal Betrag As Decimal)
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
scmCmdToExecute.CommandText = "dbo.sp_Rechnung_Buchen"
Dim conn As New SqlConnection(Me.Connectionstring)
scmCmdToExecute.CommandType = CommandType.StoredProcedure
scmCmdToExecute.Connection = conn
Try
scmCmdToExecute.Parameters.Add(New SqlParameter("@Type", SqlDbType.Int, 4, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, Type))
scmCmdToExecute.Parameters.Add(New SqlParameter("@Fakturanr", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, Rechnungsnummer))
scmCmdToExecute.Parameters.Add(New SqlParameter("@Hauptfaktura", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, Rechnungsnummer))
scmCmdToExecute.Parameters.Add(New SqlParameter("@Rate", SqlDbType.Int, 4, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, rate))
scmCmdToExecute.Parameters.Add(New SqlParameter("@behandlungsnummer", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, behandlungsnummer))
scmCmdToExecute.Parameters.Add(New SqlParameter("@Betrag", SqlDbType.Float, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, Betrag))
scmCmdToExecute.Connection.Open()
'scmCmdToExecute.Connection.Open()
scmCmdToExecute.ExecuteNonQuery()
Return
Catch ex As Exception
MsgBox(ex.Message)
Finally
scmCmdToExecute.Connection.Close()
End Try
End Sub
Public Sub Mahnung_Buchen(ByVal nrfaktura As Integer, ByVal Stufe As Integer, ByVal daten As DataTable)
Dim db As New clsDB
Dim mahndatum As Date
Dim faelligkeit As Date
Dim mahngebuehr As Double
mahndatum = daten.Rows(0).Item("Mahndatum")
faelligkeit = daten.Rows(0).Item("Mahnfaelligkeit")
mahngebuehr = daten.Rows(0).Item("mahnzuschlag")
Select Case Stufe
Case 1
db.Exec_SQL("Update faktura set mutiert_am=getdate(), mutierer=" + ActUser.ToString + ",mahndatum1='" + mahndatum + "', mahnfaelligkeit1='" + faelligkeit + "', mahngebuehr1='" + mahngebuehr.ToString + "' where nrfaktura=" + FakturaNr.ToString)
Case 2
db.Exec_SQL("Update faktura set mutiert_am=getdate(), mutierer=" + ActUser.ToString + ",mahndatum2='" + mahndatum + "', mahnfaelligkeit2='" + faelligkeit + "', mahngebuehr2='" + mahngebuehr.ToString + "' where nrfaktura=" + FakturaNr.ToString)
Case 3
db.Exec_SQL("Update faktura set mutiert_am=getdate(), mutierer=" + ActUser.ToString + ",mahndatum3='" + mahndatum + "', mahnfaelligkeit3='" + faelligkeit + "',mahngebuehr3='" + mahngebuehr.ToString + "' where nrfaktura=" + FakturaNr.ToString)
End Select
End Sub
#End Region
#Region "Documenthandling"
Public Function Save_CAMT_File_RUN(ByVal Key As Integer, Filename As String)
Return Save_File("Select * from camt_run where nreintrag=" + Key.ToString, Filename, "SourceFIle")
End Function
Public Function Save_CAMT_File(ByVal Key As Integer, Filename As String)
Return Save_File("Select * from camt_file where nreintrag=" + Key.ToString, Filename, "camt_file")
End Function
Public Function Save_RptDatei(ByVal Auswertungnr As Integer, ByVal Auswertungname As String) As String
Return Save_File("Select * from auswertung where auswertungnr=" + Auswertungnr.ToString, Auswertungname, "Reportdatei")
End Function
Public Function Get_RptDatei(ByVal Auswertungnr As Integer, ByVal Auswertungname As String) As String
Return Get_file("Select * from auswertung where auswertungnr=" + Auswertungnr.ToString, Auswertungname, "Reportdatei")
End Function
Public Function Save_File(ByVal sql As String, ByVal filename As String, ByVal DBAttribut As String) As String
Dim Connection As New SqlConnection()
Dim DA As New SqlDataAdapter(sql, Connection)
Dim cb As SqlCommandBuilder = New SqlCommandBuilder(DA)
Dim ds As New DataSet()
Dim fs As New System.IO.FileStream(filename, System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.Read)
Dim mydata(fs.Length) As Byte
fs.Read(mydata, 0, fs.Length)
fs.Close()
Try
Connection.ConnectionString = Me.Connectionstring
Connection.Open()
DA.Fill(ds, "RptFile")
Dim myRow As DataRow
If ds.Tables(0).Rows.Count = 0 Then
MsgBox("Datei kann nicht gespeichert werden.", MsgBoxStyle.Critical)
Exit Function
Else
myRow = ds.Tables(0).Rows(0)
myRow.Item(DBAttribut) = mydata
DA.Update(ds, "RptFile")
End If
Return filename
Catch ex As Exception
MsgBox(ex.Message)
filename = ""
Return filename
Finally
fs = Nothing
cb = Nothing
ds = Nothing
DA = Nothing
Connection.Close()
Connection = Nothing
End Try
End Function
Public Function Get_file(ByVal sql As String, filename As String, DBAttribut As String) As String
Dim connection As New SqlConnection()
Dim DA As New SqlDataAdapter(sql, connection)
Dim CB As SqlCommandBuilder = New SqlCommandBuilder(DA)
Dim ds As New DataSet()
Try
connection.ConnectionString = Me.Connectionstring
connection.Open()
DA.Fill(ds, "RptFile")
Dim myRow As DataRow
myRow = ds.Tables(0).Rows(0)
Dim MyData() As Byte
MyData = myRow.Item(DBAttribut)
Dim K As Long
K = UBound(MyData)
Dim fs As New FileStream(filename, FileMode.OpenOrCreate, FileAccess.Write)
fs.Write(MyData, 0, K)
fs.Close()
fs = Nothing
Return filename
Catch ex As Exception
Return ""
Finally
CB = Nothing
ds = Nothing
DA = Nothing
connection.Close()
connection = Nothing
End Try
End Function
#End Region
#Region "Zahlungen"
Public Sub Insert_ZJournal(fakturanr As String, ByVal debitor As String, ByVal debitortext As String, ByVal betrag As Decimal, ByVal konto As String, ByVal vz As String, ByVal storno As String)
Get_Tabledata("Zahlung", "", "Select top 1 * from zjournal order by pk desc")
Dim dr As DataRow = dsDaten.Tables(0).NewRow
dr.Item("nreintrag") = 0
dr.Item("Mandant") = Globals.Mandant
dr.Item("Datum") = Now
dr.Item("nrfaktura") = fakturanr
dr.Item("nrdebitor") = debitor
dr.Item("debitor") = debitortext
dr.Item("Konto") = konto
dr.Item("betrag") = betrag
If vz = "False" Then vz = ""
If vz = "True" Then vz = "J"
dr.Item("vz") = vz
dr.Item("storno") = storno
dr.Item("erstellt_am") = Now
dr.Item("mutiert_am") = Now
dr.Item("mutierer") = ActUser
dr.Item("aktiv") = True
dsDaten.Tables(0).Rows.Add(dr)
Update_Data()
End Sub
#End Region
#Region "Security"
Public Function Objexists(ByVal securityform As String, ByVal securityobjecttype As String, ByVal securityobject As String, ByVal securityobjectitem As String) As Boolean
Get_Tabledata("SecurityObject", "SecurityForm='" + securityform + "' and securityobjecttype='" + securityobjecttype + "' and securityobject='" + securityobject + "' and securityobjectitem='" + securityobjectitem + "? and aktiv=1")
If dsDaten.Tables(0).Rows.Count > 0 Then Return True Else Return False
End Function
#End Region
End Class

View File

@@ -0,0 +1 @@
a5c3c0fd74db3fae6c46f496fe10b50e35f90b25

View File

@@ -0,0 +1,4 @@
E:\Software-Projekte\DPM\DPM2016\DAL_SQLServer\obj\Debug\DAL_SQLServer.vbprojResolveAssemblyReference.cache
E:\Software-Projekte\DPM\DPM2016\DAL_SQLServer\obj\Debug\DAL_SQLServer.Resources.resources
E:\Software-Projekte\DPM\DPM2016\DAL_SQLServer\obj\Debug\DAL_SQLServer.vbproj.GenerateResource.cache
E:\Software-Projekte\DPM\DPM2016\DAL_SQLServer\obj\Debug\DAL_SQLServer.vbproj.CoreCompileInputs.cache