moved from SVN to git

This commit is contained in:
root
2016-06-27 02:24:18 +02:00
commit bab5febe08
93 changed files with 10996 additions and 0 deletions

32
BeWoAdmin.sln Normal file
View File

@@ -0,0 +1,32 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DBTool", "BeWoAdmin\DBTool.csproj", "{8B163824-6E75-455C-AEBA-49E313FFD7DC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DBAdminService", "DBAdminService\DBAdminService.csproj", "{80C16833-B497-4AFA-97D2-4744EAFE412C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DBToolControls", "DBToolControls\DBToolControls.csproj", "{3B0EDADE-2697-4936-9C15-E7BCB309AA14}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8B163824-6E75-455C-AEBA-49E313FFD7DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8B163824-6E75-455C-AEBA-49E313FFD7DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8B163824-6E75-455C-AEBA-49E313FFD7DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8B163824-6E75-455C-AEBA-49E313FFD7DC}.Release|Any CPU.Build.0 = Release|Any CPU
{80C16833-B497-4AFA-97D2-4744EAFE412C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{80C16833-B497-4AFA-97D2-4744EAFE412C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{80C16833-B497-4AFA-97D2-4744EAFE412C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{80C16833-B497-4AFA-97D2-4744EAFE412C}.Release|Any CPU.Build.0 = Release|Any CPU
{3B0EDADE-2697-4936-9C15-E7BCB309AA14}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3B0EDADE-2697-4936-9C15-E7BCB309AA14}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3B0EDADE-2697-4936-9C15-E7BCB309AA14}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3B0EDADE-2697-4936-9C15-E7BCB309AA14}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

8
BeWoAdmin/App.xaml Normal file
View File

@@ -0,0 +1,8 @@
<Application x:Class="BeWoAdmin.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="Window1.xaml">
<Application.Resources>
</Application.Resources>
</Application>

16
BeWoAdmin/App.xaml.cs Normal file
View File

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
namespace BeWoAdmin {
/// <summary>
/// Interaktionslogik für "App.xaml"
/// </summary>
public partial class App : Application {
public static readonly string Name = "BeWo Admin";
public static readonly string TransportEncryptionKey = @"b7困!#vS?難\n.어u";
}
}

View File

@@ -0,0 +1,29 @@
<Window x:Class="BeWoAdmin.CreateDatabase"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Neue Datenbank erstellen" WindowStartupLocation="CenterOwner" SizeToContent="WidthAndHeight" ResizeMode="CanResizeWithGrip"
WindowStyle="None" Background="Transparent" AllowsTransparency="True" MinWidth="250" ShowInTaskbar="False" >
<Border BorderBrush="LightGray" BorderThickness="1" CornerRadius="5" Background="WhiteSmoke" SnapsToDevicePixels="True" MouseLeftButtonDown="StartDrag">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<TextBlock Grid.ColumnSpan="2" HorizontalAlignment="Center" Margin="5">Neue Datenbank erstellen</TextBlock>
<TextBlock Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="5 5 0 5">Server-URI:</TextBlock>
<TextBlock Name="uriTextBox" Grid.Row="1" Grid.Column="1" Margin="5" />
<TextBlock Grid.Row="2" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="5 5 0 5">Mandant:</TextBlock>
<TextBox Name="tenantTextBox" Grid.Row="2" Grid.Column="1" Margin="5" />
<StackPanel Grid.Row="3" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal" Margin="5 0 5 5">
<Button IsDefault="True" MinWidth="80" Click="OKButton_Click">OK</Button>
<Button IsCancel="True" MinWidth="80" Margin="5 0 0 0">Abbrechen</Button>
</StackPanel>
</Grid>
</Border>
</Window>

View File

@@ -0,0 +1,66 @@
using System;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Windows.Threading;
using System.Threading;
using BeWoAdmin.DBAdminService;
namespace BeWoAdmin {
/// <summary>
/// Interaktionslogik für CreateDatabase.xaml
/// </summary>
public partial class CreateDatabase : Window {
internal Tenant CreatedTenant { get; private set; }
private Server server;
public CreateDatabase(Window owner, Server server) {
InitializeComponent();
this.Owner = owner;
this.server = server;
uriTextBox.Text = server.Uri.AbsoluteUri;
tenantTextBox.Focus();
Dispatcher.BeginInvoke(DispatcherPriority.Loaded, (ThreadStart)delegate() {
this.MinHeight = this.MaxHeight = this.ActualHeight;
});
}
private void StartDrag(object sender, MouseButtonEventArgs e) {
this.DragMove();
}
private void OKButton_Click(object sender, RoutedEventArgs e) {
this.IsEnabled = false;
this.Opacity = 0.8;
this.Effect = new GrayscaleEffect.GrayscaleEffect();
string serviceUri = uriTextBox.Text;
string name = tenantTextBox.Text;
new Thread(() => {
try {
MySqlService webService = new MySqlService();
webService.Url = serviceUri;
Dispatcher.BeginInvoke(DispatcherPriority.Loaded, (ThreadStart)delegate() {
CreatedTenant = server.CreateTenant(name, webService.CreateNewTenantID(), null, false);
this.DialogResult = true;
this.Close();
});
} catch (Exception ex) {
Dispatcher.BeginInvoke(DispatcherPriority.Loaded, (ThreadStart)delegate() {
MessageBox.Show(String.Format("Fehler aufgetreten: {0} ({1})", ex.Message, ex.GetType().ToString()));
this.IsEnabled = true;
this.Opacity = 1;
});
}
}).Start();
}
}
}

284
BeWoAdmin/DBTool.csproj Normal file
View File

@@ -0,0 +1,284 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{8B163824-6E75-455C-AEBA-49E313FFD7DC}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BeWoAdmin</RootNamespace>
<AssemblyName>BeWoAdmin</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="GrayscaleEffect, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>.\GrayscaleEffect.dll</HintPath>
</Reference>
<Reference Include="MySql.Data, Version=5.2.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\DBAdminService\MySql.Data.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.EnterpriseServices" />
<Reference Include="System.Web.Services" />
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="UIAutomationProvider">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="PresentationCore">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="PresentationFramework">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="CreateDatabase.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="DbCreationWnd.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="ExtndLicnsWnd.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="icons\IconResources.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="PasswordInput.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SqlInputWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SqlOutputWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Window1.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="WPF\Resources.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Window1.xaml.cs">
<DependentUpon>Window1.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="CreateDatabase.xaml.cs">
<DependentUpon>CreateDatabase.xaml</DependentUpon>
</Compile>
<Compile Include="DatabaseCreation.cs" />
<Compile Include="DbCreationWnd.xaml.cs">
<DependentUpon>DbCreationWnd.xaml</DependentUpon>
</Compile>
<Compile Include="ExtndLicnsWnd.xaml.cs">
<DependentUpon>ExtndLicnsWnd.xaml</DependentUpon>
</Compile>
<Compile Include="PasswordInput.xaml.cs">
<DependentUpon>PasswordInput.xaml</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="Server.cs" />
<Compile Include="ServerCollection.cs" />
<Compile Include="SqlInputWindow.xaml.cs">
<DependentUpon>SqlInputWindow.xaml</DependentUpon>
</Compile>
<Compile Include="SqlOutputWindow.xaml.cs">
<DependentUpon>SqlOutputWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Tenant.cs" />
<Compile Include="Web References\DBAdminService\Reference.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Reference.map</DependentUpon>
</Compile>
<Compile Include="WPF\BackgroundValueConverter.cs" />
<Compile Include="WPF\CollapsedIfFalseValueConverter.cs" />
<Compile Include="WPF\CustomCommands.cs" />
<Compile Include="WPF\FontWeightValueConverter.cs" />
<Compile Include="WPF\ForegroundValueConverter.cs" />
<Compile Include="WPF\SuccessBackgroundValueConverter.cs" />
<Compile Include="WPF\VisibleIfFalseValueConverter.cs" />
<Compile Include="WPF\VisibleIfTrueValueConverter.cs" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<AppDesigner Include="Properties\" />
</ItemGroup>
<ItemGroup>
<Resource Include="icons\database.png" />
<Resource Include="icons\database_add.png" />
<Resource Include="icons\database_delete.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="icons\server.png" />
<Resource Include="icons\server_add.png" />
<Resource Include="icons\server_connect.png" />
<Resource Include="icons\server_delete.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="icons\database_lightning.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="icons\cancel.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="icons\database_connect.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="icons\database_table.png" />
<Resource Include="icons\disk.png" />
<Resource Include="icons\door_in.png" />
<Resource Include="icons\folder.png" />
<Resource Include="icons\page_copy.png" />
<Resource Include="icons\page_white.png" />
<Resource Include="icons\page_white_database.png" />
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Service References\" />
</ItemGroup>
<ItemGroup>
<WebReferences Include="Web References\" />
</ItemGroup>
<ItemGroup>
<WebReferenceUrl Include="http://localhost:1513/MySqlService.asmx">
<UrlBehavior>Dynamic</UrlBehavior>
<RelPath>Web References\DBAdminService\</RelPath>
<UpdateFromURL>http://localhost:1513/MySqlService.asmx</UpdateFromURL>
<ServiceLocationURL>
</ServiceLocationURL>
<CachedDynamicPropName>
</CachedDynamicPropName>
<CachedAppSettingsObjectName>Settings</CachedAppSettingsObjectName>
<CachedSettingsPropName>DBToolTest2_DBAdminService_MySqlService</CachedSettingsPropName>
</WebReferenceUrl>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="Web References\DBAdminService\DBAdminServiceReturnValue1.datasource">
<DependentUpon>Reference.map</DependentUpon>
</None>
<None Include="Web References\DBAdminService\MySqlService.disco" />
<None Include="Web References\DBAdminService\MySqlService.wsdl" />
<None Include="Web References\DBAdminService\Reference.map">
<Generator>MSDiscoCodeGenerator</Generator>
<LastGenOutput>Reference.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DBToolControls\DBToolControls.csproj">
<Project>{3B0EDADE-2697-4936-9C15-E7BCB309AA14}</Project>
<Name>DBToolControls</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Resource Include="icons\license.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,115 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Diagnostics;
namespace BeWoAdmin
{
class DatabaseCreation
{
public String dbID;
private int dbNumber;
private String filePath;
private Window1 parentWindow;
public DatabaseCreation(String file, Window1 parent)
{
this.filePath = file;
this.parentWindow = parent;
}
public String generateDbId()
{
String dbId = ""; Random ran = new Random();
for (int i = 0; i < 10; i++)
{
dbId += ran.Next(10);
}
this.dbID = dbId;
return dbId;
}
public DatabaseCreateResult parseFile(int personCount)
{
DatabaseCreateResult result = new DatabaseCreateResult();
try
{
StreamReader sr = new StreamReader(File.OpenRead(this.filePath));
String tmp = sr.ReadToEnd(); String id;
id = tmp.Substring(tmp.IndexOf("CREATE DATABASE `") + "CREATE DATABASE `".Length, 10);
tmp = tmp.Replace(id, this.dbID);
// Build insert querys
// Person
String queryStr = "INSERT INTO `person` (`Oid`, `BankAccountOid`, `AddressOid`, `Tid`, `FirstName`, `LastName`, `DateOfBirth`, `Sex`, `FamilyStatus`, `Profession`, `Type`, `Notice`, `InsTs`, `InsUser`, `Version`, `UdpUser`, `IsActive`, `SystemEntryID`) VALUES ";
for (int i = 1; i <= personCount; i++)
{
if (i != 1)
queryStr += ", ";
queryStr += "("+ i + ",NULL,NULL,1,'Mitarbeiter','" + i + "',NULL,0,NULL,NULL,1,NULL,NULL,'beyondSoft GmbH',1,'beyondSoft GmbH',1,NULL)";
}
queryStr += ";COMMIT;\r\n";
// employee
queryStr += "INSERT INTO `employee` (`Oid`, `PersonOid`, `ApplicationUserOid`, `Tid`, `PersonnelNumber`, `TaxNumber`, `HealthInsurance`, `InsuranceNumber`, `HourlyRate`, `EntryDate`, `CancellationPeriod`, `ProbationPeriod`, `Sequence`, `IsActive`, `Notice`, `InsTs`, `InsUser`, `Version`, `UdpUser`, `SystemEntryID`, `weeklyfls`, `weeklytotalhours`, `leavedays`) VALUES ";
for (int i = 1; i <= personCount; i++)
{
if (i != 1)
queryStr += ", ";
queryStr += "(" + i + ", " + i + ",NULL,2,'" + i + "',NULL,NULL,NULL,NULL,NULL,0,0,NULL,1,NULL,NULL,'beyondSoft GmbH',1,'beyondSoft GmbH',NULL,NULL,NULL,NULL)";
}
queryStr += "; COMMIT;\r\n";
//applicationuser
queryStr += "INSERT INTO `applicationuser` (`Oid`, `EmployeeOid`, `Tid`, `LoginName`, `Password`, `Notice`, `Version`, `UdpUser`, `InsUser`, `InsTs`, `IsActive`, `SystemEntryID`) VALUES ";
for (int i = 1; i <= personCount; i++)
{
if (i != 1)
queryStr += ", ";
queryStr += "("+i+","+i+",28,'m" + i + "','18-14-1D-42-74-94-E6-74-4F-F2-65-A4-AE-07-66-CB',NULL,1,'beyondSoft GmbH','beyondSoft GmbH',NULL,1,NULL)";
}
queryStr += "; COMMIT;\r\n";
//ingroup
queryStr += "INSERT INTO `ingroup` (`UserGroupOid`, `ApplicationUserOid`) VALUES ";
for (int i = 1; i <= personCount; i++)
{
if (i != 1)
queryStr += ", ";
if (i == 1)
queryStr += "(1,1)";
else
queryStr += "(2," + i + ")";
}
queryStr += "; COMMIT;\r\n";
tmp = tmp + "\r\n\r\n" + queryStr;
result.Success = true;
result.SuccessString = tmp;
result.dbID = this.dbID;
}
catch
{
result.ErrorMsg = "Konnte die Datei " + this.filePath + " nicht öffnen";
result.Success = false;
}
return result;
}
}
public class DatabaseCreateResult
{
private String successString;
private String errorMsg;
private bool success;
private String databaseID;
public bool Success { get { return this.success; } set { this.success = value; } }
public String ErrorMsg { get { return this.errorMsg; } set { this.errorMsg = value; } }
public String SuccessString { get { return this.successString; } set { this.successString = value; } }
public String dbID { get { return this.databaseID; } set { this.databaseID = value; } }
}
}

View File

@@ -0,0 +1,21 @@
<Window x:Class="BeWoAdmin.DbCreationWnd"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:controls="clr-namespace:DBToolControls;assembly=DBToolControls"
Title="DatenbankID" Height="150" MinHeight="100" Width="370" MinWidth="200" WindowStyle="None" Background="Transparent"
AllowsTransparency="True" WindowStartupLocation="CenterOwner" ShowInTaskbar="False" >
<Border BorderBrush="LightGray" BorderThickness="1" CornerRadius="5" Background="WhiteSmoke" SnapsToDevicePixels="True" MouseLeftButtonDown="startDrag">
<Grid>
<TextBlock Height="29" Margin="20,7,0,0" VerticalAlignment="Top">Kundename</TextBlock>
<TextBox Name="customerName" Margin="21,27,0,0" Height="20" VerticalAlignment="Top" Width="150" HorizontalAlignment="Left"></TextBox>
<TextBlock Height="29" Margin="20,47,0,0" VerticalAlignment="Top">DatenbankID: </TextBlock>
<TextBox Name="DbID" Margin="21,66,129,0" Height="20" Width="150" HorizontalAlignment="Left" VerticalAlignment="Top"></TextBox>
<TextBlock Margin="20,89,156,32" Height="29" VerticalAlignment="Top">Anzahl der Lizenzen</TextBlock>
<TextBox Name="PersCount" Height="20" VerticalAlignment="Top" Margin="21,105,0,23" HorizontalAlignment="Left" Width="61"></TextBox>
<TextBlock Name="stateMsg" HorizontalAlignment="Right" Height="60" Width="117" TextWrapping="Wrap" VerticalAlignment="Top" Margin="0,20,6,26"></TextBlock>
<Button Width="80" Name="saveBtn" HorizontalAlignment="Right" Click="saveBtn_Click" Height="20" VerticalAlignment="Bottom" Margin="0,0,0,6">Speichern</Button>
<Button Width="80" Name="cnclBtn" Click="cnclBtn_Click" Margin="0,0,86,6" Height="20" VerticalAlignment="Bottom" HorizontalAlignment="Right">Abbrechen</Button>
<Button Width="80" Name="regenerateBtn" Click="regenerateBtn_Click" VerticalAlignment="Top" Margin="0,60,40,26" HorizontalAlignment="Right">ID generieren</Button>
</Grid>
</Border>
</Window>

View File

@@ -0,0 +1,302 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using MySql.Data.MySqlClient;
using DBToolControls;
using BeWoAdmin.DBAdminService;
using System.Threading;
using System.Windows.Threading;
namespace BeWoAdmin
{
/// <summary>
/// Interaktionslogik für DbCreationWnd.xaml
/// </summary>
public partial class DbCreationWnd : Window
{
private Window1 parent;
public String DbId { get; set; }
public String CustomerName { get; set; }
public String PersonCount { get; set; }
private bool btnLock = true;
private Server selectedServer;
private DatabaseCreation dbCr = null;
private String sqlFile;
public Server SelectedServer
{
get { return this.selectedServer; }
set { this.selectedServer = value; }
}
private User user;
public User setUser
{
set { this.user = value; }
}
public bool DbCreationWndResult { get; set; }
public static readonly string TransportEncryptionKey = @"b7困!#vS?難\n.어u";
public void setData(Server serv, User user, String path)
{
this.selectedServer = serv;
this.user = user;
this.sqlFile = path;
this.dbCr = new DatabaseCreation(path, this.parent);
this.DbId = dbCr.generateDbId() ;
this.DbID.Text = DbId;
this.setCheckField();
this.DbID.TextChanged += new TextChangedEventHandler(DbID_TextChanged);
this.DbID.KeyDown += new KeyEventHandler(DbID_KeyDown);
this.PersCount.TextChanged += new TextChangedEventHandler(PersCount_TextChanged);
this.PersCount.KeyDown += new KeyEventHandler(PersCount_KeyDown);
}
public DbCreationWnd(Window1 parent)
{
InitializeComponent();
this.parent = parent;
this.Owner = parent;
}
private void DbID_KeyDown(object sender, KeyEventArgs e)
{
String tmp;
tmp = this.DbID.Text;
if(((((int) e.Key) <= 43 && ((int) e.Key) >= 34) || (((int) e.Key) <= 83 && ((int) e.Key) >= 74)) && e.Key != Key.Space)
{
if (this.DbID.Text.Length >= 10)
e.Handled = true;
} else
{
e.Handled = true;
}
}
private void DbID_TextChanged(object sender, TextChangedEventArgs e)
{
this.DbId = this.DbID.Text;
if (this.DbId.Length == 10)
setCheckField();
else
printStateInfo("ID muss aus genau 10 Zahlen bestehen", 0);
}
private void PersCount_KeyDown(object sender, KeyEventArgs e)
{
String tmp;
tmp = this.PersCount.Text;
if (((((int)e.Key) <= 43 && ((int)e.Key) >= 34) || (((int)e.Key) <= 83 && ((int)e.Key) >= 74)) && e.Key != Key.Space)
{
}
else
{
e.Handled = true;
}
}
private void PersCount_TextChanged(object sender, TextChangedEventArgs e)
{
this.PersonCount = this.PersCount.Text;
}
private void regenerateBtn_Click(object sender, RoutedEventArgs e)
{
do
{
this.DbId = this.dbCr.generateDbId();
}
while (this.checkDatabaseId() == false);
this.DbID.Text = this.DbId;
}
private void setCheckField()
{
if (checkDatabaseId() == false)
{
this.printStateInfo("DatenbankID bereits vorhanden", 0);
this.btnLock = true;
}
else if (checkDatabaseId() == true)
{
this.printStateInfo("DatenbankID nicht vorhanden", 1);
this.btnLock = false;
}
else
{
DbCreationWndResult = false;
this.parent.showWnd = false;
this.Close();
}
}
private void printStateInfo(String msg, int state)
{
SolidColorBrush brush;
switch (state)
{
case 0:
brush = new SolidColorBrush();
brush.Color = Color.FromRgb(0xef, 0x00, 0x00);
this.stateMsg.Foreground = brush;
this.stateMsg.Text = msg;
break;
case 1:
brush = new SolidColorBrush();
brush.Color = Color.FromRgb(0x00, 0xaf, 0x00);
this.stateMsg.Foreground = brush;
this.stateMsg.Text = msg;
this.btnLock = false;
break;
case 2:
brush = new SolidColorBrush();
brush.Color = Color.FromRgb(0xcf, 0xcf, 0);
this.stateMsg.Foreground = brush;
this.stateMsg.Text = msg;
break;
}
}
private void saveBtn_Click(object sender, RoutedEventArgs e)
{
if (this.btnLock == false)
{
try
{
if (Convert.ToInt32(this.PersonCount) > 0)
{
if (checkDatabaseId() == true)
{
this.printStateInfo("Lese SQL-Script...", 2);
this.dbCr.dbID = this.DbId;
if (!String.IsNullOrEmpty(this.customerName.Text))
{
this.CustomerName = this.customerName.Text;
}
else
{
this.CustomerName = this.DbId;
}
DatabaseCreateResult result = this.dbCr.parseFile(Convert.ToInt32(this.PersCount.Text));
// Debug : throw new Exception();
if (result.Success)
{
this.printStateInfo("SQL-Script wird ausgeführt...", 2);
try
{
MySqlService dbService = new MySqlService();
dbService.Url = this.selectedServer.Uri.AbsoluteUri;
DBAdminServiceReturnValue ret = dbService.createDatabase(Encrypt(this.user.Username), Encrypt(this.user.PasswordAsInsecureString), Encrypt(this.selectedServer.Port), Encrypt(result.SuccessString), Encrypt(this.CustomerName));
if (ret.WasSuccessful)
{
this.DbCreationWndResult = true;
this.Close();
}
else
{
this.DbCreationWndResult = false;
this.parent.showErrorWnd(ret.ErrorMessage);
this.Close();
}
}
catch (Exception ee)
{
this.parent.showErrorWnd(ee.Message);
}
}
else
{
this.parent.showErrorWnd(result.ErrorMsg);
}
}
}
else
{
this.parent.showErrorWnd("Mindestens eine Lizenz muss vorhanden sein");
}
} catch
{
this.parent.showErrorWnd("Konnte " + this.PersCount.Text + " nicht in Integer konvertieren");
this.DbCreationWndResult = false;
}
}
}
private void cnclBtn_Click(object sender, RoutedEventArgs e)
{
this.DbCreationWndResult = false;
this.Close();
}
private bool? checkDatabaseId()
{
Uri SUri = this.selectedServer.Uri;
if (SUri.IsAbsoluteUri)
{
try
{
MySqlService dbService = new MySqlService();
dbService.Url = SUri.AbsoluteUri;
String[] list = dbService.GetDatabaseList(Encrypt(this.user.Username), Encrypt(this.user.PasswordAsInsecureString), Encrypt(this.selectedServer.Port));
for (int i = 0; i < list.Length; i++)
{
if (this.DbId.Equals(list[i]))
return false;
}
}
catch (Exception e)
{
this.parent.showErrorWnd("Konnte keine Verbindung zum Server " + SUri.AbsoluteUri + " aufbauen");
return null;
}
}
return true;
}
private string Encrypt(string s)
{
return EncryptionHelper.EncryptString(TransportEncryptionKey, s);
}
private string Decrypt(string s)
{
return EncryptionHelper.DecryptString(TransportEncryptionKey, s);
}
private void startDrag(object sender, MouseButtonEventArgs e)
{
this.DragMove();
}
}
}

View File

@@ -0,0 +1,23 @@
<Window x:Class="BeWoAdmin.ExtndLicnsWnd"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:controls="clr-namespace:DBToolControls;assembly=DBToolControls"
Title="SQL-Befehl eingeben" Height="60" MinHeight="60" Width="400" MinWidth="400" WindowStyle="None" Background="Transparent"
AllowsTransparency="True" WindowStartupLocation="CenterOwner" ShowInTaskbar="False" >
<Border BorderBrush="LightGray" BorderThickness="1" CornerRadius="5" Background="WhiteSmoke" SnapsToDevicePixels="True" MouseLeftButtonDown="StartDrag">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="90" />
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Width="110" Grid.Row="0" Height="20" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="10,10,0,0">Lizenzen hinzufügen</TextBlock>
<TextBox Name="licnsCount" Grid.Column="1" Grid.Row="0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="100" Margin="10,10,0,0"></TextBox>
<Button Name="chngBtn" Grid.Column="2" Grid.Row="1" VerticalAlignment="Bottom" HorizontalAlignment="Right" Height="20" Width="80" Click="chngBtn_Click" Margin="0,0,10,10">Hinzufügen</Button>
<Button Name="cnclBtn" Grid.Column="1" Grid.Row="1" VerticalAlignment="Bottom" HorizontalAlignment="Right" Height="20" Width="80" Click="cnclBtn_Click" Margin="0,0,10,10">Abbrechen</Button>
</Grid>
</Border>
</Window>

View File

@@ -0,0 +1,157 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Collections;
namespace BeWoAdmin
{
/// <summary>
/// Interaktionslogik für ExtndLicnsWnd.xaml
/// </summary>
public partial class ExtndLicnsWnd : Window
{
private Tenant selectedTenant;
private Window1 parent;
private String extLicenses = null;
private bool bntEnable = false;
public ExtndLicnsWnd(Tenant t, Window1 parent)
{
InitializeComponent();
this.Owner = parent;
this.selectedTenant = t;
this.parent = parent;
this.licnsCount.KeyDown += new KeyEventHandler(licnsCount_KeyDown);
this.licnsCount.TextChanged += new TextChangedEventHandler(licnsCount_TextChanged);
}
void licnsCount_TextChanged(object sender, TextChangedEventArgs e)
{
this.extLicenses = this.licnsCount.Text;
this.bntEnable = true;
}
void licnsCount_KeyDown(object sender, KeyEventArgs e)
{
if (((((int)e.Key) <= 43 && ((int)e.Key) >= 34) || (((int)e.Key) <= 83 && ((int)e.Key) >= 74)) && e.Key != Key.Space)
{
}
else
{
e.Handled = true;
}
}
private void StartDrag(object sender, MouseButtonEventArgs e)
{
this.DragMove();
}
private void chngBtn_Click(object sender, RoutedEventArgs e)
{
int licenses;
if (this.bntEnable)
{
try
{
if (this.extLicenses.Length > 0 && (licenses = Convert.ToInt32(this.extLicenses)) > 0)
{
// gets last 'Oid' in 'person'
List<String> ret = this.selectedTenant.ExecuteHiddenSqlCommand("SELECT Oid FROM person ORDER BY Oid DESC LIMIT 1");
String tmp; int oid;
if (ret != null)
{
tmp = ret.ElementAt(0);
try
{
oid = Convert.ToInt32(tmp);
oid += 1;
// Building the query
String queryStr = "INSERT INTO `person` (`Oid`, `BankAccountOid`, `AddressOid`, `Tid`, `FirstName`, `LastName`, `DateOfBirth`, `Sex`, `FamilyStatus`, `Profession`, `Type`, `Notice`, `InsTs`, `InsUser`, `Version`, `UdpUser`, `IsActive`, `SystemEntryID`) VALUES ";
for (int i = oid; i < (oid + licenses); i++)
{
if (i != oid)
queryStr += ", ";
queryStr += "(" + i + ",NULL,NULL,1,'Mitarbeiter','" + i + "',NULL,0,NULL,NULL,1,NULL,NULL,'beyondSoft GmbH',1,'beyondSoft GmbH',1,NULL)";
}
queryStr += ";COMMIT;\r\n";
// employee
queryStr += "INSERT INTO `employee` (`Oid`, `PersonOid`, `ApplicationUserOid`, `Tid`, `PersonnelNumber`, `TaxNumber`, `HealthInsurance`, `InsuranceNumber`, `HourlyRate`, `EntryDate`, `CancellationPeriod`, `ProbationPeriod`, `Sequence`, `IsActive`, `Notice`, `InsTs`, `InsUser`, `Version`, `UdpUser`, `SystemEntryID`, `weeklyfls`, `weeklytotalhours`, `leavedays`) VALUES ";
for (int i = oid; i < (oid + licenses); i++)
{
if (i != oid)
queryStr += ", ";
queryStr += "(" + i + ", " + i + ",NULL,2,'" + i + "',NULL,NULL,NULL,NULL,NULL,0,0,NULL,1,NULL,NULL,'beyondSoft GmbH',1,'beyondSoft GmbH',NULL,NULL,NULL,NULL)";
}
queryStr += "; COMMIT;\r\n";
//applicationuser
queryStr += "INSERT INTO `applicationuser` (`Oid`, `EmployeeOid`, `Tid`, `LoginName`, `Password`, `Notice`, `Version`, `UdpUser`, `InsUser`, `InsTs`, `IsActive`, `SystemEntryID`) VALUES ";
for (int i = oid; i < (oid + licenses); i++)
{
if (i != oid)
queryStr += ", ";
queryStr += "(" + i + "," + i + ",28,'m" + i + "','18-14-1D-42-74-94-E6-74-4F-F2-65-A4-AE-07-66-CB',NULL,1,'beyondSoft GmbH','beyondSoft GmbH',NULL,1,NULL)";
}
queryStr += "; COMMIT;\r\n";
//ingroup
queryStr += "INSERT INTO `ingroup` (`UserGroupOid`, `ApplicationUserOid`) VALUES ";
for (int i = oid; i < (oid + licenses); i++)
{
if (i != oid)
queryStr += ", ";
if (i == 1)
queryStr += "(1,1)";
else
queryStr += "(2," + i + ")";
}
queryStr += "; COMMIT;\r\n";
this.selectedTenant.ExecuteSqlCommand(queryStr);
this.parent.showSuccessWnd(licenses + " Lizenzen wurden erfolgreich der Datenbank hinzugefügt");
this.Close();
}
catch (Exception ex)
{
parent.showErrorWnd("Fehler beim konvertieren der Oid: " + ex.Message);
this.Close();
}
}
else
{
this.parent.showErrorWnd("Bei einer Datenbankabrake ist ein Fehler aufgetreten");
this.Close();
}
}
else
{
this.parent.showErrorWnd("Die Anzahl der zuzufügenden Lizenzen muss größer als 0 sein");
}
}
catch
{
this.parent.showErrorWnd("Ungültiges Zeichen in der Eingabe");
}
}
}
private void cnclBtn_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
}
}

Binary file not shown.

View File

@@ -0,0 +1,36 @@
<Window x:Class="BeWoAdmin.PasswordInput"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" ShowInTaskbar="False"
Title="Passworteingabe" SizeToContent="WidthAndHeight" WindowStyle="None" Background="Transparent" AllowsTransparency="True" WindowStartupLocation="CenterOwner">
<Border BorderBrush="LightGray" BorderThickness="1" CornerRadius="5" Background="WhiteSmoke" SnapsToDevicePixels="True" MouseLeftButtonDown="StartDrag">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Grid.ColumnSpan="2" Margin="15 15 15 5">Bitte Passwort eingeben oder Feld leer lassen um nicht zu ver-/entschlüsseln:</TextBlock>
<PasswordBox Grid.Row="1" Grid.ColumnSpan="2" Margin="15 5 15 5" MinWidth="200" Name="PWBox" PasswordChanged="PWBox_PasswordChanged" />
<StackPanel Grid.Row="2" VerticalAlignment="Center" Orientation="Horizontal" Margin="10 5 5 15">
<Ellipse Width="10" Height="10" Stroke="Black" Name="PasswordStrengthLED" Margin="5">
<Ellipse.Fill>
<RadialGradientBrush GradientOrigin="0.35,0.35" RadiusX="1.5" RadiusY="1.3">
<RadialGradientBrush.GradientStops>
<GradientStop x:Name="OuterColor" Color="Black" Offset="0.5" />
<GradientStop Color="White" Offset="0" />
</RadialGradientBrush.GradientStops>
</RadialGradientBrush>
</Ellipse.Fill>
</Ellipse>
<TextBlock Name="PasswordStrengthTextBlock" VerticalAlignment="Center">Passwortstärke: -</TextBlock>
</StackPanel>
<StackPanel Grid.Row="2" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal" Margin="5 5 15 15">
<Button MinWidth="80" Padding="3 1 3 1" IsDefault="True" Click="OKButton_Click">OK</Button>
<Button MinWidth="80" Padding="3 1 3 1" IsCancel="True" Margin="5 0 0 0">Abbrechen</Button>
</StackPanel>
</Grid>
</Border>
</Window>

View File

@@ -0,0 +1,80 @@
using System;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace BeWoAdmin {
/// <summary>
/// Interaktionslogik für PasswordInput.xaml
/// </summary>
public partial class PasswordInput : Window {
public string Password { get; private set; }
public PasswordInput(Window owner) {
InitializeComponent();
this.Owner = owner;
PWBox.Focus();
}
private void OKButton_Click(object sender, RoutedEventArgs e) {
this.Password = PWBox.Password;
this.DialogResult = true;
Close();
}
private void StartDrag(object sender, MouseButtonEventArgs e) {
this.DragMove();
}
private void PWBox_PasswordChanged(object sender, RoutedEventArgs e) {
PasswordStrength strength = EvaluatePasswordStrength((sender as PasswordBox).Password);
PasswordStrengthTextBlock.Text = String.Format("Passwortstärke: {0}", strength.Text);
OuterColor.Color = strength.Color;
}
private class PasswordStrength {
public string Text { get; set; }
public Color Color { get; set; }
private PasswordStrength() { }
public static PasswordStrength None = new PasswordStrength { Text = "-", Color = Colors.Black };
public static PasswordStrength VeryWeak = new PasswordStrength { Text = "sehr schwach", Color = Colors.Crimson };
public static PasswordStrength Weak = new PasswordStrength { Text = "schwach", Color = Colors.OrangeRed };
public static PasswordStrength Average = new PasswordStrength { Text = "mittel", Color = Colors.Gold };
public static PasswordStrength Strong = new PasswordStrength { Text = "stark", Color = Colors.LawnGreen };
public static PasswordStrength VeryStrong = new PasswordStrength { Text = "sehr stark", Color = Colors.LimeGreen };
}
private static PasswordStrength EvaluatePasswordStrength(string pw) {
if (pw.Length == 0) return PasswordStrength.None;
int lowerChars = 0, upperChars = 0, numbers = 0, other = 0, typesOfChars;
foreach (char c in pw.ToCharArray()) {
if (c >= 'A' && c <= 'Z') upperChars = 1;
else if ((c >= 'a' && c <= 'z') || c == ' ') lowerChars = 1;
else if (c >= '0' && c <= '9') numbers = 1;
else other = 1;
}
typesOfChars = lowerChars + upperChars + numbers + other;
if (pw.Length >= 15 && typesOfChars > 3) return PasswordStrength.VeryStrong;
if (pw.Length >= 10 && typesOfChars > 2) return PasswordStrength.Strong;
if (pw.Length >= 8 && typesOfChars > 1) return PasswordStrength.Average;
if (pw.Length >= 5 ) return PasswordStrength.Weak;
return PasswordStrength.VeryWeak;
}
public static string RequestPassword(Window owner) {
PasswordInput pw = new PasswordInput(owner);
bool? successful = pw.ShowDialog();
if (successful == true) return pw.Password;
else return null;
}
}
}

View File

@@ -0,0 +1,55 @@
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// Allgemeine Informationen über eine Assembly werden über die folgenden
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
// die mit einer Assembly verknüpft sind.
[assembly: AssemblyTitle("BeWoAdmin")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Beyondsoft ")]
[assembly: AssemblyProduct("BeWoAdmin")]
[assembly: AssemblyCopyright("Copyright © Beyondsoft 2008-2010")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar
// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von
// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest.
[assembly: ComVisible(false)]
//Um mit dem Erstellen lokalisierbarer Anwendungen zu beginnen, legen Sie
//<UICulture>ImCodeVerwendeteKultur</UICulture> in der .csproj-Datei
//in einer <PropertyGroup> fest. Wenn Sie in den Quelldateien beispielsweise Deutsch
//(Deutschland) verwenden, legen Sie <UICulture> auf \"de-DE\" fest. Heben Sie dann die Auskommentierung
//des nachstehenden NeutralResourceLanguage-Attributs auf. Aktualisieren Sie "en-US" in der nachstehenden Zeile,
//sodass es mit der UICulture-Einstellung in der Projektdatei übereinstimmt.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //Speicherort der designspezifischen Ressourcenwörterbücher
//(wird verwendet, wenn eine Ressource auf der Seite
// oder in den Anwendungsressourcen-Wörterbüchern nicht gefunden werden kann.)
ResourceDictionaryLocation.SourceAssembly //Speicherort des generischen Ressourcenwörterbuchs
//(wird verwendet, wenn eine Ressource auf der Seite, in der Anwendung oder einem
// designspezifischen Ressourcenwörterbuch nicht gefunden werden kann.)
)]
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
//
// Hauptversion
// Nebenversion
// Buildnummer
// Revision
//
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.3.0.0")]
[assembly: AssemblyFileVersion("1.3.0.0")]

View File

@@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Dieser Code wurde von einem Tool generiert.
// Laufzeitversion:4.0.30319.17929
//
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
// der Code erneut generiert wird.
// </auto-generated>
//------------------------------------------------------------------------------
namespace BeWoAdmin.Properties {
using System;
/// <summary>
/// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
/// </summary>
// Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
// -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
// Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
// mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("BeWoAdmin.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
/// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

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,46 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Dieser Code wurde von einem Tool generiert.
// Laufzeitversion:4.0.30319.17929
//
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
// der Code erneut generiert wird.
// </auto-generated>
//------------------------------------------------------------------------------
namespace BeWoAdmin.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.WebServiceUrl)]
[global::System.Configuration.DefaultSettingValueAttribute("http://localhost:2100/MySqlService.asmx")]
public string BeWoAdmin_DBAdminService_MySqlService {
get {
return ((string)(this["BeWoAdmin_DBAdminService_MySqlService"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.WebServiceUrl)]
[global::System.Configuration.DefaultSettingValueAttribute("http://localhost:1513/MySqlService.asmx")]
public string DBToolTest2_DBAdminService_MySqlService {
get {
return ((string)(this["DBToolTest2_DBAdminService_MySqlService"]));
}
}
}
}

View File

@@ -0,0 +1,12 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="BeWoAdmin.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="BeWoAdmin_DBAdminService_MySqlService" Type="(Web Service URL)" Scope="Application">
<Value Profile="(Default)">http://localhost:2100/MySqlService.asmx</Value>
</Setting>
<Setting Name="DBToolTest2_DBAdminService_MySqlService" Type="(Web Service URL)" Scope="Application">
<Value Profile="(Default)">http://localhost:1513/MySqlService.asmx</Value>
</Setting>
</Settings>
</SettingsFile>

136
BeWoAdmin/Server.cs Normal file
View File

@@ -0,0 +1,136 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Xml.Linq;
using DBToolControls;
namespace BeWoAdmin {
public class Server : INotifyPropertyChanged {
public event PropertyChangedEventHandler PropertyChanged;
private Uri uri;
private ObservableCollection<Tenant> tenants = new ObservableCollection<Tenant>();
private User user;
private String port;
public Uri Uri {
get { return uri != null ? uri : new Uri("http://localhost"); }
set {
uri = value;
NotifyPropertyChange("UriHost");
}
}
public string UriHost {
get { return uri != null ? uri.Host : null; }
}
public string Port
{
get { return port; }
set
{
port = value;
NotifyPropertyChange("Port");
}
}
public ObservableCollection<Tenant> Tenants {
get { return tenants; }
}
public User User {
get { return user; }
set {
user = value;
NotifyPropertyChange("User");
}
}
public bool? IsChecked {
get {
if(tenants.All(t => t.IsChecked)) return true;
else if(tenants.All(t => !t.IsChecked)) return false;
else return null;
}
set {
foreach (Tenant t in tenants)
t.IsChecked = value == true;
}
}
public bool HasOwnUser { get { return user != null; } }
// factories
public Tenant CreateTenant(string name, string database, User user, bool isChecked) {
return new Tenant(this, name, database, user, isChecked);
}
public Tenant CreateTenant() {
return new Tenant(this);
}
public static Server CreateFromXElement(XElement e, string key) {
Server s = new Server();
s.Uri = e.ReadUri();
s.User = e.ReadUser(key);
s.Port = e.ReadPort();
foreach (XElement xe in e.Elements("Tenant")) {
s.CreateTenant(xe.ReadString("Name"), Decrypt(xe.ReadString("Database")), xe.ReadUser(key), xe.ReadBool("IsChecked"));
}
return s;
}
// public methods
public void SortChildrenBy(Func<Tenant, object> sortKey) {
tenants = new ObservableCollection<Tenant>(Tenants.OrderBy(sortKey));
NotifyPropertyChange("Tenants");
}
public void NotifyPropertyChange(string propertyName) {
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
public XElement ToXElement(string pw) {
return new XElement("Server",
new XElement("URI", uri.AbsoluteUri),
new XElement("Port", port),
HasOwnUser ? user.ToXElement(pw) : null,
tenants.Select(t => t.ToXElement(pw)));
}
// private methods
private static string Decrypt(string s) {
return EncryptionHelper.DecryptString(App.TransportEncryptionKey, s);
}
}
// XElement Extension Methods
static class XElementExtensions {
public static Uri ReadUri(this XElement e) {
return e.Element("URI") != null ? new Uri(e.Element("URI").Value) : null;
}
public static User ReadUser(this XElement e, string encryptionKey) {
e = e.Element("User");
return e != null ? new User(e.ReadString("Username"), e.ReadString("Password"), encryptionKey) : null;
}
public static String ReadPort(this XElement e)
{
e = e.Element("Port");
return e != null ? e.Value : null;
}
public static string ReadString(this XElement e, string elementName) {
return e.Element(elementName) != null ? e.Element(elementName).Value : "";
}
public static bool ReadBool(this XElement e, string elementName) {
return e.Element(elementName) != null && e.Element(elementName).Value.ToLower() == "true";
}
}
}

View File

@@ -0,0 +1,89 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;
using System.Threading;
using System.Xml.Linq;
namespace BeWoAdmin {
delegate void ProgressCallback(int value);
delegate void ProgressFinishedCallback();
class ServerCollection : ObservableCollection<Server>{
private ProgressCallback progressCallback;
private ProgressFinishedCallback progressFinishedCallback;
private int numberOfCheckedDBs;
private int sqlExecutionProgress;
private string lastSqlCommand = "";
public bool CancelationPending { set; private get; }
public bool TestConnectionsOnly { set; private get; }
public bool ExecutionInProgress { set; get; }
public List<Tenant> AllTenants {
get { return this.SelectMany(s => s.Tenants).ToList(); }
}
public List<Tenant> CheckedTenants {
get { return AllTenants.Where(t => t.IsChecked).ToList(); }
}
public Window1 Parent { get; set; }
public string LastSqlCommand {
get { return lastSqlCommand; }
set { lastSqlCommand = value; }
}
public void SetDelegates(ProgressCallback progressCallback, ProgressFinishedCallback progressFinishedCallback) {
this.progressCallback = progressCallback;
this.progressFinishedCallback = progressFinishedCallback;
}
// SQL-Execution
public void ExecuteSqlCommandOnCheckedDatabases() {
foreach (Tenant t in AllTenants)
t.ResetErrorMessage();
numberOfCheckedDBs = CheckedTenants.Count;
sqlExecutionProgress = 0;
CancelationPending = false;
foreach (var group in CheckedTenants.GroupBy(t => t.Server.UriHost))
new Thread(ExecuteSqlCommandOnDatabases).Start(group);
}
private void ExecuteSqlCommandOnDatabases(object tenantList) {
foreach (Tenant t in tenantList as IEnumerable<Tenant>) {
if (!CancelationPending)
if (TestConnectionsOnly)
t.TestConnection();
else
{
t.parent = this.Parent;
t.ExecuteSqlCommand(LastSqlCommand);
}
Interlocked.Increment(ref sqlExecutionProgress);
progressCallback(100 * sqlExecutionProgress / numberOfCheckedDBs);
}
if (sqlExecutionProgress == numberOfCheckedDBs) {
ExecutionInProgress = false;
TestConnectionsOnly = false;
progressFinishedCallback();
}
}
// File Handling
public void SaveToXml(string filename, string pw) {
var content = this.Select(s => s.ToXElement(pw));
new XDocument(new XElement("DatabaseCollection", content)).Save(filename);
}
public void LoadFromXml(string filename, string pw) {
XDocument xdoc = XDocument.Load(filename);
this.Clear();
foreach (XElement xe in xdoc.Element("DatabaseCollection").Elements("Server")) {
this.Add(Server.CreateFromXElement(xe, pw));
}
}
}
}

View File

@@ -0,0 +1,24 @@
<Window x:Class="BeWoAdmin.SqlInputWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:controls="clr-namespace:DBToolControls;assembly=DBToolControls"
Title="SQL-Befehl eingeben" Height="300" MinHeight="100" Width="400" MinWidth="200" WindowStyle="None" Background="Transparent"
AllowsTransparency="True" ResizeMode="CanResizeWithGrip" WindowStartupLocation="CenterOwner" ShowInTaskbar="False" >
<Border BorderBrush="LightGray" BorderThickness="1" CornerRadius="5" Background="WhiteSmoke" SnapsToDevicePixels="True" MouseLeftButtonDown="StartDrag">
<Grid SnapsToDevicePixels="True" >
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Margin="6 3 5 0" Grid.ColumnSpan="3">SQL-Befehl eingeben:</TextBlock>
<controls:HighlightingRichTextBox Grid.Row="1" Grid.ColumnSpan="3" Margin="5" ScrollViewer.CanContentScroll="True" ScrollViewer.VerticalScrollBarVisibility="Visible" Name="SqlInput" AcceptsReturn="True" AcceptsTab="True" />
<Button Grid.Row="2" Grid.Column="1" Margin="5 0 0 5" Padding="4 1 4 1" MinHeight="23" MinWidth="75" Name="OKButton" Click="OKButton_Click" HorizontalAlignment="Right" IsDefault="True">OK</Button>
<Button Grid.Row="3" Grid.Column="2" Margin="5 0 5 5" Padding="4 1 4 1" MinHeight="23" MinWidth="75" Name="CancelButton" HorizontalAlignment="Right" IsCancel="True">Abbrechen</Button>
</Grid>
</Border>
</Window>

View File

@@ -0,0 +1,60 @@
using System;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using DBToolControls;
namespace BeWoAdmin {
/// <summary>
/// Interaktionslogik für SqlInputWindow.xaml
/// </summary>
public partial class SqlInputWindow : Window {
public string SqlCommand {
get { return SqlInput.Text; }
}
public SqlInputWindow(Window owner, string initialText) {
InitializeComponent();
this.Owner = owner;
AddSQLSyntaxToSqlInputBox();
SqlInput.Text = initialText;
SqlInput.Focus();
}
private void OKButton_Click(object sender, RoutedEventArgs e) {
this.DialogResult = true;
Close();
}
private void AddSQLSyntaxToSqlInputBox() {
Syntax s;
s = new Syntax(false);
s.AddWords("alter", "and", "auto_increment", "as", "asc", "by", "create", "database", "delete", "desc", "distinct", "drop",
"from", "group", "having", "in", "insert", "is", "join", "key", "left", "like", "limit", "natural",
"not", "null", "or", "order", "primary", "right", "select", "set", "table", "update", "where");
s.AddFormatting(Control.ForegroundProperty, Brushes.Blue);
s.AddFormatting(Control.FontWeightProperty, FontWeights.Bold);
SqlInput.SyntaxProvider.AddSyntax(s);
s = new Syntax(false);
s.AddWords("tinyint", "smallint", "mediumint", "int", "integer", "bigint", "float",
"double", "real", "decimal", "numeric", "date", "datetime", "timestamp",
"time", "year", "char", "varchar", "blob", "text", "enum", "set");
s.AddFormatting(Control.ForegroundProperty, Brushes.DarkRed);
s.AddFormatting(Control.FontWeightProperty, FontWeights.Medium);
SqlInput.SyntaxProvider.AddSyntax(s);
}
private void StartDrag(object sender, MouseButtonEventArgs e) {
this.DragMove();
}
}
}

View File

@@ -0,0 +1,25 @@
<Window x:Class="BeWoAdmin.SqlOutputWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:controls="clr-namespace:DBToolControls;assembly=DBToolControls"
Title="SQL-Result" Height="300" MinHeight="100" Width="400" MinWidth="200" WindowStyle="None" Background="Transparent"
AllowsTransparency="True" ResizeMode="CanResizeWithGrip" WindowStartupLocation="CenterOwner" ShowInTaskbar="False" >
<Border MouseLeftButtonDown="startDrag" BorderBrush="LightGray" BorderThickness="1" CornerRadius="5" Background="WhiteSmoke" SnapsToDevicePixels="True">
<Grid SnapsToDevicePixels="True" >
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Margin="6 3 5 0" Grid.ColumnSpan="3">SQL-Result:</TextBlock>
<TextBox Grid.Row="1" Grid.ColumnSpan="3" Margin="5" ScrollViewer.CanContentScroll="True" ScrollViewer.VerticalScrollBarVisibility="Visible" ScrollViewer.HorizontalScrollBarVisibility="Auto" Name="Sqloutput" AcceptsReturn="True" AcceptsTab="True" />
<Button Grid.Row="2" Grid.Column="1" Margin="5 0 0 5" Padding="4 1 4 1" MinHeight="23" MinWidth="75" Name="OKButton" Click="OKButton_Click" HorizontalAlignment="Right" IsDefault="True">OK</Button>
</Grid>
</Border>
</Window>

View File

@@ -0,0 +1,54 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace BeWoAdmin
{
/// <summary>
/// Interaktionslogik für SqlOutputWindow.xaml
/// </summary>
public partial class SqlOutputWindow : Window
{
Window1 parent;
public SqlOutputWindow(Window1 owner,List<String> result)
{
InitializeComponent();
this.Owner = owner;
this.Show();
for (int i = 0; i < result.Count; i++)
{
this.Sqloutput.AppendText(result.ElementAt(i).ToString() + "\n");
}
}
public void appendSqlQueries(List<String> results)
{
this.Sqloutput.AppendText("\n\n");
for (int i = 0; i < results.Count; i++)
{
this.Sqloutput.AppendText(results.ElementAt(i).ToString() + "\n");
}
}
private void OKButton_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
private void startDrag(object sender, MouseButtonEventArgs e)
{
this.DragMove();
}
}
}

246
BeWoAdmin/Tenant.cs Normal file
View File

@@ -0,0 +1,246 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Collections.ObjectModel;
using DBToolControls;
using BeWoAdmin.DBAdminService;
using System.Xml.Linq;
using System.Diagnostics;
namespace BeWoAdmin {
public class Tenant: INotifyPropertyChanged {
public event PropertyChangedEventHandler PropertyChanged;
private string name;
public string Name {
get { return name; }
set { name = value; NotifyPropertyChange("Name"); }
}
private string database;
public string Database {
get { return database; }
set { database = value; NotifyPropertyChange("Database"); }
}
private User user;
public User User {
get { return HasOwnUser ? user : Server.User; }
set {
user = value;
NotifyPropertyChange("User");
NotifyPropertyChange("HasOwnUser");
}
}
public Window1 parent { get; set; }
private bool isChecked;
public bool IsChecked {
get { return isChecked; }
set {
isChecked = value;
NotifyPropertyChange("IsChecked");
Server.NotifyPropertyChange("IsChecked");
}
}
private List<String> queryAnswer;
public List<String> GetQueryAnswer
{
get { return this.queryAnswer; }
set { this.queryAnswer = value; }
}
public Server Server { get; private set; }
public bool? WasSuccessful { get; set; }
public string ErrorDescription { get; set; }
public Uri SUri {
get { return Server.Uri ; }
}
public int Index {
get { return this.AndSiblings.IndexOf(this); }
}
public ObservableCollection<Tenant> AndSiblings {
get { return Server.Tenants; }
}
public bool HasOwnUser {
get { return user != null; }
}
// Constructors
public Tenant(Server server) {
this.Server = server;
this.IsChecked = server.IsChecked == true;
server.Tenants.Add(this);
}
public Tenant(Server server, string name, string database, User user, bool isChecked) {
this.Server = server;
this.Name = name;
this.Database = database;
this.User = user;
this.IsChecked = isChecked;
server.Tenants.Add(this);
}
// public methods
public bool IsSibling(Tenant t) {
return this.Server == t.Server;
}
public List<String> ExecuteSqlCommand(string sqlCommand) {
return ExecuteRemoteCall(RemoteMethods.ExecuteUpdateOnDatabase, sqlCommand, "SQL-Befehl wird ausgeführt...");
}
public List<String> ExecuteHiddenSqlCommand(string sqlCommand)
{
return ExecuteRemoteCall(RemoteMethods.ExecuteHiddenUpdateOnDatabase, sqlCommand, "SQL-Befehl wird ausgeführt...");
}
public void TestConnection() {
ExecuteRemoteCall(RemoteMethods.DatabaseIsReachable, null, "teste Verbindung...");
}
public List<string> GetTables() {
return ExecuteRemoteCall(RemoteMethods.GetTables, null, "lese Tabellen...");
}
public void Move(int offset) {
if (offset != 0) {
int oldIndex = this.Index;
int newIndex = oldIndex + offset;
if (offset < 0) {
if (oldIndex == 0) return;
if (newIndex < 0) newIndex = 0;
} else {
int maxIndex = this.AndSiblings.Count - 1;
if (oldIndex == maxIndex) return;
if (newIndex > maxIndex) newIndex = maxIndex;
}
this.AndSiblings.Move(oldIndex, newIndex);
Server.NotifyPropertyChange("Tenants");
}
}
public void NotifyPropertyChange(string propertyName) {
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
public bool Remove() {
Server.NotifyPropertyChange("IsChecked");
return this.AndSiblings.Remove(this);
}
public void ResetErrorMessage() {
SetSuccess(null, "");
}
public XElement ToXElement(string pw) {
return new XElement("Tenant",
new XElement("Name", name),
new XElement("Database", Encrypt(database)),
new XElement("IsChecked", isChecked.ToString()),
HasOwnUser ? user.ToXElement(pw) : null);
}
public override string ToString() {
return String.Format("{0} {1}, User: {2}", name, database, HasOwnUser ? user.Username : "");
}
// private methods
private enum RemoteMethods { DatabaseIsReachable, ExecuteUpdateOnDatabase, GetTables, ExecuteHiddenUpdateOnDatabase }
private List<string> ExecuteRemoteCall(RemoteMethods method, string sqlCommand, string busyText) {
List<string> returnCollection = new List<string>();
SetSuccess(null, busyText);
if (SUri.IsAbsoluteUri) {
try {
DBAdminServiceReturnValue result;
MySqlService dbService = new MySqlService();
dbService.Url = SUri.AbsoluteUri;
if (method == RemoteMethods.DatabaseIsReachable)
result = dbService.DatabaseIsReachable(Encrypt(User.Username), Encrypt(User.PasswordAsInsecureString), Encrypt(Database), Encrypt(Server.Port));
else if (method == RemoteMethods.ExecuteUpdateOnDatabase)
{
result = dbService.ExecuteUpdateOnDatabase(Encrypt(User.Username), Encrypt(User.PasswordAsInsecureString), Encrypt(Server.Port), Encrypt(Database), Encrypt(sqlCommand));
this.queryAnswer = new List<string>();
this.queryAnswer.Add("Serverantwort von " + this.Server.Uri.Host + " Datenbank " + this.Name + ":\n");
for (int i = 0; i < result.QueryAnswer.Length; i++)
{
this.queryAnswer.Add(result.QueryAnswer.ElementAt(i) + " ");
}
if(this.queryAnswer.Count > 1)
this.parent.showQueryAnswer(this.queryAnswer);
}
else if (method == RemoteMethods.ExecuteHiddenUpdateOnDatabase)
{
result = dbService.ExecuteHiddenUpdateOnDatabase(Encrypt(User.Username), Encrypt(User.PasswordAsInsecureString), Encrypt(Database), Encrypt(Server.Port), Encrypt(sqlCommand));
this.queryAnswer = null;
if (result.WasSuccessful)
{
this.queryAnswer = new List<string>();
for (int i = 0; i < result.QueryAnswer.Length; i++)
{
this.queryAnswer.Add(result.QueryAnswer.ElementAt(i) + " ");
}
}
returnCollection = this.queryAnswer;
}
else
{ // method == RemoteMethods.GetTables
foreach (string s in dbService.GetTables(Encrypt(User.Username), Encrypt(User.PasswordAsInsecureString), Encrypt(Database), Encrypt(Server.Port)))
returnCollection.Add(Decrypt(s));
if (returnCollection.Count > 0 && returnCollection[0].StartsWith("Auslesen der Tabellen fehlgeschlagen."))
SetSuccess(false, returnCollection[0]);
else
SetSuccess(true, "");
return returnCollection;
}
if (result.WasSuccessful)
{
SetSuccess(true, "");
}
else
SetSuccess(false, String.Format("Verbindung fehlgeschlagen: {0}", Decrypt(result.ErrorMessage)));
} catch (Exception e) {
SetSuccess(false, String.Format("Verbindung fehlgeschlagen: {0} ({1})", e.Message, e.GetType().ToString()));
returnCollection.Add(ErrorDescription);
}
} else {
SetSuccess(false, "Verbindung fehlgeschlagen: Die Uri ist keine absolute Uri.");
}
return returnCollection;
}
private void SetSuccess(bool? success, string errorDesc) {
WasSuccessful = success;
ErrorDescription = errorDesc;
NotifyPropertyChange("WasSuccessful");
NotifyPropertyChange("ErrorDescription");
// New Window declaration
}
private static string Encrypt(string s) {
return EncryptionHelper.EncryptString(App.TransportEncryptionKey, s);
}
private static string Decrypt(string s) {
return EncryptionHelper.DecryptString(App.TransportEncryptionKey, s);
}
}
}

View File

@@ -0,0 +1,18 @@
using System;
using System.Linq;
using System.Text;
using System.Windows.Media;
using System.Windows.Data;
namespace BeWoAdmin {
[ValueConversion(typeof(bool), typeof(Brush))]
class BackgroundValueConverter : IValueConverter {
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
return (bool)value ? Brushes.White : new SolidColorBrush(Color.FromRgb(222, 222, 222));
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
throw new NotSupportedException();
}
}
}

View File

@@ -0,0 +1,19 @@
using System;
using System.Linq;
using System.Text;
using System.Windows.Media;
using System.Windows.Data;
using System.Windows;
namespace BeWoAdmin {
[ValueConversion(typeof(bool), typeof(Visibility))]
class CollapsedIfFalseValueConverter : IValueConverter {
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
return (bool)value ? Visibility.Visible : Visibility.Collapsed;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
throw new NotSupportedException();
}
}
}

View File

@@ -0,0 +1,45 @@
using System;
using System.Text;
using System.Windows.Input;
namespace BeWoAdmin {
public sealed class CustomCommands {
private CustomCommands() { }
private static RoutedUICommand addServer = new RoutedUICommand("Add Server", "AddServer", typeof(CustomCommands));
private static RoutedUICommand addDatabase = new RoutedUICommand("Add Database", "AddDatabase", typeof(CustomCommands));
private static RoutedUICommand removeDatabase = new RoutedUICommand("Remove Database", "RemoveDatabase", typeof(CustomCommands));
private static RoutedUICommand createDatabase = new RoutedUICommand("Create Database", "CreateDatabase", typeof(CustomCommands));
private static RoutedUICommand executeSqlOnCheckedDBs = new RoutedUICommand("Execute SQL-Command on checked Databases", "ExecuteSql", typeof(CustomCommands));
private static RoutedUICommand executeSqlOnSingleDB = new RoutedUICommand("Execute SQL-Command on this Database", "ExecuteSqlOnSingleDB", typeof(CustomCommands));
private static RoutedUICommand cancelExecution = new RoutedUICommand("Cancel Execution", "CancelExecution", typeof(CustomCommands));
private static RoutedUICommand testConnection = new RoutedUICommand("Test Connection", "TestConnection", typeof(CustomCommands));
private static RoutedUICommand testAllConnections = new RoutedUICommand("Test all Connections", "TestAllConnections", typeof(CustomCommands));
private static RoutedUICommand showTables = new RoutedUICommand("Show Tables", "ShowTables", typeof(CustomCommands));
private static RoutedUICommand extendDBLicenses = new RoutedUICommand("Extend licenses", "ExtendDBLicenses", typeof(CustomCommands));
private static RoutedUICommand openBrowser = new RoutedUICommand("Open browser", "OpenBrowser", typeof(CustomCommands));
static CustomCommands() {
addDatabase.InputGestures.Add(new KeyGesture(Key.A, ModifierKeys.Control, "Strg+A"));
addDatabase.InputGestures.Add(new KeyGesture(Key.Add, ModifierKeys.None, "+"));
removeDatabase.InputGestures.Add(new KeyGesture(Key.Delete, ModifierKeys.None, "Entf"));
createDatabase.InputGestures.Add(new KeyGesture(Key.N, ModifierKeys.Shift | ModifierKeys.Control, "Strg+Shift+N"));
executeSqlOnCheckedDBs.InputGestures.Add(new KeyGesture(Key.R, ModifierKeys.Control, "Strg+R"));
cancelExecution.InputGestures.Add(new KeyGesture(Key.Escape, ModifierKeys.None));
testConnection.InputGestures.Add(new KeyGesture(Key.T, ModifierKeys.Control, "Strg+T"));
}
public static RoutedUICommand AddServer { get { return addServer; } }
public static RoutedUICommand AddDatabase { get { return addDatabase; } }
public static RoutedUICommand RemoveDatabase { get { return removeDatabase; } }
public static RoutedUICommand CreateDatabase { get { return createDatabase; } }
public static RoutedUICommand ExecuteSqlOnCheckedDBs { get { return executeSqlOnCheckedDBs; } }
public static RoutedUICommand ExecuteSqlOnSingleDB { get { return executeSqlOnSingleDB; } }
public static RoutedUICommand CancelExecution { get { return cancelExecution; } }
public static RoutedUICommand TestConnection { get { return testConnection; } }
public static RoutedUICommand TestAllConnections { get { return testAllConnections; } }
public static RoutedUICommand ShowTables { get { return showTables; } }
public static RoutedUICommand ExtendDBLicenses { get { return extendDBLicenses; } }
public static RoutedUICommand OpenBrowser { get { return openBrowser; } }
}
}

View File

@@ -0,0 +1,18 @@
using System;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Windows;
namespace BeWoAdmin {
[ValueConversion(typeof(bool), typeof(FontWeight))]
class FontWeightValueConverter : IValueConverter{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
return (bool)value ? FontWeights.Bold : FontWeights.Regular;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
throw new NotSupportedException();
}
}
}

