diff --git a/SanSystem/BüroExporter.cs b/SanSystem/BüroExporter.cs
index b527712..f912fb8 100644
--- a/SanSystem/BüroExporter.cs
+++ b/SanSystem/BüroExporter.cs
@@ -58,7 +58,7 @@ namespace SanSystem
}
else if (san is KlassenBIB.SchachtAnbindung)
{
- string sourceDirectory = san.CheckVerzeichnisse(Global.Instance.Projektpfad);
+ /*string sourceDirectory = san.CheckVerzeichnisse(Global.Instance.Projektpfad);
SchachtAnbindung fotoDokumentation = (san as SchachtAnbindung);
KlassenBIB.Collections.Bilder fotos = fotoDokumentation.SavedBilders;
foreach (SavedBilder foto in fotos)
@@ -70,6 +70,7 @@ namespace SanSystem
File.Copy(foto.Speicherpfad, Path.Combine(tempPath, destinationName));
}
+ */
}
}
diff --git a/SanSystem/FrmNewProjekt.cs b/SanSystem/FrmNewProjekt.cs
index a2c4a55..184267a 100644
--- a/SanSystem/FrmNewProjekt.cs
+++ b/SanSystem/FrmNewProjekt.cs
@@ -25,26 +25,30 @@ namespace SanSystem
InitializeComponent();
}
- private bool project_already_excist(string projektnummer)
- {
- return Datenbank.Instance.TeufelDB.Projekte.FindAll(x => x.Nummer.Equals(projektnummer)).Count > 0;
- }
-
private void btn_save_Click(object sender, EventArgs e)
{
- if(project_already_excist(txt_pro_nr.Text))
+ using (var context = new SanVerwalterContext())
{
- MessageBox.Show(string.Format("Projekt mit den nummer {0} excistiert bereits. Projekt wird nicht angelegt", txt_pro_nr.Text));
- return;
+ if (project_already_exist(context, txt_pro_nr.Text))
+ {
+ MessageBox.Show(string.Format("Projekt mit den nummer {0} excistiert bereits. Projekt wird nicht angelegt", txt_pro_nr.Text));
+ return;
+ }
+ Projekt projekt = new Projekt();
+ projekt.Nummer = txt_pro_nr.Text;
+ projekt.Ort = txt_ort.Text;
+ context.Projekte.Add(projekt);
+ context.SaveChanges();
}
- Projekt projekt = new Projekt();
- projekt.Nummer = txt_pro_nr.Text;
- projekt.Ort = txt_ort.Text;
- Global.Instance.SetProjekt(projekt);
this.Close();
//Global.Instance.ChangeProjekt(txt_pro_nr.Text);
}
+ private bool project_already_exist(SanVerwalterContext context, string text)
+ {
+ return context.Projekte.Count(x => x.Nummer.Equals(text)) > 0;
+ }
+
private void txt_pro_nr_KeyPress(object sender, KeyPressEventArgs e)
{
if(e.KeyChar == '/' || e.KeyChar == '\\')
diff --git a/SanSystem/Global.cs b/SanSystem/Global.cs
index 934e76c..cabdb5e 100644
--- a/SanSystem/Global.cs
+++ b/SanSystem/Global.cs
@@ -95,18 +95,6 @@ namespace SanSystem
}
}
- internal void SetProjekt(Projekt projekt)
- {
- Database.Datenbank.Instance.SaveProjekt();
- this.ProjektNummer = projekt.Nummer;
- Database.Datenbank.Instance.loadedProjekt = null;
- Database.Datenbank.Instance.LoadProjekt(projekt.Nummer);
-
- if (!Directory.Exists(Projektpfad)) Directory.CreateDirectory(Projektpfad);
- Database.Datenbank.Instance.TeufelDB.Projekte.Add(projekt);
- Database.Datenbank.Instance.InitProjekt(projekt, Projektpfad);
- }
-
public string Projektpfad
{
get
diff --git a/SanSystem/KlassenBIB/Auftraggeber.cs b/SanSystem/KlassenBIB/Auftraggeber.cs
index 845ebf3..bc529cd 100644
--- a/SanSystem/KlassenBIB/Auftraggeber.cs
+++ b/SanSystem/KlassenBIB/Auftraggeber.cs
@@ -10,7 +10,7 @@ namespace KlassenBIB
///
///
///
- public class Auftraggeber :IAuftraggeber
+ public class Auftraggeber : DBModel, IAuftraggeber
{
///
///
diff --git a/SanSystem/KlassenBIB/DBModel.cs b/SanSystem/KlassenBIB/DBModel.cs
new file mode 100644
index 0000000..5887593
--- /dev/null
+++ b/SanSystem/KlassenBIB/DBModel.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace KlassenBIB
+{
+ public abstract class DBModel
+ {
+ public int Id { get; set; }
+ }
+}
diff --git a/SanSystem/KlassenBIB/Inspektionsobjekt.cs b/SanSystem/KlassenBIB/Inspektionsobjekt.cs
index 5a9fa74..7d7e406 100644
--- a/SanSystem/KlassenBIB/Inspektionsobjekt.cs
+++ b/SanSystem/KlassenBIB/Inspektionsobjekt.cs
@@ -1,6 +1,7 @@
using SanShared;
using System;
using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -11,11 +12,11 @@ namespace KlassenBIB
///
///
///
- public class Inspektionsobjekt
+ public class Inspektionsobjekt: DBModel
{
private string strasseName = "none";
- public IAuftraggeber OverrideAuftraggeber { get; set; }
+ public Auftraggeber OverrideAuftraggeber { get; set; }
public bool GeschlossenesEnde { get; set; }
public string StrasseName { get => strasseName; set => strasseName = value; }
@@ -42,25 +43,26 @@ namespace KlassenBIB
public DateTime HaltungGemessen { get; set; }
- public Collections.Inspektionskuerzeln Schadenskuerzeln { get; set; }
+ //public Collections.Inspektionskuerzeln Schadenskuerzeln { get; set; }
public string Bemerkung { get; set; }
-
+
+ [NotMapped]
public Collections.Sanierung Sanierung { get;set; }
- public Collections.AusgefuehrteTaetigkeiten AusgefuehrteTaetigkeiten { get; set; }
+ //public Collections.AusgefuehrteTaetigkeiten AusgefuehrteTaetigkeiten { get; set; }
public string Inspektionsrichtung { get; set; }
public string Sanierungsnummer { get; set; }
- public Guid Guid { get; set; }
+
public Inspektionsobjekt()
{
- Schadenskuerzeln = new Collections.Inspektionskuerzeln();
+ //Schadenskuerzeln = new Collections.Inspektionskuerzeln();
Sanierung = new Collections.Sanierung();
- AusgefuehrteTaetigkeiten = new Collections.AusgefuehrteTaetigkeiten();
+ //AusgefuehrteTaetigkeiten = new Collections.AusgefuehrteTaetigkeiten();
if (HaltungGemessen <= DateTime.MinValue || HaltungGemessen >= DateTime.MaxValue) HaltungGemessen = DateTime.Now;
}
}
diff --git a/SanSystem/KlassenBIB/Projekt.cs b/SanSystem/KlassenBIB/Projekt.cs
index 711c86d..715891b 100644
--- a/SanSystem/KlassenBIB/Projekt.cs
+++ b/SanSystem/KlassenBIB/Projekt.cs
@@ -8,12 +8,12 @@ using System.Windows.Markup;
namespace KlassenBIB
{
- public class Projekt :IProjekt
+ public class Projekt: DBModel //:IProjekt
{
public string Nummer { get; set; }
public string Ort { get; set; }
- public IAuftraggeber Auftraggeber { get; set; }
- public Collections.Leistungsverzeichnis Leistungsverzeichnis { get; set; }
+ public Auftraggeber Auftraggeber { get; set; }
+ //public Collections.Leistungsverzeichnis Leistungsverzeichnis { get; set; }
public Collections.AbwasserTechnischeAnlage Objekte { get; set; }
public string SanierungsIDPrefix { get; set; }
public string SanierungsIDSuffix { get; set; }
@@ -23,7 +23,7 @@ namespace KlassenBIB
public Projekt()
{
Objekte = new Collections.AbwasserTechnischeAnlage();
- Leistungsverzeichnis = new Collections.Leistungsverzeichnis();
+ //Leistungsverzeichnis = new Collections.Leistungsverzeichnis();
Auftraggeber = new Auftraggeber();
}
}
diff --git a/SanSystem/KlassenBIB/Sanierung/Renovation/InlinerSanierung.cs b/SanSystem/KlassenBIB/Sanierung/Renovation/InlinerSanierung.cs
index 0bc0343..2530261 100644
--- a/SanSystem/KlassenBIB/Sanierung/Renovation/InlinerSanierung.cs
+++ b/SanSystem/KlassenBIB/Sanierung/Renovation/InlinerSanierung.cs
@@ -51,7 +51,7 @@ namespace KlassenBIB
return haltungslaenge * harzbedarf;
}
- public override string CheckVerzeichnisse(string projektpfad)
+ public string CheckVerzeichnisse(string projektpfad)
{
string path = Path.Combine(projektpfad, PfadZurSan);
if (!Directory.Exists(path)) Directory.CreateDirectory(path);
diff --git a/SanSystem/KlassenBIB/Sanierung/Reparatur.cs b/SanSystem/KlassenBIB/Sanierung/Reparatur.cs
index 465cddc..2c1e693 100644
--- a/SanSystem/KlassenBIB/Sanierung/Reparatur.cs
+++ b/SanSystem/KlassenBIB/Sanierung/Reparatur.cs
@@ -32,7 +32,7 @@ namespace KlassenBIB
///
///
///
- public override string CheckVerzeichnisse(string projektpfad)
+ public string CheckVerzeichnisse(string projektpfad)
{
throw new NotImplementedException();
}
diff --git a/SanSystem/KlassenBIB/Sanierung/Sanierung.cs b/SanSystem/KlassenBIB/Sanierung/Sanierung.cs
index 4a375c3..8bef836 100644
--- a/SanSystem/KlassenBIB/Sanierung/Sanierung.cs
+++ b/SanSystem/KlassenBIB/Sanierung/Sanierung.cs
@@ -10,7 +10,7 @@ namespace KlassenBIB
{
[EditorBrowsable(EditorBrowsableState.Never)]
[Browsable(false)]
- public abstract class Sanierung : INotifyPropertyChanged
+ public class Sanierung : INotifyPropertyChanged
{
Guid guid;
double tempAusen;
@@ -37,7 +37,7 @@ namespace KlassenBIB
}
- public abstract string CheckVerzeichnisse(string projektpfad);
+ //public string CheckVerzeichnisse(string projektpfad);
public Guid Guid { get => guid; set => guid = value; }
diff --git a/SanSystem/KlassenBIB/SchachtAnbindung.cs b/SanSystem/KlassenBIB/SchachtAnbindung.cs
index 27770e5..601bafe 100644
--- a/SanSystem/KlassenBIB/SchachtAnbindung.cs
+++ b/SanSystem/KlassenBIB/SchachtAnbindung.cs
@@ -37,7 +37,7 @@ namespace KlassenBIB
///
///
///
- public override string CheckVerzeichnisse(string projektpfad)
+ public string CheckVerzeichnisse(string projektpfad)
{
string path = Path.Combine(projektpfad, PfadZurSan);
if (!Directory.Exists(path)) Directory.CreateDirectory(path);
diff --git a/SanSystem/Migrations/20230114101006_InitialCreate.Designer.cs b/SanSystem/Migrations/20230114101006_InitialCreate.Designer.cs
new file mode 100644
index 0000000..5b2c3a7
--- /dev/null
+++ b/SanSystem/Migrations/20230114101006_InitialCreate.Designer.cs
@@ -0,0 +1,226 @@
+//
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using SanSystem;
+
+#nullable disable
+
+namespace SanSystem.Migrations
+{
+ [DbContext(typeof(SanVerwalterContext))]
+ [Migration("20230114101006_InitialCreate")]
+ partial class InitialCreate
+ {
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder.HasAnnotation("ProductVersion", "6.0.0");
+
+ modelBuilder.Entity("KlassenBIB.Auftraggeber", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("Ansprechpartner")
+ .HasColumnType("TEXT");
+
+ b.Property("Name")
+ .HasColumnType("TEXT");
+
+ b.Property("Ort")
+ .HasColumnType("TEXT");
+
+ b.Property("Strasse")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("Auftraggebers");
+ });
+
+ modelBuilder.Entity("KlassenBIB.Inspektionsobjekt", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("Bemerkung")
+ .HasColumnType("TEXT");
+
+ b.Property("BisPunkt")
+ .HasColumnType("TEXT");
+
+ b.Property("GeschlossenesEnde")
+ .HasColumnType("INTEGER");
+
+ b.Property("Guid")
+ .HasColumnType("TEXT");
+
+ b.Property("HaltungGemessen")
+ .HasColumnType("TEXT");
+
+ b.Property("Haltungslaenge")
+ .HasColumnType("REAL");
+
+ b.Property("Hausnummer")
+ .HasColumnType("TEXT");
+
+ b.Property("Inspektionsrichtung")
+ .HasColumnType("TEXT");
+
+ b.Property("Kanalrohrweite")
+ .HasColumnType("INTEGER");
+
+ b.Property("Objektbezeichnung")
+ .HasColumnType("TEXT");
+
+ b.Property("OrtName")
+ .HasColumnType("TEXT");
+
+ b.Property("OverrideAuftraggeberId")
+ .HasColumnType("INTEGER");
+
+ b.Property("ProjektId")
+ .HasColumnType("INTEGER");
+
+ b.Property("Projektnummer")
+ .HasColumnType("TEXT");
+
+ b.Property("RohrMaterial")
+ .HasColumnType("TEXT");
+
+ b.Property("Sanierungsnummer")
+ .HasColumnType("TEXT");
+
+ b.Property("Schachtlaenge")
+ .HasColumnType("REAL");
+
+ b.Property("StrasseName")
+ .HasColumnType("TEXT");
+
+ b.Property("VonPunkt")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("OverrideAuftraggeberId");
+
+ b.HasIndex("ProjektId");
+
+ b.ToTable("InspektionObjekte");
+ });
+
+ modelBuilder.Entity("KlassenBIB.Projekt", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("AuftraggeberId")
+ .HasColumnType("INTEGER");
+
+ b.Property("Nummer")
+ .HasColumnType("TEXT");
+
+ b.Property("Ort")
+ .HasColumnType("TEXT");
+
+ b.Property("SanierungsIDPrefix")
+ .HasColumnType("TEXT");
+
+ b.Property("SanierungsIDSuffix")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AuftraggeberId");
+
+ b.ToTable("Projekte");
+ });
+
+ modelBuilder.Entity("KlassenBIB.Sanierung", b =>
+ {
+ b.Property("GenehmigungVorhanden")
+ .HasColumnType("INTEGER");
+
+ b.Property("Guid")
+ .HasColumnType("TEXT");
+
+ b.Property("HDReinigung")
+ .HasColumnType("INTEGER");
+
+ b.Property("HDReinigungDatum")
+ .HasColumnType("TEXT");
+
+ b.Property("InspektionsobjektId")
+ .HasColumnType("INTEGER");
+
+ b.Property("STVOAbsicherung")
+ .HasColumnType("INTEGER");
+
+ b.Property("TempAusen")
+ .HasColumnType("REAL");
+
+ b.Property("TempKanal")
+ .HasColumnType("REAL");
+
+ b.Property("VorbereitetMechanisch")
+ .HasColumnType("INTEGER");
+
+ b.Property("VorbereitetRoboter")
+ .HasColumnType("INTEGER");
+
+ b.Property("WasserhaltungEingerichtet")
+ .HasColumnType("INTEGER");
+
+ b.Property("Wetter")
+ .HasColumnType("TEXT");
+
+ b.HasIndex("InspektionsobjektId");
+
+ b.ToTable("Sanierung");
+ });
+
+ modelBuilder.Entity("KlassenBIB.Inspektionsobjekt", b =>
+ {
+ b.HasOne("KlassenBIB.Auftraggeber", "OverrideAuftraggeber")
+ .WithMany()
+ .HasForeignKey("OverrideAuftraggeberId");
+
+ b.HasOne("KlassenBIB.Projekt", null)
+ .WithMany("Objekte")
+ .HasForeignKey("ProjektId");
+
+ b.Navigation("OverrideAuftraggeber");
+ });
+
+ modelBuilder.Entity("KlassenBIB.Projekt", b =>
+ {
+ b.HasOne("KlassenBIB.Auftraggeber", "Auftraggeber")
+ .WithMany()
+ .HasForeignKey("AuftraggeberId");
+
+ b.Navigation("Auftraggeber");
+ });
+
+ modelBuilder.Entity("KlassenBIB.Sanierung", b =>
+ {
+ b.HasOne("KlassenBIB.Inspektionsobjekt", "Inspektionsobjekt")
+ .WithMany()
+ .HasForeignKey("InspektionsobjektId");
+
+ b.Navigation("Inspektionsobjekt");
+ });
+
+ modelBuilder.Entity("KlassenBIB.Projekt", b =>
+ {
+ b.Navigation("Objekte");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/SanSystem/Migrations/20230114101006_InitialCreate.cs b/SanSystem/Migrations/20230114101006_InitialCreate.cs
new file mode 100644
index 0000000..c915327
--- /dev/null
+++ b/SanSystem/Migrations/20230114101006_InitialCreate.cs
@@ -0,0 +1,153 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace SanSystem.Migrations
+{
+ public partial class InitialCreate : Migration
+ {
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.CreateTable(
+ name: "Auftraggebers",
+ columns: table => new
+ {
+ Id = table.Column(type: "INTEGER", nullable: false)
+ .Annotation("Sqlite:Autoincrement", true),
+ Name = table.Column(type: "TEXT", nullable: true),
+ Strasse = table.Column(type: "TEXT", nullable: true),
+ Ort = table.Column(type: "TEXT", nullable: true),
+ Ansprechpartner = table.Column(type: "TEXT", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Auftraggebers", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Projekte",
+ columns: table => new
+ {
+ Id = table.Column(type: "INTEGER", nullable: false)
+ .Annotation("Sqlite:Autoincrement", true),
+ Nummer = table.Column(type: "TEXT", nullable: true),
+ Ort = table.Column(type: "TEXT", nullable: true),
+ AuftraggeberId = table.Column(type: "INTEGER", nullable: true),
+ SanierungsIDPrefix = table.Column(type: "TEXT", nullable: true),
+ SanierungsIDSuffix = table.Column(type: "TEXT", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Projekte", x => x.Id);
+ table.ForeignKey(
+ name: "FK_Projekte_Auftraggebers_AuftraggeberId",
+ column: x => x.AuftraggeberId,
+ principalTable: "Auftraggebers",
+ principalColumn: "Id");
+ });
+
+ migrationBuilder.CreateTable(
+ name: "InspektionObjekte",
+ columns: table => new
+ {
+ Id = table.Column(type: "INTEGER", nullable: false)
+ .Annotation("Sqlite:Autoincrement", true),
+ OverrideAuftraggeberId = table.Column(type: "INTEGER", nullable: true),
+ GeschlossenesEnde = table.Column(type: "INTEGER", nullable: false),
+ StrasseName = table.Column(type: "TEXT", nullable: true),
+ OrtName = table.Column(type: "TEXT", nullable: true),
+ Hausnummer = table.Column(type: "TEXT", nullable: true),
+ Projektnummer = table.Column(type: "TEXT", nullable: true),
+ Objektbezeichnung = table.Column(type: "TEXT", nullable: true),
+ VonPunkt = table.Column(type: "TEXT", nullable: true),
+ BisPunkt = table.Column(type: "TEXT", nullable: true),
+ RohrMaterial = table.Column(type: "TEXT", nullable: true),
+ Kanalrohrweite = table.Column(type: "INTEGER", nullable: false),
+ Haltungslaenge = table.Column(type: "REAL", nullable: false),
+ Schachtlaenge = table.Column(type: "REAL", nullable: false),
+ HaltungGemessen = table.Column(type: "TEXT", nullable: false),
+ Bemerkung = table.Column(type: "TEXT", nullable: true),
+ Inspektionsrichtung = table.Column(type: "TEXT", nullable: true),
+ Sanierungsnummer = table.Column(type: "TEXT", nullable: true),
+ Guid = table.Column(type: "TEXT", nullable: false),
+ ProjektId = table.Column(type: "INTEGER", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_InspektionObjekte", x => x.Id);
+ table.ForeignKey(
+ name: "FK_InspektionObjekte_Auftraggebers_OverrideAuftraggeberId",
+ column: x => x.OverrideAuftraggeberId,
+ principalTable: "Auftraggebers",
+ principalColumn: "Id");
+ table.ForeignKey(
+ name: "FK_InspektionObjekte_Projekte_ProjektId",
+ column: x => x.ProjektId,
+ principalTable: "Projekte",
+ principalColumn: "Id");
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Sanierung",
+ columns: table => new
+ {
+ Guid = table.Column(type: "TEXT", nullable: false),
+ TempAusen = table.Column(type: "REAL", nullable: false),
+ TempKanal = table.Column(type: "REAL", nullable: false),
+ Wetter = table.Column(type: "TEXT", nullable: true),
+ GenehmigungVorhanden = table.Column(type: "INTEGER", nullable: false),
+ WasserhaltungEingerichtet = table.Column(type: "INTEGER", nullable: false),
+ STVOAbsicherung = table.Column(type: "INTEGER", nullable: false),
+ HDReinigung = table.Column(type: "INTEGER", nullable: false),
+ HDReinigungDatum = table.Column(type: "TEXT", nullable: false),
+ InspektionsobjektId = table.Column(type: "INTEGER", nullable: true),
+ VorbereitetMechanisch = table.Column(type: "INTEGER", nullable: false),
+ VorbereitetRoboter = table.Column(type: "INTEGER", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.ForeignKey(
+ name: "FK_Sanierung_InspektionObjekte_InspektionsobjektId",
+ column: x => x.InspektionsobjektId,
+ principalTable: "InspektionObjekte",
+ principalColumn: "Id");
+ });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_InspektionObjekte_OverrideAuftraggeberId",
+ table: "InspektionObjekte",
+ column: "OverrideAuftraggeberId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_InspektionObjekte_ProjektId",
+ table: "InspektionObjekte",
+ column: "ProjektId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Projekte_AuftraggeberId",
+ table: "Projekte",
+ column: "AuftraggeberId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Sanierung_InspektionsobjektId",
+ table: "Sanierung",
+ column: "InspektionsobjektId");
+ }
+
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropTable(
+ name: "Sanierung");
+
+ migrationBuilder.DropTable(
+ name: "InspektionObjekte");
+
+ migrationBuilder.DropTable(
+ name: "Projekte");
+
+ migrationBuilder.DropTable(
+ name: "Auftraggebers");
+ }
+ }
+}
diff --git a/SanSystem/Migrations/SanVerwalterContextModelSnapshot.cs b/SanSystem/Migrations/SanVerwalterContextModelSnapshot.cs
new file mode 100644
index 0000000..ab05f7b
--- /dev/null
+++ b/SanSystem/Migrations/SanVerwalterContextModelSnapshot.cs
@@ -0,0 +1,224 @@
+//
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using SanSystem;
+
+#nullable disable
+
+namespace SanSystem.Migrations
+{
+ [DbContext(typeof(SanVerwalterContext))]
+ partial class SanVerwalterContextModelSnapshot : ModelSnapshot
+ {
+ protected override void BuildModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder.HasAnnotation("ProductVersion", "6.0.0");
+
+ modelBuilder.Entity("KlassenBIB.Auftraggeber", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("Ansprechpartner")
+ .HasColumnType("TEXT");
+
+ b.Property("Name")
+ .HasColumnType("TEXT");
+
+ b.Property("Ort")
+ .HasColumnType("TEXT");
+
+ b.Property("Strasse")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("Auftraggebers");
+ });
+
+ modelBuilder.Entity("KlassenBIB.Inspektionsobjekt", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("Bemerkung")
+ .HasColumnType("TEXT");
+
+ b.Property("BisPunkt")
+ .HasColumnType("TEXT");
+
+ b.Property("GeschlossenesEnde")
+ .HasColumnType("INTEGER");
+
+ b.Property("Guid")
+ .HasColumnType("TEXT");
+
+ b.Property("HaltungGemessen")
+ .HasColumnType("TEXT");
+
+ b.Property("Haltungslaenge")
+ .HasColumnType("REAL");
+
+ b.Property("Hausnummer")
+ .HasColumnType("TEXT");
+
+ b.Property("Inspektionsrichtung")
+ .HasColumnType("TEXT");
+
+ b.Property("Kanalrohrweite")
+ .HasColumnType("INTEGER");
+
+ b.Property("Objektbezeichnung")
+ .HasColumnType("TEXT");
+
+ b.Property("OrtName")
+ .HasColumnType("TEXT");
+
+ b.Property("OverrideAuftraggeberId")
+ .HasColumnType("INTEGER");
+
+ b.Property("ProjektId")
+ .HasColumnType("INTEGER");
+
+ b.Property("Projektnummer")
+ .HasColumnType("TEXT");
+
+ b.Property("RohrMaterial")
+ .HasColumnType("TEXT");
+
+ b.Property("Sanierungsnummer")
+ .HasColumnType("TEXT");
+
+ b.Property("Schachtlaenge")
+ .HasColumnType("REAL");
+
+ b.Property("StrasseName")
+ .HasColumnType("TEXT");
+
+ b.Property("VonPunkt")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("OverrideAuftraggeberId");
+
+ b.HasIndex("ProjektId");
+
+ b.ToTable("InspektionObjekte");
+ });
+
+ modelBuilder.Entity("KlassenBIB.Projekt", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("AuftraggeberId")
+ .HasColumnType("INTEGER");
+
+ b.Property("Nummer")
+ .HasColumnType("TEXT");
+
+ b.Property("Ort")
+ .HasColumnType("TEXT");
+
+ b.Property("SanierungsIDPrefix")
+ .HasColumnType("TEXT");
+
+ b.Property("SanierungsIDSuffix")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AuftraggeberId");
+
+ b.ToTable("Projekte");
+ });
+
+ modelBuilder.Entity("KlassenBIB.Sanierung", b =>
+ {
+ b.Property("GenehmigungVorhanden")
+ .HasColumnType("INTEGER");
+
+ b.Property("Guid")
+ .HasColumnType("TEXT");
+
+ b.Property("HDReinigung")
+ .HasColumnType("INTEGER");
+
+ b.Property("HDReinigungDatum")
+ .HasColumnType("TEXT");
+
+ b.Property("InspektionsobjektId")
+ .HasColumnType("INTEGER");
+
+ b.Property("STVOAbsicherung")
+ .HasColumnType("INTEGER");
+
+ b.Property("TempAusen")
+ .HasColumnType("REAL");
+
+ b.Property("TempKanal")
+ .HasColumnType("REAL");
+
+ b.Property("VorbereitetMechanisch")
+ .HasColumnType("INTEGER");
+
+ b.Property("VorbereitetRoboter")
+ .HasColumnType("INTEGER");
+
+ b.Property("WasserhaltungEingerichtet")
+ .HasColumnType("INTEGER");
+
+ b.Property("Wetter")
+ .HasColumnType("TEXT");
+
+ b.HasIndex("InspektionsobjektId");
+
+ b.ToTable("Sanierung");
+ });
+
+ modelBuilder.Entity("KlassenBIB.Inspektionsobjekt", b =>
+ {
+ b.HasOne("KlassenBIB.Auftraggeber", "OverrideAuftraggeber")
+ .WithMany()
+ .HasForeignKey("OverrideAuftraggeberId");
+
+ b.HasOne("KlassenBIB.Projekt", null)
+ .WithMany("Objekte")
+ .HasForeignKey("ProjektId");
+
+ b.Navigation("OverrideAuftraggeber");
+ });
+
+ modelBuilder.Entity("KlassenBIB.Projekt", b =>
+ {
+ b.HasOne("KlassenBIB.Auftraggeber", "Auftraggeber")
+ .WithMany()
+ .HasForeignKey("AuftraggeberId");
+
+ b.Navigation("Auftraggeber");
+ });
+
+ modelBuilder.Entity("KlassenBIB.Sanierung", b =>
+ {
+ b.HasOne("KlassenBIB.Inspektionsobjekt", "Inspektionsobjekt")
+ .WithMany()
+ .HasForeignKey("InspektionsobjektId");
+
+ b.Navigation("Inspektionsobjekt");
+ });
+
+ modelBuilder.Entity("KlassenBIB.Projekt", b =>
+ {
+ b.Navigation("Objekte");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/SanSystem/Program.cs b/SanSystem/Program.cs
index a6fe33a..5cf0819 100644
--- a/SanSystem/Program.cs
+++ b/SanSystem/Program.cs
@@ -18,6 +18,7 @@ namespace SanSystem
[STAThread]
static void Main()
{
+
new Mutex(initiallyOwned: true, "SanVerwaltung", out bool result);
if(!result)
{
diff --git a/SanSystem/SanSystem.csproj b/SanSystem/SanSystem.csproj
index b690094..c94cb85 100644
--- a/SanSystem/SanSystem.csproj
+++ b/SanSystem/SanSystem.csproj
@@ -18,13 +18,30 @@
-
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+ PreserveNewest
+
+
+ Never
+
+
+ Never
+
+
+
diff --git a/SanSystem/SanVerwalterContext.cs b/SanSystem/SanVerwalterContext.cs
new file mode 100644
index 0000000..d7f1f83
--- /dev/null
+++ b/SanSystem/SanVerwalterContext.cs
@@ -0,0 +1,32 @@
+using KlassenBIB;
+using Microsoft.EntityFrameworkCore;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SanSystem
+{
+ public class SanVerwalterContext : DbContext
+ {
+ public DbSet Projekte { get; set; }
+ public DbSet InspektionObjekte { get; set; }
+ public DbSet Sanierung { get; set; }
+ public DbSet Auftraggebers { get; set; }
+
+ protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
+ {
+ optionsBuilder.UseSqlite("Data Source=SanVerwaltung.db");
+ base.OnConfiguring(optionsBuilder);
+
+ }
+
+ protected override void OnModelCreating(ModelBuilder modelBuilder)
+ {
+ modelBuilder.Entity().HasNoKey();
+ base.OnModelCreating(modelBuilder);
+
+ }
+ }
+}
diff --git a/SanSystem/SanVerwaltung.db b/SanSystem/SanVerwaltung.db
new file mode 100644
index 0000000..f544ca9
Binary files /dev/null and b/SanSystem/SanVerwaltung.db differ
diff --git a/SanSystem/SchnittstelleImporter/I2006XML.cs b/SanSystem/SchnittstelleImporter/I2006XML.cs
index 2066b0c..5aee332 100644
--- a/SanSystem/SchnittstelleImporter/I2006XML.cs
+++ b/SanSystem/SchnittstelleImporter/I2006XML.cs
@@ -188,7 +188,7 @@ namespace SchnittstelleImporter
inspektionskuerzelns.Add(inspektionskuerzeln);
}
- inspektionsobjekt.Schadenskuerzeln = inspektionskuerzelns;
+ //inspektionsobjekt.Schadenskuerzeln = inspektionskuerzelns;
result.Add(inspektionsobjekt);
}
diff --git a/SanSystem/UCInliner.cs b/SanSystem/UCInliner.cs
index a0e0598..340fccb 100644
--- a/SanSystem/UCInliner.cs
+++ b/SanSystem/UCInliner.cs
@@ -319,7 +319,7 @@ namespace SanSystem
{
MessageBox.Show("Warnung, es wurden keine Daten von der Anlage geladen, Grafik konnte nicht erstellt werden");
}
- Hashtable hashtable = inliner.MakeProtokoll(destinationPath, Database.Datenbank.Instance.loadedProjekt,inliner.Offset);
+ Hashtable hashtable = new Hashtable(); //inliner.MakeProtokoll(destinationPath, Database.Datenbank.Instance.loadedProjekt,inliner.Offset);
DirectoryInfo directory = Directory.GetParent(destinationPath);
string speicherpfad = directory.FullName;
speicherpfad = Path.Combine(speicherpfad, "Einbauprotokolle");
diff --git a/SanSystem/frmMain.cs b/SanSystem/frmMain.cs
index 6382f12..a09f7fd 100644
--- a/SanSystem/frmMain.cs
+++ b/SanSystem/frmMain.cs
@@ -331,10 +331,10 @@ namespace SanSystem
}
}
string destinationPath = san.CheckVerzeichnisse(Global.Instance.Projektpfad);
- Hashtable hashtable = san.MakeProtokoll(destinationPath, Database.Datenbank.Instance.loadedProjekt, DateTime.MinValue);
+ //Hashtable hashtable = san.MakeProtokoll(destinationPath, Database.Datenbank.Instance.loadedProjekt, DateTime.MinValue);
DirectoryInfo directory = Directory.GetParent(destinationPath);
string speicherpfad = Path.Combine(directory.FullName,"Einbauprotokolle");
- BerichtGen.FrmOptions options = new BerichtGen.FrmOptions("JUME", "liner_einbauBlueLight.docx", speicherpfad, san.Inspektionsobjekt.Objektbezeichnung, hashtable, bilder,null,true);
+ //BerichtGen.FrmOptions options = new BerichtGen.FrmOptions("JUME", "liner_einbauBlueLight.docx", speicherpfad, san.Inspektionsobjekt.Objektbezeichnung, hashtable, bilder,null,true);
}
//options.ShowDialog();
diff --git a/SanSystem/frmObjektEdit.cs b/SanSystem/frmObjektEdit.cs
index 9ddf533..5bdf5fe 100644
--- a/SanSystem/frmObjektEdit.cs
+++ b/SanSystem/frmObjektEdit.cs
@@ -40,8 +40,8 @@ namespace SanSystem
tabControl1.TabPages.RemoveAt(2);
tabControl1.TabPages.RemoveAt(1);
#endif
- dgv_schadenkuerzel.DataSource = inspektion.Schadenskuerzeln;
- dgv_sanierungen.DataSource = inspektion.AusgefuehrteTaetigkeiten;
+ //dgv_schadenkuerzel.DataSource = inspektion.Schadenskuerzeln;
+ //dgv_sanierungen.DataSource = inspektion.AusgefuehrteTaetigkeiten;
foreach(Sanierung san in inspektion.Sanierung)
{
@@ -283,7 +283,7 @@ namespace SanSystem
private void FrmAuftraggeberEdit_FormClosed(object sender, FormClosedEventArgs e)
{
- inspektionsobjekt.OverrideAuftraggeber = (sender as frmAuftraggeberEdit).Auftraggeber;
+ //inspektionsobjekt.OverrideAuftraggeber = (sender as frmAuftraggeberEdit).Auftraggeber;
}
}
diff --git a/SanSystem/frmObjekteList.cs b/SanSystem/frmObjekteList.cs
index 2a20b36..92677be 100644
--- a/SanSystem/frmObjekteList.cs
+++ b/SanSystem/frmObjekteList.cs
@@ -189,7 +189,7 @@ namespace SanSystem
private void btn_add_Click(object sender, EventArgs e)
{
Inspektionsobjekt inspektionsobjekt = new Inspektionsobjekt();
- inspektionsobjekt.Guid = Guid.NewGuid();
+ //inspektionsobjekt.Guid = Guid.NewGuid();
inspektionsobjekt.Projektnummer = inspektionsobjekte.First().Projektnummer;
inspektionsobjekt.OrtName = inspektionsobjekte.First().OrtName;
inspektionsobjekt.StrasseName = inspektionsobjekte.First().StrasseName;
diff --git a/SanSystem/frmStrassenList.cs b/SanSystem/frmStrassenList.cs
index 668f80a..57ff24b 100644
--- a/SanSystem/frmStrassenList.cs
+++ b/SanSystem/frmStrassenList.cs
@@ -47,6 +47,7 @@ namespace SanSystem
private void buildSortedSteetList()
{
+
List ortteile = Datenbank.Instance.loadedProjekt.Objekte.Select(x => x.OrtName).Distinct().ToList();
int aktuellOpened = -1;
bool aktuelleStrasse = false;
@@ -109,7 +110,8 @@ namespace SanSystem
}
private void buildUnsortedStreetList()
- {
+ {
+
List strassen = Datenbank.Instance.loadedProjekt.Objekte.Select(x => x.StrasseName).Distinct().ToList();
List streets = new List();
@@ -129,6 +131,9 @@ namespace SanSystem
private void frmStrassenList_Load(object sender, EventArgs e)
{
+
+
+
this.Height = this.MdiParent.Height - 120;
if(streetListSetting.SortedSelected())
{