Merge branch 'auftraggeberDatenbank'
This commit is contained in:
@@ -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)
|
||||
@@ -56,6 +70,7 @@ namespace Database
|
||||
loadedProjekt = new KlassenBIB.Projekt();
|
||||
|
||||
UpdateDatabase.UpdateNewGuids();
|
||||
UpdateDatabase.TransferAuftraggeber();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -193,6 +208,7 @@ namespace Database
|
||||
|
||||
public void SaveProjekt()
|
||||
{
|
||||
XamlServices.Save("./projekte/MainDatenbank.xaml", MainDatenbank);
|
||||
XamlServices.Save(projektpfad, loadedProjekt);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
using System;
|
||||
using KlassenBIB;
|
||||
using SanShared;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xaml;
|
||||
|
||||
namespace Database
|
||||
{
|
||||
@@ -26,5 +30,34 @@ namespace Database
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
public static void TransferAuftraggeber()
|
||||
{
|
||||
List<string> projekte = new List<string>();
|
||||
List<IAuftraggeber> auftraggebers = new List<IAuftraggeber>();
|
||||
Projekt tempProjekt = null;
|
||||
foreach(DirectoryInfo projekt in (new DirectoryInfo("./projekte").GetDirectories()))
|
||||
{
|
||||
projekte.Add(projekt.Name);
|
||||
}
|
||||
|
||||
foreach(string t in projekte)
|
||||
{
|
||||
tempProjekt = XamlServices.Load(Path.Combine("projekte", t,string.Format("{0}.xaml",t))) as KlassenBIB.Projekt;
|
||||
|
||||
//auftraggebers.Add(tempProjekt.Auftraggeber);
|
||||
if (Datenbank.Instance.MainDatenbank.AuftraggeberListe.Contains(tempProjekt.Auftraggeber))
|
||||
{
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
Datenbank.Instance.MainDatenbank.AuftraggeberListe.Add(tempProjekt.Auftraggeber);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
21
KlassenBIB/AnlagenType.cs
Normal file
21
KlassenBIB/AnlagenType.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
namespace KlassenBIB
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class AnlagenType
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string Hersteller { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string Seriennummer { get; set; }
|
||||
}
|
||||
}
|
||||
0
KlassenBIB/AuftraggeberListCollection.cs
Normal file
0
KlassenBIB/AuftraggeberListCollection.cs
Normal file
@@ -44,13 +44,16 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AbwasserTechnischeAnlageCollection.cs" />
|
||||
<Compile Include="AnlagenType.cs" />
|
||||
<Compile Include="Auftraggeber.cs" />
|
||||
<Compile Include="AuftraggeberListCollection.cs" />
|
||||
<Compile Include="BilderCollection.cs" />
|
||||
<Compile Include="ChargeNummerCollection.cs" />
|
||||
<Compile Include="Hutprofil.cs" />
|
||||
<Compile Include="IImportedObjekte.cs" />
|
||||
<Compile Include="InlinerSanierung.cs" />
|
||||
<Compile Include="Kurzliner.cs" />
|
||||
<Compile Include="MainDataBase.cs" />
|
||||
<Compile Include="Projekt.cs" />
|
||||
<Compile Include="Inspektionskuerzeln.cs" />
|
||||
<Compile Include="InspektionskuerzelnCollection.cs" />
|
||||
|
||||
1
KlassenBIB/MainDataBase.cs
Normal file
1
KlassenBIB/MainDataBase.cs
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
Reference in New Issue
Block a user