View File

@@ -0,0 +1,18 @@
using System;
using System.Linq;
using System.Text;
using System.Windows.Media;
using System.Windows.Data;
namespace BeWoAdmin {
[ValueConversion(typeof(bool), typeof(Brush))]
class ForegroundValueConverter : IValueConverter {
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
return (bool)value ? Brushes.Black : Brushes.DarkGray;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
throw new NotSupportedException();
}
}
}

View File

@@ -0,0 +1,196 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:BeWoAdmin"
xmlns:grayscale="clr-namespace:GrayscaleEffect;assembly=GrayscaleEffect">
<!-- Brushes -->
<!-- Window Background Brush -->
<LinearGradientBrush x:Key="BackgroundBrush">
<LinearGradientBrush.GradientStops>
<GradientStop Color="WhiteSmoke" Offset="0" />
<GradientStop Color="White" Offset="0.5" />
<GradientStop Color="Gainsboro" Offset="1" />
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
<!-- Title Bar Background Brush -->
<LinearGradientBrush x:Key="TitleBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
<LinearGradientBrush.GradientStops>
<GradientStop Color="LightGray" Offset="0.1" />
<GradientStop Color="Transparent" Offset="1" />
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
<!-- Toolbar-Button Brushes -->
<SolidColorBrush x:Key="SelectedBackgroundBrush" Color="#607F9DD0" />
<SolidColorBrush x:Key="SelectedBorderBrush" Color="#FF7F9DB9" />
<SolidColorBrush x:Key="SelectedBackgroundBrushRed" Color="#60FF1020" />
<SolidColorBrush x:Key="SelectedBorderBrushRed" Color="#FFD02044" />
<LinearGradientBrush x:Key="PressedBorderBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#447" Offset="0.0"/>
<GradientStop Color="#88B" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="PressedBorderBrushRed" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#744" Offset="0.0"/>
<GradientStop Color="#B88" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="PressedBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#AAB" Offset="0.0"/>
<GradientStop Color="#507F9DD0" Offset="0.1"/>
<GradientStop Color="#DDE" Offset="0.9"/>
<GradientStop Color="#EEF" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="PressedBrushRed" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#BAA" Offset="0.0"/>
<GradientStop Color="#90DC143C" Offset="0.1"/>
<GradientStop Color="#FDD" Offset="0.9"/>
<GradientStop Color="#FEE" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<!-- Styles -->
<!-- ToolBar Button Style -->
<Style x:Key="ToolBarButtonStyle" TargetType="Button">
<Setter Property="SnapsToDevicePixels" Value="true"/>
<Setter Property="OverridesDefaultStyle" Value="true"/>
<Setter Property="Focusable" Value="False" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="Border" BorderThickness="1" CornerRadius="2" Background="Transparent" BorderBrush="Transparent">
<ContentPresenter x:Name="Content" Margin="2" HorizontalAlignment="Center" VerticalAlignment="Center" RecognizesAccessKey="True">
<ContentPresenter.BitmapEffect>
<OuterGlowBitmapEffect GlowColor="White" Opacity="0.5" />
</ContentPresenter.BitmapEffect>
</ContentPresenter>
</Border>
<ControlTemplate.Triggers>
<!-- Selected -->
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True"/>
<Condition Property="Background" Value="{x:Null}" />
</MultiTrigger.Conditions>
<Setter TargetName="Border" Property="Background" Value="{StaticResource SelectedBackgroundBrush}" />
<Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource SelectedBorderBrush}" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True"/>
<Condition Property="Background" Value="Red" />
</MultiTrigger.Conditions>
<Setter TargetName="Border" Property="Background" Value="{StaticResource SelectedBackgroundBrushRed}" />
<Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource SelectedBorderBrushRed}" />
</MultiTrigger>
<!-- Pressed -->
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsPressed" Value="True"/>
<Condition Property="Background" Value="{x:Null}" />
</MultiTrigger.Conditions>
<Setter TargetName="Border" Property="Background" Value="{StaticResource PressedBrush}" />
<Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource PressedBorderBrush}" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsPressed" Value="True"/>
<Condition Property="Background" Value="Red" />
</MultiTrigger.Conditions>
<Setter TargetName="Border" Property="Background" Value="{StaticResource PressedBrushRed}" />
<Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource PressedBorderBrushRed}" />
</MultiTrigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="Content" Property="RenderTransform">
<Setter.Value>
<TransformGroup>
<TranslateTransform X="0.5" Y="1" />
<ScaleTransform ScaleX="0.95" ScaleY="0.95" />
</TransformGroup>
</Setter.Value>
</Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- Disabled Button Image Style-->
<Style TargetType="{x:Type Image}">
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type Button}, AncestorLevel=1}, Path=IsEnabled}" Value="False">
<Setter Property="Opacity" Value="0.5" />
<Setter Property="Effect">
<Setter.Value>
<grayscale:GrayscaleEffect />
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
<!-- MenuItem Style -->
<Style TargetType="{x:Type MenuItem}">
<Style.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#607F9DD0" />
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="Black" />
</Style.Resources>
<Style.Triggers>
<Trigger Property="IsHighlighted" Value="true">
<Setter Property="BorderBrush" Value="{StaticResource SelectedBorderBrush}"/>
</Trigger>
</Style.Triggers>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Padding" Value="5 2 6 2" />
</Style>
<!-- TreeViewItem Style -->
<Style x:Key="TreeViewItemStyle" TargetType="{x:Type TreeViewItem}">
<Style.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#607F9DD0" />
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="Black" />
</Style.Resources>
<Style.Triggers>
<Trigger Property="IsSelected" Value="true">
<Setter Property="BorderBrush" Value="{StaticResource SelectedBorderBrush}"/>
</Trigger>
</Style.Triggers>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="TreeViewItem.Padding" Value="0" />
<Setter Property="TreeViewItem.IsExpanded" Value="True" />
</Style>
<!-- Value Converters -->
<local:FontWeightValueConverter x:Key="FontWeightConverter" />
<local:BackgroundValueConverter x:Key="BackgroundConverter" />
<local:ForegroundValueConverter x:Key="ForegroundConverter" />
<local:SuccessBackgroundValueConverter x:Key="SuccessBackgroundConverter" />
<local:VisibleIfFalseValueConverter x:Key="VisibleIfFalseConverter" />
<local:VisibleIfTrueValueConverter x:Key="VisibleIfTrueConverter" />
<local:CollapsedIfFalseValueConverter x:Key="CollapsedIfFalseConverter" />
</ResourceDictionary>

View File

@@ -0,0 +1,21 @@
using System;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Media;
using System.Windows.Data;
namespace BeWoAdmin {
[ValueConversion(typeof(bool?), typeof(Brush))]
class SuccessBackgroundValueConverter : IValueConverter {
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
if(value == null) return Brushes.Transparent;
if ((bool)value) return new SolidColorBrush(Color.FromArgb(127, 32, 220, 32)); // Brushes.LightGreen on white background
else return new SolidColorBrush(Color.FromArgb(127, 255, 109, 130)); // Brushes.LightPink on white background
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
throw new NotSupportedException();
}
}
}

View File

@@ -0,0 +1,18 @@
using System;
using System.Text;
using System.Windows.Media;
using System.Windows.Data;
using System.Windows;
namespace BeWoAdmin {
[ValueConversion(typeof(bool?), typeof(Visibility))]
class VisibleIfFalseValueConverter : IValueConverter {
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
return (bool?)value == false ? Visibility.Visible : Visibility.Collapsed;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
throw new NotSupportedException();
}
}
}

View File

@@ -0,0 +1,18 @@
using System;
using System.Text;
using System.Windows.Media;
using System.Windows.Data;
using System.Windows;
namespace BeWoAdmin {
[ValueConversion(typeof(bool?), typeof(Visibility))]
class VisibleIfTrueValueConverter : IValueConverter {
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
return (bool?)value == false ? Visibility.Collapsed : Visibility.Visible;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
throw new NotSupportedException();
}
}
}

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio .Net. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="DBAdminServiceReturnValue" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>BeWoAdmin.DBAdminService.DBAdminServiceReturnValue, Web References.DBAdminService.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<discovery xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/disco/">
<contractRef ref="http://localhost:1513/MySqlService.asmx?wsdl" docRef="http://localhost:1513/MySqlService.asmx" xmlns="http://schemas.xmlsoap.org/disco/scl/" />
<soap address="http://localhost:1513/MySqlService.asmx" xmlns:q1="http://tempuri.org" binding="q1:MySqlServiceSoap" xmlns="http://schemas.xmlsoap.org/disco/soap/" />
<soap address="http://localhost:1513/MySqlService.asmx" xmlns:q2="http://tempuri.org" binding="q2:MySqlServiceSoap12" xmlns="http://schemas.xmlsoap.org/disco/soap/" />
</discovery>

View File

@@ -0,0 +1,345 @@
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://tempuri.org" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org">
<s:element name="createDatabase">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="userName" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="pw" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="port" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="query" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="customerName" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="createDatabaseResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="createDatabaseResult" type="tns:DBAdminServiceReturnValue" />
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="DBAdminServiceReturnValue">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="QueryAnswer" type="tns:ArrayOfString" />
<s:element minOccurs="1" maxOccurs="1" name="WasSuccessful" type="s:boolean" />
<s:element minOccurs="0" maxOccurs="1" name="ErrorMessage" type="s:string" />
</s:sequence>
</s:complexType>
<s:complexType name="ArrayOfString">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="string" nillable="true" type="s:string" />
</s:sequence>
</s:complexType>
<s:element name="GetDatabaseList">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="userName" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="pw" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="port" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetDatabaseListResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="GetDatabaseListResult" type="tns:ArrayOfString" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="ExecuteUpdateOnDatabase">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="userName" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="pw" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="port" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="db" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="query" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="ExecuteUpdateOnDatabaseResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="ExecuteUpdateOnDatabaseResult" type="tns:DBAdminServiceReturnValue" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="ExecuteHiddenUpdateOnDatabase">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="userName" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="pw" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="db" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="port" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="query" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="ExecuteHiddenUpdateOnDatabaseResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="ExecuteHiddenUpdateOnDatabaseResult" type="tns:DBAdminServiceReturnValue" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="DatabaseIsReachable">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="userName" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="pw" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="db" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="port" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="DatabaseIsReachableResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="DatabaseIsReachableResult" type="tns:DBAdminServiceReturnValue" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetTables">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="userName" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="pw" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="db" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="port" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetTablesResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="GetTablesResult" type="tns:ArrayOfString" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="CreateNewTenantID">
<s:complexType />
</s:element>
<s:element name="CreateNewTenantIDResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="CreateNewTenantIDResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</wsdl:types>
<wsdl:message name="createDatabaseSoapIn">
<wsdl:part name="parameters" element="tns:createDatabase" />
</wsdl:message>
<wsdl:message name="createDatabaseSoapOut">
<wsdl:part name="parameters" element="tns:createDatabaseResponse" />
</wsdl:message>
<wsdl:message name="GetDatabaseListSoapIn">
<wsdl:part name="parameters" element="tns:GetDatabaseList" />
</wsdl:message>
<wsdl:message name="GetDatabaseListSoapOut">
<wsdl:part name="parameters" element="tns:GetDatabaseListResponse" />
</wsdl:message>
<wsdl:message name="ExecuteUpdateOnDatabaseSoapIn">
<wsdl:part name="parameters" element="tns:ExecuteUpdateOnDatabase" />
</wsdl:message>
<wsdl:message name="ExecuteUpdateOnDatabaseSoapOut">
<wsdl:part name="parameters" element="tns:ExecuteUpdateOnDatabaseResponse" />
</wsdl:message>
<wsdl:message name="ExecuteHiddenUpdateOnDatabaseSoapIn">
<wsdl:part name="parameters" element="tns:ExecuteHiddenUpdateOnDatabase" />
</wsdl:message>
<wsdl:message name="ExecuteHiddenUpdateOnDatabaseSoapOut">
<wsdl:part name="parameters" element="tns:ExecuteHiddenUpdateOnDatabaseResponse" />
</wsdl:message>
<wsdl:message name="DatabaseIsReachableSoapIn">
<wsdl:part name="parameters" element="tns:DatabaseIsReachable" />
</wsdl:message>
<wsdl:message name="DatabaseIsReachableSoapOut">
<wsdl:part name="parameters" element="tns:DatabaseIsReachableResponse" />
</wsdl:message>
<wsdl:message name="GetTablesSoapIn">
<wsdl:part name="parameters" element="tns:GetTables" />
</wsdl:message>
<wsdl:message name="GetTablesSoapOut">
<wsdl:part name="parameters" element="tns:GetTablesResponse" />
</wsdl:message>
<wsdl:message name="CreateNewTenantIDSoapIn">
<wsdl:part name="parameters" element="tns:CreateNewTenantID" />
</wsdl:message>
<wsdl:message name="CreateNewTenantIDSoapOut">
<wsdl:part name="parameters" element="tns:CreateNewTenantIDResponse" />
</wsdl:message>
<wsdl:portType name="MySqlServiceSoap">
<wsdl:operation name="createDatabase">
<wsdl:input message="tns:createDatabaseSoapIn" />
<wsdl:output message="tns:createDatabaseSoapOut" />
</wsdl:operation>
<wsdl:operation name="GetDatabaseList">
<wsdl:input message="tns:GetDatabaseListSoapIn" />
<wsdl:output message="tns:GetDatabaseListSoapOut" />
</wsdl:operation>
<wsdl:operation name="ExecuteUpdateOnDatabase">
<wsdl:input message="tns:ExecuteUpdateOnDatabaseSoapIn" />
<wsdl:output message="tns:ExecuteUpdateOnDatabaseSoapOut" />
</wsdl:operation>
<wsdl:operation name="ExecuteHiddenUpdateOnDatabase">
<wsdl:input message="tns:ExecuteHiddenUpdateOnDatabaseSoapIn" />
<wsdl:output message="tns:ExecuteHiddenUpdateOnDatabaseSoapOut" />
</wsdl:operation>
<wsdl:operation name="DatabaseIsReachable">
<wsdl:input message="tns:DatabaseIsReachableSoapIn" />
<wsdl:output message="tns:DatabaseIsReachableSoapOut" />
</wsdl:operation>
<wsdl:operation name="GetTables">
<wsdl:input message="tns:GetTablesSoapIn" />
<wsdl:output message="tns:GetTablesSoapOut" />
</wsdl:operation>
<wsdl:operation name="CreateNewTenantID">
<wsdl:input message="tns:CreateNewTenantIDSoapIn" />
<wsdl:output message="tns:CreateNewTenantIDSoapOut" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="MySqlServiceSoap" type="tns:MySqlServiceSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="createDatabase">
<soap:operation soapAction="http://tempuri.org/createDatabase" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetDatabaseList">
<soap:operation soapAction="http://tempuri.org/GetDatabaseList" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="ExecuteUpdateOnDatabase">
<soap:operation soapAction="http://tempuri.org/ExecuteUpdateOnDatabase" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="ExecuteHiddenUpdateOnDatabase">
<soap:operation soapAction="http://tempuri.org/ExecuteHiddenUpdateOnDatabase" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="DatabaseIsReachable">
<soap:operation soapAction="http://tempuri.org/DatabaseIsReachable" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetTables">
<soap:operation soapAction="http://tempuri.org/GetTables" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="CreateNewTenantID">
<soap:operation soapAction="http://tempuri.org/CreateNewTenantID" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="MySqlServiceSoap12" type="tns:MySqlServiceSoap">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="createDatabase">
<soap12:operation soapAction="http://tempuri.org/createDatabase" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetDatabaseList">
<soap12:operation soapAction="http://tempuri.org/GetDatabaseList" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="ExecuteUpdateOnDatabase">
<soap12:operation soapAction="http://tempuri.org/ExecuteUpdateOnDatabase" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="ExecuteHiddenUpdateOnDatabase">
<soap12:operation soapAction="http://tempuri.org/ExecuteHiddenUpdateOnDatabase" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="DatabaseIsReachable">
<soap12:operation soapAction="http://tempuri.org/DatabaseIsReachable" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetTables">
<soap12:operation soapAction="http://tempuri.org/GetTables" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="CreateNewTenantID">
<soap12:operation soapAction="http://tempuri.org/CreateNewTenantID" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="MySqlService">
<wsdl:port name="MySqlServiceSoap" binding="tns:MySqlServiceSoap">
<soap:address location="http://localhost:1513/MySqlService.asmx" />
</wsdl:port>
<wsdl:port name="MySqlServiceSoap12" binding="tns:MySqlServiceSoap12">
<soap12:address location="http://localhost:1513/MySqlService.asmx" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

