From a75b69175cf27413b6b3598c6334402e0741e98d Mon Sep 17 00:00:00 2001 From: Husky Date: Fri, 12 Jul 2019 08:27:09 +0200 Subject: [PATCH] =?UTF-8?q?Auftraggeber=20Datenbank=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Database/Datenbank.cs | 15 ++++++++++++++ KlassenBIB/AuftraggeberListCollection.cs | 15 ++++++++++++++ KlassenBIB/KlassenBIB.csproj | 2 ++ KlassenBIB/MainDataBase.cs | 25 ++++++++++++++++++++++++ 4 files changed, 57 insertions(+) create mode 100644 KlassenBIB/AuftraggeberListCollection.cs create mode 100644 KlassenBIB/MainDataBase.cs diff --git a/Database/Datenbank.cs b/Database/Datenbank.cs index edfbadf..33e74f2 100644 --- a/Database/Datenbank.cs +++ b/Database/Datenbank.cs @@ -28,6 +28,20 @@ namespace Database } public KlassenBIB.Projekt loadedProjekt = null; + public KlassenBIB.MainDataBase MainDatenbank = null; + + public Datenbank() + { + string filepath = Path.Combine("./projekte","MainDatenbank.xaml"); + if(File.Exists(filepath)) + { + MainDatenbank = XamlServices.Load(filepath) as KlassenBIB.MainDataBase; + } + else + { + MainDatenbank = new MainDataBase(); + } + } private string projektpfad = string.Empty; public bool LoadProjekt(string projekt, string projektpfad) @@ -193,6 +207,7 @@ namespace Database public void SaveProjekt() { + XamlServices.Save("./projekte/MainDatenbank.xaml", MainDatenbank); XamlServices.Save(projektpfad, loadedProjekt); } } diff --git a/KlassenBIB/AuftraggeberListCollection.cs b/KlassenBIB/AuftraggeberListCollection.cs new file mode 100644 index 0000000..23f3a8c --- /dev/null +++ b/KlassenBIB/AuftraggeberListCollection.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace KlassenBIB +{ + /// + /// + /// + public class AuftraggeberListCollection : List + { + } +} diff --git a/KlassenBIB/KlassenBIB.csproj b/KlassenBIB/KlassenBIB.csproj index 23f005c..8f143d2 100644 --- a/KlassenBIB/KlassenBIB.csproj +++ b/KlassenBIB/KlassenBIB.csproj @@ -45,12 +45,14 @@ + + diff --git a/KlassenBIB/MainDataBase.cs b/KlassenBIB/MainDataBase.cs new file mode 100644 index 0000000..8eee451 --- /dev/null +++ b/KlassenBIB/MainDataBase.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Markup; + +namespace KlassenBIB +{ + /// + /// + /// + [ContentProperty("AuftraggeberListe")] + public class MainDataBase + { + /// + /// + /// + public AuftraggeberListCollection AuftraggeberListe { get; set; } + public MainDataBase() + { + AuftraggeberListe = new AuftraggeberListCollection(); + } + } +}