Datenbank erweitert
This commit is contained in:
@@ -1,14 +1,15 @@
|
||||
using System;
|
||||
using KlassenBIB;
|
||||
using SanShared.Exceptions;
|
||||
using SanSystem;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xaml;
|
||||
using System.IO.Compression;
|
||||
using System.Diagnostics;
|
||||
using KlassenBIB;
|
||||
using SanShared.Exceptions;
|
||||
|
||||
namespace Database
|
||||
{
|
||||
@@ -53,31 +54,13 @@ namespace Database
|
||||
public bool LoadProjekt(string projekt)
|
||||
{
|
||||
this.projekt = projekt;
|
||||
loadedProjekt = Datenbank.Instance.TeufelDB.Projekte.Find(x => x.Nummer != null && x.Nummer.Equals(projekt));
|
||||
|
||||
string filepath = Path.Combine(pfad, "projekte", "TeufelDB.xaml");
|
||||
if (!File.Exists(filepath))
|
||||
using (var context = new SanVerwalterContext())
|
||||
{
|
||||
if (!Directory.Exists("./projekte")) return true;
|
||||
//UpdateDatabase.UpdateNewGuids();
|
||||
|
||||
//UpdateDatabase.TransferAuftraggeber();
|
||||
//UpdateDatabase.MakeNewDatabaseSystem();
|
||||
} else
|
||||
{
|
||||
//UpdateDatabase.GenerateNewBeziehungen();
|
||||
}
|
||||
|
||||
return true;
|
||||
loadedProjekt = context.Projekte.Where(x => x.Nummer != null && x.Nummer.Equals(projekt)).FirstOrDefault();
|
||||
}
|
||||
return loadedProjekt != null;
|
||||
}
|
||||
|
||||
public bool InitProjekt(Projekt projekt,string projektpfad)
|
||||
{
|
||||
this.projektpfad = Path.Combine(projektpfad,string.Format("{0}.xaml",projekt.Nummer));
|
||||
loadedProjekt = projekt;
|
||||
SaveProjekt();
|
||||
return true;
|
||||
}
|
||||
|
||||
public void SaveProjekt()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user