View File

@@ -0,0 +1,593 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Dieser Code wurde von einem Tool generiert.
// Laufzeitversion:4.0.30319.17929
//
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
// der Code erneut generiert wird.
// </auto-generated>
//------------------------------------------------------------------------------
//
// Der Quellcode wurde automatisch mit Microsoft.VSDesigner generiert. Version 4.0.30319.17929.
//
#pragma warning disable 1591
namespace BeWoAdmin.DBAdminService {
using System;
using System.Web.Services;
using System.Diagnostics;
using System.Web.Services.Protocols;
using System.Xml.Serialization;
using System.ComponentModel;
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Web.Services.WebServiceBindingAttribute(Name="MySqlServiceSoap", Namespace="http://tempuri.org")]
public partial class MySqlService : System.Web.Services.Protocols.SoapHttpClientProtocol {
private System.Threading.SendOrPostCallback createDatabaseOperationCompleted;
private System.Threading.SendOrPostCallback GetDatabaseListOperationCompleted;
private System.Threading.SendOrPostCallback ExecuteUpdateOnDatabaseOperationCompleted;
private System.Threading.SendOrPostCallback ExecuteHiddenUpdateOnDatabaseOperationCompleted;
private System.Threading.SendOrPostCallback DatabaseIsReachableOperationCompleted;
private System.Threading.SendOrPostCallback GetTablesOperationCompleted;
private System.Threading.SendOrPostCallback CreateNewTenantIDOperationCompleted;
private bool useDefaultCredentialsSetExplicitly;
/// <remarks/>
public MySqlService() {
this.Url = global::BeWoAdmin.Properties.Settings.Default.DBToolTest2_DBAdminService_MySqlService;
if ((this.IsLocalFileSystemWebService(this.Url) == true)) {
this.UseDefaultCredentials = true;
this.useDefaultCredentialsSetExplicitly = false;
}
else {
this.useDefaultCredentialsSetExplicitly = true;
}
}
public new string Url {
get {
return base.Url;
}
set {
if ((((this.IsLocalFileSystemWebService(base.Url) == true)
&& (this.useDefaultCredentialsSetExplicitly == false))
&& (this.IsLocalFileSystemWebService(value) == false))) {
base.UseDefaultCredentials = false;
}
base.Url = value;
}
}
public new bool UseDefaultCredentials {
get {
return base.UseDefaultCredentials;
}
set {
base.UseDefaultCredentials = value;
this.useDefaultCredentialsSetExplicitly = true;
}
}
/// <remarks/>
public event createDatabaseCompletedEventHandler createDatabaseCompleted;
/// <remarks/>
public event GetDatabaseListCompletedEventHandler GetDatabaseListCompleted;
/// <remarks/>
public event ExecuteUpdateOnDatabaseCompletedEventHandler ExecuteUpdateOnDatabaseCompleted;
/// <remarks/>
public event ExecuteHiddenUpdateOnDatabaseCompletedEventHandler ExecuteHiddenUpdateOnDatabaseCompleted;
/// <remarks/>
public event DatabaseIsReachableCompletedEventHandler DatabaseIsReachableCompleted;
/// <remarks/>
public event GetTablesCompletedEventHandler GetTablesCompleted;
/// <remarks/>
public event CreateNewTenantIDCompletedEventHandler CreateNewTenantIDCompleted;
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/createDatabase", RequestNamespace="http://tempuri.org", ResponseNamespace="http://tempuri.org", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public DBAdminServiceReturnValue createDatabase(string userName, string pw, string port, string query, string customerName) {
object[] results = this.Invoke("createDatabase", new object[] {
userName,
pw,
port,
query,
customerName});
return ((DBAdminServiceReturnValue)(results[0]));
}
/// <remarks/>
public void createDatabaseAsync(string userName, string pw, string port, string query, string customerName) {
this.createDatabaseAsync(userName, pw, port, query, customerName, null);
}
/// <remarks/>
public void createDatabaseAsync(string userName, string pw, string port, string query, string customerName, object userState) {
if ((this.createDatabaseOperationCompleted == null)) {
this.createDatabaseOperationCompleted = new System.Threading.SendOrPostCallback(this.OncreateDatabaseOperationCompleted);
}
this.InvokeAsync("createDatabase", new object[] {
userName,
pw,
port,
query,
customerName}, this.createDatabaseOperationCompleted, userState);
}
private void OncreateDatabaseOperationCompleted(object arg) {
if ((this.createDatabaseCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.createDatabaseCompleted(this, new createDatabaseCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetDatabaseList", RequestNamespace="http://tempuri.org", ResponseNamespace="http://tempuri.org", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public string[] GetDatabaseList(string userName, string pw, string port) {
object[] results = this.Invoke("GetDatabaseList", new object[] {
userName,
pw,
port});
return ((string[])(results[0]));
}
/// <remarks/>
public void GetDatabaseListAsync(string userName, string pw, string port) {
this.GetDatabaseListAsync(userName, pw, port, null);
}
/// <remarks/>
public void GetDatabaseListAsync(string userName, string pw, string port, object userState) {
if ((this.GetDatabaseListOperationCompleted == null)) {
this.GetDatabaseListOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetDatabaseListOperationCompleted);
}
this.InvokeAsync("GetDatabaseList", new object[] {
userName,
pw,
port}, this.GetDatabaseListOperationCompleted, userState);
}
private void OnGetDatabaseListOperationCompleted(object arg) {
if ((this.GetDatabaseListCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.GetDatabaseListCompleted(this, new GetDatabaseListCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/ExecuteUpdateOnDatabase", RequestNamespace="http://tempuri.org", ResponseNamespace="http://tempuri.org", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public DBAdminServiceReturnValue ExecuteUpdateOnDatabase(string userName, string pw, string port, string db, string query) {
object[] results = this.Invoke("ExecuteUpdateOnDatabase", new object[] {
userName,
pw,
port,
db,
query});
return ((DBAdminServiceReturnValue)(results[0]));
}
/// <remarks/>
public void ExecuteUpdateOnDatabaseAsync(string userName, string pw, string port, string db, string query) {
this.ExecuteUpdateOnDatabaseAsync(userName, pw, port, db, query, null);
}
/// <remarks/>
public void ExecuteUpdateOnDatabaseAsync(string userName, string pw, string port, string db, string query, object userState) {
if ((this.ExecuteUpdateOnDatabaseOperationCompleted == null)) {
this.ExecuteUpdateOnDatabaseOperationCompleted = new System.Threading.SendOrPostCallback(this.OnExecuteUpdateOnDatabaseOperationCompleted);
}
this.InvokeAsync("ExecuteUpdateOnDatabase", new object[] {
userName,
pw,
port,
db,
query}, this.ExecuteUpdateOnDatabaseOperationCompleted, userState);
}
private void OnExecuteUpdateOnDatabaseOperationCompleted(object arg) {
if ((this.ExecuteUpdateOnDatabaseCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.ExecuteUpdateOnDatabaseCompleted(this, new ExecuteUpdateOnDatabaseCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/ExecuteHiddenUpdateOnDatabase", RequestNamespace="http://tempuri.org", ResponseNamespace="http://tempuri.org", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public DBAdminServiceReturnValue ExecuteHiddenUpdateOnDatabase(string userName, string pw, string db, string port, string query) {
object[] results = this.Invoke("ExecuteHiddenUpdateOnDatabase", new object[] {
userName,
pw,
db,
port,
query});
return ((DBAdminServiceReturnValue)(results[0]));
}
/// <remarks/>
public void ExecuteHiddenUpdateOnDatabaseAsync(string userName, string pw, string db, string port, string query) {
this.ExecuteHiddenUpdateOnDatabaseAsync(userName, pw, db, port, query, null);
}
/// <remarks/>
public void ExecuteHiddenUpdateOnDatabaseAsync(string userName, string pw, string db, string port, string query, object userState) {
if ((this.ExecuteHiddenUpdateOnDatabaseOperationCompleted == null)) {
this.ExecuteHiddenUpdateOnDatabaseOperationCompleted = new System.Threading.SendOrPostCallback(this.OnExecuteHiddenUpdateOnDatabaseOperationCompleted);
}
this.InvokeAsync("ExecuteHiddenUpdateOnDatabase", new object[] {
userName,
pw,
db,
port,
query}, this.ExecuteHiddenUpdateOnDatabaseOperationCompleted, userState);
}
private void OnExecuteHiddenUpdateOnDatabaseOperationCompleted(object arg) {
if ((this.ExecuteHiddenUpdateOnDatabaseCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.ExecuteHiddenUpdateOnDatabaseCompleted(this, new ExecuteHiddenUpdateOnDatabaseCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DatabaseIsReachable", RequestNamespace="http://tempuri.org", ResponseNamespace="http://tempuri.org", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public DBAdminServiceReturnValue DatabaseIsReachable(string userName, string pw, string db, string port) {
object[] results = this.Invoke("DatabaseIsReachable", new object[] {
userName,
pw,
db,
port});
return ((DBAdminServiceReturnValue)(results[0]));
}
/// <remarks/>
public void DatabaseIsReachableAsync(string userName, string pw, string db, string port) {
this.DatabaseIsReachableAsync(userName, pw, db, port, null);
}
/// <remarks/>
public void DatabaseIsReachableAsync(string userName, string pw, string db, string port, object userState) {
if ((this.DatabaseIsReachableOperationCompleted == null)) {
this.DatabaseIsReachableOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDatabaseIsReachableOperationCompleted);
}
this.InvokeAsync("DatabaseIsReachable", new object[] {
userName,
pw,
db,
port}, this.DatabaseIsReachableOperationCompleted, userState);
}
private void OnDatabaseIsReachableOperationCompleted(object arg) {
if ((this.DatabaseIsReachableCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.DatabaseIsReachableCompleted(this, new DatabaseIsReachableCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetTables", RequestNamespace="http://tempuri.org", ResponseNamespace="http://tempuri.org", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public string[] GetTables(string userName, string pw, string db, string port) {
object[] results = this.Invoke("GetTables", new object[] {
userName,
pw,
db,
port});
return ((string[])(results[0]));
}
/// <remarks/>
public void GetTablesAsync(string userName, string pw, string db, string port) {
this.GetTablesAsync(userName, pw, db, port, null);
}
/// <remarks/>
public void GetTablesAsync(string userName, string pw, string db, string port, object userState) {
if ((this.GetTablesOperationCompleted == null)) {
this.GetTablesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetTablesOperationCompleted);
}
this.InvokeAsync("GetTables", new object[] {
userName,
pw,
db,
port}, this.GetTablesOperationCompleted, userState);
}
private void OnGetTablesOperationCompleted(object arg) {
if ((this.GetTablesCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.GetTablesCompleted(this, new GetTablesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CreateNewTenantID", RequestNamespace="http://tempuri.org", ResponseNamespace="http://tempuri.org", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public string CreateNewTenantID() {
object[] results = this.Invoke("CreateNewTenantID", new object[0]);
return ((string)(results[0]));
}
/// <remarks/>
public void CreateNewTenantIDAsync() {
this.CreateNewTenantIDAsync(null);
}
/// <remarks/>
public void CreateNewTenantIDAsync(object userState) {
if ((this.CreateNewTenantIDOperationCompleted == null)) {
this.CreateNewTenantIDOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateNewTenantIDOperationCompleted);
}
this.InvokeAsync("CreateNewTenantID", new object[0], this.CreateNewTenantIDOperationCompleted, userState);
}
private void OnCreateNewTenantIDOperationCompleted(object arg) {
if ((this.CreateNewTenantIDCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.CreateNewTenantIDCompleted(this, new CreateNewTenantIDCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
public new void CancelAsync(object userState) {
base.CancelAsync(userState);
}
private bool IsLocalFileSystemWebService(string url) {
if (((url == null)
|| (url == string.Empty))) {
return false;
}
System.Uri wsUri = new System.Uri(url);
if (((wsUri.Port >= 1024)
&& (string.Compare(wsUri.Host, "localHost", System.StringComparison.OrdinalIgnoreCase) == 0))) {
return true;
}
return false;
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.17929")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://tempuri.org")]
public partial class DBAdminServiceReturnValue {
private string[] queryAnswerField;
private bool wasSuccessfulField;
private string errorMessageField;
/// <remarks/>
public string[] QueryAnswer {
get {
return this.queryAnswerField;
}
set {
this.queryAnswerField = value;
}
}
/// <remarks/>
public bool WasSuccessful {
get {
return this.wasSuccessfulField;
}
set {
this.wasSuccessfulField = value;
}
}
/// <remarks/>
public string ErrorMessage {
get {
return this.errorMessageField;
}
set {
this.errorMessageField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929")]
public delegate void createDatabaseCompletedEventHandler(object sender, createDatabaseCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class createDatabaseCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal createDatabaseCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public DBAdminServiceReturnValue Result {
get {
this.RaiseExceptionIfNecessary();
return ((DBAdminServiceReturnValue)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929")]
public delegate void GetDatabaseListCompletedEventHandler(object sender, GetDatabaseListCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class GetDatabaseListCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal GetDatabaseListCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public string[] Result {
get {
this.RaiseExceptionIfNecessary();
return ((string[])(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929")]
public delegate void ExecuteUpdateOnDatabaseCompletedEventHandler(object sender, ExecuteUpdateOnDatabaseCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class ExecuteUpdateOnDatabaseCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal ExecuteUpdateOnDatabaseCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public DBAdminServiceReturnValue Result {
get {
this.RaiseExceptionIfNecessary();
return ((DBAdminServiceReturnValue)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929")]
public delegate void ExecuteHiddenUpdateOnDatabaseCompletedEventHandler(object sender, ExecuteHiddenUpdateOnDatabaseCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class ExecuteHiddenUpdateOnDatabaseCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal ExecuteHiddenUpdateOnDatabaseCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public DBAdminServiceReturnValue Result {
get {
this.RaiseExceptionIfNecessary();
return ((DBAdminServiceReturnValue)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929")]
public delegate void DatabaseIsReachableCompletedEventHandler(object sender, DatabaseIsReachableCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class DatabaseIsReachableCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal DatabaseIsReachableCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public DBAdminServiceReturnValue Result {
get {
this.RaiseExceptionIfNecessary();
return ((DBAdminServiceReturnValue)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929")]
public delegate void GetTablesCompletedEventHandler(object sender, GetTablesCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class GetTablesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal GetTablesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public string[] Result {
get {
this.RaiseExceptionIfNecessary();
return ((string[])(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929")]
public delegate void CreateNewTenantIDCompletedEventHandler(object sender, CreateNewTenantIDCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class CreateNewTenantIDCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal CreateNewTenantIDCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public string Result {
get {
this.RaiseExceptionIfNecessary();
return ((string)(this.results[0]));
}
}
}
}
#pragma warning restore 1591

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<DiscoveryClientResultsFile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Results>
<DiscoveryClientResult referenceType="System.Web.Services.Discovery.DiscoveryDocumentReference" url="http://localhost:1513/MySqlService.asmx?disco" filename="MySqlService.disco" />
<DiscoveryClientResult referenceType="System.Web.Services.Discovery.ContractReference" url="http://localhost:1513/MySqlService.asmx?wsdl" filename="MySqlService.wsdl" />
</Results>
</DiscoveryClientResultsFile>

334
BeWoAdmin/Window1.xaml Normal file
View File

@@ -0,0 +1,334 @@
<Window x:Class="BeWoAdmin.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:BeWoAdmin"
Name="MainWindow" Title="{Binding ElementName=MainWindow, Path=WindowTitle}" Height="700" Width="900" Closing="MainWindow_Closing"
WindowStartupLocation="CenterScreen" StateChanged="MainWindow_StateChanged" Background="Transparent" AllowsTransparency="True" WindowStyle="None" ResizeMode="CanResizeWithGrip">
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="WPF/Resources.xaml" />
<ResourceDictionary Source="icons/IconResources.xaml" />
</ResourceDictionary.MergedDictionaries>
<!-- TreeViewItem Style -->
<Style BasedOn="{StaticResource TreeViewItemStyle}" TargetType="{x:Type TreeViewItem}">
<EventSetter Event="TreeViewItem.MouseDown" Handler="TreeViewItem_MouseButtonDown"/>
</Style>
<!-- TreeViewItem Templates -->
<!-- Server -->
<HierarchicalDataTemplate DataType="{x:Type local:Server}" ItemsSource="{Binding Path=Tenants}">
<StackPanel Orientation="Horizontal" Margin="2 0 2 0" SnapsToDevicePixels="True" Background="{Binding Path=WasSuccessful, Converter={StaticResource SuccessBackgroundConverter}}">
<StackPanel.ContextMenu>
<ContextMenu>
<MenuItem Header="Datenbank hinzufügen" Command="local:CustomCommands.AddDatabase">
<MenuItem.Icon>
<Image Source="Icons/database_add.png" />
</MenuItem.Icon>
</MenuItem>
<Separator />
<MenuItem Header="DBs nach Namen sortieren" Click="SortByNameMenuItem_Click" />
</ContextMenu>
</StackPanel.ContextMenu>
<CheckBox VerticalAlignment="Center" Margin="1 1 5 1" IsChecked="{Binding Path=IsChecked}" Focusable="False" Checked="CheckBox_Click" Unchecked="CheckBox_Click" />
<Image Source="icons/server.png" />
<TextBlock Margin="1 1 1 1" Text="{Binding Path=UriHost}" FontWeight="Bold">
<TextBlock.Effect>
<DropShadowEffect Color="LightBlue" BlurRadius="5" Opacity="1" ShadowDepth="0" />
</TextBlock.Effect>
</TextBlock>
<TextBlock VerticalAlignment="Center" Margin="1 1 5 1"> | User:</TextBlock>
<TextBlock VerticalAlignment="Center" Margin="1 1 1 1" Text="{Binding Path=User.Username}" />
</StackPanel>
</HierarchicalDataTemplate>
<!-- Tenant -->
<HierarchicalDataTemplate DataType="{x:Type local:Tenant}">
<Border MouseMove="Border_MouseMove" DragEnter="DBDragDrop" DragOver="DBDragDrop" DragLeave="DBDragDrop" Drop="DBDragDrop" Tag="{Binding}" AllowDrop="True" BorderBrush="{StaticResource SelectedBorderBrush}" >
<StackPanel Orientation="Horizontal" Margin="2 0 2 0" SnapsToDevicePixels="True" Background="{Binding Path=WasSuccessful, Converter={StaticResource SuccessBackgroundConverter}}">
<StackPanel.ContextMenu>
<ContextMenu>
<MenuItem Header="Datenbank hinzufügen" Command="local:CustomCommands.AddDatabase">
<MenuItem.Icon>
<Image Source="Icons/database_add.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Datenbank entfernen" Command="local:CustomCommands.RemoveDatabase">
<MenuItem.Icon>
<Image Source="Icons/database_delete.png" />
</MenuItem.Icon>
</MenuItem>
<Separator />
<MenuItem Header="Verbindung Testen" Command="local:CustomCommands.TestConnection">
<MenuItem.Icon>
<Image Source="Icons/database_connect.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Tabellen der Datenbank anzeigen" Command="local:CustomCommands.ShowTables">
<MenuItem.Icon>
<Image Source="Icons/database_table.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="SQL-Befehl auf dieser Datenbank ausführen" Command="local:CustomCommands.ExecuteSqlOnSingleDB">
<MenuItem.Icon>
<Image Source="Icons/database_lightning.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Lizenzen erweitern" Command="local:CustomCommands.ExtendDBLicenses">
<MenuItem.Icon>
<Image Source="Icons\license.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Im Browser aufrufen" Command="local:CustomCommands.OpenBrowser">
</MenuItem>
<MenuItem Header="Fehlermeldung in die Zwischenablage kopieren" Click="CopyErrorMessageToClipboard" Tag="{Binding Path=ErrorDescription}" Visibility="{Binding Path=WasSuccessful, Converter={StaticResource VisibleIfFalseConverter}}">
<MenuItem.Icon>
<Image Source="Icons/page_copy.png" />
</MenuItem.Icon>
</MenuItem>
</ContextMenu>
</StackPanel.ContextMenu>
<CheckBox VerticalAlignment="Center" Margin="1 1 5 1" IsChecked="{Binding Path=IsChecked}" Focusable="False" Checked="CheckBox_Click" Unchecked="CheckBox_Click" />
<Image Source="icons/database.png" />
<TextBlock VerticalAlignment="Center" Margin="1 1 1 1" Text="{Binding Path=Name}" FontWeight="Bold">
<TextBlock.Effect>
<DropShadowEffect Color="LightBlue" BlurRadius="5" Opacity="1" ShadowDepth="0" />
</TextBlock.Effect>
</TextBlock>
<TextBlock VerticalAlignment="Center" Margin="1 1 5 1">, Datenbank:</TextBlock>
<TextBlock VerticalAlignment="Center" Margin="1 1 1 1" Text="{Binding Path=Database}" />
<TextBlock VerticalAlignment="Center" Margin="1 1 5 1">, User:</TextBlock>
<TextBlock VerticalAlignment="Center" Margin="1 1 1 1" Foreground="{Binding Path=HasOwnUser, Converter={StaticResource ForegroundConverter}}" Text="{Binding Path=User.Username}" FontWeight="Bold" />
<TextBlock VerticalAlignment="Center" Margin="5 1 1 1" Text="{Binding Path=ErrorDescription}" Foreground="DarkRed" />
</StackPanel>
</Border>
</HierarchicalDataTemplate>
</ResourceDictionary>
</Window.Resources>
<Window.CommandBindings>
<CommandBinding Command="ApplicationCommands.New" Executed="New_Executed" />
<CommandBinding Command="ApplicationCommands.Open" Executed="Open_Executed" />
<CommandBinding Command="ApplicationCommands.Save" Executed="Save_Executed" CanExecute="Save_CanExecute" />
<CommandBinding Command="ApplicationCommands.SaveAs" Executed="SaveAs_Executed" />
<CommandBinding Command="ApplicationCommands.Close" Executed="Close_Executed" />
<CommandBinding Command="local:CustomCommands.AddServer" Executed="AddServer_Executed" />
<CommandBinding Command="local:CustomCommands.AddDatabase" Executed="AddDatabase_Executed" CanExecute="AddDatabase_CanExecute" />
<CommandBinding Command="local:CustomCommands.RemoveDatabase" Executed="RemoveDatabase_Executed" CanExecute="RemoveDatabase_CanExecute" />
<CommandBinding Command="local:CustomCommands.CreateDatabase" Executed="CreateDatabase_Executed" CanExecute="CreateDatabase_CanExecute" />
<CommandBinding Command="local:CustomCommands.ExecuteSqlOnCheckedDBs" Executed="ExecuteSqlOnCheckedDBs_Executed" CanExecute="ExecuteSql_CanExecute" />
<CommandBinding Command="local:CustomCommands.ExecuteSqlOnSingleDB" Executed="ExecuteSqlOnSingleDB_Executed" CanExecute="ExecuteSql_CanExecute" />
<CommandBinding Command="local:CustomCommands.CancelExecution" Executed="CancelExecution_Executed" CanExecute="CancelExecution_CanExecute" />
<CommandBinding Command="local:CustomCommands.TestConnection" Executed="TestConnection_Executed" />
<CommandBinding Command="local:CustomCommands.TestAllConnections" Executed="TestAllConnections_Executed" CanExecute="ExecuteSql_CanExecute" />
<CommandBinding Command="local:CustomCommands.ShowTables" Executed="ShowTables_Executed" />
<CommandBinding Command="local:CustomCommands.ExtendDBLicenses" Executed="ExtendDBLicenses_Executed" />
<CommandBinding Command="local:CustomCommands.OpenBrowser" Executed="OpenBrowser_Excecuted" />
</Window.CommandBindings>
<!-- Content -->
<Border BorderBrush="LightGray" Background="{StaticResource BackgroundBrush}" BorderThickness="2" CornerRadius="5" SnapsToDevicePixels="True" MouseLeftButtonDown="StartDrag">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<!-- Title, Menu and Toolbar -->
<Grid Background="{StaticResource TitleBackgroundBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.Resources>
<Style TargetType="Button" BasedOn="{StaticResource ToolBarButtonStyle}" />
</Grid.Resources>
<!-- Title -->
<Label Grid.RowSpan="3" Content="{Binding ElementName=MainWindow, Path=WindowTitle}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
HorizontalContentAlignment="Center" FontSize="13" Padding="2" MouseDoubleClick="TitleLabel_MouseDoubleClick" FontWeight="SemiBold" />
<Label HorizontalAlignment="Left" MouseDoubleClick="InvisibleIconArea_MouseDoubleClick" Height="15" Width="15" Margin="5 0 0 0" />
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button Content="{StaticResource MinimizeIcon}" Click="MinimizeButton_Click" />
<Button Content="{StaticResource RestoreIcon}" Click="MaximizeOrRestoreButton_Click" Name="normalSizeButton" Visibility="Collapsed" />
<Button Content="{StaticResource MaximizeIcon}" Click="MaximizeOrRestoreButton_Click" Name="maximizeButton" />
<Button Content="{StaticResource CloseIcon}" Command="ApplicationCommands.Close" Margin="0 0 1 0" Background="Red" />
</StackPanel>
<!-- Menu -->
<Menu Grid.Row="1" HorizontalAlignment="Left" Background="Transparent" Margin="5 0 0 0" >
<MenuItem Header="_Datei">
<MenuItem Header="_Neu" Command="ApplicationCommands.New">
<MenuItem.Icon>
<Image Source="Icons/page_white.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Ö_ffnen..." Command="ApplicationCommands.Open">
<MenuItem.Icon>
<Image Source="Icons/disk.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="_Speichern" Command="ApplicationCommands.Save">
<MenuItem.Icon>
<Image Source="Icons/folder.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Speichern _unter..." Command="ApplicationCommands.SaveAs">
</MenuItem>
<Separator />
<MenuItem Header="_Beenden" Command="ApplicationCommands.Close">
<MenuItem.Icon>
<Image Source="Icons/door_in.png" />
</MenuItem.Icon>
</MenuItem>
</MenuItem>
<MenuItem Header="D_atenbanken">
<MenuItem Header="Server Hinzufügen" Command="local:CustomCommands.AddServer">
<MenuItem.Icon>
<Image Source="Icons/server_add.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Datenbank _Hinzufügen" Command="local:CustomCommands.AddDatabase">
<MenuItem.Icon>
<Image Source="Icons/database_add.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Server/Datenbank _Entfernen" Command="local:CustomCommands.RemoveDatabase">
<MenuItem.Icon>
<Image Source="Icons/database_delete.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="_Neue Datenbank erstellen" Command="local:CustomCommands.CreateDatabase">
<MenuItem.Icon>
<Image Source="Icons/page_white_database.png" />
</MenuItem.Icon>
</MenuItem>
<Separator />
<MenuItem Header="Verbindungen Testen" Command="local:CustomCommands.TestAllConnections" Visibility="{Binding RelativeSource={RelativeSource self}, Path=IsEnabled, Converter={StaticResource CollapsedIfFalseConverter}}">
<MenuItem.Icon>
<Image Source="Icons/database_connect.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="_SQL-Befehl ausführen" Command="local:CustomCommands.ExecuteSqlOnCheckedDBs" Visibility="{Binding RelativeSource={RelativeSource self}, Path=IsEnabled, Converter={StaticResource CollapsedIfFalseConverter}}">
<MenuItem.Icon>
<Image Source="Icons/database_lightning.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="_SQL-Befehl abbrechen" Command="local:CustomCommands.CancelExecution" Visibility="{Binding RelativeSource={RelativeSource self}, Path=IsEnabled, Converter={StaticResource CollapsedIfFalseConverter}}">
<MenuItem.Icon>
<Image Source="Icons/cancel.png" />
</MenuItem.Icon>
</MenuItem>
</MenuItem>
</Menu>
<!-- Toolbar -->
<StackPanel Grid.Row="2" Margin="5 0 0 0" Orientation="Horizontal">
<Button Command="ApplicationCommands.New" ToolTip="Neu (Strg+N)">
<Image Source="Icons/page_white.png" />
</Button>
<Button Command="ApplicationCommands.Open" ToolTip="Öffnen (Strg+O)">
<Image Source="Icons/folder.png" />
</Button>
<Button Command="ApplicationCommands.Save" ToolTip="Speichern (Strg+S)">
<Image Source="Icons/disk.png" />
</Button>
<Rectangle Width="1" VerticalAlignment="Stretch" Margin="4" Fill="LightGray" />
<Button Command="local:CustomCommands.AddServer" ToolTip="Server hinzufügen">
<Image Source="Icons/server_add.png" />
</Button>
<Button Command="local:CustomCommands.AddDatabase" ToolTip="Datenbank hinzufügen (Strg+A)">
<Image Source="Icons/database_add.png" />
</Button>
<Button Command="local:CustomCommands.RemoveDatabase" ToolTip="Datenbank entfernen (Entf)">
<Image Source="Icons/database_delete.png" />
</Button>
<Button Command="local:CustomCommands.CreateDatabase" ToolTip="Neue Datenbank erstellen (Strg+Shift+N)">
<Image Source ="Icons/page_white_database.png" />
</Button>
<Rectangle Width="1" VerticalAlignment="Stretch" Margin="4" Fill="LightGray" />
<Button Command="local:CustomCommands.TestAllConnections" ToolTip="Verbindung zu ausgewählten Datenbanken testen" Visibility="{Binding RelativeSource={RelativeSource self}, Path=IsEnabled, Converter={StaticResource CollapsedIfFalseConverter}}">
<Image Source="Icons/database_connect.png" />
</Button>
<Button Command="local:CustomCommands.ExecuteSqlOnCheckedDBs" ToolTip="SQL-Befehl ausführen (Strg+E)" Visibility="{Binding RelativeSource={RelativeSource self}, Path=IsEnabled, Converter={StaticResource CollapsedIfFalseConverter}}">
<Image Source="Icons/database_lightning.png" />
</Button>
<Button Command="local:CustomCommands.CancelExecution" ToolTip="Abbrechen (Esc)" Visibility="{Binding RelativeSource={RelativeSource self}, Path=IsEnabled, Converter={StaticResource CollapsedIfFalseConverter}}">
<Image Source="Icons/cancel.png" />
</Button>
</StackPanel>
</Grid>
<!-- Main Tree -->
<TreeView Grid.Row="1" Name="mainTree" KeyUp="mainTree_KeyUp" SelectedItemChanged="mainTree_SelectedItemChanged" Margin="5 5 5 0" />
<!-- Edit Grid -->
<Grid Grid.Row="2" DataContext="{Binding ElementName=mainTree, Path=SelectedItem}" Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Name="UriLabel" Visibility="Collapsed" VerticalAlignment="Center" HorizontalAlignment="Right">URI:</TextBlock>
<TextBox Name="UriText" Visibility="Collapsed" Grid.Column="1" Text="{Binding Path=Uri}" Margin="2 0 2 1" TextChanged="TextBox_TextChanged" GotFocus="TextBox_GotFocus" />
<TextBlock Name="PortLabel" Visibility="Collapsed" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Right">Port:</TextBlock>
<TextBox Name="PortText" Visibility="Collapsed" Grid.Column="3" Grid.ColumnSpan="2" Text="{Binding Path=Port}" Margin="2 0 2 1" TextChanged="TextBox_TextChanged" GotFocus="TextBox_GotFocus" />
<TextBlock Name="TenantLabel" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Right">Mandant:</TextBlock>
<TextBox Name="TenantText" Grid.Row="1" Grid.Column="1" Text="{Binding Path=Name}" Margin="2 0 7 1" TextChanged="TextBox_TextChanged" GotFocus="TextBox_GotFocus" />
<TextBlock Name="DBLabel" Grid.Row="1" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Right">Datenbank:</TextBlock>
<TextBox Name="DBText" Grid.Row="1" Grid.ColumnSpan="2" Grid.Column="3" Text="{Binding Path=Database}" Margin="2 0 2 1" TextChanged="TextBox_TextChanged" GotFocus="TextBox_GotFocus" />
<TextBlock Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Right">Benutzername:</TextBlock>
<TextBox Grid.Row="2" Grid.Column="1" Margin="2 4 7 1" Name="UsernameTextBox" Foreground="{Binding Path=HasOwnUser, Converter={StaticResource ForegroundConverter}}" GotFocus="TextBox_GotFocus" TextChanged="UsernameTextBox_TextChanged" />
<TextBlock Grid.Row="2" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Right">Passwort:</TextBlock>
<PasswordBox Grid.Row="2" Grid.Column="3" Margin="2 4 2 1" Name="UserPasswordBox" Background="{Binding Path=HasOwnUser, Converter={StaticResource BackgroundConverter}}" PasswordChanged="UserPasswordBox_PasswordChanged" />
<Button Grid.Row="2" Grid.Column="4" Name="ApplyButton" IsEnabled="false" Margin="2 2 2 0" Click="ApplyButton_Click" Padding="3 1 3 1">übernehmen</Button>
</Grid>
<Separator Grid.Row="3" Margin="0" Background="LightGray" />
<!-- Status Bar -->
<StatusBar Grid.Row="4" Background="Transparent">
<StatusBar.ItemsPanel>
<ItemsPanelTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="4" />
</Grid.ColumnDefinitions>
</Grid>
</ItemsPanelTemplate>
</StatusBar.ItemsPanel>
<StatusBarItem Grid.Column="1">
<TextBlock Name="NumberOfItemsText" />
</StatusBarItem>
<Separator Grid.Column="2" Background="LightGray"/>
<StatusBarItem Grid.Column="3">
<StackPanel Name="ProgressPanel" Orientation="Horizontal" Visibility="Hidden">
<TextBlock Name="StatusText" Margin="0 0 2 0" >SQL-Befehl wird ausgeführt...</TextBlock>
<ProgressBar Name="ProgressBar" Width="150" Height="15" />
</StackPanel>
</StatusBarItem>
</StatusBar>
<!-- Dark Overlay -->
<Border Opacity="0" Background="Black" CornerRadius="4" Grid.RowSpan="5" Visibility="Collapsed" Name="darkOverlay" SnapsToDevicePixels="True" />
</Grid>
</Border>
</Window>

637
BeWoAdmin/Window1.xaml.cs Normal file
View File

@@ -0,0 +1,637 @@
using System;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Media.Animation;
using System.IO;
using System.ComponentModel;
using System.Windows.Threading;
using System.Threading;
using System.Collections.Generic;
using Microsoft.Win32;
using DBToolControls;
using System.Diagnostics;
using System.Reflection;
namespace BeWoAdmin {
/// <summary>
/// Interaktionslogik für Window1.xaml
/// </summary>
public partial class Window1 : Window, INotifyPropertyChanged {
public event PropertyChangedEventHandler PropertyChanged;
private ServerCollection servers = new ServerCollection();
private bool isDirty;
private string currentFilename = "Unbenannt";
private Server selectedServer;
private Tenant selectedTenant;
public bool SqlOutputWindowActive = false;
private bool tenantCreated = false;
private String tenantServerId = "";
private String tenantName = "";
public bool showWnd = true;
private SqlOutputWindow outputWnd = null;
public string WindowTitle {
get {
return String.Format("{0}{1} - {2} {3}",
isDirty ? "* " : "",
File.Exists(currentFilename) ? Path.GetFileName(currentFilename) : "Unbenannt",
App.Name, Assembly.GetEntryAssembly().GetName().Version.Major + "." + Assembly.GetEntryAssembly().GetName().Version.Minor);
}
}
public Window1() {
InitializeComponent();
servers.SetDelegates(SetProgressValue, DispatchUpdateStatusBar);
servers.Parent = this;
mainTree.ItemsSource = servers;
UpdateStatusBar();
// animation precaching
MakeDark();
MakeBright();
// Events
UserPasswordBox.GotFocus += new RoutedEventHandler((sender, e) => UserPasswordBox.SelectAll());
}
// Events
private void CheckBox_Click(object sender, RoutedEventArgs e) {
UpdateStatusBar();
SetDirty(true);
}
private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) {
if (!ChangesSavedOrDiscarded())
e.Cancel = true;
}
private void mainTree_KeyUp(object sender, KeyEventArgs e) {
if (e.Key == Key.Space) {
Tenant t;
Server s;
if ((t = mainTree.SelectedItem as Tenant) != null)
t.IsChecked = t.IsChecked == false;
else if ((s = mainTree.SelectedItem as Server) != null)
s.IsChecked = s.IsChecked == false;
}
}
private void TreeViewItem_MouseButtonDown(object sender, MouseEventArgs e) {
(sender as TreeViewItem).Focus();
e.Handled = true;
}
private void DBDragDrop(object sender, DragEventArgs e) {
bool dragEnter = e.RoutedEvent == DragDrop.DragEnterEvent;
bool dragOver = e.RoutedEvent == DragDrop.DragOverEvent;
bool drop = e.RoutedEvent == DragDrop.DropEvent;
Border b = sender as Border;
Tenant thisTenant = b.Tag as Tenant;
Tenant draggedTenant = e.Data.GetData("BeWoAdmin.Tenant") as Tenant;
e.Handled = true;
if (draggedTenant != thisTenant && draggedTenant.IsSibling(thisTenant)) {
e.Effects = DragDropEffects.Move;
if (dragEnter) {
b.BorderThickness = draggedTenant.Index < thisTenant.Index ? new Thickness(0, 0, 0, 2) : new Thickness(0, 2, 0, 0);
} else if (!dragOver) {
b.BorderThickness = new Thickness(0);
if (drop) {
draggedTenant.Move(thisTenant.Index - draggedTenant.Index);
SetDirty(true);
}
}
} else
e.Effects = DragDropEffects.None;
}
private void UsernameTextBox_TextChanged(object sender, TextChangedEventArgs e) {
UserPasswordBox.Password = "";
ApplyButton.IsEnabled = true;
}
private void ApplyButton_Click(object sender, RoutedEventArgs e) {
if (mainTree.SelectedItem != null) {
User newUser = (UsernameTextBox.Text.Length > 0) ? new User(UsernameTextBox.Text, UserPasswordBox.SecurePassword) : null;
if (mainTree.SelectedItem is Server) selectedServer.User = newUser;
else if (mainTree.SelectedItem is Tenant) selectedTenant.User = newUser;
SetDirty(true);
}
}
private void UserPasswordBox_PasswordChanged(object sender, RoutedEventArgs e) {
ApplyButton.IsEnabled = true;
}
private void TextBox_TextChanged(object sender, TextChangedEventArgs e) {
if ((sender as TextBox).IsFocused) // Text changed by User, not Data Binding
SetDirty(true);
}
private void TextBox_GotFocus(object sender, RoutedEventArgs e) {
(sender as TextBox).SelectAll();
}
private void Border_MouseMove(object sender, MouseEventArgs e) {
Border sp = sender as Border;
if (e.LeftButton == MouseButtonState.Pressed)
DragDrop.DoDragDrop(sp, sp.Tag as Tenant, DragDropEffects.Move);
}
private void SortByNameMenuItem_Click(object sender, RoutedEventArgs e) {
if (selectedServer != null)
selectedServer.SortChildrenBy(t => t.Name);
}
private void CopyErrorMessageToClipboard(object sender, RoutedEventArgs e) {
Clipboard.SetText((sender as MenuItem).Tag.ToString());
}
private void StartDrag(object sender, MouseButtonEventArgs e) {
this.DragMove();
}
private void MainWindow_StateChanged(object sender, EventArgs e) {
Window w = sender as Window;
if (w.WindowState == WindowState.Maximized) {
normalSizeButton.Visibility = Visibility.Visible;
maximizeButton.Visibility = Visibility.Collapsed;
} else {
normalSizeButton.Visibility = Visibility.Collapsed;
maximizeButton.Visibility = Visibility.Visible;
}
}
private void MinimizeButton_Click(object sender, RoutedEventArgs e) {
this.WindowState = WindowState.Minimized;
}
private void MaximizeOrRestoreButton_Click(object sender, RoutedEventArgs e) {
MaximizeOrRestoreWindow();
}
private void TitleLabel_MouseDoubleClick(object sender, MouseButtonEventArgs e) {
MaximizeOrRestoreWindow();
}
private void InvisibleIconArea_MouseDoubleClick(object sender, MouseButtonEventArgs e) {
ApplicationCommands.Close.Execute(null, this);
e.Handled = true;
}
private void mainTree_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e) {
selectedTenant = mainTree.SelectedItem as Tenant;
if (selectedTenant != null) {
selectedServer = selectedTenant.Server;
SetUserBoxContents(selectedTenant.User);
setEditMode(editModes.Tenant);
selectedTenant.parent = this;
} else {
selectedServer = mainTree.SelectedItem as Server;
if (selectedServer != null) {
SetUserBoxContents(selectedServer.User);
setEditMode(editModes.Server);
} else
SetUserBoxContents(null);
}
ApplyButton.IsEnabled = false;
}
// Commands
private void New_Executed(object sender, ExecutedRoutedEventArgs e) {
if (ChangesSavedOrDiscarded()) {
servers.Clear();
InitDatabases("Unbenannt");
}
}
private void Open_Executed(object sender, ExecutedRoutedEventArgs e) {
if (!ChangesSavedOrDiscarded()) return;
MakeDark();
OpenFileDialog openDialog = new OpenFileDialog() { Filter = "XML Files|*.xml|All Files|*.*" };
if (openDialog.ShowDialog() == true) {
string pw = PasswordInput.RequestPassword(this);
if (pw != null)
try {
servers.LoadFromXml(openDialog.FileName, pw);
InitDatabases(openDialog.FileName);
} catch (System.Xml.XmlException) {
ShowMessage(String.Format("Fehler beim Parsen der XML-Datei {0}", openDialog.FileName));
} catch (System.Security.Cryptography.CryptographicException) {
ShowMessage(String.Format("Fehler beim Entschlüsseln der Datei {0}", openDialog.FileName));
} catch {
ShowMessage(String.Format("Fehler beim Laden der Datei {0}", openDialog.FileName));
}
}
new Thread(delegate() {
this.Dispatcher.BeginInvoke(DispatcherPriority.Loaded, (ThreadStart)MakeBright);
}).Start();
}
private void Save_Executed(object sender, ExecutedRoutedEventArgs e) {
SaveDatabases(false);
}
private void SaveAs_Executed(object sender, ExecutedRoutedEventArgs e) {
SaveDatabases(true);
}
private void Close_Executed(object sender, ExecutedRoutedEventArgs e) {
Close();
}
private void AddServer_Executed(object sender, ExecutedRoutedEventArgs e) {
servers.Add(new Server());
SetDirty(true);
}
public void showErrorWnd(String msg)
{
new Thread(delegate() {
this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (ThreadStart)delegate()
{
ShowMessage(msg, MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK);
});
}).Start();
}
public void showSuccessWnd(String msg)
{
new Thread(delegate()
{
this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (ThreadStart)delegate()
{
ShowMessage(msg, MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK);
});
}).Start();
}
private void AddDatabase_Executed(object sender, ExecutedRoutedEventArgs e) {
bool createDB = true;
if (selectedServer != null) {
MakeDark();
if(YesNoMessageConfirmed("Soll eine SQL-Datei geladen werden?"))
{
Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
dlg.Filter = "SQL Files|*.sql";
dlg.Multiselect = false;
dlg.Title = "SQL-Datei wählen";
dlg.ShowDialog();
String path = null;
path = dlg.FileName.ToString();
if (path == null || path == "")
{
if (!YesNoMessageConfirmed("Datenbank ohne SQL-Datei anlegen?"))
createDB = false;
}
else
{
MakeDark();
this.showWnd = true;
DbCreationWnd dbCrWnd = new DbCreationWnd(this);
dbCrWnd.setData(selectedServer, selectedServer.User, path);
if(this.showWnd)
dbCrWnd.ShowDialog();
MakeBright();
if (dbCrWnd.DbCreationWndResult == false)
createDB = false;
else
{
this.tenantCreated = true;
this.tenantServerId = dbCrWnd.DbId;
this.tenantName = dbCrWnd.CustomerName;
}
}
}
MakeBright();
if (createDB)
{
selectedServer.CreateTenant();
if (this.tenantCreated)
{
((Tenant)selectedServer.Tenants.ElementAt(selectedServer.Tenants.Count-1)).Database = this.tenantServerId;
((Tenant)selectedServer.Tenants.ElementAt(selectedServer.Tenants.Count - 1)).Name = this.tenantName;
// Tidy up
this.SqlOutputWindowActive = false;
this.tenantCreated = false;
this.tenantServerId = "";
this.outputWnd = null;
this.showWnd = true;
}
selectedServer.NotifyPropertyChange("Tenants");
SetDirty(true);
UpdateStatusBar();
}
} else
ShowMessage("Es ist kein Server ausgewählt.");
}
private void AddDatabase_CanExecute(object sender, CanExecuteRoutedEventArgs e) {
e.CanExecute = selectedServer != null;
}
private void RemoveDatabase_Executed(object sender, ExecutedRoutedEventArgs e) {
bool wasServer = false;
if (selectedTenant == null && selectedServer != null)
wasServer = true;
if (YesNoMessageConfirmed(String.Format("Soll {0} wirklich entfernt werden?", wasServer ? "der ausgewählte Server" : "die ausgewählte Datenbank"))) {
SetDirty(wasServer ? servers.Remove(selectedServer) : selectedTenant.Remove());
UpdateStatusBar();
}
}
private void RemoveDatabase_CanExecute(object sender, CanExecuteRoutedEventArgs e) {
e.CanExecute = selectedServer != null || selectedTenant != null;
}
private void CreateDatabase_Executed(object sender, ExecutedRoutedEventArgs e) {
//ShowMessage("funktioniert noch nicht");
MakeDark();
if (selectedServer != null)
new CreateDatabase(this, selectedServer).ShowDialog();
else
ShowMessage("es ist kein Server ausgewählt");
MakeBright();
}
private void CreateDatabase_CanExecute(object sender, CanExecuteRoutedEventArgs e) {
e.CanExecute = false;
}
public void showQueryAnswer(List<String> list)
{
new Thread(delegate()
{
this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (ThreadStart)delegate()
{
if (!this.SqlOutputWindowActive)
{
this.outputWnd = new SqlOutputWindow(this, list);
this.outputWnd.Closing += new CancelEventHandler(outputWnd_Closing);
this.SqlOutputWindowActive = true;
}
else
{
this.outputWnd.appendSqlQueries(list);
}
});
}).Start();
}
private void outputWnd_Closing(object sender, CancelEventArgs e)
{
this.SqlOutputWindowActive = false;
}
private void ExecuteSqlOnCheckedDBs_Executed(object sender, ExecutedRoutedEventArgs e)
{
if (servers.CheckedTenants.Count == 0) {
ShowMessage("Es wurde keine Datenbank ausgewählt");
} else if (RequestSqlCommand()) {
servers.ExecutionInProgress = true;
UpdateStatusBar();
new Thread(delegate() {
servers.Parent = this;
servers.ExecuteSqlCommandOnCheckedDatabases();
}).Start();
}
}
private void ExecuteSqlOnSingleDB_Executed(object sender, RoutedEventArgs e) {
if (selectedTenant != null && RequestSqlCommand())
new Thread(delegate() {
selectedTenant.parent = this;
selectedTenant.ExecuteSqlCommand(servers.LastSqlCommand);
}).Start();
}
private void CancelExecution_Executed(object sender, RoutedEventArgs e) {
servers.CancelationPending = true;
StatusText.Text = "Ausführung wird abgebrochen...";
}
private void TestConnection_Executed(object sender, RoutedEventArgs e) {
if (selectedTenant != null)
new Thread(selectedTenant.TestConnection).Start();
}
private void TestAllConnections_Executed(object sender, RoutedEventArgs e) {
if (servers.CheckedTenants.Count == 0) {
ShowMessage("Es wurde keine Datenbank ausgewählt");
} else {
servers.ExecutionInProgress = true;
servers.TestConnectionsOnly = true;
UpdateStatusBar();
new Thread(servers.ExecuteSqlCommandOnCheckedDatabases).Start();
}
}
private void ShowTables_Executed(object sender, RoutedEventArgs e) {
if (selectedTenant != null)
new Thread(delegate() {
Tenant t = selectedTenant;
StringBuilder sb = new StringBuilder(String.Format("Tabellen in {0}:\n", t.Database));
t.GetTables().ForEach(s => sb.AppendLine(s));
this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (ThreadStart)delegate() {
if (t.WasSuccessful != false) ShowMessage(sb.ToString());
});
}).Start();
}
private void Save_CanExecute(object sender, CanExecuteRoutedEventArgs e) {
e.CanExecute = isDirty;
}
private void ExecuteSql_CanExecute(object sender, CanExecuteRoutedEventArgs e) {
e.CanExecute = !servers.ExecutionInProgress;
}
private void CancelExecution_CanExecute(object sender, CanExecuteRoutedEventArgs e) {
e.CanExecute = servers.ExecutionInProgress;
}
// private helper methods
private void SetDirty(bool isDirty) {
this.isDirty = isDirty;
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs("WindowTitle"));
}
private void InitDatabases(string filename) {
servers.LastSqlCommand = "";
currentFilename = filename;
SetDirty(false);
UpdateStatusBar();
}
private void MaximizeOrRestoreWindow() {
this.WindowState = (this.WindowState == WindowState.Maximized) ? WindowState.Normal : WindowState.Maximized;
}
private void SetUserBoxContents(User user) {
if (user != null) {
UsernameTextBox.Text = user.Username;
UserPasswordBox.Password = new String(' ', user.PasswordLength);
} else {
UsernameTextBox.Text = "";
UserPasswordBox.Password = "";
}
}
private enum editModes { Server, Tenant }
private void setEditMode(editModes mode) {
Visibility serverVisibility = (mode == editModes.Server) ? Visibility.Visible : Visibility.Collapsed;
Visibility tenantVisibility = (mode == editModes.Tenant) ? Visibility.Visible : Visibility.Collapsed;
new List<UIElement> { UriLabel, UriText, PortLabel, PortText }.ForEach(u => u.Visibility = serverVisibility);
new List<UIElement> { TenantLabel, TenantText, DBLabel, DBText }.ForEach(u => u.Visibility = tenantVisibility);
}
private void UpdateStatusBar() {
NumberOfItemsText.Text = String.Format("{0} Datenbanken ({1} ausgewählt)", servers.AllTenants.Count, servers.CheckedTenants.Count);
if (servers.ExecutionInProgress) {
StatusText.Text = "SQL-Befehl wird ausgeführt...";
ProgressPanel.Visibility = Visibility.Visible;
} else {
ProgressBar.Value = 0;
ProgressPanel.Visibility = Visibility.Hidden;
CommandManager.InvalidateRequerySuggested();
}
}
// Modal Dialogs
private bool RequestSqlCommand() {
MakeDark();
SqlInputWindow input = new SqlInputWindow(this, servers.LastSqlCommand);
bool successful = input.ShowDialog() == true;
MakeBright();
if (successful) {
servers.LastSqlCommand = input.SqlCommand;
return true;
} else
return false;
}
private MessageBoxResult ShowMessage(string messageBoxText, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult) {
MakeDark();
MessageBoxResult result = WpfMsgBox.Show(this, messageBoxText, button, icon, defaultResult);
MakeBright();
return result;
}
private MessageBoxResult ShowMessage(string messageBoxText) {
return ShowMessage(messageBoxText, MessageBoxButton.OK, MessageBoxImage.None, MessageBoxResult.OK);
}
private bool YesNoMessageConfirmed(string messageBoxText) {
return ShowMessage(messageBoxText, MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.No) == MessageBoxResult.Yes;
}
private bool QuestionNegated(string messageBoxText) {
return ShowMessage(messageBoxText, MessageBoxButton.YesNo, MessageBoxImage.None, MessageBoxResult.No) == MessageBoxResult.No;
}
private void MakeDark() {
this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (ThreadStart)delegate() {
darkOverlay.Visibility = Visibility.Visible;
DoubleAnimation opacityAnimation = new DoubleAnimation(0.25, TimeSpan.FromMilliseconds(300));
darkOverlay.BeginAnimation(FrameworkElement.OpacityProperty, opacityAnimation);
});
}
private void MakeBright() {
this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (ThreadStart)delegate() {
DoubleAnimation opacityAnimation = new DoubleAnimation(0, TimeSpan.FromMilliseconds(100));
opacityAnimation.Completed += (sender, e) => { if (darkOverlay.Opacity < 0.01) darkOverlay.Visibility = Visibility.Collapsed; };
darkOverlay.BeginAnimation(FrameworkElement.OpacityProperty, opacityAnimation);
});
}
// Progress Callbacks
public void SetProgressValue(int value) {
this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (ThreadStart)delegate() {
ProgressBar.Value = value;
});
}
public void DispatchUpdateStatusBar() {
this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (ThreadStart)UpdateStatusBar);
}
// File Handling
private bool ChangesSavedOrDiscarded() {
if (!isDirty) return true;
MessageBoxResult result = ShowMessage(String.Format("Die Datei {0} wurde verändert.\n\nAktuelle Änderungen speichern?", currentFilename), MessageBoxButton.YesNoCancel, MessageBoxImage.Exclamation, MessageBoxResult.No);
return (result == MessageBoxResult.Yes) ? SaveDatabases(false) : (result == MessageBoxResult.Cancel) ? false : true;
}
private bool SaveDatabases(bool forceFileChooser) {
mainTree.Focus();
MakeDark();
if (!File.Exists(currentFilename) || forceFileChooser) {
SaveFileDialog saveDialog = new SaveFileDialog() { Filter = "XML Files|*.xml|All Files|*.*" };
bool? saveResult = saveDialog.ShowDialog(this);
if (saveResult == true) {
currentFilename = saveDialog.FileName;
} else {
MakeBright();
return false;
}
}
string pw = PasswordInput.RequestPassword(this);
MakeBright();
if (pw == null) return false;
try {
servers.SaveToXml(currentFilename, pw);
SetDirty(false);
return true;
}
catch (Exception ex)
{
ShowMessage(String.Format("Fehler beim Speichern der Datei {0}:\n" + ex.Message, currentFilename));
return false;
}
}
private void ExtendDBLicenses_Executed(object sender, ExecutedRoutedEventArgs e)
{
MakeDark();
ExtndLicnsWnd win = new ExtndLicnsWnd(this.selectedTenant,this);
win.ShowDialog();
MakeBright();
}
private void OpenBrowser_Excecuted(object sender, ExecutedRoutedEventArgs e)
{
System.Diagnostics.Process.Start("https://" + this.selectedTenant.Server.UriHost + "/bewo/bewo.xbap?k=" + this.selectedTenant.Database);
}
}
}

18
BeWoAdmin/app.config Normal file
View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="BeWoAdmin.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<applicationSettings>
<BeWoAdmin.Properties.Settings>
<setting name="BeWoAdmin_DBAdminService_MySqlService" serializeAs="String">
<value>http://localhost:2100/MySqlService.asmx</value>
</setting>
<setting name="DBToolTest2_DBAdminService_MySqlService" serializeAs="String">
<value>http://localhost:1513/MySqlService.asmx</value>
</setting>
</BeWoAdmin.Properties.Settings>
</applicationSettings>
</configuration>

View File

@@ -0,0 +1,55 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush Color="Black" x:Key="Color" />
<!-- Minimize -->
<Canvas x:Key="MinimizeIcon" Height="12" Width="12">
<Path StrokeThickness="0" Fill="{StaticResource Color}" SnapsToDevicePixels="True">
<Path.Data>
<GeometryGroup>
<RectangleGeometry Rect="1,9 8,2" />
</GeometryGroup>
</Path.Data>
</Path>
</Canvas>
<!-- Restore -->
<Canvas x:Key="RestoreIcon" Height="12" Width="12">
<Path StrokeThickness="0" Fill="{StaticResource Color}" SnapsToDevicePixels="True">
<Path.Data>
<GeometryGroup>
<RectangleGeometry Rect="4,1 7,4" />
<RectangleGeometry Rect="5,3 5,2" />
<RectangleGeometry Rect="8,5 3,2" />
<RectangleGeometry Rect="8,5 2,1" />
<RectangleGeometry Rect="1,5 7,6" />
<RectangleGeometry Rect="2,7 5,3" />
</GeometryGroup>
</Path.Data>
</Path>
</Canvas>
<!-- Maximize -->
<Canvas x:Key="MaximizeIcon" Height="12" Width="12">
<Path StrokeThickness="0" Fill="{StaticResource Color}" SnapsToDevicePixels="True">
<Path.Data>
<GeometryGroup>
<RectangleGeometry Rect="1,1 10,10" />
<RectangleGeometry Rect="2,4 8,6" />
</GeometryGroup>
</Path.Data>
</Path>
</Canvas>
<!-- Close -->
<Canvas x:Key="CloseIcon" Height="12" Width="12">
<Path Stroke="{StaticResource Color}" StrokeThickness="2" SnapsToDevicePixels="True" StrokeEndLineCap="Round" StrokeStartLineCap="Round">
<Path.Data>
<GeometryGroup>
<LineGeometry StartPoint="2,2" EndPoint="10,10" />
<LineGeometry StartPoint="2,10" EndPoint="10,2" />
</GeometryGroup>
</Path.Data>
</Path>
</Canvas>
</ResourceDictionary>

BIN
BeWoAdmin/icons/cancel.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 587 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 390 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 658 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 763 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 659 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 775 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 726 B

BIN
BeWoAdmin/icons/disk.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 620 B

BIN
BeWoAdmin/icons/door_in.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 693 B

BIN
BeWoAdmin/icons/folder.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 537 B

BIN
BeWoAdmin/icons/license.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 574 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 663 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 294 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 579 B

BIN
BeWoAdmin/icons/server.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 530 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 676 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 755 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 668 B

View File

@@ -0,0 +1,20 @@
<publishData>
<publishTarget publishUrl="C:\Projects\beyondSoft\BeWoPlaner\BeWoAdmin\Publish\">
<file relUrl="MySqlService.asmx" publishTime="08/02/2010 16:06:20" />
<file relUrl="bin/MySql.Data.dll" publishTime="08/02/2010 16:06:20" />
<file relUrl="bin/DBToolControls.dll" publishTime="09/15/2011 17:11:30" />
<file relUrl="bin/DBToolControls.pdb" publishTime="09/15/2011 17:11:30" />
<file relUrl="bin/WebService1.dll" publishTime="09/15/2011 17:11:33" />
<file relUrl="bin/WebService1.pdb" publishTime="09/15/2011 17:11:33" />
<file relUrl="Web.config" publishTime="08/02/2010 16:06:21" />
</publishTarget>
<publishTarget publishUrl="C:\Dokumente und Einstellungen\MasslochL\Desktop\">
<file relUrl="MySqlService.asmx" publishTime="12/11/2008 14:53:47" />
<file relUrl="bin/MySql.Data.dll" publishTime="08/14/2008 19:17:32" />
<file relUrl="bin/DBToolControls.dll" publishTime="12/11/2008 16:42:22" />
<file relUrl="bin/DBToolControls.pdb" publishTime="12/11/2008 16:42:22" />
<file relUrl="bin/WebService1.dll" publishTime="12/11/2008 16:42:23" />
<file relUrl="bin/WebService1.pdb" publishTime="12/11/2008 16:42:23" />
<file relUrl="Web.config" publishTime="12/11/2008 14:24:12" />
</publishTarget>
</publishData>

View File

@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" 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>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{80C16833-B497-4AFA-97D2-4744EAFE412C}</ProjectGuid>
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>WebService1</RootNamespace>
<AssemblyName>WebService1</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="MySql.Data, Version=5.2.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>.\MySql.Data.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Web.Extensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Xml" />
<Reference Include="System.Configuration" />
<Reference Include="System.Web.Services" />
<Reference Include="System.EnterpriseServices" />
<Reference Include="System.Web.Mobile" />
</ItemGroup>
<ItemGroup>
<Content Include="MySqlService.asmx" />
<Content Include="Web.config" />
</ItemGroup>
<ItemGroup>
<Compile Include="MySqlService.asmx.cs">
<DependentUpon>MySqlService.asmx</DependentUpon>
<SubType>Component</SubType>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DBToolControls\DBToolControls.csproj">
<Project>{3B0EDADE-2697-4936-9C15-E7BCB309AA14}</Project>
<Name>DBToolControls</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="configuration.conf" />
</ItemGroup>
<ItemGroup>
<Folder Include="App_Data\" />
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>False</UseIIS>
<AutoAssignPort>False</AutoAssignPort>
<DevelopmentServerPort>1513</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>
</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
</Project>

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<StartPageUrl>
</StartPageUrl>
<StartAction>CurrentPage</StartAction>
<AspNetDebugging>True</AspNetDebugging>
<NativeDebugging>False</NativeDebugging>
<SQLDebugging>False</SQLDebugging>
<PublishCopyOption>RunFiles</PublishCopyOption>
<PublishTargetLocation>C:\Projects\beyondSoft\BeWoPlaner\BeWoAdmin\Publish\</PublishTargetLocation>
<PublishDeleteAllFiles>False</PublishDeleteAllFiles>
<PublishCopyAppData>True</PublishCopyAppData>
<ExternalProgram>
</ExternalProgram>
<StartExternalURL>
</StartExternalURL>
<StartCmdLineArguments>
</StartCmdLineArguments>
<StartWorkingDirectory>
</StartWorkingDirectory>
<EnableENC>False</EnableENC>
<AlwaysStartWebServerOnDebug>True</AlwaysStartWebServerOnDebug>
<EnableWcfTestClientForSVC>False</EnableWcfTestClientForSVC>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
</Project>

View File

@@ -0,0 +1,21 @@
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="hibernate-configuration" type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate" />
</configSections>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="connection.driver_class">NHibernate.Driver.MySqlDataDriver</property>
<property name="connection.connection_string">Server=localhost;Password=<Template_Password>;User ID=<Template_USERID>;Initial Catalog=<Template_DATABASE></property>
<property name="dialect">NHibernate.Dialect.MySQLDialect</property>
<property name="proxyfactory.factory_class">NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle</property>
<property name="hbm2ddl.keywords">none</property>
<property name="show_sql">true</property>
<mapping assembly="BeWo.Data" />
</session-factory>
</hibernate-configuration>
</configuration>

Binary file not shown.

View File

@@ -0,0 +1 @@
<%@ WebService Language="C#" CodeBehind="MySqlService.asmx.cs" Class="DBAdminService.MySqlService" %>

View File

@@ -0,0 +1,388 @@
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
using System.Collections.Generic;
using MySql.Data.MySqlClient;
using DBToolControls;
using System.IO;
namespace DBAdminService {
/// <summary>
/// Zusammenfassungsbeschreibung für MySqlService
/// </summary>
[WebService(Namespace = "http://tempuri.org")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
// Um das Aufrufen dieses Webdiensts aus einem Skript mit ASP.NET-AJAX zuzulassen, heben Sie die Auskommentierung der folgenden Zeile auf.
// [System.Web.Script.Services.ScriptService]
public class MySqlService : System.Web.Services.WebService {
public static readonly string TransportEncryptionKey = @"b7困!#vS?難\n.어u";
public List<String> queryResponse;
public static string configurationFilePath = @"configuration.conf";
private DBAdminServiceDBCreationReturnValue generateDbFiles(String host, String user, String pw, String db, String customerName)
{
DBAdminServiceDBCreationReturnValue result = new DBAdminServiceDBCreationReturnValue();
try
{
FileStream fs = File.OpenRead(Server.MapPath(configurationFilePath));
StreamReader sr = new StreamReader(fs);
StreamWriter sw;
String conf = sr.ReadToEnd(), tmp, id=null; String DBcnfTmp = null, BakCnf = null, targetFolder = null, targetFolder2 = null; int pos, epos;
if (conf != "" && conf != null)
{
pos = conf.IndexOf("<DBConfigTemplateFile>");
epos = conf.IndexOf("</DBConfigTemplateFile>");
if (pos != -1 && epos != -1)
{
DBcnfTmp = conf.Substring(pos + "<DBConfigTemplateFile>".Length, epos - (pos + "<DBConfigTemplateFile>".Length));
result.DBcnfTmp = DBcnfTmp;
}
pos = conf.IndexOf("<BackupConfigFile>");
epos = conf.IndexOf("</BackupConfigFile>");
if (pos != -1 && epos != -1)
{
BakCnf = conf.Substring(pos + "<BackupConfigFile>".Length, epos - (pos + "<BackupConfigFile>".Length));
result.BakCnf = BakCnf;
}
pos = conf.IndexOf("<BeWoPlanerMultitenancy>");
epos = conf.IndexOf("</BeWoPlanerMultitenancy>");
if (pos != -1 && epos != -1)
{
targetFolder = conf.Substring(pos + "<BeWoPlanerMultitenancy>".Length, epos - (pos + "<BeWoPlanerMultitenancy>".Length));
result.TargetFolder = targetFolder;
}
pos = conf.IndexOf("<BeWoPlanerBackupPath>");
epos = conf.IndexOf("</BeWoPlanerBackupPath>");
if (pos != -1 && epos != -1)
{
targetFolder2 = conf.Substring(pos + "<BeWoPlanerBackupPath>".Length, epos - (pos + "<BeWoPlanerBackupPath>".Length));
result.TargetFolder2 = targetFolder2;
}
// Create Dbcnf File
try
{
fs = File.OpenRead(DBcnfTmp);
sr = new StreamReader(fs);
tmp = sr.ReadToEnd();
id = db;
pos = tmp.IndexOf("<Template_Password>");
tmp = tmp.Remove(tmp.IndexOf("<Template_Password>"), "<Template_Password>".Length);
tmp = tmp.Insert(pos, pw);
pos = tmp.IndexOf("<Template_USERID>");
tmp = tmp.Remove(tmp.IndexOf("<Template_USERID>"), "<Template_USERID>".Length);
tmp = tmp.Insert(pos, user);
pos = tmp.IndexOf("<Template_DATABASE>");
tmp = tmp.Remove(tmp.IndexOf("<Template_DATABASE>"), "<Template_DATABASE>".Length);
tmp = tmp.Insert(pos, db);
fs = File.Create(targetFolder+"\\"+db+".config");
sw = new StreamWriter(fs);
sw.WriteLine(tmp);
sw.Flush();
sw.Close();
fs.Close();
result.DBCnfFileCreated = true;
}
catch
{
result.BakFileCreated = false;
}
try
{
fs = File.OpenRead(BakCnf);
sr = new StreamReader(fs);
tmp = sr.ReadToEnd();
id = db;
pos = tmp.IndexOf("<Kundenname>");
tmp = tmp.Remove(tmp.IndexOf("<Kundenname>"), "<Kundenname>".Length);
tmp = tmp.Insert(pos, customerName);
pos = tmp.IndexOf("<Kundennummer>");
tmp = tmp.Remove(tmp.IndexOf("<Kundennummer>"), "<Kundennummer>".Length);
tmp = tmp.Insert(pos, db);
fs = File.Create(targetFolder2 + "\\" + db + ".db2mail");
sw = new StreamWriter(fs);
sw.WriteLine(tmp);
sw.Flush();
sw.Close();
fs.Close();
result.BakFileCreated = true;
}
catch
{
result.BakFileCreated = false;
}
}
result.Success = true;
return result;
}
catch
{
result.Success = false;
throw new Exception("Could not open configuration file");
return result;
}
}
private String findDatabaseName(String query)
{
String id = query.Substring(query.IndexOf("CREATE DATABASE `") + "CREATE DATABASE `".Length, 10);
return id;
}
[WebMethod]
public DBAdminServiceReturnValue createDatabase(string userName, string pw, string port, string query, string customerName)
{
DBAdminServiceReturnValue ret = new DBAdminServiceReturnValue();
DBAdminServiceDBCreationReturnValue result = new DBAdminServiceDBCreationReturnValue();
string connStr = String.Format("server=localhost;user id={0}; password={1}; port={2}; database=mysql; pooling=false", Decrypt(userName), Decrypt(pw), Decrypt(port));
MySqlConnection conn = new MySqlConnection(connStr);
MySqlCommand com = new MySqlCommand(Decrypt(query), conn);
try
{
conn.Open();
com.ExecuteNonQuery();
ret.WasSuccessful = true;
result = this.generateDbFiles("localhost", Decrypt(userName), Decrypt(pw), this.findDatabaseName(Decrypt(query)), Decrypt(customerName));
if (result.BakFileCreated == false)
throw new Exception("Exception BakFileCreated");
if (result.DBCnfFileCreated == false)
throw new Exception("Exception DBCnfFileCreated");
}
catch (Exception e)
{
ret.WasSuccessful = false;
if(e.Message.Equals("Exception BakFileCreated"))
ret.ErrorMessage = String.Format("Konnte db2mail-Datei \"{0}\" nicht in \"{1}\" anlegen", result.BakCnf, result.TargetFolder2);
else if(e.Message.Equals("Exception DBCnfFileCreated"))
ret.ErrorMessage = String.Format("Konnte Datenbankkonfigurationsdatei \"{0}\" nicht in \"{1}\" anlegen", result.DBcnfTmp, result.TargetFolder);
else
ret.ErrorMessage = String.Format("Ausführen des SQL-Scriptes fehlgeschlagen. {0} ({1})", e.Message, e.GetType().ToString());
}
return ret;
}
[WebMethod]
public string[] GetDatabaseList(string userName, string pw, string port)
{
string connStr = String.Format("server=localhost;user id={0}; password={1}; port={2}; database=mysql; pooling=false", Decrypt(userName), Decrypt(pw), Decrypt(port));
List<string> dbList = new List<string>();
using (MySqlConnection conn = new MySqlConnection(connStr)) {
using (MySqlCommand cmd = new MySqlCommand("SHOW DATABASES", conn)) {
try {
conn.Open();
MySqlDataReader reader = cmd.ExecuteReader();
while (reader.Read())
dbList.Add(reader.GetString(0));
} catch (Exception e) {
dbList.Add(String.Format("Auslesen der Datenbanken fehlgeschlagen. {0} ({1})", e.Message, e.GetType().ToString()));
}
}
}
return dbList.ToArray();
}
[WebMethod]
public DBAdminServiceReturnValue ExecuteUpdateOnDatabase(string userName, string pw, string port, string db, string query)
{
string connStr = String.Format("server=localhost;user id={0}; password={1}; database={2}; port={3}; pooling=false", Decrypt(userName), Decrypt(pw), Decrypt(db), Decrypt(port));
DBAdminServiceReturnValue result = new DBAdminServiceReturnValue();
using (MySqlConnection conn = new MySqlConnection(connStr)) {
using (MySqlCommand command = new MySqlCommand(Decrypt(query), conn)) {
MySqlDataReader sqlReadData;
try {
conn.Open();
//command.ExecuteNonQuery();
sqlReadData = command.ExecuteReader();
this.queryResponse = new List<String>();
while(sqlReadData.Read())
{
string tmp = "";
for (int i = 0; i < sqlReadData.FieldCount; i++)
{
tmp += sqlReadData.GetName(i) + ": " + sqlReadData.GetValue(i).ToString() + "\n" ;
}
tmp += "-------\n";
this.queryResponse.Add(tmp);
result.QueryAnswer = queryResponse;
}
result.WasSuccessful = true;
} catch (Exception e) {
result.WasSuccessful = false;
result.ErrorMessage = Encrypt(String.Format("{0} ({1})", e.Message, e.GetType().ToString()));
result.QueryAnswer = null;
}
}
}
return result;
}
[WebMethod]
public DBAdminServiceReturnValue ExecuteHiddenUpdateOnDatabase(string userName, string pw, string db, string port, string query)
{
string connStr = String.Format("server=localhost;user id={0}; password={1}; database={2}; port={3};pooling=false", Decrypt(userName), Decrypt(pw), Decrypt(db), Decrypt(port));
DBAdminServiceReturnValue result = new DBAdminServiceReturnValue();
using (MySqlConnection conn = new MySqlConnection(connStr))
{
using (MySqlCommand command = new MySqlCommand(Decrypt(query), conn))
{
MySqlDataReader sqlReadData;
try
{
conn.Open();
sqlReadData = command.ExecuteReader();
this.queryResponse = new List<String>();
while (sqlReadData.Read())
{
string tmp = "";
for (int i = 0; i < sqlReadData.FieldCount; i++)
{
tmp += sqlReadData.GetValue(i).ToString() + "\n";
}
this.queryResponse.Add(tmp);
result.QueryAnswer = queryResponse;
}
result.WasSuccessful = true;
}
catch (Exception e)
{
result.WasSuccessful = false;
result.ErrorMessage = Encrypt(String.Format("{0} ({1})", e.Message, e.GetType().ToString()));
}
}
}
return result;
}
public List<String> QueryResponse
{
get { return this.queryResponse; }
private set { this.queryResponse = value; }
}
[WebMethod]
public DBAdminServiceReturnValue DatabaseIsReachable(string userName, string pw, string db, string port) {
string connStr = String.Format("server=localhost;user id={0}; password={1}; database={2}; port={3}; pooling=false", Decrypt(userName), Decrypt(pw), Decrypt(db), Decrypt(port));
DBAdminServiceReturnValue result = new DBAdminServiceReturnValue();
using (MySqlConnection conn = new MySqlConnection(connStr)) {
try {
conn.Open();
result.WasSuccessful = true;
} catch (Exception e) {
result.WasSuccessful = false;
result.ErrorMessage = Encrypt(e.Message + " (" + e.GetType().ToString() + ")");
}
}
return result;
}
[WebMethod]
public string[] GetTables(string userName, string pw, string db, string port)
{
string connStr = String.Format("server=localhost;user id={0}; password={1}; database={2}; port={3}; pooling=false", Decrypt(userName), Decrypt(pw), Decrypt(db), Decrypt(port));
List<string> tableList = new List<string>();
using (MySqlConnection conn = new MySqlConnection(connStr)) {
using (MySqlCommand cmd = new MySqlCommand("SHOW TABLES", conn)) {
try {
conn.Open();
MySqlDataReader reader = cmd.ExecuteReader();
while (reader.Read())
tableList.Add(Encrypt(reader.GetString(0)));
} catch (Exception e) {
tableList.Add(Encrypt(String.Format("Auslesen der Tabellen fehlgeschlagen. {0} ({1})", e.Message, e.GetType().ToString())));
}
}
}
return tableList.ToArray();
}
[WebMethod]
public string CreateNewTenantID() {
// TODO implement
// TODO implement create new Database
System.Threading.Thread.Sleep(500);
return "0000000000";
}
private static string Encrypt(string s) {
return EncryptionHelper.EncryptString(TransportEncryptionKey, s);
}
private static string Decrypt(string s) {
return EncryptionHelper.DecryptString(TransportEncryptionKey, s);
}
}
public class DBAdminServiceReturnValue {
bool wasSuccessful = true;
string errorMessage = "";
private List<String> queryAnswer = new List<String>();
public List<String> QueryAnswer
{
get { return this.queryAnswer; }
set { this.queryAnswer = value; }
}
public bool WasSuccessful {
get { return wasSuccessful; }
set { wasSuccessful = value; }
}
public string ErrorMessage {
get { return errorMessage; }
set { errorMessage = value; }
}
}
public class DBAdminServiceDBCreationReturnValue
{
private bool success;
public bool Success { get { return success; } set { success = value; } }
public bool DBCnfFileCreated { get; set; }
public bool BakFileCreated { get; set; }
public String TargetFolder { get; set; }
public String TargetFolder2 { get; set; }
public String BakCnf { set; get; }
public String DBcnfTmp { set; get; }
}
}

View File

@@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Allgemeine Informationen über eine Assembly werden über die folgenden
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
// die mit einer Assembly verknüpft sind.
[assembly: AssemblyTitle("DBAdminService")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Beyondsoft ")]
[assembly: AssemblyProduct("DBAdminService")]
[assembly: AssemblyCopyright("Copyright © Beyondsoft 2008")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar
// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von
// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest.
[assembly: ComVisible(false)]
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
[assembly: Guid("3d5900ae-111a-45be-96b3-d9e4606ca793")]
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
//
// Hauptversion
// Nebenversion
// Buildnummer
// Revision
//
// Sie können alle Werte angeben oder die standardmäßigen Revisions- und Buildnummern
// übernehmen, indem Sie "*" eingeben:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

108
DBAdminService/Web.config Normal file
View File

@@ -0,0 +1,108 @@
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>
<appSettings/>
<connectionStrings/>
<system.web>
<!--
Legen Sie beim Kompilieren debug="true" fest, um
Debugsymbole in die kompilierte Seite einzufügen.
Da dies die Leistung beeinträchtigt, sollte der
Wert nur beim Entwickeln auf "True" gesetzt werden.
-->
<compilation debug="true">
<assemblies>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<!--
Der Abschnitt <authentication> ermöglicht die Konfiguration
des Sicherheitsauthentifizierungsmodus, mit dem
ASP.NET eingehende Benutzer identifiziert.
-->
<authentication mode="Windows"/>
<!--
Der Abschnitt <customErrors> ermöglicht die Konfiguration
der Vorgehensweise bei unbehandelten Fehlern während
der Anforderungsausführung. Insbesondere können
Entwickler HTML-Fehlerseiten konfigurieren, die anstelle
einer Fehlerstapelüberwachung angezeigt werden.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</controls>
</pages>
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</httpModules>
</system.web>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
</compilers>
</system.codedom>
<!--
Der system.webServer-Abschnitt ist zum Ausführen von ASP.NET-AJAX unter
Internetinformationsdienste 7.0 erforderlich. Für frühere Versionen von
IIS ist er nicht erforderlich.
-->
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<remove name="ScriptModule"/>
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated"/>
<remove name="ScriptHandlerFactory"/>
<remove name="ScriptHandlerFactoryAppServices"/>
<remove name="ScriptResource"/>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</handlers>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@@ -0,0 +1,9 @@
<publishData>
<publishTarget publishUrl="C:\Dokumente und Einstellungen\MasslochL\Desktop\">
<file relUrl="bin/MySql.Data.dll" publishTime="08/14/2008 19:17:32" />
<file relUrl="bin/WebService1.dll" publishTime="12/11/2008 14:35:09" />
<file relUrl="Service1.asmx" publishTime="12/11/2008 14:24:12" />
<file relUrl="bin/WebService1.pdb" publishTime="12/11/2008 14:35:09" />
<file relUrl="Web.config" publishTime="12/11/2008 14:24:12" />
</publishTarget>
</publishData>

View File

@@ -0,0 +1,4 @@
<DBConfigTemplateFile>C:\Projects\beyondSoft\BeWoPlaner\BeWoAdmin\DBAdminService\DBcnfTemplate.config</DBConfigTemplateFile>
<BackupConfigFile>C:\Projects\beyondSoft\BeWoPlaner\BeWoAdmin\DBAdminService\template.db2mail</BackupConfigFile>
<BeWoPlanerMultitenancy>C:\Projects\beyondSoft\BeWoPlaner\BeWo\BeWo\Multitenancy</BeWoPlanerMultitenancy>
<BeWoPlanerBackupPath>C:\Projects\beyondSoft\BeWoPlaner\BeWo\BeWo\Multitenancy</BeWoPlanerBackupPath>

View File

@@ -0,0 +1,7 @@
<Kundenname>
cb@beyondsoft.de
localhost
3306
<Kundennummer>
BeWoUser
BeWoPl@ner!

View File

@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{3B0EDADE-2697-4936-9C15-E7BCB309AA14}</ProjectGuid>
<OutputType>library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DBToolControls</RootNamespace>
<AssemblyName>DBToolControls</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Drawing" />
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="UIAutomationProvider">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="PresentationCore">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="PresentationFramework">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="EncryptionHelper.cs" />
<Compile Include="Syntax.cs" />
<Compile Include="HighlightingRichTextBox.cs" />
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="SyntaxProvider.cs" />
<Compile Include="User.cs" />
<Compile Include="WpfMsgBox.xaml.cs">
<DependentUpon>WpfMsgBox.xaml</DependentUpon>
</Compile>
<Compile Include="WordBreaker.cs" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<AppDesigner Include="Properties\" />
</ItemGroup>
<ItemGroup>
<Page Include="WpfMsgBox.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,91 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Security.Cryptography;
using System.Security;
namespace DBToolControls {
public sealed class EncryptionHelper {
private EncryptionHelper() { }
private static UnicodeEncoding byteConverter = new UnicodeEncoding();
public static string EncryptString(string key, string stringToEncrypt) {
if (key.Length == 0) return stringToEncrypt;
byte[] dataToEncrypt = byteConverter.GetBytes(stringToEncrypt);
return ByteArrayToHexString(AESEncrypt(dataToEncrypt, CreateCryptoProvider(key)));
}
public static string DecryptString(string key, string encryptedData) {
if (key.Length == 0) return encryptedData;
byte[] decryptedData = AESDecrypt(HexStringToByteArray(encryptedData), CreateCryptoProvider(key));
return byteConverter.GetString(decryptedData);
}
public static SecureString DecryptStringAsSecureString(string key, string encryptedData) {
SecureString secStr = new SecureString();
if (key.Length == 0) {
foreach(char c in encryptedData)
secStr.AppendChar(c);
} else {
byte[] decryptedData = AESDecrypt(HexStringToByteArray(encryptedData), CreateCryptoProvider(key));
foreach (char c in byteConverter.GetString(decryptedData).ToCharArray())
secStr.AppendChar(c);
}
return secStr;
}
private static AesCryptoServiceProvider CreateCryptoProvider(String key) {
byte[] salt = {185, 209, 196, 142, 52, 143, 231, 113,
250, 70, 74, 119, 161, 120, 251, 7,
220, 254, 173, 80, 209, 217, 253, 8,
179, 134, 239, 176, 139, 20, 47, 116,
76, 253, 164, 195, 7, 97, 87, 245,
129, 183, 30, 70, 232, 203, 86, 117};
List<byte> keyAsByteList = new List<byte>(byteConverter.GetBytes(key.ToCharArray())).FindAll(b => b != 0);
byte[] sBytes = new byte[48];
for(int i=0; i<48; i++) {
sBytes[i] = keyAsByteList[i % keyAsByteList.Count];
}
byte[] returnIV = new byte[16];
for (int i = 0; i < 16; i++) {
returnIV[i] = (byte)(salt[i] ^ sBytes[i]);
}
byte[] returnKey = new byte[32];
for (int i = 16; i < 48; i++) {
returnKey[i-16] = (byte)(salt[i] ^ sBytes[i]);
}
AesCryptoServiceProvider returnValue = new AesCryptoServiceProvider();
returnValue.IV = returnIV;
returnValue.Key = returnKey;
return returnValue;
}
private static byte[] AESEncrypt(byte[] DataToEncrypt, AesCryptoServiceProvider aes) {
return aes.CreateEncryptor().TransformFinalBlock(DataToEncrypt, 0, DataToEncrypt.Length);
}
private static byte[] AESDecrypt(byte[] DataToDecrypt, AesCryptoServiceProvider aes) {
return aes.CreateDecryptor().TransformFinalBlock(DataToDecrypt, 0, DataToDecrypt.Length);
}
private static string ByteArrayToHexString(byte[] data) {
StringBuilder sb = new StringBuilder();
foreach (byte b in data)
sb.Append(String.Format("{0:X2}", b));
return sb.ToString();
}
private static byte[] HexStringToByteArray(string data) {
if (data.Length % 2 == 1) throw new CryptographicException("Invalid data");
byte[] bytes = new byte[data.Length / 2];
for (int i = 0; i < data.Length; i += 2)
bytes[i/2] = Byte.Parse(data.Substring(i, 2), System.Globalization.NumberStyles.HexNumber);
return bytes;
}
}
}

View File

@@ -0,0 +1,141 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Text.RegularExpressions;
[assembly: CLSCompliant(true)]
namespace DBToolControls {
public class HighlightingRichTextBox : RichTextBox {
private bool textHandlingInProgress;
private bool pasting;
private string lineStartOffset;
private SyntaxProvider syntaxProvider = new SyntaxProvider();
public SyntaxProvider SyntaxProvider {
get { return syntaxProvider; }
}
public string Text {
set {
Document.Blocks.Clear();
if (value.Length > 2) {
Document.Blocks.Add(new Paragraph(new Run(value.Substring(0, value.Length - 2))));
RebuildContent();
SelectAll();
}
}
get { return new TextRange(Document.ContentStart, Document.ContentEnd).Text; }
}
public HighlightingRichTextBox() {
Document.LineHeight = 1;
DataObject.AddPastingHandler(this, (sender, e) => pasting = true);
}
// keep indentation in new lines
protected override void OnPreviewKeyDown(KeyEventArgs e) {
if (e.Key == Key.Tab) {
CaretPosition.InsertTextInRun("\t");
if(CaretPosition.GetOffsetToPosition(Document.ContentEnd) != 0)
CaretPosition = CaretPosition.GetPositionAtOffset(1);
e.Handled = true;
} else if (e.Key == Key.Enter) {
TextRange range = new TextRange(CaretPosition.GetLineStartPosition(0), CaretPosition);
string s = range.Text;
lineStartOffset = s.Substring(0, s.Length - s.TrimStart().Length);
if (new List<string> { ")", ");", "}", "};" }.Contains(s.Trim())) { // unindent
if (lineStartOffset.EndsWith("\t")) {
lineStartOffset = lineStartOffset.Remove(lineStartOffset.Length - 1);
} else if (lineStartOffset.EndsWith(" ")) {
lineStartOffset = lineStartOffset.Remove(lineStartOffset.Length - 2);
}
range.Text = lineStartOffset + range.Text.Trim();
CaretPosition = range.End;
} else if (CaretPosition.GetPositionAtOffset(-1) != null) { // indent if line ends with ( or {
s = new TextRange(CaretPosition.GetPositionAtOffset(-1), CaretPosition).Text;
if (s.Length > 0 && new List<char> { '(', '{' }.Contains(s[0]))
lineStartOffset += " ";
}
}
base.OnPreviewKeyDown(e);
}
protected override void OnKeyUp(KeyEventArgs e) {
if (e.Key == Key.Enter)
CaretPosition.InsertTextInRun(lineStartOffset);
base.OnKeyUp(e);
}
// Syntax Highlighting
protected override void OnTextChanged(TextChangedEventArgs e) {
if (pasting) {
pasting = false;
RebuildContent();
} else if (!textHandlingInProgress) {
FormatTextAt(CaretPosition);
}
base.OnTextChanged(e);
}
private void FormatTextAt(TextPointer pointer) {
textHandlingInProgress = true;
TextRange range = WordBreaker.GetWordRange(pointer);
TextPointer temp = range.End.GetNextInsertionPosition(LogicalDirection.Backward);
if (temp != null) {
TextRange lastInput = new TextRange(range.End, temp);
if (SyntaxProvider.Delimiters.Contains(lastInput.Text[0]))
lastInput.ClearAllProperties();
}
ApplyFormatting(range);
temp = CaretPosition.GetPositionAtOffset(-3);
if (temp != null && !range.Contains(temp)) ApplyFormatting(WordBreaker.GetWordRange(temp));
textHandlingInProgress = false;
}
private void RebuildContent() {
textHandlingInProgress = true;
string s = new TextRange(Document.ContentStart, Document.ContentEnd).Text;
Paragraph p = new Paragraph();
string[] words = Regex.Split(s, SyntaxProvider.DelimitersAsRegExPattern);
if (words.Length < 2) return;
foreach (string word in words.Take(words.Length - 2).Where(w => w.Length > 0))
p.Inlines.Add(word.Trim().Length > 0 ? ApplyFormatting(new Run(word)) : new Run(word));
Document.Blocks.Clear();
Document.Blocks.Add(p);
CaretPosition = Document.ContentEnd;
textHandlingInProgress = false;
}
private void ApplyFormatting(TextRange range) {
Dictionary<DependencyProperty, object> formatting = SyntaxProvider.GetFormattingFor(range.Text);
if (formatting != null)
foreach (KeyValuePair<DependencyProperty, object> pv in formatting)
range.ApplyPropertyValue(pv.Key, pv.Value);
else
range.ClearAllProperties();
}
private Run ApplyFormatting(Run r) {
Dictionary<DependencyProperty, object> formatting = SyntaxProvider.GetFormattingFor(r.Text);
if (formatting != null)
foreach (KeyValuePair<DependencyProperty, object> pv in formatting)
r.SetValue(pv.Key, pv.Value);
return r;
}
}
}

View File

@@ -0,0 +1,56 @@
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// Allgemeine Informationen über eine Assembly werden über die folgenden
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
// die mit einer Assembly verknüpft sind.
[assembly: AssemblyTitle("DBToolControls")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Beyondsoft ")]
[assembly: AssemblyProduct("DBToolControls")]
[assembly: AssemblyCopyright("Copyright © Beyondsoft 2008")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar
// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von
// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest.
[assembly: ComVisible(false)]
//Um mit dem Erstellen lokalisierbarer Anwendungen zu beginnen, legen Sie
//<UICulture>ImCodeVerwendeteKultur</UICulture> in der .csproj-Datei
//in einer <PropertyGroup> fest. Wenn Sie in den Quelldateien beispielsweise Deutsch
//(Deutschland) verwenden, legen Sie <UICulture> auf \"de-DE\" fest. Heben Sie dann die Auskommentierung
//des nachstehenden NeutralResourceLanguage-Attributs auf. Aktualisieren Sie "en-US" in der nachstehenden Zeile,
//sodass es mit der UICulture-Einstellung in der Projektdatei übereinstimmt.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //Speicherort der designspezifischen Ressourcenwörterbücher
//(wird verwendet, wenn eine Ressource auf der Seite
// oder in den Anwendungsressourcen-Wörterbüchern nicht gefunden werden kann.)
ResourceDictionaryLocation.SourceAssembly //Speicherort des generischen Ressourcenwörterbuchs
//(wird verwendet, wenn eine Ressource auf der Seite, in der Anwendung oder einem
// designspezifischen Ressourcenwörterbuch nicht gefunden werden kann.)
)]
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
//
// Hauptversion
// Nebenversion
// Buildnummer
// Revision
//
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: NeutralResourcesLanguageAttribute("en")]

View File

@@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Dieser Code wurde von einem Tool generiert.
// Laufzeitversion:4.0.30319.17929
//
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
// der Code erneut generiert wird.
// </auto-generated>
//------------------------------------------------------------------------------
namespace DBToolControls.Properties {
using System;
/// <summary>
/// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
/// </summary>
// Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
// -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
// Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
// mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DBToolControls.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
/// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

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,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Dieser Code wurde von einem Tool generiert.
// Laufzeitversion:4.0.30319.17929
//
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
// der Code erneut generiert wird.
// </auto-generated>
//------------------------------------------------------------------------------
namespace DBToolControls.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}

View File

@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

33
DBToolControls/Syntax.cs Normal file
View File

@@ -0,0 +1,33 @@
using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Windows;
namespace DBToolControls {
public class Syntax {
private List<string> wordsToFormat = new List<string>();
private bool isCaseSensitive;
private Dictionary<DependencyProperty, object> propertyValues = new Dictionary<DependencyProperty, object>();
internal Dictionary<DependencyProperty, object> PropertyValues {
get { return propertyValues; }
}
public Syntax(bool caseSensitive) {
this.isCaseSensitive = caseSensitive;
}
internal bool Contains(string s) {
return wordsToFormat.Contains(isCaseSensitive ? s : s.ToLower());
}
public void AddWords(params string[] words) {
wordsToFormat.AddRange(isCaseSensitive ? words : words.Select(w => w.ToLower()));
}
public void AddFormatting(DependencyProperty dp, object value) {
propertyValues.Add(dp, value);
}
}
}

View File

@@ -0,0 +1,41 @@
using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Text.RegularExpressions;
namespace DBToolControls {
public class SyntaxProvider {
private static List<char> delimiters = new List<char>() { ' ', '\r', '\n', '\t', '(', ')', ';', ',', '.' };
public static ICollection<char> Delimiters {
get { return delimiters; }
}
public static string DelimitersAsRegExPattern {
get {
StringBuilder sb = new StringBuilder("(\\r\\n", 32);
foreach (char c in delimiters)
sb.AppendFormat("|{0}", Regex.Escape(c.ToString()));
return sb.Append(")").ToString();
}
}
private List<Syntax> syntaxes = new List<Syntax>();
// Constructor
public SyntaxProvider() {
syntaxes = new List<Syntax>();
}
// Mehods
public void AddSyntax(Syntax item) {
syntaxes.Add(item);
}
public Dictionary<DependencyProperty, object> GetFormattingFor(string wordToFormat) {
foreach (Syntax sy in syntaxes)
if (sy.Contains(wordToFormat)) return sy.PropertyValues;
return null;
}
}
}

62
DBToolControls/User.cs Normal file
View File

@@ -0,0 +1,62 @@
using System;
using System.Security;
using System.Runtime.InteropServices;
using DBToolControls;
using System.Xml.Linq;
namespace DBToolControls {
public class User : IDisposable{
public string Username { get; private set; }
private SecureString password;
public int PasswordLength {
get { return password.Length; }
}
public string PasswordAsInsecureString {
get {
IntPtr passwordBSTR = default(IntPtr);
try {
passwordBSTR = Marshal.SecureStringToBSTR(password);
return Marshal.PtrToStringBSTR(passwordBSTR);
} catch {
return "";
}
}
}
// Constructors
public User(string username) {
this.Username = username;
this.password = new SecureString();
}
public User(string username, SecureString password) {
this.Username = username;
this.password = password;
}
public User(string username, string encryptedPassword, string encryptionKey) {
this.Username = username;
this.password = EncryptionHelper.DecryptStringAsSecureString(encryptionKey, encryptedPassword);
}
// Methods
public string EncryptedPassword(string encryptionKey) {
return EncryptionHelper.EncryptString(encryptionKey, this.PasswordAsInsecureString);
}
public void Dispose() {
password.Dispose();
GC.SuppressFinalize(this);
}
public XElement ToXElement(string pw) {
return new XElement("User",
new XElement("Username", Username),
PasswordLength > 0 ? new XElement("Password", EncryptedPassword(pw)) : null);
}
}
}

View File

@@ -0,0 +1,80 @@
using System;
using System.Windows;
using System.Windows.Documents;
using System.Collections.Generic;
namespace DBToolControls {
public static class WordBreaker {
/// <summary>
/// Returns a TextRange covering a word containing or following this TextPointer.
/// </summary>
/// <remarks>
/// If this TextPointer is within a word or at start of word, the containing word range is returned.
/// If this TextPointer is between two words, the following word range is returned.
/// If this TextPointer is at trailing word boundary, the following word range is returned.
/// </remarks>
///
public static TextRange GetWordRange(TextPointer position) {
TextRange wordRange = null;
TextPointer wordStartPosition = null;
TextPointer wordEndPosition = null;
// Go forward first, to find word end position.
wordEndPosition = GetPositionAtWordBoundary(position, /*wordBreakDirection*/LogicalDirection.Forward);
if (wordEndPosition != null) {
// Then travel backwards, to find word start position.
wordStartPosition = GetPositionAtWordBoundary(wordEndPosition, /*wordBreakDirection*/LogicalDirection.Backward);
}
if (wordStartPosition != null && wordEndPosition != null) {
wordRange = new TextRange(wordStartPosition, wordEndPosition);
}
return wordRange;
}
/// <summary>
/// 1. When wordBreakDirection = Forward, returns a position at the end of the word,
/// i.e. a position with a wordBreak character (space) following it.
/// 2. When wordBreakDirection = Backward, returns a position at the start of the word,
/// i.e. a position with a wordBreak character (space) preceeding it.
/// 3. Returns null when there is no workbreak in the requested direction.
/// </summary>
///
private static TextPointer GetPositionAtWordBoundary(TextPointer position, LogicalDirection wordBreakDirection) {
if (!position.IsAtInsertionPosition) {
position = position.GetInsertionPosition(wordBreakDirection);
}
TextPointer navigator = position;
while (navigator != null && !IsPositionNextToWordBreak(navigator, wordBreakDirection)) {
navigator = navigator.GetNextInsertionPosition(wordBreakDirection);
}
return navigator;
}
// Helper for GetPositionAtWordBoundary.
// Returns true when passed TextPointer is next to a wordBreak in requested direction.
private static bool IsPositionNextToWordBreak(TextPointer position, LogicalDirection wordBreakDirection) {
bool isAtWordBoundary = false;
// Skip over any formatting.
if (position.GetPointerContext(wordBreakDirection) != TextPointerContext.Text) {
position = position.GetInsertionPosition(wordBreakDirection);
}
if (position.GetPointerContext(wordBreakDirection) == TextPointerContext.Text) {
LogicalDirection oppositeDirection = (wordBreakDirection == LogicalDirection.Forward) ?
LogicalDirection.Backward : LogicalDirection.Forward;
char[] runBuffer = new char[1];
char[] oppositeRunBuffer = new char[1];
position.GetTextInRun(wordBreakDirection, runBuffer, /*startIndex*/0, /*count*/1);
position.GetTextInRun(oppositeDirection, oppositeRunBuffer, /*startIndex*/0, /*count*/1);
if (SyntaxProvider.Delimiters.Contains(runBuffer[0]) && !(SyntaxProvider.Delimiters.Contains(oppositeRunBuffer[0]))) {
isAtWordBoundary = true;
}
} else {
// If we're not adjacent to text then we always want to consider this position a "word break".
// In practice, we're most likely next to an embedded object or a block boundary.
isAtWordBoundary = true;
}
return isAtWordBoundary;
}
}
}

View File

@@ -0,0 +1,19 @@
<Window x:Class="DBToolControls.WpfMsgBox"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
SizeToContent="WidthAndHeight" WindowStyle="None" ShowInTaskbar="False" ResizeMode="NoResize" Background="Transparent" AllowsTransparency="True">
<Border BorderBrush="LightGray" BorderThickness="1" CornerRadius="5" Background="WhiteSmoke" SnapsToDevicePixels="True" MouseLeftButtonDown="StartDrag">
<StackPanel>
<StackPanel Margin="11 12 11 10" Orientation="Horizontal" HorizontalAlignment="Center">
<Image Name="BoxIcon" Stretch="None" VerticalAlignment="Center" Margin="0 0 10 0" />
<TextBlock Name="MessageText" VerticalAlignment="Center">Dies ist ein Testtext.</TextBlock>
</StackPanel>
<StackPanel Name="buttonPanel" HorizontalAlignment="Center" Orientation="Horizontal" Margin="9 3 9 10">
<Button Name="OkButton" MinWidth="80" Padding="2" Visibility="Collapsed" Margin="2" Click="Button_Click">OK</Button>
<Button Name="YesButton" MinWidth="80" Padding="2" Visibility="Collapsed" Margin="2" Click="Button_Click">Ja</Button>
<Button Name="NoButton" MinWidth="80" Padding="2" Visibility="Collapsed" Margin="2" Click="Button_Click">Nein</Button>
<Button Name="CancelButton" MinWidth="80" Padding="2" Visibility="Collapsed" Margin="2" Click="Button_Click">Abbrechen</Button>
</StackPanel>
</StackPanel>
</Border>
</Window>

View File

@@ -0,0 +1,111 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using IconImage = System.Drawing.Icon;
using System.IO;
namespace DBToolControls {
/// <summary>
/// Interaktionslogik für Window1.xaml
/// </summary>
public partial class WpfMsgBox : Window {
public MessageBoxResult Result { get; private set; }
private WpfMsgBox(string message, MessageBoxButton buttons, MessageBoxImage icon, MessageBoxResult defaultResult) {
InitializeComponent();
// Message
MessageText.Text = message;
// Buttons
if (buttons == MessageBoxButton.OK || buttons == MessageBoxButton.OKCancel) {
OkButton.Visibility = Visibility.Visible;
OkButton.Focus();
if (buttons == MessageBoxButton.OK) OkButton.IsCancel = true;
}
if (buttons == MessageBoxButton.YesNoCancel || buttons == MessageBoxButton.OKCancel) {
CancelButton.Visibility = Visibility.Visible;
CancelButton.IsCancel = true;
}
if (buttons == MessageBoxButton.YesNo || buttons == MessageBoxButton.YesNoCancel) {
YesButton.Visibility = Visibility.Visible;
NoButton.Visibility = Visibility.Visible;
if (buttons == MessageBoxButton.YesNo) NoButton.IsCancel = true;
YesButton.Focus();
}
// Icon
if (icon == MessageBoxImage.Asterisk) BoxIcon.Source = GetBitmapImageFromIcon(System.Drawing.SystemIcons.Asterisk);
else if (icon == MessageBoxImage.Error) BoxIcon.Source = GetBitmapImageFromIcon(System.Drawing.SystemIcons.Error);
else if (icon == MessageBoxImage.Exclamation) BoxIcon.Source = GetBitmapImageFromIcon(System.Drawing.SystemIcons.Exclamation);
else if (icon == MessageBoxImage.Hand) BoxIcon.Source = GetBitmapImageFromIcon(System.Drawing.SystemIcons.Hand);
else if (icon == MessageBoxImage.Information) BoxIcon.Source = GetBitmapImageFromIcon(System.Drawing.SystemIcons.Information);
else if (icon == MessageBoxImage.Question) BoxIcon.Source = GetBitmapImageFromIcon(System.Drawing.SystemIcons.Question);
else if (icon == MessageBoxImage.Stop) BoxIcon.Source = GetBitmapImageFromIcon(System.Drawing.SystemIcons.Hand);
else if (icon == MessageBoxImage.Warning) BoxIcon.Source = GetBitmapImageFromIcon(System.Drawing.SystemIcons.Warning);
else BoxIcon.Visibility = Visibility.Collapsed;
// DefaultResult
Result = (defaultResult == MessageBoxResult.None) ? MessageBoxResult.OK : defaultResult;
OkButton.Tag = MessageBoxResult.OK;
CancelButton.Tag = MessageBoxResult.Cancel;
YesButton.Tag = MessageBoxResult.Yes;
NoButton.Tag = MessageBoxResult.No;
}
private void Button_Click(object sender, RoutedEventArgs e) {
Result = (MessageBoxResult)(sender as Button).Tag ;
Close();
}
private static BitmapImage GetBitmapImageFromIcon(IconImage ico) {
System.Drawing.Bitmap bmp = ico.ToBitmap();
MemoryStream strm = new MemoryStream();
bmp.Save(strm, System.Drawing.Imaging.ImageFormat.Png);
BitmapImage bmpImage = new BitmapImage();
bmpImage.BeginInit();
strm.Seek(0, SeekOrigin.Begin);
bmpImage.StreamSource = strm;
bmpImage.EndInit();
return bmpImage;
}
private void StartDrag(object sender, MouseButtonEventArgs e) {
this.DragMove();
}
// static Show-Methods
public static MessageBoxResult Show(Window owner, string messageBoxText, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult) {
WpfMsgBox box = new WpfMsgBox(messageBoxText, button, icon, defaultResult);
box.Owner = owner;
box.WindowStartupLocation = WindowStartupLocation.CenterOwner;
box.ShowDialog();
return box.Result;
}
public static MessageBoxResult Show(Window owner, string messageBoxText) {
return Show(owner, messageBoxText, MessageBoxButton.OK, MessageBoxImage.None, MessageBoxResult.OK);
}
public static MessageBoxResult Show(Window owner, string messageBoxText, MessageBoxButton button) {
return Show(owner, messageBoxText, button, MessageBoxImage.None, MessageBoxResult.OK);
}
public static MessageBoxResult Show(Window owner, string messageBoxText, MessageBoxButton button, MessageBoxImage icon) {
return Show(owner, messageBoxText, button, icon, MessageBoxResult.OK);
}
}
}

39
SQL/Rechnungsliste.sql Normal file
View File

@@ -0,0 +1,39 @@
select
uniontable.`1` as 'Erf.-Datum',
uniontable.`2` as 'Valutadatum',
uniontable.`3` as 'Beleg-Nr.',
uniontable.`4` as 'Kontonummer',
uniontable.`5` as 'Gegenkonto',
ROUND(uniontable.`6`,2) as 'Betrag',
uniontable.`7` as 'Buchungstext'
from
((select DATE(NOW()) as '1', DATE(ib.`InvoiceDate`) as '2', ib.`InvoiceNumber` as '3',
c.`DebitorNumber` as '4',
'8011' as '5',
ii.`GrossAmountTotal` as '6',
p.`LastName` as '7'
from `invoiceitem` ii
inner join `invoicebase` ib on ii.`InvoiceBaseOid` = ib.`Oid`
inner join `supportconcept` sc on ib.`SupportConceptOid` = sc.`Oid`
inner join `customer` c on sc.`CustomerOid` = c.`Oid`
inner join `person` p on c.`PersonOid` = p.`Oid`
where

2973
SQL/create_Empty_MySQL.sql Normal file

File diff suppressed because it is too large Load Diff

670
SQL/inserts.sql Normal file
View File

@@ -0,0 +1,670 @@
#
# Medikamentenverordnung
#
INSERT INTO medverorddarform(tid, isactive, insts, insuser, version, udpuser, bezeichnung, wert) VALUES(99, 1, now(), 'System', 1 , 'System', 'Tabl.', 0);
INSERT INTO medverorddarform(tid, isactive, insts, insuser, version, udpuser, bezeichnung, wert) VALUES(99, 1, now(), 'System', 1 , 'System', 'Drag.', 1);
INSERT INTO medverorddarform(tid, isactive, insts, insuser, version, udpuser, bezeichnung, wert) VALUES(99, 1, now(), 'System', 1 , 'System', 'Trpf.', 2);
INSERT INTO medverorddarform(tid, isactive, insts, insuser, version, udpuser, bezeichnung, wert) VALUES(99, 1, now(), 'System', 1 , 'System', 'Kps.', 3);
INSERT INTO medverorddarform(tid, isactive, insts, insuser, version, udpuser, bezeichnung, wert) VALUES(99, 1, now(), 'System', 1 , 'System', 'ml', 4);
INSERT INTO medverorddarform(tid, isactive, insts, insuser, version, udpuser, bezeichnung, wert) VALUES(99, 1, now(), 'System', 1 , 'System', 'Spray', 5);
INSERT INTO medverorddarform(tid, isactive, insts, insuser, version, udpuser, bezeichnung, wert) VALUES(99, 1, now(), 'System', 1 , 'System', 'Becher', 6);
INSERT INTO medverorddarform(tid, isactive, insts, insuser, version, udpuser, bezeichnung, wert) VALUES(99, 1, now(), 'System', 1 , 'System', 'Zäpf.', 7);
INSERT INTO medverorddarform(tid, isactive, insts, insuser, version, udpuser, bezeichnung, wert) VALUES(99, 1, now(), 'System', 1 , 'System', 'i.m.', 8);
INSERT INTO medverorddarform(tid, isactive, insts, insuser, version, udpuser, bezeichnung, wert) VALUES(99, 1, now(), 'System', 1 , 'System', 'i.v.', 9);
INSERT INTO medverorddarform(tid, isactive, insts, insuser, version, udpuser, bezeichnung, wert) VALUES(99, 1, now(), 'System', 1 , 'System', 'subkutan', 10);
INSERT INTO medverorddepotrhythmus(tid, isactive, insts, insuser, version, udpuser, bezeichnung, wert) VALUES(100, 1, now(), 'System', 1 , 'System', '', 0);
INSERT INTO medverorddepotrhythmus(tid, isactive, insts, insuser, version, udpuser, bezeichnung, wert) VALUES(100, 1, now(), 'System', 1 , 'System', 'wöchentlich', 1);
INSERT INTO medverorddepotrhythmus(tid, isactive, insts, insuser, version, udpuser, bezeichnung, wert) VALUES(100, 1, now(), 'System', 1 , 'System', '2-wöchentlich', 2);
INSERT INTO medverorddepotrhythmus(tid, isactive, insts, insuser, version, udpuser, bezeichnung, wert) VALUES(100, 1, now(), 'System', 1 , 'System', 'monatlich', 3);
INSERT INTO medverorddepotrhythmus(tid, isactive, insts, insuser, version, udpuser, bezeichnung, wert) VALUES(100, 1, now(), 'System', 1 , 'System', '3-monatlich', 4);
INSERT INTO medverorddepotrhythmus(tid, isactive, insts, insuser, version, udpuser, bezeichnung, wert) VALUES(100, 1, now(), 'System', 1 , 'System', 'halbjährlich', 5);
INSERT INTO medverorddepotrhythmus(tid, isactive, insts, insuser, version, udpuser, bezeichnung, wert) VALUES(100, 1, now(), 'System', 1 , 'System', 'jährlich', 6);
INSERT INTO medverorddepotrhythmus(tid, isactive, insts, insuser, version, udpuser, bezeichnung, wert) VALUES(100, 1, now(), 'System', 1 , 'System', 'täglich', 7);
INSERT INTO medverorddepotrhythmus(tid, isactive, insts, insuser, version, udpuser, bezeichnung, wert) VALUES(100, 1, now(), 'System', 1 , 'System', '6-wöchentlich', 8);
INSERT INTO medverorddepotrhythmus(tid, isactive, insts, insuser, version, udpuser, bezeichnung, wert) VALUES(100, 1, now(), 'System', 1 , 'System', '2tägig', 9);
INSERT INTO medverorddepotrhythmus(tid, isactive, insts, insuser, version, udpuser, bezeichnung, wert) VALUES(100, 1, now(), 'System', 1 , 'System', '3-wöchentlich', 10);
#
# LVR
#
INSERT INTO `address` (`Oid`, `Tid`, `Street`, `PostalCode`, `Town`, `State`, `Country`, `Notice`, `InsTs`, `InsUser`, `Version`, `UdpUser`, `IsActive`, `SystemEntryID`) VALUES
(1,5,'Kennedy-Ufer 2','50663 ','Köln',NULL,NULL,NULL,'2008-11-10 11:18:42','Max Mustermann',1,'Max Mustermann',1,NULL);
COMMIT;
INSERT INTO `costbearer` (`Oid`, `Tid`, `HourlyRate`, `RateFactor`, `Notice`, `InsTs`, `InsUser`, `UdpUser`, `Version`, `IsActive`, `MinutesIntervall`, `ReferenceNumber`, `SystemEntryID`) VALUES
(1,22,49.9000000000,20.0000000000,NULL,'2008-10-05 19:12:11','Max Mustermann','Max Mustermann',1,1,10,NULL,0);
COMMIT;
INSERT INTO `organisation` (`Oid`, `BankAccountOid`, `AddressOid`, `CostBearerOid`, `Tid`, `Notice`, `InsTs`, `InsUser`, `Version`, `UdpUser`, `Name`, `IsActive`, `SystemEntryID`) VALUES
(1,NULL,1,1,11,NULL,'2008-10-05 19:12:11','Max Mustermann',2,'Max Mustermann','LVR',1,NULL);
COMMIT;
INSERT INTO `costrateperiod` (`Oid`, `ObjectOid`, `ObjectTid`, `CostRateType`, `CostRateValue`, `StartDate`, `EndDate`, `Notice`, `InsTs`, `InsUser`, `Version`, `UdpUser`, `IsActive`, `SystemEntryID`, `UnitName`) VALUES
(1,1,22,0,50.4000000000,NULL,NULL,NULL,'2009-09-30 00:00:00','BS',1,'BS',1,NULL, NULL),
(2,1,22,1,10.0000000000,NULL,NULL,NULL,'2009-09-30 00:00:00','BS',1,'BS',1,NULL, NULL),
(3,1,22,2,20.0000000000,NULL,NULL,NULL,'2009-09-30 00:00:00','BS',1,'BS',1,NULL, NULL),
(4,1,22,3,60.0000000000,NULL,NULL,NULL,'2009-09-30 00:00:00','BS',1,'BS',1,NULL, 'FLS');
COMMIT;
#
# LVL
#
INSERT INTO `address` (`Oid`, `Tid`, `Street`, `PostalCode`, `Town`, `State`, `Country`, `Notice`, `InsTs`, `InsUser`, `Version`, `UdpUser`, `IsActive`, `SystemEntryID`) VALUES
(2,5,'Warendorfer Straße 26-28','48145 ','Münster',NULL,NULL,NULL,'2008-11-10 11:18:42','Max Mustermann',1,'Max Mustermann',1,NULL);
COMMIT;
INSERT INTO `costbearer` (`Oid`, `Tid`, `HourlyRate`, `RateFactor`, `Notice`, `InsTs`, `InsUser`, `UdpUser`, `Version`, `IsActive`, `MinutesIntervall`, `ReferenceNumber`, `SystemEntryID`, `IsCalculatingWithFactor`, `ID`) VALUES
(2,22,NULL,NULL,NULL,'2008-10-05 19:12:11','Max Mustermann','Max Mustermann',1,1,10,NULL,0,1,'LWLNEU');
COMMIT;
INSERT INTO `organisation` (`Oid`, `BankAccountOid`, `AddressOid`, `CostBearerOid`, `Tid`, `Notice`, `InsTs`, `InsUser`, `Version`, `UdpUser`, `Name`, `IsActive`, `SystemEntryID`) VALUES
(2,NULL,2,2,11,NULL,'2008-10-05 19:12:11','Max Mustermann',2,'Max Mustermann','LWL',1,NULL);
COMMIT;
INSERT INTO `costrateperiod` (`Oid`, `ObjectOid`, `ObjectTid`, `CostRateType`, `CostRateValue`, `StartDate`, `EndDate`, `Notice`, `InsTs`, `InsUser`, `Version`, `UdpUser`, `IsActive`, `SystemEntryID`, `UnitName`) VALUES
(5,2,22,0,53.1000000000,NULL,NULL,NULL,'2009-09-30 00:00:00','BS',1,'BS',1,NULL, NULL),
(6,2,22,1,10.0000000000,NULL,NULL,NULL,'2009-09-30 00:00:00','BS',1,'BS',1,NULL, NULL),
(7,2,22,2,20.0000000000,NULL,NULL,NULL,'2009-09-30 00:00:00','BS',1,'BS',1,NULL, NULL),
(8,2,22,3,60.0000000000,NULL,NULL,NULL,'2009-09-30 00:00:00','BS',1,'BS',1,NULL, 'FLS');
COMMIT;
INSERT INTO `query` (`Oid`, `Tid`, `Type`, `Title`, `Sql`, `Notice`, `InsTs`, `InsUser`, `UdpUser`, `Version`, `IsActive`, `SystemEntryID`, `UserGroupOids`, `ReportTypeName`) VALUES
(1,24,0,'Gesamtliste Geburtstage','select LastName as Nachname, FirstName as Vorname, DateOfBirth as Geburtstag, case Type when 1 then ''Angestellte(r)'' when 2 then ''Klient(in)''\twhen 3 then ''Umfeld'' end as Typ from person where dateofbirth is not null and isactive=1 order by lastname',NULL,'2008-06-23 16:16:02',NULL,NULL,1,1,NULL,NULL,NULL),
(2,24,0,'Kommende Geburtstage (nächste 60 Tage)','select LastName as Nachname, FirstName as Vorname, DateOfBirth as Geburtstag, case Type when 1 then ''Angestellte(r)'' when 2 then ''Klient(in)''\twhen 3 then ''Umfeld'' end as Typ from person where dayofyear(DateOfBirth) between dayofyear(CURDATE()) and (dayofyear(CURDATE()) + 60) and isactive=1 order by lastname',NULL,'2008-06-23 18:56:39',NULL,NULL,1,1,NULL,NULL,NULL),
(3,24,0,'Organisationen Stammdaten','select distinct o.`Name`, a.Street as Strasse, a.PostalCode as PLZ, a.Town as Ort, c4.`value` as Ansprechpartner, c5.`value` as Postfach, c0.`value` as Telefon, c1.`value` as Fax, c2.`value` as Mail, c3.`value` as Homepage from Organisation o left join Address a on o.addressOid = a.oid left join Contact c0 on o.Oid = c0.OrganisationOid and c0.`Type` = 3 left join Contact c1 on o.Oid = c1.OrganisationOid and c1.`Type` = 5 left join Contact c2 on o.Oid = c2.OrganisationOid and c2.`Type` = 7 left join Contact c3 on o.Oid = c3.OrganisationOid and c3.`Type` = 9 left join Contact c4 on o.Oid = c4.OrganisationOid and c4.`Type` = 10 left join Contact c5 on o.Oid = c5.OrganisationOid and c5.`Type` = 11 where o.isactive=1 order by o.`Name`',NULL,'2008-06-23 19:45:48',NULL,NULL,1,1,NULL,NULL,NULL),
(4,24,0,'Stammdaten aller Klienten','select distinct p.Lastname as Nachname, p.FirstName as Vorname, p.DateOfBirth as Geburtstag, a.Street as Strasse, a.PostalCode as PLZ, a.Town as Ort, c0.`value` as Telefon, c1.`value` as Handy, c2.`value` as Fax, c3.`value` as Mail from customer c inner join Person p on c.personoid = p.oid left join Address a on p.addressoid = a.oid left join Contact c0 on p.Oid = c0.PersonOid and c0.`Type` = 3 left join Contact c1 on p.Oid = c1.PersonOid and c1.`Type` = 1 left join Contact c2 on p.Oid = c2.PersonOid and c2.`Type` = 5 left join Contact c3 on p.Oid = c3.PersonOid and c3.`Type` = 7 where c.isactive=1 order by p.LastName',NULL,'2008-06-24 11:57:10',NULL,NULL,1,1,NULL,NULL,NULL),
(5,24,0,'Personen Stammdaten dienstlich','select distinct o.`Name` as Organisation, p.Lastname as Nachname, p.FirstName as Vorname, c0.`Value` as ''Tel. (dienstl.)'', c1.`Value` as ''Fax (dienstl.)'', c2.`Value` as ''Mail (dienstl.)'', a.Street as ''Strasse (dienstl.)'', a.PostalCode as ''PLZ (dienstl.)'', a.Town as ''Ort (dienstl.)'' from person p inner join organisation2person o2p on o2p.personoid = p.oid inner join organisation o on o2p.organisationoid = o.oid left join address a on o.addressoid = a.oid left join contact c0 on c0.organisation2personoid = o2p.oid and c0.`type` = 3 left join contact c1 on c1.organisation2personoid = o2p.oid and c1.`type` = 5 left join contact c2 on c2.organisation2personoid = o2p.oid and c2.`type` = 7 where p.Type = 3 and p.isactive=1 and o.isactive=1 order by p.lastname',NULL,'2008-06-24 12:47:32',NULL,NULL,1,1,NULL,NULL,NULL),
(6,24,0,'Hilfepläne die innerhalb der nächsten 3 Monate auslaufen','select p.LastName as Nachname, p.FirstName as Vorname, ROUND(DATEDIFF(CURDATE(), cb2sc.`RequestedStartDate`) / 30, 2) as ''Monate seit Beginn der Betreuung'', cb2sc.ApprovedStartDate as ''Bewilligt von'', cb2sc.ApprovedEndDate as ''Bewilligt bis'', o.`Name` as ''Kostentraeger'', (select CONCAT(emp1p.`FirstName`, '' '', emp1p.`LastName`) from employee emp1 join `person` emp1p on emp1p.`Oid` = emp1.`PersonOid` where emp1.`Oid` in (select employeeoid from `employee2customer` e2c1 join `valuelistentry2object` vl2o on e2c1.`Oid` = vl2o.`ObjectOid` join `valuelistentry` vle on vl2o.`ValueListEntryOid` = vle.`Oid` where e2c1.`CustomerOid` = cust.`Oid` and vle.`SystemEntryID` = 3) LIMIT 1) as ''Bezugsbetreuung'' from `person` p join `customer` cust on p.Oid = cust.PersonOid join `supportconcept` sc on cust.Oid = sc.CustomerOid join `costbearer2supportconcept` cb2sc on sc.Oid = cb2sc.SupportConceptOid join `costbearer` cb on cb2sc.`CostBearerOid` = cb.`Oid` join `organisation` o on cb.`Oid` = o.`CostBearerOid` WHERE cb2sc.ApprovedEndDate is not null and cb2sc.ApprovedEndDate > CURDATE() and cb2sc.ApprovedEndDate <= DATE_ADD(CURDATE(), INTERVAL 3 MONTH) and cust.IsActive <> 0 and sc.IsActive <> 0 order by Bezugsbetreuung;',NULL,NULL,NULL,NULL,1,1,NULL,NULL,NULL),
(7,24,0,'Hilfepläne die innerhalb der nächsten 7 Tage auslaufen','select p.LastName as Nachname, p.FirstName as Vorname, ROUND(DATEDIFF(CURDATE(), cb2sc.`RequestedStartDate`) / 30, 2) as ''Monate seit Beginn der Betreuung'', cb2sc.ApprovedStartDate as ''Bewilligt von'', cb2sc.ApprovedEndDate as ''Bewilligt bis'', o.`Name` as ''Kostentraeger'', (select CONCAT(emp1p.`FirstName`, '' '', emp1p.`LastName`) from employee emp1 join `person` emp1p on emp1p.`Oid` = emp1.`PersonOid` where emp1.`Oid` in (select employeeoid from `employee2customer` e2c1 join `valuelistentry2object` vl2o on e2c1.`Oid` = vl2o.`ObjectOid` join `valuelistentry` vle on vl2o.`ValueListEntryOid` = vle.`Oid` where e2c1.`CustomerOid` = cust.`Oid` and vle.`SystemEntryID` = 3) LIMIT 1) as ''Bezugsbetreuung'' from `person` p join `customer` cust on p.Oid = cust.PersonOid join `supportconcept` sc on cust.Oid = sc.CustomerOid join `costbearer2supportconcept` cb2sc on sc.Oid = cb2sc.SupportConceptOid join `costbearer` cb on cb2sc.`CostBearerOid` = cb.`Oid` join `organisation` o on cb.`Oid` = o.`CostBearerOid` WHERE cb2sc.ApprovedEndDate is not null and cb2sc.ApprovedEndDate > CURDATE() and cb2sc.ApprovedEndDate < DATE_ADD(CURDATE(), INTERVAL 8 DAY) and cust.IsActive <> 0 and sc.IsActive <> 0 order by Bezugsbetreuung;',NULL,NULL,NULL,NULL,1,1,NULL,NULL,NULL),
(8,24,0,'Hilfepläne ohne Bewilligung','select p.LastName as Nachname, p.FirstName as Vorname, ROUND(DATEDIFF(CURDATE(), cb2sc.`RequestedStartDate`) / 30, 2) as ''Monate seit Beginn der Betreuung'', cb2sc.`RequestedStartDate` as ''Beantragt von'', cb2sc.`RequestedEndDate` as ''Beantragt bis'', o.`Name` as ''Kostentraeger'', (select CONCAT(emp1p.`FirstName`, '' '', emp1p.`LastName`) from employee emp1 join `person` emp1p on emp1p.`Oid` = emp1.`PersonOid` where emp1.`Oid` in (select employeeoid from `employee2customer` e2c1 join `valuelistentry2object` vl2o on e2c1.`Oid` = vl2o.`ObjectOid` join `valuelistentry` vle on vl2o.`ValueListEntryOid` = vle.`Oid` where e2c1.`CustomerOid` = cust.`Oid` and vle.`SystemEntryID` = 3) LIMIT 1) as ''Bezugsbetreuung'' from `person` p join `customer` cust on p.Oid = cust.PersonOid join `supportconcept` sc on cust.Oid = sc.CustomerOid join `costbearer2supportconcept` cb2sc on sc.Oid = cb2sc.SupportConceptOid join `costbearer` cb on cb2sc.`CostBearerOid` = cb.`Oid` join `organisation` o on cb.`Oid` = o.`CostBearerOid` WHERE cb2sc.`Status` <> 2 and cust.IsActive = 1 and sc.IsActive = 1 order by Bezugsbetreuung;',NULL,NULL,NULL,NULL,1,1,NULL,NULL,NULL),
(9,24,0,'Abwesenheiten der Mitarbeiter','select p.`FirstName` as Vorname, p.`LastName` as Nachname, ar.`Description` as Kategorie, at.`Start` as von, at.`EndTime` as bis, at.`Notice` as Bemerkung from `person` p inner join `employee` emp on p.`Oid` = emp.`PersonOid` inner join `absencetime` at on emp.`Oid` = at.`EmployeeOid` inner join `absencereason` ar on at.`AbsenceReasonOid` = ar.`Oid` where emp.`IsActive` = 1 order by p.`LastName`;',NULL,NULL,NULL,NULL,1,1,NULL,NULL,NULL),
(10,24,0,'Abwesenheiten der Klienten','select p.`FirstName` as Vorname, p.`LastName` as Nachname, ar.`Description` as Kategorie, at.`Start` as von, at.`EndTime` as bis, at.`Notice` as Bemerkung from `person` p inner join `customer` c on p.`Oid` = c.`PersonOid` inner join `absencetime` at on c.`Oid` = at.`CustomerOid` inner join `absencereason` ar on at.`AbsenceReasonOid` = ar.`Oid` where c.`IsActive` = 1 order by p.`LastName`;',NULL,NULL,NULL,NULL,1,1,NULL,NULL,NULL);
COMMIT;
update person set isactive = 1 where type = 1 and oid in (select personoid from employee where isactive = 1);
update person set isactive = 1 where type = 2 and oid in (select personoid from customer where isactive = 1);
update person set isactive = 1 where type = 1 and oid in (select personoid from employee where isactive = 1);
update person set isactive = 1 where type = 2 and oid in (select personoid from customer where isactive = 1);
update person set isactive = 0 where type = 1 and oid in (select personoid from employee where isactive = 0);
update person set isactive = 0 where type = 2 and oid in (select personoid from customer where isactive = 0);
update person set isactive = 2 where type = 1 and oid in (select personoid from employee where isactive = 2);
update person set isactive = 2 where type = 2 and oid in (select personoid from customer where isactive = 2);
commit;
#
# Data for the `absencereason` table (LIMIT 0,500)
#
INSERT INTO `absencereason` (`Oid`, `Tid`, `Description`, `Hours`, `Notice`, `InsTs`, `InsUser`, `Version`, `UdpUser`, `IsActive`, `SystemEntryID`, `Color`) VALUES
(5,13,'Krankenhausaufenthalt',120,NULL,'2010-10-25 14:19:19','Mitarbeiter 1',1,'Mitarbeiter 1',1,NULL,NULL),
(6,13,'Krankenhausaufenthalt unbeschränkt',0,NULL,'2010-10-25 14:19:19','Mitarbeiter 1',1,'Mitarbeiter 1',1,NULL,NULL);
COMMIT;
#
# Data for the `valuelistentry` table (LIMIT 0,500)
#
INSERT INTO `valuelistentry` (`Oid`, `Tid`, `Type`, `Value`, `Abbreviation`, `IsActive`, `SystemEntryID`, `Notice`, `InsTs`, `InsUser`, `Version`, `UdpUser`, `ParentOid`) VALUES
(4,4,0,'400 ?',NULL,0,NULL,NULL,'2010-08-12 22:34:43','Nuran Asche',2,'Nuran Asche',NULL),
(5,4,0,'Vollzeit',NULL,1,NULL,NULL,'2010-08-12 22:34:43','Nuran Asche',1,'Nuran Asche',NULL),
(6,4,0,'Teilzeit',NULL,1,NULL,NULL,'2010-08-12 22:34:43','Nuran Asche',1,'Nuran Asche',NULL),
(7,4,0,'400 Euro',NULL,1,NULL,NULL,'2010-08-12 22:35:40','Nuran Asche',1,'Nuran Asche',NULL),
(8,4,3,'Mitbetreuung',NULL,1,NULL,NULL,'2010-08-12 23:15:01','Nuran Asche',1,'Nuran Asche',NULL),
(9,4,3,'Vertretung',NULL,1,NULL,NULL,'2010-08-12 23:15:01','Nuran Asche',1,'Nuran Asche',NULL),
(10,4,3,'Coach',NULL,1,NULL,NULL,'2010-08-12 23:15:01','Nuran Asche',1,'Nuran Asche',NULL),
(11,4,7,'Mutter',NULL,1,NULL,NULL,'2010-08-12 23:17:14','Nuran Asche',1,'Nuran Asche',NULL),
(12,4,7,'Vater',NULL,1,NULL,NULL,'2010-08-12 23:17:14','Nuran Asche',1,'Nuran Asche',NULL),
(13,4,7,'Eltern',NULL,1,NULL,NULL,'2010-08-12 23:17:14','Nuran Asche',1,'Nuran Asche',NULL),
(14,4,7,'Kinder',NULL,1,NULL,NULL,'2010-08-12 23:17:14','Nuran Asche',1,'Nuran Asche',NULL),
(15,4,7,'Therapeut',NULL,1,NULL,NULL,'2010-08-12 23:17:14','Nuran Asche',1,'Nuran Asche',NULL),
(16,4,7,'Facharzt',NULL,1,NULL,NULL,'2010-08-12 23:17:14','Nuran Asche',1,'Nuran Asche',NULL),
(17,4,7,'Suchtberater',NULL,1,NULL,NULL,'2010-08-12 23:17:14','Nuran Asche',1,'Nuran Asche',NULL),
(18,4,7,'Ehepartner',NULL,1,NULL,NULL,'2010-08-12 23:17:14','Nuran Asche',1,'Nuran Asche',NULL),
(19,4,7,'Lebensgefährte',NULL,1,NULL,NULL,'2010-08-12 23:17:14','Nuran Asche',1,'Nuran Asche',NULL),
(20,4,7,'SPFH',NULL,1,NULL,NULL,'2010-08-12 23:17:14','Nuran Asche',1,'Nuran Asche',NULL),
(21,4,7,'Jugendamt',NULL,1,NULL,NULL,'2010-08-12 23:17:14','Nuran Asche',1,'Nuran Asche',NULL),
(22,4,7,'Hausarzt',NULL,1,NULL,NULL,'2010-08-12 23:17:14','Nuran Asche',1,'Nuran Asche',NULL),
(23,4,7,'Arzt',NULL,1,NULL,NULL,'2010-08-12 23:17:14','Nuran Asche',1,'Nuran Asche',NULL),
(24,4,7,'Bewährungshelfer',NULL,1,NULL,NULL,'2010-08-12 23:17:14','Nuran Asche',1,'Nuran Asche',NULL),
(25,4,5,'Dipl. Sozialarbeiter',NULL,1,NULL,NULL,'2010-08-12 23:35:13','Nuran Asche',1,'Nuran Asche',NULL),
(26,4,5,'Dipl. Sozialpädagoge',NULL,1,NULL,NULL,'2010-08-12 23:35:13','Nuran Asche',2,'Mitarbeiter 1',NULL),
(27,4,5,'Erzieher',NULL,1,NULL,NULL,'2010-08-12 23:35:13','Nuran Asche',1,'Nuran Asche',NULL),
(28,4,5,'Therapeut',NULL,1,NULL,NULL,'2010-08-12 23:35:13','Nuran Asche',1,'Nuran Asche',NULL),
(29,4,5,'Heilpädagoge',NULL,1,NULL,NULL,'2010-08-12 23:35:13','Nuran Asche',2,'Mitarbeiter 1',NULL),
(30,4,0,'Aushilfe',NULL,1,NULL,NULL,'2010-08-12 23:36:42','Nuran Asche',1,'Nuran Asche',NULL),
(31,4,0,'Ehrenamt',NULL,1,NULL,NULL,'2010-08-12 23:36:42','Nuran Asche',1,'Nuran Asche',NULL),
(32,4,1,'Seelische Behinderung',NULL,1,NULL,NULL,'2010-08-13 22:02:47','Nuran Asche',1,'Nuran Asche',NULL),
(33,4,1,'Suchterkrankung',NULL,1,NULL,NULL,'2010-08-13 22:04:04','Nuran Asche',1,'Nuran Asche',NULL),
(34,4,1,'Geistige Behinderung',NULL,1,NULL,NULL,'2010-08-13 22:04:04','Nuran Asche',1,'Nuran Asche',NULL),
(35,4,1,'Körperliche Behinderung',NULL,1,NULL,NULL,'2010-08-13 22:04:04','Nuran Asche',1,'Nuran Asche',NULL),
(36,4,6,'Gruppenraum',NULL,1,NULL,NULL,'2010-08-13 23:50:30','Nuran Asche',1,'Nuran Asche',NULL),
(37,4,6,'Büro',NULL,1,NULL,NULL,'2010-08-13 23:50:30','Nuran Asche',1,'Nuran Asche',NULL),
(38,4,6,'Dienstwagen',NULL,1,NULL,NULL,'2010-08-13 23:50:30','Nuran Asche',1,'Nuran Asche',NULL),
(39,4,13,'Jugendamt',NULL,1,NULL,NULL,'2010-08-14 00:16:14','Nuran Asche',1,'Nuran Asche',NULL),
(40,4,13,'gGmbH',NULL,1,NULL,NULL,'2010-08-14 00:16:14','Nuran Asche',1,'Nuran Asche',NULL),
(41,4,13,'über einen Klient',NULL,1,NULL,NULL,'2010-08-14 00:16:14','Nuran Asche',1,'Nuran Asche',NULL),
(42,4,13,'gesetzliche Betreuer',NULL,1,NULL,NULL,'2010-08-14 00:16:14','Nuran Asche',1,'Nuran Asche',NULL),
(43,4,13,'Ämter',NULL,1,NULL,NULL,'2010-08-14 00:16:14','Nuran Asche',1,'Nuran Asche',NULL),
(44,4,13,'Andere',NULL,1,NULL,NULL,'2010-08-14 00:16:14','Nuran Asche',1,'Nuran Asche',NULL),
(45,4,13,'Klient selbst',NULL,1,NULL,NULL,'2010-08-14 00:16:14','Nuran Asche',1,'Nuran Asche',NULL),
(46,4,11,'Herr',NULL,1,NULL,NULL,'2010-08-14 00:16:36','Nuran Asche',1,'Nuran Asche',NULL),
(47,4,11,'Frau',NULL,1,NULL,NULL,'2010-08-14 00:16:36','Nuran Asche',1,'Nuran Asche',NULL),
(48,4,11,'Eheleute',NULL,1,NULL,NULL,'2010-08-14 00:16:36','Nuran Asche',1,'Nuran Asche',NULL),
(49,4,11,'Dr.',NULL,1,NULL,NULL,'2010-08-14 00:16:36','Nuran Asche',1,'Nuran Asche',NULL),
(50,4,9,'Eigene Wohnung beziehen',NULL,1,NULL,NULL,'2010-08-14 00:22:35','Nuran Asche',1,'Nuran Asche',NULL),
(51,4,9,'Wohnung erhalten',NULL,1,NULL,NULL,'2010-08-14 00:22:35','Nuran Asche',1,'Nuran Asche',NULL),
(52,4,9,'Essen und Trinken',NULL,1,NULL,NULL,'2010-08-14 00:22:35','Nuran Asche',1,'Nuran Asche',NULL),
(53,4,9,'Wäschepflege',NULL,0,NULL,NULL,'2010-08-14 00:22:35','Nuran Asche',2,'Nuran Asche',NULL),
(54,4,9,'Haushaltspflege',NULL,0,NULL,NULL,'2010-08-14 00:22:35','Nuran Asche',2,'Nuran Asche',NULL),
(55,4,9,'Haushaltsordnung',NULL,0,NULL,NULL,'2010-08-14 00:22:35','Nuran Asche',2,'Nuran Asche',NULL),
(56,4,9,'Haushaltshygiene',NULL,0,NULL,NULL,'2010-08-14 00:22:35','Nuran Asche',2,'Nuran Asche',NULL),
(57,4,9,'Tagesstruktur',NULL,0,NULL,NULL,'2010-08-14 00:22:35','Nuran Asche',2,'Nuran Asche',NULL),
(58,4,9,'Tag- und Nachtrhytmus',NULL,0,NULL,NULL,'2010-08-14 00:22:35','Nuran Asche',2,'Nuran Asche',NULL),
(59,4,9,'Beschäftigung',NULL,1,NULL,NULL,'2010-08-14 00:22:35','Nuran Asche',1,'Nuran Asche',NULL),
(60,4,9,'Arbeiten',NULL,1,NULL,NULL,'2010-08-14 00:22:35','Nuran Asche',1,'Nuran Asche',NULL),
(61,4,9,'Teilhabe am Leben',NULL,0,NULL,NULL,'2010-08-14 00:22:35','Nuran Asche',2,'Nuran Asche',NULL),
(62,4,9,'sinnvolle Freizeitbeschäftigung',NULL,0,NULL,NULL,'2010-08-14 00:22:35','Nuran Asche',2,'Nuran Asche',NULL),
(63,4,9,'Soziale Beziehungen',NULL,1,NULL,NULL,'2010-08-14 00:22:35','Nuran Asche',2,'Nuran Asche',NULL),
(64,4,9,'Krankheitseinsicht',NULL,1,NULL,NULL,'2010-08-14 00:22:35','Nuran Asche',1,'Nuran Asche',NULL),
(65,4,9,'Wahrnehmung ärztlicher/ therapeutischer Hilfen',NULL,1,NULL,NULL,'2010-08-14 00:22:35','Nuran Asche',1,'Nuran Asche',NULL),
(66,4,9,'Regeln von finanziellen und (sozial-)rechtlichen Angelegenheiten',NULL,1,NULL,NULL,'2010-08-14 00:28:10','Nuran Asche',1,'Nuran Asche',NULL),
(67,4,9,'Geld verwalten',NULL,1,NULL,NULL,'2010-08-14 00:28:10','Nuran Asche',1,'Nuran Asche',NULL),
(68,4,9,'Ordnung im eigenen Bereich',NULL,1,NULL,NULL,'2010-08-14 00:28:10','Nuran Asche',1,'Nuran Asche',NULL),
(69,4,9,'Einkaufen',NULL,0,NULL,NULL,'2010-08-14 00:28:10','Nuran Asche',2,'Nuran Asche',NULL),
(70,4,9,'Zubereitung von Hauptmahlzeiten',NULL,0,NULL,NULL,'2010-08-14 00:28:10','Nuran Asche',2,'Nuran Asche',NULL),
(71,4,9,'Individuelle Basisversorgung',NULL,1,NULL,NULL,'2010-08-14 00:28:10','Nuran Asche',1,'Nuran Asche',NULL),
(72,4,9,'Gestaltung sozialer Beziehungen',NULL,0,NULL,NULL,'2010-08-14 00:28:10','Nuran Asche',2,'Nuran Asche',NULL),
(73,4,9,'Teilnahme am kulturellen und gesellschaftlichen Leben',NULL,1,NULL,NULL,'2010-08-14 00:28:10','Nuran Asche',1,'Nuran Asche',NULL),
(74,4,9,'Erschließen außerhäuslicher Lebensbereiche',NULL,0,NULL,NULL,'2010-08-14 00:28:10','Nuran Asche',2,'Nuran Asche',NULL),
(75,4,9,'Entwickeln von Zukunftsperspektiven, Lebensplanung',NULL,0,NULL,NULL,'2010-08-14 00:28:10','Nuran Asche',2,'Nuran Asche',NULL),
(76,4,9,'Kommunikation und Orientierung',NULL,0,NULL,NULL,'2010-08-14 00:28:10','Nuran Asche',2,'Nuran Asche',NULL),
(77,4,9,'Emotionale und psychische Entwicklung',NULL,1,NULL,NULL,'2010-08-14 00:28:10','Nuran Asche',1,'Nuran Asche',NULL),
(78,4,9,'Gesundheitsförderung und -erhaltung',NULL,1,NULL,NULL,'2010-08-14 00:28:10','Nuran Asche',1,'Nuran Asche',NULL),
(79,4,9,'Alltägliche Lebensführung',NULL,1,NULL,NULL,'2010-08-14 00:31:33','Nuran Asche',1,'Nuran Asche',NULL),
(80,4,10,'Einkaufen',NULL,1,NULL,NULL,'2010-08-14 00:32:37','Nuran Asche',2,'Nuran Asche',52),
(81,4,10,'Zubereitung von Hauptmahlzeiten',NULL,1,NULL,NULL,'2010-08-14 00:32:37','Nuran Asche',1,'Nuran Asche',79),
(82,4,10,'Zubereitung von Zwischenmahlzeiten',NULL,1,NULL,NULL,'2010-08-14 00:32:37','Nuran Asche',1,'Nuran Asche',79),
(83,4,10,'Wäschepflege',NULL,1,NULL,NULL,'2010-08-14 00:32:37','Nuran Asche',1,'Nuran Asche',79),
(84,4,10,'Ordnung im eigenen Bereich',NULL,1,NULL,NULL,'2010-08-14 00:34:08','Nuran Asche',1,'Nuran Asche',79),
(85,4,10,'Geld verwalten',NULL,1,NULL,NULL,'2010-08-14 00:34:08','Nuran Asche',1,'Nuran Asche',79),
(86,4,10,'Ernährung',NULL,1,NULL,NULL,'2010-08-14 00:34:08','Nuran Asche',1,'Nuran Asche',71),
(87,4,10,'Körperpflege',NULL,1,NULL,NULL,'2010-08-14 00:34:08','Nuran Asche',1,'Nuran Asche',71),
(88,4,10,'Klären der beruflichen Wiedereingliederung',NULL,1,NULL,NULL,'2010-08-16 17:34:20','Nuran Asche',1,'Nuran Asche',60),
(89,4,10,'Aufnahme einer Arbeit',NULL,1,NULL,NULL,'2010-08-16 17:34:20','Nuran Asche',1,'Nuran Asche',60),
(90,4,10,'Durchführung von therapeu-tischen Verordnungen nach Anleitung',NULL,1,NULL,NULL,'2010-08-16 17:35:19','Nuran Asche',3,'Nuran Asche',64),
(91,4,10,'selbstständige Medikamenten-einnahme',NULL,1,NULL,NULL,'2010-08-16 17:35:19','Nuran Asche',1,'Nuran Asche',65),
(92,4,10,'selbstständige Durchführung von ärztlichen Anordnungen',NULL,1,NULL,NULL,'2010-08-16 17:36:28','Nuran Asche',1,'Nuran Asche',65),
(93,4,10,'Teilnahme an Krankengymnastik in Begleitung',NULL,1,NULL,NULL,'2010-08-16 17:36:28','Nuran Asche',1,'Nuran Asche',65),
(94,4,10,'führt Arztbesuche in Begleitung durch',NULL,1,NULL,NULL,'2010-08-16 17:38:14','Nuran Asche',1,'Nuran Asche',65),
(95,4,10,'führt Arztbesuche selbstständig durch',NULL,1,NULL,NULL,'2010-08-16 17:38:14','Nuran Asche',1,'Nuran Asche',65),
(96,4,10,'führt das Gespräch mit dem Arzt',NULL,1,NULL,NULL,'2010-08-16 17:38:14','Nuran Asche',1,'Nuran Asche',65),
(97,4,10,'hat sich auf Hausarzt/Facharzt festgelegt',NULL,1,NULL,NULL,'2010-08-16 17:38:14','Nuran Asche',1,'Nuran Asche',65),
(98,4,10,'informiert Betreuungspersonal über anstehende Arztbesuche',NULL,1,NULL,NULL,'2010-08-16 17:38:14','Nuran Asche',1,'Nuran Asche',65),
(99,4,10,'nimmt Terminvereinbarung selbstständig vor',NULL,1,NULL,NULL,'2010-08-16 17:38:14','Nuran Asche',1,'Nuran Asche',65),
(100,4,10,'hat Kontakte im unmittelbaren Nahbereich',NULL,1,NULL,NULL,'2010-08-16 17:40:28','Nuran Asche',2,'Nuran Asche',63),
(101,4,10,'kann Nähe und Distanz steuern',NULL,1,NULL,NULL,'2010-08-16 17:40:28','Nuran Asche',2,'Nuran Asche',63),
(102,4,10,'pflegt Kontakte',NULL,1,NULL,NULL,'2010-08-16 17:40:28','Nuran Asche',2,'Nuran Asche',63),
(103,4,10,'stellt sich Konflikten',NULL,1,NULL,NULL,'2010-08-16 17:40:28','Nuran Asche',2,'Nuran Asche',63),
(104,4,10,'trägt Konflikte angemessen aus',NULL,1,NULL,NULL,'2010-08-16 17:40:28','Nuran Asche',2,'Nuran Asche',63),
(105,4,10,'verhält sich angemessen',NULL,1,NULL,NULL,'2010-08-16 17:40:28','Nuran Asche',2,'Nuran Asche',63),
(106,4,10,'akzeptiert den Abbruch von Beziehungen zu den Angehörigen',NULL,1,NULL,NULL,'2010-08-16 17:42:40','Nuran Asche',2,'Nuran Asche',63),
(107,4,10,'hat sich vom Elternhaus abgelöst',NULL,1,NULL,NULL,'2010-08-16 17:42:40','Nuran Asche',2,'Nuran Asche',63),
(108,4,10,'akzeptiert gesetzlichen Betreuer',NULL,1,NULL,NULL,'2010-08-16 17:42:40','Nuran Asche',2,'Nuran Asche',63),
(109,4,10,'kann Bedürfnisse und Grenzen des Gegenübers erkennen',NULL,1,NULL,NULL,'2010-08-16 17:42:40','Nuran Asche',2,'Nuran Asche',63),
(110,4,10,'kann Bedürfnisse und Grenzen mitteilen',NULL,1,NULL,NULL,'2010-08-16 17:42:40','Nuran Asche',2,'Nuran Asche',63),
(111,4,10,'legt Wert auf die Freundschaft',NULL,1,NULL,NULL,'2010-08-16 17:42:40','Nuran Asche',2,'Nuran Asche',63),
(112,4,10,'pflegt die Partnerschaft',NULL,1,NULL,NULL,'2010-08-16 17:43:25','Nuran Asche',2,'Nuran Asche',63),
(113,4,10,'übt die Elternschaft adäquat aus',NULL,1,NULL,NULL,'2010-08-16 17:43:25','Nuran Asche',2,'Nuran Asche',63),
(114,4,10,'erkennt Notwendigkeit der Körperpflege',NULL,1,NULL,NULL,'2010-08-16 17:45:44','Nuran Asche',1,'Nuran Asche',71),
(115,4,10,'führt Körperpflege nach Anleitung durch',NULL,1,NULL,NULL,'2010-08-16 17:45:44','Nuran Asche',1,'Nuran Asche',71),
(116,4,10,'führt Körperpflege nach Erinnerung durch',NULL,1,NULL,NULL,'2010-08-16 17:45:44','Nuran Asche',1,'Nuran Asche',71),
(117,4,10,'nutzt Pflegemittel sachgerecht',NULL,1,NULL,NULL,'2010-08-16 17:45:44','Nuran Asche',1,'Nuran Asche',71),
(118,4,10,'selbstständige Körperpflege',NULL,1,NULL,NULL,'2010-08-16 17:45:44','Nuran Asche',1,'Nuran Asche',71),
(119,4,10,'selbstständige Auswahl der Art der Nahrung',NULL,1,NULL,NULL,'2010-08-16 17:47:34','Nuran Asche',1,'Nuran Asche',52),
(120,4,10,'selbstständige Einteilung der Menge der Nahrungsmittel',NULL,1,NULL,NULL,'2010-08-16 17:47:34','Nuran Asche',1,'Nuran Asche',52),
(121,4,10,'möchte abnehmen',NULL,1,NULL,NULL,'2010-08-16 17:47:34','Nuran Asche',1,'Nuran Asche',52),
(122,4,10,'Erstellt einen Ernährungsplan und hält sich daran',NULL,1,NULL,NULL,'2010-08-16 17:47:34','Nuran Asche',1,'Nuran Asche',52),
(123,4,10,'Aufsuchen von Ã?mtern und Behörden mit Begleitung',NULL,1,NULL,NULL,'2010-08-16 17:51:28','Nuran Asche',1,'Nuran Asche',66),
(124,4,10,'Beantworten von Schriftstücken mit Anleitung',NULL,1,NULL,NULL,'2010-08-16 17:51:28','Nuran Asche',1,'Nuran Asche',66),
(125,4,10,'füllt Formulare selbstständig aus',NULL,1,NULL,NULL,'2010-08-16 17:51:28','Nuran Asche',1,'Nuran Asche',66),
(126,4,10,'füllt unter Anleitung Formulare aus',NULL,1,NULL,NULL,'2010-08-16 17:51:28','Nuran Asche',1,'Nuran Asche',66),
(127,4,10,'führt Bankgeschäfte mit Begleitung durch',NULL,1,NULL,NULL,'2010-08-16 17:51:28','Nuran Asche',1,'Nuran Asche',66),
(128,4,10,'selbstständige Bankgeschäfte',NULL,1,NULL,NULL,'2010-08-16 17:51:28','Nuran Asche',1,'Nuran Asche',66),
(129,4,10,'selbstständiges Aufsuchen von Ã?mtern und Behörden',NULL,1,NULL,NULL,'2010-08-16 17:51:28','Nuran Asche',1,'Nuran Asche',66),
(130,4,10,'selbstständiges Stellen von Anträgen',NULL,1,NULL,NULL,'2010-08-16 17:51:28','Nuran Asche',1,'Nuran Asche',66),
(131,4,10,'Stellen von Anträgen mit Anleitung',NULL,1,NULL,NULL,'2010-08-16 17:51:28','Nuran Asche',1,'Nuran Asche',66),
(132,4,10,'führt Preisvergleiche durch',NULL,1,NULL,NULL,'2010-08-16 17:53:01','Nuran Asche',1,'Nuran Asche',67),
(133,4,10,'hat Fähigkeit zum Beurteilen des Geldwertes',NULL,1,NULL,NULL,'2010-08-16 17:53:01','Nuran Asche',1,'Nuran Asche',67),
(134,4,10,'möchte Geld sparen',NULL,1,NULL,NULL,'2010-08-16 17:53:01','Nuran Asche',1,'Nuran Asche',67),
(135,4,10,'möchte Schulden abbauen',NULL,1,NULL,NULL,'2010-08-16 17:53:01','Nuran Asche',1,'Nuran Asche',67),
(136,4,10,'selbstständiger Umgang mit Geld',NULL,1,NULL,NULL,'2010-08-16 17:53:01','Nuran Asche',1,'Nuran Asche',67),
(137,4,10,'teilt sich das zur Verfügung stehende Geld über definierten Zeitraum ein',NULL,1,NULL,NULL,'2010-08-16 17:53:01','Nuran Asche',1,'Nuran Asche',67),
(138,4,10,'erkennt Notwendigkeit der Raumpflege',NULL,1,NULL,NULL,'2010-08-16 17:55:40','Nuran Asche',2,'Nuran Asche',79),
(139,4,10,'führt Raumpflege nach Erinnerung durch',NULL,1,NULL,NULL,'2010-08-16 17:55:40','Nuran Asche',1,'Nuran Asche',68),
(140,4,10,'selbstständige Raumpflege',NULL,1,NULL,NULL,'2010-08-16 17:55:40','Nuran Asche',1,'Nuran Asche',68),
(141,4,10,'selbstständiges Aufräumen',NULL,1,NULL,NULL,'2010-08-16 17:55:40','Nuran Asche',1,'Nuran Asche',68),
(142,4,10,'selbständige Müllentsorgung',NULL,1,NULL,NULL,'2010-08-16 17:55:40','Nuran Asche',1,'Nuran Asche',68),
(143,4,10,'Selbständiges Säubern der Sanitäranlagen',NULL,1,NULL,NULL,'2010-08-16 17:55:40','Nuran Asche',1,'Nuran Asche',68),
(144,4,10,'selbstständige Wäschepflege',NULL,1,NULL,NULL,'2010-08-16 17:59:24','Nuran Asche',1,'Nuran Asche',79),
(145,4,10,'selbstständiges Aufhängen der Wäsche',NULL,1,NULL,NULL,'2010-08-16 17:59:24','Nuran Asche',1,'Nuran Asche',79),
(146,4,10,'selbstständiges Bedienen der Waschmaschine',NULL,1,NULL,NULL,'2010-08-16 17:59:24','Nuran Asche',1,'Nuran Asche',79),
(147,4,10,'selbstständiges Bügeln',NULL,1,NULL,NULL,'2010-08-16 17:59:24','Nuran Asche',1,'Nuran Asche',79),
(148,4,10,'selbstständiges Einsortieren der Wäsche',NULL,1,NULL,NULL,'2010-08-16 17:59:24','Nuran Asche',1,'Nuran Asche',79),
(149,4,10,'erkennt Einkaufsbedarf',NULL,1,NULL,NULL,'2010-08-16 17:59:24','Nuran Asche',2,'Nuran Asche',52),
(150,4,10,'erstellt sich einen Einkaufszettel',NULL,1,NULL,NULL,'2010-08-16 17:59:24','Nuran Asche',1,'Nuran Asche',79),
(151,4,10,'erstellt sich unter Anleitung einen Einkaufszettel',NULL,1,NULL,NULL,'2010-08-16 17:59:24','Nuran Asche',1,'Nuran Asche',79),
(152,4,10,'kauft preisbewusst ein',NULL,1,NULL,NULL,'2010-08-16 17:59:24','Nuran Asche',1,'Nuran Asche',79),
(153,4,10,'selbstständiges Einkaufen',NULL,1,NULL,NULL,'2010-08-16 17:59:24','Nuran Asche',1,'Nuran Asche',79),
(154,4,10,'sucht Geschäfte zum Einkaufen selbstständig auf',NULL,1,NULL,NULL,'2010-08-16 17:59:24','Nuran Asche',1,'Nuran Asche',79),
(155,4,10,'sucht sich Gegenstände selbstständig aus',NULL,1,NULL,NULL,'2010-08-16 17:59:24','Nuran Asche',1,'Nuran Asche',79),
(156,4,10,'geht in Begleitung Einkaufen',NULL,1,NULL,NULL,'2010-08-16 17:59:56','Nuran Asche',1,'Nuran Asche',79),
(157,4,10,'gestaltet Freizeit selbstständig',NULL,1,NULL,NULL,'2010-08-16 18:03:04','Nuran Asche',1,'Nuran Asche',73),
(158,4,10,'hat Hobbys',NULL,1,NULL,NULL,'2010-08-16 18:03:04','Nuran Asche',1,'Nuran Asche',73),
(159,4,10,'kennt Medien',NULL,1,NULL,NULL,'2010-08-16 18:03:04','Nuran Asche',1,'Nuran Asche',73),
(160,4,10,'möchte Freizeit selbst strukturieren',NULL,1,NULL,NULL,'2010-08-16 18:03:04','Nuran Asche',1,'Nuran Asche',73),
(161,4,10,'teilt sich Zeit frei ein',NULL,1,NULL,NULL,'2010-08-16 18:03:04','Nuran Asche',1,'Nuran Asche',73),
(162,4,10,'zeigt Geduld / Ausdauer / Konzentration für Aktivitäten',NULL,1,NULL,NULL,'2010-08-16 18:03:04','Nuran Asche',1,'Nuran Asche',73),
(163,4,10,'zeigt Interessen an Aktivtäten',NULL,1,NULL,NULL,'2010-08-16 18:03:04','Nuran Asche',1,'Nuran Asche',73),
(164,4,10,'erkennt und akzeptiert eigene Grenzen',NULL,1,NULL,NULL,'2010-08-16 18:04:44','Nuran Asche',2,'Nuran Asche',63),
(165,4,10,'hat Interesse an Ausflügen, Urlaub',NULL,1,NULL,NULL,'2010-08-16 18:04:45','Nuran Asche',1,'Nuran Asche',73),
(166,4,10,'nimmt an bestehenden Freizeitangeboten teil',NULL,1,NULL,NULL,'2010-08-16 18:04:45','Nuran Asche',1,'Nuran Asche',73),
(167,4,10,'zeigt Interesse an kulturellen Veranstaltungen',NULL,1,NULL,NULL,'2010-08-16 18:04:45','Nuran Asche',1,'Nuran Asche',73),
(168,4,10,'ist gruppenfähig, hat soziale Kompetenz',NULL,1,NULL,NULL,'2010-08-16 18:19:38','Nuran Asche',1,'Nuran Asche',73),
(169,4,10,'ist in der Lage situationsgerecht zu kommunizieren',NULL,1,NULL,NULL,'2010-08-16 18:19:38','Nuran Asche',1,'Nuran Asche',73),
(170,4,10,'zeigt Interesse am Kennenlernen fremder Personen und Gruppen',NULL,1,NULL,NULL,'2010-08-16 18:19:38','Nuran Asche',1,'Nuran Asche',73),
(171,4,10,'hat Integration in Vereinen, Religionsgemeinschaften, Freizeitgruppen',NULL,1,NULL,NULL,'2010-08-16 18:20:03','Nuran Asche',1,'Nuran Asche',73),
(172,4,10,'hat Interesse, Motivation an Erweiterung der gewohnten Umgebung',NULL,1,NULL,NULL,'2010-08-16 18:20:25','Nuran Asche',1,'Nuran Asche',73),
(173,4,10,'ist sich ihrer/seiner Rolle in der Gesellschaft bewusst',NULL,1,NULL,NULL,'2010-08-16 18:25:00','Nuran Asche',1,'Nuran Asche',73),
(174,4,10,'setzt sich mit ihrer/seiner eigenen Situation/Behinderung auseinander',NULL,1,NULL,NULL,'2010-08-16 18:25:00','Nuran Asche',1,'Nuran Asche',64),
(175,4,10,'akzeptiert angeordnete Maßnahmen',NULL,1,NULL,NULL,'2010-08-16 18:25:00','Nuran Asche',1,'Nuran Asche',78),
(176,4,10,'benennt Krankheitssymptome',NULL,1,NULL,NULL,'2010-08-16 18:25:00','Nuran Asche',1,'Nuran Asche',78),
(177,4,10,'hält sich an angeordnete Maßnahmen',NULL,1,NULL,NULL,'2010-08-16 18:25:00','Nuran Asche',1,'Nuran Asche',78),
(178,4,10,'setzt sich mit Gesundheits-zustand auseinander',NULL,1,NULL,NULL,'2010-08-16 18:25:00','Nuran Asche',1,'Nuran Asche',78),
(179,4,10,'teilt Gesundheitsempfinden mit',NULL,1,NULL,NULL,'2010-08-16 18:25:00','Nuran Asche',1,'Nuran Asche',78),
(180,4,10,'hat Kenntnisse über gesunde Ernährung',NULL,1,NULL,NULL,'2010-08-16 18:25:00','Nuran Asche',1,'Nuran Asche',78),
(181,4,10,'hat Krankheitseinsicht',NULL,1,NULL,NULL,'2010-08-16 18:25:00','Nuran Asche',1,'Nuran Asche',78),
(182,4,10,'kann Folgen der Erkrankung erfassen',NULL,1,NULL,NULL,'2010-08-16 18:25:00','Nuran Asche',1,'Nuran Asche',78),
(183,4,10,'legt Wert auf gesunde Lebensführung',NULL,1,NULL,NULL,'2010-08-16 18:25:00','Nuran Asche',1,'Nuran Asche',78),
(184,4,10,'legt Wert darauf, sich an der frischen Luft zu bewegen',NULL,1,NULL,NULL,'2010-08-16 18:25:00','Nuran Asche',1,'Nuran Asche',78),
(185,4,10,'vermeidet gesundheitsschädigende Verhaltensweisen',NULL,1,NULL,NULL,'2010-08-16 18:25:00','Nuran Asche',1,'Nuran Asche',78),
(186,4,10,'Adäqutes Verhalten in der Nachbarschaft',NULL,1,NULL,NULL,'2010-08-16 20:54:17','Nuran Asche',1,'Nuran Asche',51),
(187,4,10,'Mietadäquates Verhalten',NULL,1,NULL,NULL,'2010-08-16 20:54:17','Nuran Asche',1,'Nuran Asche',51),
(188,4,10,'Sicherung der Wohnung durch Mietzahlung',NULL,1,NULL,NULL,'2010-08-16 20:54:17','Nuran Asche',1,'Nuran Asche',51),
(189,4,10,'Gemütliche Gestaltung der Wohnung',NULL,1,NULL,NULL,'2010-08-16 20:54:17','Nuran Asche',1,'Nuran Asche',51),
(190,4,10,'Haushaltsordnung und Haushaltshygiene einhalten',NULL,1,NULL,NULL,'2010-08-16 20:54:17','Nuran Asche',1,'Nuran Asche',51),
(191,4,10,'Tagesstrukturplan erstellen',NULL,1,NULL,NULL,'2010-08-16 20:56:31','Nuran Asche',1,'Nuran Asche',59),
(192,4,10,'Tag- und Nachtrhythmus einhalten',NULL,1,NULL,NULL,'2010-08-16 20:56:31','Nuran Asche',1,'Nuran Asche',59),
(193,4,10,'Sinnvolle Freizeitbeschäftigung',NULL,1,NULL,NULL,'2010-08-16 20:56:31','Nuran Asche',1,'Nuran Asche',59),
(194,4,10,'Besuch einer Maßnahme',NULL,1,NULL,NULL,'2010-08-16 20:56:31','Nuran Asche',1,'Nuran Asche',59),
(195,4,10,'Besuch einer Tagesstruktuierenden Maßnahme',NULL,1,NULL,NULL,'2010-08-16 20:56:31','Nuran Asche',1,'Nuran Asche',59),
(196,4,10,'Ausüben eines Ehrenamtes',NULL,1,NULL,NULL,'2010-08-16 20:56:31','Nuran Asche',1,'Nuran Asche',59),
(197,4,10,'Anleitung bei der Wohnungssuche',NULL,1,NULL,NULL,'2010-08-16 20:58:50','Nuran Asche',1,'Nuran Asche',50),
(198,4,10,'Vorbereitung / Planung des Umzuges',NULL,1,NULL,NULL,'2010-08-16 20:58:50','Nuran Asche',1,'Nuran Asche',50),
(199,4,10,'Renovieren der eigenen Räume',NULL,1,NULL,NULL,'2010-08-16 20:58:50','Nuran Asche',1,'Nuran Asche',50),
(200,4,10,'Beschaffen von Möbeln und Inventar',NULL,1,NULL,NULL,'2010-08-16 20:58:50','Nuran Asche',1,'Nuran Asche',50),
(201,4,10,'Einrichten der Wohnung',NULL,1,NULL,NULL,'2010-08-16 20:58:50','Nuran Asche',1,'Nuran Asche',50),
(202,4,10,'erkennt/benennt aufkommende Störungen',NULL,1,NULL,NULL,'2010-08-16 21:06:24','Nuran Asche',1,'Nuran Asche',77),
(203,4,10,'hat persönliche Bewältigungsstrategien entwickelt',NULL,1,NULL,NULL,'2010-08-16 21:06:24','Nuran Asche',1,'Nuran Asche',77),
(204,4,10,'kennt Techniken zur Vermeidung/Minimierung der Störungen',NULL,1,NULL,NULL,'2010-08-16 21:06:24','Nuran Asche',1,'Nuran Asche',77),
(205,4,10,'äußert Wünsche/Bedürfnisse',NULL,1,NULL,NULL,'2010-08-16 21:11:22','Nuran Asche',1,'Nuran Asche',77),
(206,4,10,'kennt die Ursachen der Antriebslosigkeit',NULL,1,NULL,NULL,'2010-08-16 21:11:22','Nuran Asche',1,'Nuran Asche',77),
(207,4,10,'setzt sich mit persönlicher Situation auseinander',NULL,1,NULL,NULL,'2010-08-16 21:11:22','Nuran Asche',1,'Nuran Asche',77),
(208,4,10,'zeigt Interesse an Neuem',NULL,1,NULL,NULL,'2010-08-16 21:11:22','Nuran Asche',1,'Nuran Asche',77),
(209,4,10,'Nimmt Teilziele bewußt wahr und erlebt diese als Erfolg',NULL,1,NULL,NULL,'2010-08-16 21:11:22','Nuran Asche',1,'Nuran Asche',77),
(210,4,10,'erkennt Zusammenhang zwischen persönlichen Problemen und Suchtpotenzial',NULL,1,NULL,NULL,'2010-08-16 21:11:22','Nuran Asche',1,'Nuran Asche',77),
(211,4,10,'hat persönliche Bewältigungsstrategien entwickelt',NULL,1,NULL,NULL,'2010-08-16 21:11:22','Nuran Asche',1,'Nuran Asche',77),
(212,4,10,'ist kooperativ im Umgang mit Ã?rzten und anderen Berufsgruppen',NULL,1,NULL,NULL,'2010-08-16 21:11:22','Nuran Asche',1,'Nuran Asche',77),
(213,4,10,'kann mit Stress und Konflikten umgehen',NULL,1,NULL,NULL,'2010-08-16 21:11:22','Nuran Asche',1,'Nuran Asche',77),
(214,4,10,'kann zwischen Realität und Halluzination unterscheiden',NULL,1,NULL,NULL,'2010-08-16 21:11:22','Nuran Asche',1,'Nuran Asche',77),
(215,4,10,'kennt/benennt die eigenen Störungen',NULL,1,NULL,NULL,'2010-08-16 21:11:22','Nuran Asche',1,'Nuran Asche',77),
(216,4,10,'nimmt Hilfe an',NULL,1,NULL,NULL,'2010-08-16 21:11:22','Nuran Asche',1,'Nuran Asche',77),
(217,4,10,'nimmt Medikamente ein',NULL,1,NULL,NULL,'2010-08-16 21:11:22','Nuran Asche',1,'Nuran Asche',77),
(218,4,10,'erkennt selbstgefährdendes Verhalten',NULL,1,NULL,NULL,'2010-08-16 21:11:22','Nuran Asche',1,'Nuran Asche',77),
(219,4,10,'reflektiert selbstgefährdendes Verhalten',NULL,1,NULL,NULL,'2010-08-16 21:11:22','Nuran Asche',1,'Nuran Asche',77),
(220,4,10,'geht einer Beschäftigung regelmäßig nach',NULL,1,NULL,NULL,'2010-08-16 21:25:57','Nuran Asche',1,'Nuran Asche',59),
(221,4,10,'geht einer Arbeit regelmäßig nach',NULL,1,NULL,NULL,'2010-08-16 21:25:57','Nuran Asche',1,'Nuran Asche',60),
(222,4,10,'Adäquates Verhalten gegenüber Vorgesetzten',NULL,1,NULL,NULL,'2010-08-16 21:25:57','Nuran Asche',1,'Nuran Asche',60),
(223,4,10,'Adäquates Verhalten gegenüber Kollegen',NULL,1,NULL,NULL,'2010-08-16 21:25:57','Nuran Asche',1,'Nuran Asche',60),
(224,4,12,'Hausarzt',NULL,1,NULL,NULL,'2010-08-18 19:57:11','Nuran Asche',1,'Nuran Asche',NULL),
(225,4,12,'Psychiater',NULL,1,NULL,NULL,'2010-08-18 19:57:11','Nuran Asche',1,'Nuran Asche',NULL),
(226,4,12,'gesetzliche(r) Betreuer(in)',NULL,1,NULL,NULL,'2010-08-18 19:57:11','Nuran Asche',1,'Nuran Asche',NULL),
(227,4,12,'Gynäkologe',NULL,1,NULL,NULL,'2010-08-18 19:57:11','Nuran Asche',1,'Nuran Asche',NULL),
(228,4,12,'Neurologe',NULL,1,NULL,NULL,'2010-08-18 19:57:11','Nuran Asche',1,'Nuran Asche',NULL),
(229,4,12,'Therapeut (analytisch/tiefenpschologisch)',NULL,1,NULL,NULL,'2010-08-18 19:57:11','Nuran Asche',2,'Nuran Asche',NULL),
(230,4,12,'SPFH',NULL,1,NULL,NULL,'2010-08-18 19:57:11','Nuran Asche',1,'Nuran Asche',NULL),
(231,4,12,'ASD Jugendamt',NULL,1,NULL,NULL,'2010-08-18 19:57:11','Nuran Asche',1,'Nuran Asche',NULL),
(232,4,12,'Therapeut (Verhaltenstherapie)',NULL,1,NULL,NULL,'2010-08-18 20:17:21','Nuran Asche',1,'Nuran Asche',NULL),
(233,4,12,'Psychiater und Therapeut',NULL,1,NULL,NULL,'2010-08-18 20:17:21','Nuran Asche',1,'Nuran Asche',NULL),
(234,4,11,NULL,NULL,0,NULL,NULL,'2010-08-18 20:27:07','Nuran Asche',2,'Nuran Asche',NULL),
(235,4,10,'Eingehende Post mit Anleitung bearbeiten',NULL,1,NULL,NULL,'2010-08-19 21:47:03','Nuran Asche',1,'Nuran Asche',66),
(236,4,10,'Papiere sortieren, abheften',NULL,1,NULL,NULL,'2010-08-19 21:47:04','Nuran Asche',1,'Nuran Asche',66),
(237,4,10,'administrative Dinge fristgerecht erledigen',NULL,1,NULL,NULL,'2010-08-19 21:47:04','Nuran Asche',1,'Nuran Asche',66),
(238,4,10,'Tragfähige Beziehungen aufbauen',NULL,1,NULL,NULL,'2010-08-19 21:47:04','Nuran Asche',1,'Nuran Asche',63),
(239,4,10,'Psychiatrische Anbindung',NULL,1,NULL,NULL,'2010-08-19 21:47:04','Nuran Asche',1,'Nuran Asche',78),
(240,4,10,'Selbstsicherheit gewinnen',NULL,1,NULL,NULL,'2010-08-19 21:48:54','Nuran Asche',1,'Nuran Asche',77),
(241,4,10,'Stabilisierung des Gesundheitszustandes',NULL,1,NULL,NULL,'2010-08-19 21:50:57','Nuran Asche',1,'Nuran Asche',78),
(242,4,10,'Bestehende Beziehungen pflegen',NULL,1,NULL,NULL,'2010-08-19 21:50:57','Nuran Asche',1,'Nuran Asche',63),
(243,4,10,'Regelmäßige Nahrungsaufnahme',NULL,1,NULL,NULL,'2010-08-19 21:50:57','Nuran Asche',1,'Nuran Asche',71),
(244,4,10,'Ermittlung der Arbeitsfähigkeit durch Begutachtung',NULL,1,NULL,NULL,'2010-08-19 21:53:47','Nuran Asche',1,'Nuran Asche',60),
(245,4,10,'Abgrenzung',NULL,1,NULL,NULL,'2010-08-19 21:53:47','Nuran Asche',1,'Nuran Asche',63),
(246,4,10,'Aufnahme einer Ausbildung',NULL,1,NULL,NULL,'2010-08-19 21:54:06','Nuran Asche',1,'Nuran Asche',60),
(247,4,10,'Erhalt des Arbeitsplatzes',NULL,1,NULL,NULL,'2010-08-19 22:00:38','Nuran Asche',1,'Nuran Asche',60),
(248,4,10,'Wohnsituation aufrecht erhalten',NULL,1,NULL,NULL,'2010-08-19 22:00:38','Nuran Asche',1,'Nuran Asche',51),
(249,4,10,'Aufsuchen der Drogenberatung',NULL,1,NULL,NULL,'2010-08-19 22:00:38','Nuran Asche',1,'Nuran Asche',78),
(250,4,10,'Wohnungsbesichtigung in Begleitung',NULL,1,NULL,NULL,'2010-08-19 22:01:13','Nuran Asche',1,'Nuran Asche',50),
(251,4,10,'Erhalt der Ausbildung',NULL,1,NULL,NULL,'2010-08-19 22:01:32','Nuran Asche',1,'Nuran Asche',60),
(252,4,10,'Stärken und erweitern der sozialen Kompetenzen',NULL,1,NULL,NULL,'2010-08-19 22:04:43','Nuran Asche',1,'Nuran Asche',63),
(253,4,10,'Entwicklung von eigenen Interessen und Neigungen',NULL,1,NULL,NULL,'2010-08-19 22:04:43','Nuran Asche',1,'Nuran Asche',59),
(254,4,10,'Neue Kontkat schließen',NULL,1,NULL,NULL,'2010-08-19 22:04:43','Nuran Asche',1,'Nuran Asche',63),
(255,4,10,'Stabilisierung der Paarbeziehung',NULL,1,NULL,NULL,'2010-08-19 22:24:46','Nuran Asche',1,'Nuran Asche',63),
(256,4,10,'Insolvenzantrag stellen',NULL,1,NULL,NULL,'2010-08-19 22:24:46','Nuran Asche',1,'Nuran Asche',66),
(257,4,10,'Anbindung an die Schuldnerberatung',NULL,1,NULL,NULL,'2010-08-19 22:24:46','Nuran Asche',1,'Nuran Asche',67),
(258,4,6,'Abwesenheit',NULL,1,NULL,NULL,'2010-08-22 01:30:43','Nuran Asche',1,'Nuran Asche',NULL),
(259,4,14,'erfolgreich Beendigung',NULL,1,NULL,NULL,'2010-08-23 22:44:56','Nuran Asche',1,'Nuran Asche',NULL),
(260,4,14,'Vermittlung an anderen Bewo-Anbieter',NULL,1,NULL,NULL,'2010-08-23 22:44:56','Nuran Asche',1,'Nuran Asche',NULL),
(261,4,14,'Vermittlung an stationäre Einrichtung',NULL,1,NULL,NULL,'2010-08-23 22:44:56','Nuran Asche',1,'Nuran Asche',NULL),
(262,4,8,'Ambulant Betreutes Wohnen',NULL,1,NULL,NULL,'2010-10-25 14:14:54','Mitarbeiter 1',1,'Mitarbeiter 1',NULL),
(263,4,8,'Haushaltsnahe Dienstleistungen',NULL,1,NULL,NULL,'2010-10-25 14:14:54','Mitarbeiter 1',1,'Mitarbeiter 1',NULL),
(264,4,8,'Stationär',NULL,1,NULL,NULL,'2010-10-25 14:14:54','Mitarbeiter 1',1,'Mitarbeiter 1',NULL),
(265,4,6,'Dienstplan',NULL,1,NULL,NULL,'2010-10-26 10:52:31','Mitarbeiter 1',1,'Mitarbeiter 1',NULL),
(266,4,2,'Pauschale AuW',NULL,1,NULL,NULL,'2011-03-14 09:54:23','Lothar Essenborn',1,'Lothar Essenborn',NULL),
(267,4,2,'Pauschale Trainingswohnen',NULL,1,NULL,NULL,'2011-03-14 09:54:23','Lothar Essenborn',1,'Lothar Essenborn',NULL);
COMMIT;
#
# Data for the `assessmentsheetcategory` table (LIMIT 0,500)
#
INSERT INTO `assessmentsheetcategory` (`Oid`, `Tid`, `Description`, `IsActive`, `Notice`, `InsTs`, `InsUser`, `Version`, `UdpUser`, `SystemEntryID`, `Position`) VALUES
(1,54,'Teilnahme am Essen','0',NULL,'2010-10-05 17:15:59','Mitarbeiter 1',2,'Mitarbeiter 1',NULL,0),
(2,54,'Kommunikationsverhalten','1',NULL,'2010-10-05 17:17:39','Mitarbeiter 1',1,'Mitarbeiter 1',NULL,0),
(3,54,'Medikamente','1',NULL,'2010-10-05 17:17:39','Mitarbeiter 1',1,'Mitarbeiter 1',NULL,0),
(4,54,'Teilnahme am Essen','1',NULL,'2010-10-05 17:17:39','Mitarbeiter 1',1,'Mitarbeiter 1',NULL,0),
(5,54,'Toilettengang','1',NULL,'2010-10-05 17:17:39','Mitarbeiter 1',1,'Mitarbeiter 1',NULL,0),
(6,54,'Waschen','1',NULL,'2010-10-05 17:17:39','Mitarbeiter 1',1,'Mitarbeiter 1',NULL,0);
COMMIT;
#
# Data for the `assessmentsheetvalue` table (LIMIT 0,500)
#
INSERT INTO `assessmentsheetvalue` (`Oid`, `Tid`, `Sign`, `Color`, `ShortcutKey`, `Description`, `IsActive`, `Notice`, `InsTs`, `InsUser`, `Version`, `UdpUser`, `SystemEntryID`, `Position`) VALUES
(8,53,'o','#FF7CFC00',NULL,'Gut','1',NULL,'2010-10-05 17:15:37','Mitarbeiter 1',1,'Mitarbeiter 1',NULL,0),
(9,53,NULL,'#FFFFFF00',NULL,'Mit Hilfe','1',NULL,'2010-10-05 17:15:37','Mitarbeiter 1',1,'Mitarbeiter 1',NULL,0),
(10,53,'x','#FFDC143C',NULL,'Schlecht','1',NULL,'2010-10-05 17:15:37','Mitarbeiter 1',1,'Mitarbeiter 1',NULL,0),
(11,53,NULL,'#FFFFB6C1',NULL,'Verweigert','1',NULL,'2010-10-05 17:15:37','Mitarbeiter 1',1,'Mitarbeiter 1',NULL,0);
COMMIT;
#
# Data for the `employmenttype` table (LIMIT 0,500)
#
INSERT INTO `employmenttype` (`Oid`, `Tid`, `Notice`, `InsTs`, `InsUser`, `UdpUser`, `Version`, `IsActive`, `SystemEntryID`, `Name`) VALUES
(5,66,NULL,'2010-08-12 22:34:43','Nuran Asche','Nuran Asche',1,'1',NULL,'Vollzeit'),
(6,66,NULL,'2010-08-12 22:34:43','Nuran Asche','Nuran Asche',1,'1',NULL,'Teilzeit'),
(7,66,NULL,'2010-08-12 22:35:40','Nuran Asche','Nuran Asche',1,'1',NULL,'400 Euro'),
(30,66,NULL,'2010-08-12 23:36:42','Nuran Asche','Nuran Asche',1,'1',NULL,'Aushilfe'),
(31,66,NULL,'2010-08-12 23:36:42','Nuran Asche','Nuran Asche',1,'1',NULL,'Ehrenamt');
COMMIT;
#
# Data for the `servicecategory` table (LIMIT 0,500)
#
INSERT INTO `servicecategory` (`Oid`, `Tid`, `Name`, `Abbreviation`, `Percentage`, `Billable`, `Notice`, `InsTs`, `InsUser`, `Version`, `UdpUser`, `IsActive`, `SystemEntryID`, `BillableFixedAmount`) VALUES
(5,0,'Abrechenbare Leistung','Abr. Leist.',100,1,NULL,'2010-10-05 17:11:07','Mitarbeiter 1',1,'Mitarbeiter 1',1,NULL,NULL),
(6,0,'Mittelbare Leistung','Mitt. Leist.',100,1,NULL,'2010-10-05 17:11:07','Mitarbeiter 1',2,'Lothar Essenborn',1,NULL,NULL),
(7,0,'Indirekte Leistung','Ind. Leist.',100,1,NULL,'2010-10-05 17:11:07','Mitarbeiter 1',3,'Lothar Essenborn',1,NULL,NULL),
(8,0,'Freie Mitarbeiter Fachkraft','FMA',100,1,NULL,'2011-03-14 09:59:51','Lothar Essenborn',4,'Lothar Essenborn',1,NULL,NULL),
(9,0,'Direkte Leistung',NULL,100,1,NULL,'2011-03-14 10:12:10','Lothar Essenborn',2,'Lothar Essenborn',1,NULL,NULL),
(10,0,'Freie Mitarbeiter Hilfskraft',NULL,100,0,NULL,'2011-03-14 15:40:31','Lothar Essenborn',1,'Lothar Essenborn',1,NULL,NULL),
(11,0,'FLS',NULL,100,1,NULL,'2011-11-28 13:01:58','Lothar Essenborn',1,'Lothar Essenborn',1,NULL,NULL);
COMMIT;
#
# Data for the `servicedescription` table (LIMIT 0,500)
#
INSERT INTO `servicedescription` (`Oid`, `ServiceCategoryOid`, `Tid`, `Name`, `Abbreviation`, `Notice`, `InsTs`, `InsUser`, `Version`, `UdpUser`, `IsActive`, `SystemEntryID`, `BillableFixedAmount`) VALUES
(43,5,0,'face to face',NULL,NULL,'2010-10-05 17:13:24','Mitarbeiter 1',1,'Mitarbeiter 1',1,NULL,NULL),
(44,5,0,'ear to ear',NULL,NULL,'2010-10-05 17:13:24','Mitarbeiter 1',1,'Mitarbeiter 1',1,NULL,NULL),
(45,5,0,'Sonstiger Direktkontakt',NULL,NULL,'2010-10-05 17:13:24','Mitarbeiter 1',2,'Mitarbeiter 1',0,NULL,NULL),
(46,6,0,'Telefonate mit Angehörigen',NULL,NULL,'2010-10-05 17:13:24','Mitarbeiter 1',1,'Mitarbeiter 1',1,NULL,NULL),
(47,6,0,'Telefonate mit Ämtern',NULL,NULL,'2010-10-05 17:13:24','Mitarbeiter 1',2,'Mitarbeiter 1',1,NULL,NULL),
(48,6,0,'Sonstige klientenbezogene nicht-abrechenbare Leistungen',NULL,NULL,'2010-10-05 17:13:24','Mitarbeiter 1',1,'Mitarbeiter 1',1,NULL,NULL),
(49,7,0,'Teamsitzung',NULL,NULL,'2010-10-05 17:13:24','Mitarbeiter 1',1,'Mitarbeiter 1',1,NULL,NULL),
(50,7,0,'Verwaltungstätigkeiten',NULL,NULL,'2010-10-05 17:13:24','Mitarbeiter 1',1,'Mitarbeiter 1',1,NULL,NULL),
(51,7,0,'Sonstiges',NULL,NULL,'2010-11-18 12:32:49','Mitarbeiter 1',1,'Mitarbeiter 1',1,NULL,NULL),
(52,7,0,'Sonstiges',NULL,NULL,'2010-12-02 11:32:53','Mitarbeiter 1',1,'Mitarbeiter 1',1,NULL,NULL),
(53,9,0,'Direkte Zeit FK',NULL,NULL,'2011-03-14 10:01:21','Lothar Essenborn',2,'Lothar Essenborn',1,NULL,NULL),
(54,9,0,'Direkte Zeit HK',NULL,NULL,'2011-03-14 10:04:30','Lothar Essenborn',2,'Lothar Essenborn',1,NULL,NULL),
(55,5,0,'Assistenz im Auftrag',NULL,NULL,'2011-03-14 10:04:30','Lothar Essenborn',1,'Lothar Essenborn',1,NULL,NULL),
(56,7,0,'Kontakt zu Dritten',NULL,NULL,'2011-03-14 10:04:30','Lothar Essenborn',1,'Lothar Essenborn',1,NULL,NULL),
(57,7,0,'Übergabegespräche',NULL,NULL,'2011-03-14 10:11:22','Lothar Essenborn',1,'Lothar Essenborn',1,NULL,NULL),
(58,7,0,'Fahrtzeiten',NULL,NULL,'2011-03-14 10:12:48','Lothar Essenborn',1,'Lothar Essenborn',1,NULL,NULL),
(59,7,0,'Sonstiges',NULL,NULL,'2011-03-14 10:12:48','Lothar Essenborn',1,'Lothar Essenborn',1,NULL,NULL),
(60,8,0,'FMA 1',NULL,NULL,'2011-03-14 15:39:36','Lothar Essenborn',1,'Lothar Essenborn',1,NULL,NULL),
(61,8,0,'FMA 2',NULL,NULL,'2011-03-14 15:39:37','Lothar Essenborn',1,'Lothar Essenborn',1,NULL,NULL),
(62,8,0,'FMA 3',NULL,NULL,'2011-03-14 15:39:37','Lothar Essenborn',1,'Lothar Essenborn',1,NULL,NULL),
(63,11,0,'HAusbesuch',NULL,NULL,'2011-11-28 13:04:00','Lothar Essenborn',1,'Lothar Essenborn',1,NULL,NULL);
COMMIT;
//Ziele
INSERT INTO `valuelistentry` (`Oid`, `Tid`, `Type`, `Value`, `Abbreviation`, `IsActive`, `SystemEntryID`, `Notice`, `InsTs`, `InsUser`, `Version`, `UdpUser`, `ParentOid`) VALUES
(50,4,9,'Eigene Wohnung beziehen',NULL,1,NULL,NULL,'2010-08-14 00:22:35','beyondSoft',1,'beyondSoft',NULL),
(51,4,9,'Wohnung erhalten',NULL,0,NULL,NULL,'2010-08-14 00:22:35','beyondSoft',2,'beyondSoft',NULL),
(52,4,9,'Essen und Trinken',NULL,1,NULL,NULL,'2010-08-14 00:22:35','beyondSoft',1,'beyondSoft',NULL),
(53,4,9,'Wäschepflege',NULL,0,NULL,NULL,'2010-08-14 00:22:35','beyondSoft',2,'beyondSoft',NULL),
(54,4,9,'Haushaltspflege',NULL,0,NULL,NULL,'2010-08-14 00:22:35','beyondSoft',2,'beyondSoft',NULL),
(55,4,9,'Haushaltsordnung',NULL,0,NULL,NULL,'2010-08-14 00:22:35','beyondSoft',2,'beyondSoft',NULL),
(56,4,9,'Haushaltshygiene',NULL,0,NULL,NULL,'2010-08-14 00:22:35','beyondSoft',2,'beyondSoft',NULL),
(57,4,9,'Tagesstruktur',NULL,0,NULL,NULL,'2010-08-14 00:22:35','beyondSoft',2,'beyondSoft',NULL),
(58,4,9,'Tag- und Nachtrhytmus',NULL,0,NULL,NULL,'2010-08-14 00:22:35','beyondSoft',2,'beyondSoft',NULL),
(59,4,9,'Beschäftigung',NULL,1,NULL,NULL,'2010-08-14 00:22:35','beyondSoft',1,'beyondSoft',NULL),
(60,4,9,'Arbeiten',NULL,1,NULL,NULL,'2010-08-14 00:22:35','beyondSoft',1,'beyondSoft',NULL),
(61,4,9,'Teilhabe am Leben',NULL,0,NULL,NULL,'2010-08-14 00:22:35','beyondSoft',2,'beyondSoft',NULL),
(62,4,9,'sinnvolle Freizeitbeschäftigung',NULL,0,NULL,NULL,'2010-08-14 00:22:35','beyondSoft',2,'beyondSoft',NULL),
(63,4,9,'Soziale Beziehungen',NULL,0,NULL,NULL,'2010-08-14 00:22:35','beyondSoft',3,'beyondSoft',NULL),
(64,4,9,'Krankheitseinsicht',NULL,1,NULL,NULL,'2010-08-14 00:22:35','beyondSoft',1,'beyondSoft',NULL),
(65,4,9,'Wahrnehmung ärztlicher/ therapeutischer Hilfen',NULL,1,NULL,NULL,'2010-08-14 00:22:35','beyondSoft',1,'beyondSoft',NULL),
(66,4,9,'Regeln von finanziellen und (sozial-)rechtlichen Angelegenheiten',NULL,1,NULL,NULL,'2010-08-14 00:28:10','beyondSoft',1,'beyondSoft',NULL),
(67,4,9,'Geld verwalten',NULL,1,NULL,NULL,'2010-08-14 00:28:10','beyondSoft',1,'beyondSoft',NULL),
(68,4,9,'Ordnung im eigenen Bereich',NULL,1,NULL,NULL,'2010-08-14 00:28:10','beyondSoft',1,'beyondSoft',NULL),
(69,4,9,'Einkaufen',NULL,0,NULL,NULL,'2010-08-14 00:28:10','beyondSoft',2,'beyondSoft',NULL),
(70,4,9,'Zubereitung von Hauptmahlzeiten',NULL,0,NULL,NULL,'2010-08-14 00:28:10','beyondSoft',2,'beyondSoft',NULL),
(71,4,9,'Individuelle Basisversorgung',NULL,1,NULL,NULL,'2010-08-14 00:28:10','beyondSoft',1,'beyondSoft',NULL),
(72,4,9,'Gestaltung sozialer Beziehungen',NULL,0,NULL,NULL,'2010-08-14 00:28:10','beyondSoft',2,'beyondSoft',NULL),
(73,4,9,'Teilnahme am kulturellen und gesellschaftlichen Leben',NULL,0,NULL,NULL,'2010-08-14 00:28:10','beyondSoft',2,'beyondSoft',NULL),
(74,4,9,'Erschließen außerhäuslicher Lebensbereiche',NULL,0,NULL,NULL,'2010-08-14 00:28:10','beyondSoft',2,'beyondSoft',NULL),
(75,4,9,'Entwickeln von Zukunftsperspektiven, Lebensplanung',NULL,0,NULL,NULL,'2010-08-14 00:28:10','beyondSoft',2,'beyondSoft',NULL),
(76,4,9,'Kommunikation und Orientierung',NULL,0,NULL,NULL,'2010-08-14 00:28:10','beyondSoft',2,'beyondSoft',NULL),
(77,4,9,'Emotionale und psychische Entwicklung',NULL,1,NULL,NULL,'2010-08-14 00:28:10','beyondSoft',1,'beyondSoft',NULL),
(78,4,9,'Gesundheitsförderung und -erhaltung',NULL,1,NULL,NULL,'2010-08-14 00:28:10','beyondSoft',1,'beyondSoft',NULL),
(79,4,9,'Alltägliche Lebensführung',NULL,1,NULL,NULL,'2010-08-14 00:31:33','beyondSoft',1,'beyondSoft',NULL),
(80,4,10,'Einkaufen',NULL,1,NULL,NULL,'2010-08-14 00:32:37','beyondSoft',2,'beyondSoft',52),
(81,4,10,'Zubereitung von Hauptmahlzeiten',NULL,1,NULL,NULL,'2010-08-14 00:32:37','beyondSoft',1,'beyondSoft',79),
(82,4,10,'Zubereitung von Zwischenmahlzeiten',NULL,1,NULL,NULL,'2010-08-14 00:32:37','beyondSoft',1,'beyondSoft',79),
(83,4,10,'Wäschepflege',NULL,1,NULL,NULL,'2010-08-14 00:32:37','beyondSoft',1,'beyondSoft',79),
(84,4,10,'Ordnung im eigenen Bereich',NULL,1,NULL,NULL,'2010-08-14 00:34:08','beyondSoft',1,'beyondSoft',79),
(85,4,10,'Geld verwalten',NULL,1,NULL,NULL,'2010-08-14 00:34:08','beyondSoft',1,'beyondSoft',79),
(86,4,10,'Ernährung',NULL,1,NULL,NULL,'2010-08-14 00:34:08','beyondSoft',1,'beyondSoft',71),
(87,4,10,'Körperpflege',NULL,1,NULL,NULL,'2010-08-14 00:34:08','beyondSoft',1,'beyondSoft',71),
(88,4,10,'Klären der beruflichen Wiedereingliederung',NULL,1,NULL,NULL,'2010-08-16 17:34:20','beyondSoft',1,'beyondSoft',60),
(89,4,10,'Aufnahme einer Arbeit',NULL,1,NULL,NULL,'2010-08-16 17:34:20','beyondSoft',1,'beyondSoft',60),
(90,4,10,'Durchführung von therapeu-tischen Verordnungen nach Anleitung',NULL,1,NULL,NULL,'2010-08-16 17:35:19','beyondSoft',3,'beyondSoft',64),
(91,4,10,'selbstständige Medikamenten-einnahme',NULL,1,NULL,NULL,'2010-08-16 17:35:19','beyondSoft',1,'beyondSoft',65),
(92,4,10,'selbstständige Durchführung von ärztlichen Anordnungen',NULL,1,NULL,NULL,'2010-08-16 17:36:28','beyondSoft',1,'beyondSoft',65),
(93,4,10,'Teilnahme an Krankengymnastik in Begleitung',NULL,1,NULL,NULL,'2010-08-16 17:36:28','beyondSoft',1,'beyondSoft',65),
(94,4,10,'führt Arztbesuche in Begleitung durch',NULL,1,NULL,NULL,'2010-08-16 17:38:14','beyondSoft',1,'beyondSoft',65),
(95,4,10,'führt Arztbesuche selbstständig durch',NULL,1,NULL,NULL,'2010-08-16 17:38:14','beyondSoft',1,'beyondSoft',65),
(96,4,10,'führt das Gespräch mit dem Arzt',NULL,1,NULL,NULL,'2010-08-16 17:38:14','beyondSoft',1,'beyondSoft',65),
(97,4,10,'hat sich auf Hausarzt/Facharzt festgelegt',NULL,1,NULL,NULL,'2010-08-16 17:38:14','beyondSoft',1,'beyondSoft',65),
(98,4,10,'informiert Betreuungspersonal über anstehende Arztbesuche',NULL,1,NULL,NULL,'2010-08-16 17:38:14','beyondSoft',1,'beyondSoft',65),
(99,4,10,'nimmt Terminvereinbarung selbstständig vor',NULL,1,NULL,NULL,'2010-08-16 17:38:14','beyondSoft',1,'beyondSoft',65),
(114,4,10,'erkennt Notwendigkeit der Körperpflege',NULL,1,NULL,NULL,'2010-08-16 17:45:44','beyondSoft',1,'beyondSoft',71),
(115,4,10,'führt Körperpflege nach Anleitung durch',NULL,1,NULL,NULL,'2010-08-16 17:45:44','beyondSoft',1,'beyondSoft',71),
(116,4,10,'führt Körperpflege nach Erinnerung durch',NULL,1,NULL,NULL,'2010-08-16 17:45:44','beyondSoft',1,'beyondSoft',71),
(117,4,10,'nutzt Pflegemittel sachgerecht',NULL,1,NULL,NULL,'2010-08-16 17:45:44','beyondSoft',1,'beyondSoft',71),
(118,4,10,'selbstständige Körperpflege',NULL,1,NULL,NULL,'2010-08-16 17:45:44','beyondSoft',1,'beyondSoft',71),
(119,4,10,'selbstständige Auswahl der Art der Nahrung',NULL,1,NULL,NULL,'2010-08-16 17:47:34','beyondSoft',1,'beyondSoft',52),
(120,4,10,'selbstständige Einteilung der Menge der Nahrungsmittel',NULL,1,NULL,NULL,'2010-08-16 17:47:34','beyondSoft',1,'beyondSoft',52),
(121,4,10,'möchte abnehmen',NULL,1,NULL,NULL,'2010-08-16 17:47:34','beyondSoft',1,'beyondSoft',52),
(122,4,10,'Erstellt einen Ernährungsplan und hält sich daran',NULL,1,NULL,NULL,'2010-08-16 17:47:34','beyondSoft',1,'beyondSoft',52),
(123,4,10,'Aufsuchen von Ã?mtern und Behörden mit Begleitung',NULL,1,NULL,NULL,'2010-08-16 17:51:28','beyondSoft',1,'beyondSoft',66),
(124,4,10,'Beantworten von Schriftstücken mit Anleitung',NULL,1,NULL,NULL,'2010-08-16 17:51:28','beyondSoft',1,'beyondSoft',66),
(125,4,10,'füllt Formulare selbstständig aus',NULL,1,NULL,NULL,'2010-08-16 17:51:28','beyondSoft',1,'beyondSoft',66),
(126,4,10,'füllt unter Anleitung Formulare aus',NULL,1,NULL,NULL,'2010-08-16 17:51:28','beyondSoft',1,'beyondSoft',66),
(127,4,10,'führt Bankgeschäfte mit Begleitung durch',NULL,1,NULL,NULL,'2010-08-16 17:51:28','beyondSoft',1,'beyondSoft',66),
(128,4,10,'selbstständige Bankgeschäfte',NULL,1,NULL,NULL,'2010-08-16 17:51:28','beyondSoft',1,'beyondSoft',66),
(129,4,10,'selbstständiges Aufsuchen von Ã?mtern und Behörden',NULL,1,NULL,NULL,'2010-08-16 17:51:28','beyondSoft',1,'beyondSoft',66),
(130,4,10,'selbstständiges Stellen von Anträgen',NULL,1,NULL,NULL,'2010-08-16 17:51:28','beyondSoft',1,'beyondSoft',66),
(131,4,10,'Stellen von Anträgen mit Anleitung',NULL,1,NULL,NULL,'2010-08-16 17:51:28','beyondSoft',1,'beyondSoft',66),
(132,4,10,'führt Preisvergleiche durch',NULL,1,NULL,NULL,'2010-08-16 17:53:01','beyondSoft',1,'beyondSoft',67),
(133,4,10,'hat Fähigkeit zum Beurteilen des Geldwertes',NULL,1,NULL,NULL,'2010-08-16 17:53:01','beyondSoft',1,'beyondSoft',67),
(134,4,10,'möchte Geld sparen',NULL,1,NULL,NULL,'2010-08-16 17:53:01','beyondSoft',1,'beyondSoft',67),
(135,4,10,'möchte Schulden abbauen',NULL,1,NULL,NULL,'2010-08-16 17:53:01','beyondSoft',1,'beyondSoft',67),
(136,4,10,'selbstständiger Umgang mit Geld',NULL,1,NULL,NULL,'2010-08-16 17:53:01','beyondSoft',1,'beyondSoft',67),
(137,4,10,'teilt sich das zur Verfügung stehende Geld über definierten Zeitraum ein',NULL,1,NULL,NULL,'2010-08-16 17:53:01','beyondSoft',1,'beyondSoft',67),
(138,4,10,'erkennt Notwendigkeit der Raumpflege',NULL,1,NULL,NULL,'2010-08-16 17:55:40','beyondSoft',2,'beyondSoft',79),
(139,4,10,'führt Raumpflege nach Erinnerung durch',NULL,1,NULL,NULL,'2010-08-16 17:55:40','beyondSoft',1,'beyondSoft',68),
(140,4,10,'selbstständige Raumpflege',NULL,1,NULL,NULL,'2010-08-16 17:55:40','beyondSoft',1,'beyondSoft',68),
(141,4,10,'selbstständiges Aufräumen',NULL,1,NULL,NULL,'2010-08-16 17:55:40','beyondSoft',1,'beyondSoft',68),
(142,4,10,'selbständige Müllentsorgung',NULL,1,NULL,NULL,'2010-08-16 17:55:40','beyondSoft',1,'beyondSoft',68),
(143,4,10,'Selbständiges Säubern der Sanitäranlagen',NULL,1,NULL,NULL,'2010-08-16 17:55:40','beyondSoft',1,'beyondSoft',68),
(144,4,10,'selbstständige Wäschepflege',NULL,1,NULL,NULL,'2010-08-16 17:59:24','beyondSoft',1,'beyondSoft',79),
(145,4,10,'selbstständiges Aufhängen der Wäsche',NULL,1,NULL,NULL,'2010-08-16 17:59:24','beyondSoft',1,'beyondSoft',79),
(146,4,10,'selbstständiges Bedienen der Waschmaschine',NULL,1,NULL,NULL,'2010-08-16 17:59:24','beyondSoft',1,'beyondSoft',79),
(147,4,10,'selbstständiges Bügeln',NULL,1,NULL,NULL,'2010-08-16 17:59:24','beyondSoft',1,'beyondSoft',79),
(148,4,10,'selbstständiges Einsortieren der Wäsche',NULL,1,NULL,NULL,'2010-08-16 17:59:24','beyondSoft',1,'beyondSoft',79),
(149,4,10,'erkennt Einkaufsbedarf',NULL,1,NULL,NULL,'2010-08-16 17:59:24','beyondSoft',2,'beyondSoft',52),
(150,4,10,'erstellt sich einen Einkaufszettel',NULL,1,NULL,NULL,'2010-08-16 17:59:24','beyondSoft',1,'beyondSoft',79),
(151,4,10,'erstellt sich unter Anleitung einen Einkaufszettel',NULL,1,NULL,NULL,'2010-08-16 17:59:24','beyondSoft',1,'beyondSoft',79),
(152,4,10,'kauft preisbewusst ein',NULL,1,NULL,NULL,'2010-08-16 17:59:24','beyondSoft',1,'beyondSoft',79),
(153,4,10,'selbstständiges Einkaufen',NULL,1,NULL,NULL,'2010-08-16 17:59:24','beyondSoft',1,'beyondSoft',79),
(154,4,10,'sucht Geschäfte zum Einkaufen selbstständig auf',NULL,1,NULL,NULL,'2010-08-16 17:59:24','beyondSoft',1,'beyondSoft',79),
(155,4,10,'sucht sich Gegenstände selbstständig aus',NULL,1,NULL,NULL,'2010-08-16 17:59:24','beyondSoft',1,'beyondSoft',79),
(156,4,10,'geht in Begleitung Einkaufen',NULL,1,NULL,NULL,'2010-08-16 17:59:56','beyondSoft',1,'beyondSoft',79),
(174,4,10,'setzt sich mit ihrer/seiner eigenen Situation/Behinderung auseinander',NULL,1,NULL,NULL,'2010-08-16 18:25:00','beyondSoft',1,'beyondSoft',64),
(175,4,10,'akzeptiert angeordnete Maßnahmen',NULL,1,NULL,NULL,'2010-08-16 18:25:00','beyondSoft',1,'beyondSoft',78),
(176,4,10,'benennt Krankheitssymptome',NULL,1,NULL,NULL,'2010-08-16 18:25:00','beyondSoft',1,'beyondSoft',78),
(177,4,10,'hält sich an angeordnete Maßnahmen',NULL,1,NULL,NULL,'2010-08-16 18:25:00','beyondSoft',1,'beyondSoft',78),
(178,4,10,'setzt sich mit Gesundheits-zustand auseinander',NULL,1,NULL,NULL,'2010-08-16 18:25:00','beyondSoft',1,'beyondSoft',78),
(179,4,10,'teilt Gesundheitsempfinden mit',NULL,1,NULL,NULL,'2010-08-16 18:25:00','beyondSoft',1,'beyondSoft',78),
(180,4,10,'hat Kenntnisse über gesunde Ernährung',NULL,1,NULL,NULL,'2010-08-16 18:25:00','beyondSoft',1,'beyondSoft',78),
(181,4,10,'hat Krankheitseinsicht',NULL,1,NULL,NULL,'2010-08-16 18:25:00','beyondSoft',1,'beyondSoft',78),
(182,4,10,'kann Folgen der Erkrankung erfassen',NULL,1,NULL,NULL,'2010-08-16 18:25:00','beyondSoft',1,'beyondSoft',78),
(183,4,10,'legt Wert auf gesunde Lebensführung',NULL,1,NULL,NULL,'2010-08-16 18:25:00','beyondSoft',1,'beyondSoft',78),
(184,4,10,'legt Wert darauf, sich an der frischen Luft zu bewegen',NULL,1,NULL,NULL,'2010-08-16 18:25:00','beyondSoft',1,'beyondSoft',78),
(185,4,10,'vermeidet gesundheitsschädigende Verhaltensweisen',NULL,1,NULL,NULL,'2010-08-16 18:25:00','beyondSoft',1,'beyondSoft',78),
(191,4,10,'Tagesstrukturplan erstellen',NULL,1,NULL,NULL,'2010-08-16 20:56:31','beyondSoft',1,'beyondSoft',59),
(192,4,10,'Tag- und Nachtrhythmus einhalten',NULL,1,NULL,NULL,'2010-08-16 20:56:31','beyondSoft',1,'beyondSoft',59),
(193,4,10,'Sinnvolle Freizeitbeschäftigung',NULL,1,NULL,NULL,'2010-08-16 20:56:31','beyondSoft',1,'beyondSoft',59),
(194,4,10,'Besuch einer Maßnahme',NULL,1,NULL,NULL,'2010-08-16 20:56:31','beyondSoft',1,'beyondSoft',59),
(195,4,10,'Besuch einer Tagesstruktuierenden Maßnahme',NULL,1,NULL,NULL,'2010-08-16 20:56:31','beyondSoft',1,'beyondSoft',59),
(196,4,10,'Ausüben eines Ehrenamtes',NULL,1,NULL,NULL,'2010-08-16 20:56:31','beyondSoft',1,'beyondSoft',59),
(197,4,10,'Anleitung bei der Wohnungssuche',NULL,1,NULL,NULL,'2010-08-16 20:58:50','beyondSoft',1,'beyondSoft',50),
(198,4,10,'Vorbereitung / Planung des Umzuges',NULL,1,NULL,NULL,'2010-08-16 20:58:50','beyondSoft',1,'beyondSoft',50),
(199,4,10,'Renovieren der eigenen Räume',NULL,1,NULL,NULL,'2010-08-16 20:58:50','beyondSoft',1,'beyondSoft',50),
(200,4,10,'Beschaffen von Möbeln und Inventar',NULL,1,NULL,NULL,'2010-08-16 20:58:50','beyondSoft',1,'beyondSoft',50),
(201,4,10,'Einrichten der Wohnung',NULL,1,NULL,NULL,'2010-08-16 20:58:50','beyondSoft',1,'beyondSoft',50),
(202,4,10,'erkennt/benennt aufkommende Störungen',NULL,1,NULL,NULL,'2010-08-16 21:06:24','beyondSoft',1,'beyondSoft',77),
(203,4,10,'hat persönliche Bewältigungsstrategien entwickelt',NULL,1,NULL,NULL,'2010-08-16 21:06:24','beyondSoft',1,'beyondSoft',77),
(204,4,10,'kennt Techniken zur Vermeidung/Minimierung der Störungen',NULL,1,NULL,NULL,'2010-08-16 21:06:24','beyondSoft',1,'beyondSoft',77),
(205,4,10,'äußert Wünsche/Bedürfnisse',NULL,1,NULL,NULL,'2010-08-16 21:11:22','beyondSoft',1,'beyondSoft',77),
(206,4,10,'kennt die Ursachen der Antriebslosigkeit',NULL,1,NULL,NULL,'2010-08-16 21:11:22','beyondSoft',1,'beyondSoft',77),
(207,4,10,'setzt sich mit persönlicher Situation auseinander',NULL,1,NULL,NULL,'2010-08-16 21:11:22','beyondSoft',1,'beyondSoft',77),
(208,4,10,'zeigt Interesse an Neuem',NULL,1,NULL,NULL,'2010-08-16 21:11:22','beyondSoft',1,'beyondSoft',77),
(209,4,10,'Nimmt Teilziele bewußt wahr und erlebt diese als Erfolg',NULL,1,NULL,NULL,'2010-08-16 21:11:22','beyondSoft',1,'beyondSoft',77),
(210,4,10,'erkennt Zusammenhang zwischen persönlichen Problemen und Suchtpotenzial',NULL,1,NULL,NULL,'2010-08-16 21:11:22','beyondSoft',1,'beyondSoft',77),
(211,4,10,'hat persönliche Bewältigungsstrategien entwickelt',NULL,1,NULL,NULL,'2010-08-16 21:11:22','beyondSoft',1,'beyondSoft',77),
(212,4,10,'ist kooperativ im Umgang mit Ã?rzten und anderen Berufsgruppen',NULL,1,NULL,NULL,'2010-08-16 21:11:22','beyondSoft',1,'beyondSoft',77),
(213,4,10,'kann mit Stress und Konflikten umgehen',NULL,1,NULL,NULL,'2010-08-16 21:11:22','beyondSoft',1,'beyondSoft',77),
(214,4,10,'kann zwischen Realität und Halluzination unterscheiden',NULL,1,NULL,NULL,'2010-08-16 21:11:22','beyondSoft',1,'beyondSoft',77),
(215,4,10,'kennt/benennt die eigenen Störungen',NULL,1,NULL,NULL,'2010-08-16 21:11:22','beyondSoft',1,'beyondSoft',77),
(216,4,10,'nimmt Hilfe an',NULL,1,NULL,NULL,'2010-08-16 21:11:22','beyondSoft',1,'beyondSoft',77),
(217,4,10,'nimmt Medikamente ein',NULL,1,NULL,NULL,'2010-08-16 21:11:22','beyondSoft',1,'beyondSoft',77),
(218,4,10,'erkennt selbstgefährdendes Verhalten',NULL,1,NULL,NULL,'2010-08-16 21:11:22','beyondSoft',1,'beyondSoft',77),
(219,4,10,'reflektiert selbstgefährdendes Verhalten',NULL,1,NULL,NULL,'2010-08-16 21:11:22','beyondSoft',1,'beyondSoft',77),
(220,4,10,'geht einer Beschäftigung regelmäßig nach',NULL,1,NULL,NULL,'2010-08-16 21:25:57','beyondSoft',1,'beyondSoft',59),
(221,4,10,'geht einer Arbeit regelmäßig nach',NULL,1,NULL,NULL,'2010-08-16 21:25:57','beyondSoft',1,'beyondSoft',60),
(222,4,10,'Adäquates Verhalten gegenüber Vorgesetzten',NULL,1,NULL,NULL,'2010-08-16 21:25:57','beyondSoft',1,'beyondSoft',60),
(223,4,10,'Adäquates Verhalten gegenüber Kollegen',NULL,1,NULL,NULL,'2010-08-16 21:25:57','beyondSoft',1,'beyondSoft',60),
(235,4,10,'Eingehende Post mit Anleitung bearbeiten',NULL,1,NULL,NULL,'2010-08-19 21:47:03','beyondSoft',1,'beyondSoft',66),
(236,4,10,'Papiere sortieren, abheften',NULL,1,NULL,NULL,'2010-08-19 21:47:04','beyondSoft',1,'beyondSoft',66),
(237,4,10,'administrative Dinge fristgerecht erledigen',NULL,1,NULL,NULL,'2010-08-19 21:47:04','beyondSoft',1,'beyondSoft',66),
(239,4,10,'Psychiatrische Anbindung',NULL,1,NULL,NULL,'2010-08-19 21:47:04','beyondSoft',1,'beyondSoft',78),
(240,4,10,'Selbstsicherheit gewinnen',NULL,1,NULL,NULL,'2010-08-19 21:48:54','beyondSoft',1,'beyondSoft',77),
(241,4,10,'Stabilisierung des Gesundheitszustandes',NULL,1,NULL,NULL,'2010-08-19 21:50:57','beyondSoft',1,'beyondSoft',78),
(243,4,10,'Regelmäßige Nahrungsaufnahme',NULL,1,NULL,NULL,'2010-08-19 21:50:57','beyondSoft',1,'beyondSoft',71),
(244,4,10,'Ermittlung der Arbeitsfähigkeit durch Begutachtung',NULL,1,NULL,NULL,'2010-08-19 21:53:47','beyondSoft',1,'beyondSoft',60),
(246,4,10,'Aufnahme einer Ausbildung',NULL,1,NULL,NULL,'2010-08-19 21:54:06','beyondSoft',1,'beyondSoft',60),
(247,4,10,'Erhalt des Arbeitsplatzes',NULL,1,NULL,NULL,'2010-08-19 22:00:38','beyondSoft',1,'beyondSoft',60),
(249,4,10,'Aufsuchen der Drogenberatung',NULL,1,NULL,NULL,'2010-08-19 22:00:38','beyondSoft',1,'beyondSoft',78),
(250,4,10,'Wohnungsbesichtigung in Begleitung',NULL,1,NULL,NULL,'2010-08-19 22:01:13','beyondSoft',1,'beyondSoft',50),
(251,4,10,'Erhalt der Ausbildung',NULL,1,NULL,NULL,'2010-08-19 22:01:32','beyondSoft',1,'beyondSoft',60),
(253,4,10,'Entwicklung von eigenen Interessen und Neigungen',NULL,1,NULL,NULL,'2010-08-19 22:04:43','beyondSoft',1,'beyondSoft',59),
(256,4,10,'Insolvenzantrag stellen',NULL,1,NULL,NULL,'2010-08-19 22:24:46','beyondSoft',1,'beyondSoft',66),
(257,4,10,'Anbindung an die Schuldnerberatung',NULL,1,NULL,NULL,'2010-08-19 22:24:46','beyondSoft',1,'beyondSoft',67);
COMMIT;
INSERT INTO `person` (`Oid`, `BankAccountOid`, `AddressOid`, `Tid`, `FirstName`, `LastName`, `DateOfBirth`, `Sex`, `FamilyStatus`, `Profession`, `Type`, `Notice`, `InsTs`, `InsUser`, `Version`, `UdpUser`, `IsActive`, `SystemEntryID`) VALUES
(1,NULL,NULL,1,'Mitarbeiter','1',NULL,0,NULL,NULL,1,NULL,NULL,'beyondSoft GmbH',1,'beyondSoft GmbH',1,NULL),
(2,NULL,NULL,1,'Mitarbeiter','2',NULL,0,NULL,NULL,1,NULL,NULL,'beyondSoft GmbH',1,'beyondSoft GmbH',1,NULL),
(3,NULL,NULL,1,'Mitarbeiter','3',NULL,0,NULL,NULL,1,NULL,NULL,'beyondSoft GmbH',1,'beyondSoft GmbH',1,NULL),
(4,NULL,NULL,1,'Mitarbeiter','4',NULL,0,NULL,NULL,1,NULL,NULL,'beyondSoft GmbH',1,'beyondSoft GmbH',1,NULL),
(5,NULL,NULL,1,'Mitarbeiter','5',NULL,0,NULL,NULL,1,NULL,NULL,'beyondSoft GmbH',1,'beyondSoft GmbH',1,NULL);
COMMIT;
INSERT INTO `employee` (`Oid`, `PersonOid`, `ApplicationUserOid`, `Tid`, `PersonnelNumber`, `TaxNumber`, `HealthInsurance`, `InsuranceNumber`, `HourlyRate`, `EntryDate`, `CancellationPeriod`, `ProbationPeriod`, `Sequence`, `IsActive`, `Notice`, `InsTs`, `InsUser`, `Version`, `UdpUser`, `SystemEntryID`, `weeklyfls`, `weeklytotalhours`, `leavedays`) VALUES
(1,1,NULL,2,'1',NULL,NULL,NULL,NULL,NULL,0,0,NULL,1,NULL,NULL,'beyondSoft GmbH',1,'beyondSoft GmbH',NULL,NULL,NULL,NULL),
(2,2,NULL,2,'2',NULL,NULL,NULL,NULL,NULL,0,0,NULL,1,NULL,NULL,'beyondSoft GmbH',1,'beyondSoft GmbH',NULL,NULL,NULL,NULL),
(3,3,NULL,2,'3',NULL,NULL,NULL,NULL,NULL,0,0,NULL,1,NULL,NULL,'beyondSoft GmbH',1,'beyondSoft GmbH',NULL,NULL,NULL,NULL),
(4,4,NULL,2,'4',NULL,NULL,NULL,NULL,NULL,0,0,NULL,1,NULL,NULL,'beyondSoft GmbH',1,'beyondSoft GmbH',NULL,NULL,NULL,NULL),
(5,5,NULL,2,'5',NULL,NULL,NULL,NULL,NULL,0,0,NULL,1,NULL,NULL,'beyondSoft GmbH',1,'beyondSoft GmbH',NULL,NULL,NULL,NULL);
COMMIT;
INSERT INTO `applicationuser` (`Oid`, `EmployeeOid`, `Tid`, `LoginName`, `Password`, `Notice`, `Version`, `UdpUser`, `InsUser`, `InsTs`, `IsActive`, `SystemEntryID`) VALUES
(1,1,28,'m1','18-14-1D-42-74-94-E6-74-4F-F2-65-A4-AE-07-66-CB',NULL,1,'beyondSoft GmbH','beyondSoft GmbH',NULL,1,NULL),
(2,2,28,'m2','18-14-1D-42-74-94-E6-74-4F-F2-65-A4-AE-07-66-CB',NULL,1,'beyondSoft GmbH','beyondSoft GmbH',NULL,1,NULL),
(3,3,28,'m3','18-14-1D-42-74-94-E6-74-4F-F2-65-A4-AE-07-66-CB',NULL,1,'beyondSoft GmbH','beyondSoft GmbH',NULL,1,NULL),
(4,4,28,'m4','18-14-1D-42-74-94-E6-74-4F-F2-65-A4-AE-07-66-CB',NULL,1,'beyondSoft GmbH','beyondSoft GmbH',NULL,1,NULL),
(5,5,28,'m5','18-14-1D-42-74-94-E6-74-4F-F2-65-A4-AE-07-66-CB',NULL,1,'beyondSoft GmbH','beyondSoft GmbH',NULL,1,NULL);
INSERT INTO `usergroup` (`Oid`, `ParentGroupOid`, `Tid`, `Name`, `Description`, `Notice`, `Version`, `InsTs`, `InsUser`, `UdpUser`, `IsActive`, `SystemEntryID`) VALUES
(1,NULL,0,'Administratoren',NULL,NULL,1,'2009-01-13 17:20:18','Max Mustermann','Max Mustermann',1,NULL),
(2,NULL,0,'Mitarbeiter',NULL,NULL,1,'2009-01-20 11:41:35','Max Mustermann','Max Mustermann',1,NULL);
COMMIT;
INSERT INTO `ingroup` (`UserGroupOid`, `ApplicationUserOid`) VALUES
(1,1),
(2,2),
(2,3),
(2,4),
(2,5);
COMMIT;

34
SQL/insertsDefault.sql Normal file
View File

@@ -0,0 +1,34 @@
INSERT INTO `address` (`Oid`, `Tid`, `Street`, `PostalCode`, `Town`, `State`, `Country`, `Notice`, `InsTs`, `InsUser`, `Version`, `UdpUser`, `IsActive`, `SystemEntryID`) VALUES
(1,5,'Kennedy-Ufer 2','50663 ','Köln',NULL,NULL,NULL,'2008-11-10 11:18:42','Max Mustermann',1,'Max Mustermann',1,NULL);
COMMIT;
INSERT INTO `costbearer` (`Oid`, `Tid`, `HourlyRate`, `RateFactor`, `Notice`, `InsTs`, `InsUser`, `UdpUser`, `Version`, `IsActive`, `MinutesIntervall`, `ReferenceNumber`, `SystemEntryID`) VALUES
(1,22,49.9000000000,20.0000000000,NULL,'2008-10-05 19:12:11','Max Mustermann','Max Mustermann',1,1,10,NULL,0);
COMMIT;
INSERT INTO `organisation` (`Oid`, `BankAccountOid`, `AddressOid`, `CostBearerOid`, `Tid`, `Notice`, `InsTs`, `InsUser`, `Version`, `UdpUser`, `Name`, `IsActive`, `SystemEntryID`) VALUES
(1,NULL,1,1,11,NULL,'2008-10-05 19:12:11','Max Mustermann',2,'Max Mustermann','LVR',1,NULL);
COMMIT;
INSERT INTO `costrateperiod` (`Oid`, `ObjectOid`, `ObjectTid`, `CostRateType`, `CostRateValue`, `StartDate`, `EndDate`, `Notice`, `InsTs`, `InsUser`, `Version`, `UdpUser`, `IsActive`, `SystemEntryID`, `UnitName`) VALUES
(1,1,22,0,50.4000000000,NULL,NULL,NULL,'2009-09-30 00:00:00','BS',1,'BS',1,NULL, NULL),
(2,1,22,1,10.0000000000,NULL,NULL,NULL,'2009-09-30 00:00:00','BS',1,'BS',1,NULL, NULL),
(3,1,22,2,20.0000000000,NULL,NULL,NULL,'2009-09-30 00:00:00','BS',1,'BS',1,NULL, NULL),
(4,1,22,3,60.0000000000,NULL,NULL,NULL,'2009-09-30 00:00:00','BS',1,'BS',1,NULL, 'FLS');
COMMIT;
INSERT INTO `query` (`Oid`, `Tid`, `Type`, `Title`, `Sql`, `Notice`, `InsTs`, `InsUser`, `UdpUser`, `Version`, `IsActive`, `SystemEntryID`, `UserGroupOids`, `ReportTypeName`) VALUES
(1,24,0,'Gesamtliste Geburtstage','select LastName as Nachname, FirstName as Vorname, DateOfBirth as Geburtstag, case Type when 1 then ''Angestellte(r)'' when 2 then ''Klient(in)''\twhen 3 then ''Umfeld'' end as Typ from person where dateofbirth is not null and isactive=1 order by lastname',NULL,'2008-06-23 16:16:02',NULL,NULL,1,1,NULL,NULL,NULL),
(2,24,0,'Kommende Geburtstage (nächste 60 Tage)','select LastName as Nachname, FirstName as Vorname, DateOfBirth as Geburtstag, case Type when 1 then ''Angestellte(r)'' when 2 then ''Klient(in)''\twhen 3 then ''Umfeld'' end as Typ from person where dayofyear(DateOfBirth) between dayofyear(CURDATE()) and (dayofyear(CURDATE()) + 60) and isactive=1 order by lastname',NULL,'2008-06-23 18:56:39',NULL,NULL,1,1,NULL,NULL,NULL),
(3,24,0,'Organisationen Stammdaten','select distinct o.`Name`, a.Street as Strasse, a.PostalCode as PLZ, a.Town as Ort, c4.`value` as Ansprechpartner, c5.`value` as Postfach, c0.`value` as Telefon, c1.`value` as Fax, c2.`value` as Mail, c3.`value` as Homepage from Organisation o left join Address a on o.addressOid = a.oid left join Contact c0 on o.Oid = c0.OrganisationOid and c0.`Type` = 3 left join Contact c1 on o.Oid = c1.OrganisationOid and c1.`Type` = 5 left join Contact c2 on o.Oid = c2.OrganisationOid and c2.`Type` = 7 left join Contact c3 on o.Oid = c3.OrganisationOid and c3.`Type` = 9 left join Contact c4 on o.Oid = c4.OrganisationOid and c4.`Type` = 10 left join Contact c5 on o.Oid = c5.OrganisationOid and c5.`Type` = 11 where o.isactive=1 order by o.`Name`',NULL,'2008-06-23 19:45:48',NULL,NULL,1,1,NULL,NULL,NULL),
(4,24,0,'Stammdaten aller Klienten','select distinct p.Lastname as Nachname, p.FirstName as Vorname, p.DateOfBirth as Geburtstag, a.Street as Strasse, a.PostalCode as PLZ, a.Town as Ort, c0.`value` as Telefon, c1.`value` as Handy, c2.`value` as Fax, c3.`value` as Mail from customer c inner join Person p on c.personoid = p.oid left join Address a on p.addressoid = a.oid left join Contact c0 on p.Oid = c0.PersonOid and c0.`Type` = 3 left join Contact c1 on p.Oid = c1.PersonOid and c1.`Type` = 1 left join Contact c2 on p.Oid = c2.PersonOid and c2.`Type` = 5 left join Contact c3 on p.Oid = c3.PersonOid and c3.`Type` = 7 where c.isactive=1 order by p.LastName',NULL,'2008-06-24 11:57:10',NULL,NULL,1,1,NULL,NULL,NULL),
(5,24,0,'Personen Stammdaten dienstlich','select distinct o.`Name` as Organisation, p.Lastname as Nachname, p.FirstName as Vorname, c0.`Value` as ''Tel. (dienstl.)'', c1.`Value` as ''Fax (dienstl.)'', c2.`Value` as ''Mail (dienstl.)'', a.Street as ''Strasse (dienstl.)'', a.PostalCode as ''PLZ (dienstl.)'', a.Town as ''Ort (dienstl.)'' from person p inner join organisation2person o2p on o2p.personoid = p.oid inner join organisation o on o2p.organisationoid = o.oid left join address a on o.addressoid = a.oid left join contact c0 on c0.organisation2personoid = o2p.oid and c0.`type` = 3 left join contact c1 on c1.organisation2personoid = o2p.oid and c1.`type` = 5 left join contact c2 on c2.organisation2personoid = o2p.oid and c2.`type` = 7 where p.Type = 3 and p.isactive=1 and o.isactive=1 order by p.lastname',NULL,'2008-06-24 12:47:32',NULL,NULL,1,1,NULL,NULL,NULL),
(6,24,0,'Hilfepläne die innerhalb der nächsten 3 Monate auslaufen','select p.LastName as Nachname, p.FirstName as Vorname, ROUND(DATEDIFF(CURDATE(), cb2sc.`RequestedStartDate`) / 30, 2) as ''Monate seit Beginn der Betreuung'', cb2sc.ApprovedStartDate as ''Bewilligt von'', cb2sc.ApprovedEndDate as ''Bewilligt bis'', o.`Name` as ''Kostentraeger'', (select CONCAT(emp1p.`FirstName`, '' '', emp1p.`LastName`) from employee emp1 join `person` emp1p on emp1p.`Oid` = emp1.`PersonOid` where emp1.`Oid` in (select employeeoid from `employee2customer` e2c1 join `valuelistentry2object` vl2o on e2c1.`Oid` = vl2o.`ObjectOid` join `valuelistentry` vle on vl2o.`ValueListEntryOid` = vle.`Oid` where e2c1.`CustomerOid` = cust.`Oid` and vle.`SystemEntryID` = 3) LIMIT 1) as ''Bezugsbetreuung'' from `person` p join `customer` cust on p.Oid = cust.PersonOid join `supportconcept` sc on cust.Oid = sc.CustomerOid join `costbearer2supportconcept` cb2sc on sc.Oid = cb2sc.SupportConceptOid join `costbearer` cb on cb2sc.`CostBearerOid` = cb.`Oid` join `organisation` o on cb.`Oid` = o.`CostBearerOid` WHERE cb2sc.ApprovedEndDate is not null and cb2sc.ApprovedEndDate > CURDATE() and cb2sc.ApprovedEndDate <= DATE_ADD(CURDATE(), INTERVAL 3 MONTH) and cust.IsActive <> 0 and sc.IsActive <> 0 order by Bezugsbetreuung;',NULL,NULL,NULL,NULL,1,1,NULL,NULL,NULL),
(7,24,0,'Hilfepläne die innerhalb der nächsten 7 Tage auslaufen','select p.LastName as Nachname, p.FirstName as Vorname, ROUND(DATEDIFF(CURDATE(), cb2sc.`RequestedStartDate`) / 30, 2) as ''Monate seit Beginn der Betreuung'', cb2sc.ApprovedStartDate as ''Bewilligt von'', cb2sc.ApprovedEndDate as ''Bewilligt bis'', o.`Name` as ''Kostentraeger'', (select CONCAT(emp1p.`FirstName`, '' '', emp1p.`LastName`) from employee emp1 join `person` emp1p on emp1p.`Oid` = emp1.`PersonOid` where emp1.`Oid` in (select employeeoid from `employee2customer` e2c1 join `valuelistentry2object` vl2o on e2c1.`Oid` = vl2o.`ObjectOid` join `valuelistentry` vle on vl2o.`ValueListEntryOid` = vle.`Oid` where e2c1.`CustomerOid` = cust.`Oid` and vle.`SystemEntryID` = 3) LIMIT 1) as ''Bezugsbetreuung'' from `person` p join `customer` cust on p.Oid = cust.PersonOid join `supportconcept` sc on cust.Oid = sc.CustomerOid join `costbearer2supportconcept` cb2sc on sc.Oid = cb2sc.SupportConceptOid join `costbearer` cb on cb2sc.`CostBearerOid` = cb.`Oid` join `organisation` o on cb.`Oid` = o.`CostBearerOid` WHERE cb2sc.ApprovedEndDate is not null and cb2sc.ApprovedEndDate > CURDATE() and cb2sc.ApprovedEndDate < DATE_ADD(CURDATE(), INTERVAL 8 DAY) and cust.IsActive <> 0 and sc.IsActive <> 0 order by Bezugsbetreuung;',NULL,NULL,NULL,NULL,1,1,NULL,NULL,NULL),
(8,24,0,'Hilfepläne ohne Bewilligung','select p.LastName as Nachname, p.FirstName as Vorname, ROUND(DATEDIFF(CURDATE(), cb2sc.`RequestedStartDate`) / 30, 2) as ''Monate seit Beginn der Betreuung'', cb2sc.`RequestedStartDate` as ''Beantragt von'', cb2sc.`RequestedEndDate` as ''Beantragt bis'', o.`Name` as ''Kostentraeger'', (select CONCAT(emp1p.`FirstName`, '' '', emp1p.`LastName`) from employee emp1 join `person` emp1p on emp1p.`Oid` = emp1.`PersonOid` where emp1.`Oid` in (select employeeoid from `employee2customer` e2c1 join `valuelistentry2object` vl2o on e2c1.`Oid` = vl2o.`ObjectOid` join `valuelistentry` vle on vl2o.`ValueListEntryOid` = vle.`Oid` where e2c1.`CustomerOid` = cust.`Oid` and vle.`SystemEntryID` = 3) LIMIT 1) as ''Bezugsbetreuung'' from `person` p join `customer` cust on p.Oid = cust.PersonOid join `supportconcept` sc on cust.Oid = sc.CustomerOid join `costbearer2supportconcept` cb2sc on sc.Oid = cb2sc.SupportConceptOid join `costbearer` cb on cb2sc.`CostBearerOid` = cb.`Oid` join `organisation` o on cb.`Oid` = o.`CostBearerOid` WHERE cb2sc.`Status` <> 2 and cust.IsActive = 1 and sc.IsActive = 1 order by Bezugsbetreuung;',NULL,NULL,NULL,NULL,1,1,NULL,NULL,NULL),
(9,24,0,'Abwesenheiten der Mitarbeiter','select p.`FirstName` as Vorname, p.`LastName` as Nachname, ar.`Description` as Kategorie, at.`Start` as von, at.`EndTime` as bis, at.`Notice` as Bemerkung from `person` p inner join `employee` emp on p.`Oid` = emp.`PersonOid` inner join `absencetime` at on emp.`Oid` = at.`EmployeeOid` inner join `absencereason` ar on at.`AbsenceReasonOid` = ar.`Oid` where emp.`IsActive` = 1 order by p.`LastName`;',NULL,NULL,NULL,NULL,1,1,NULL,NULL,NULL),
(10,24,0,'Abwesenheiten der Klienten','select p.`FirstName` as Vorname, p.`LastName` as Nachname, ar.`Description` as Kategorie, at.`Start` as von, at.`EndTime` as bis, at.`Notice` as Bemerkung from `person` p inner join `customer` c on p.`Oid` = c.`PersonOid` inner join `absencetime` at on c.`Oid` = at.`CustomerOid` inner join `absencereason` ar on at.`AbsenceReasonOid` = ar.`Oid` where c.`IsActive` = 1 order by p.`LastName`;',NULL,NULL,NULL,NULL,1,1,NULL,NULL,NULL);
COMMIT;

1096
bewo.xml Normal file

File diff suppressed because it is too large Load Diff