WPF hinzugefügt

This commit is contained in:
Husky
2021-02-26 18:31:57 +01:00
parent 6761b17f4d
commit 746353e54e
34 changed files with 1261 additions and 37 deletions

View File

@@ -3,6 +3,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\DataGen\DataGen.csproj" /> <ProjectReference Include="..\DataGen\DataGen.csproj" />
<ProjectReference Include="..\DPGetDataContract\DPGetDataContract.csproj" /> <ProjectReference Include="..\DPGetDataContract\DPGetDataContract.csproj" />
<ProjectReference Include="..\Mappings\Mappings.csproj" />
<ProjectReference Include="..\ProtokollWriterContract\ProtokollWriterContract.csproj" /> <ProjectReference Include="..\ProtokollWriterContract\ProtokollWriterContract.csproj" />
<ProjectReference Include="..\ProtokollWriter\ProtokollWriter.csproj" /> <ProjectReference Include="..\ProtokollWriter\ProtokollWriter.csproj" />
<ProjectReference Include="..\Models\Models.csproj" /> <ProjectReference Include="..\Models\Models.csproj" />
@@ -10,6 +11,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.3" /> <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.3" />
<PackageReference Include="Ninject" Version="3.3.4" />
</ItemGroup> </ItemGroup>
<!-- <ItemGroup> <!-- <ItemGroup>

View File

@@ -5,7 +5,10 @@ using DPGetDataContract;
using Models; using Models;
using ProtokollWriter; using ProtokollWriter;
using ProtokollWriterContract; using ProtokollWriterContract;
using Ninject;
using Mappings;
using DichtheitManagement.Contract;
using System.Collections.Generic;
namespace ConsoleApplication namespace ConsoleApplication
{ {
@@ -13,6 +16,31 @@ namespace ConsoleApplication
{ {
static void Main(string[] args) static void Main(string[] args)
{ {
var kernel = new StandardKernel();
new KernelInitializer().Initialize(kernel);
var manager = kernel.Get<IAuftraggeberManager>();
var baustellen = kernel.Get<IBaustelleManager>();
/*
Auftraggeber auftraggeber = new Auftraggeber();
auftraggeber.Baustellen = new List<Bauvorhaben>();
auftraggeber.Baustellen.Add(new Bauvorhaben()
{
Standort = "Oldenburg",
Strasse = "Donner",
Auftraggeber = auftraggeber,
Ort = "Oldenburg"
});
auftraggeber.Name = "Junker";
manager.Add(auftraggeber);
*/
var auftragger = manager.GetAllAuftraggeber();
var bau = baustellen.GetAllBauvorhaben();
Debugger.Break();
/*
IDPGetDataContract eingabe = new MeasureDataGen(); IDPGetDataContract eingabe = new MeasureDataGen();
(eingabe as MeasureDataGen).GenerateUnterdruck(DateTime.Now,-100); (eingabe as MeasureDataGen).GenerateUnterdruck(DateTime.Now,-100);
@@ -56,6 +84,7 @@ namespace ConsoleApplication
//Debugger.Break(); //Debugger.Break();
Console.WriteLine("Hello World!"); Console.WriteLine("Hello World!");
*/
} }
} }
} }

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
namespace DataStoring.Contract
{
public interface IRepository<TEntity> where TEntity : class
{
IQueryable<TEntity> Query { get; }
void Insert(TEntity entity);
void Update(TEntity entity);
void Delete(int id);
IEnumerable<TEntity> Get(
Expression<Func<TEntity,bool>> filter = null,
Func<IQueryable<TEntity>, IOrderedQueryable<TEntity>> orderBy = null,
string includeProperties = "");
//TEntity GetObjectByID(object id);
}
}

View File

@@ -0,0 +1,30 @@
using Microsoft.EntityFrameworkCore;
using Models;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataStoring.EfCore
{
public class DPContext : DbContext
{
public DbSet<Auftraggeber> AuftraggeberSet { get; set; }
public DbSet<Bauvorhaben> BaustellenSet { get; set; }
public DbSet<Inspektionsobjekt> SewerObjectsSet { get; set; }
public DbSet<MeasureData> MessungenSet { get; set; }
public DbSet<PressureTest> PruefungSet { get; set; }
public DPContext()
{
//Debugger.Break();
}
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
base.OnConfiguring(optionsBuilder);
optionsBuilder.UseNpgsql("Host = localhost; Database = DP; Username = DP; Password = DP");
}
}
}

View File

@@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="5.0.2" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL.Design" Version="1.1.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DataStoring.Contract\DataStoring.Contract.csproj" />
<ProjectReference Include="..\Models\Models.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,49 @@
// <auto-generated />
using DataStoring.EfCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace DataStoring.EfCore.Migrations
{
[DbContext(typeof(DPContext))]
[Migration("20210226140235_Initialcommit")]
partial class Initialcommit
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 63)
.HasAnnotation("ProductVersion", "5.0.3")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
modelBuilder.Entity("Models.Auftraggeber", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("Name")
.HasColumnType("text");
b.Property<string>("Ort")
.HasColumnType("text");
b.Property<string>("Strasse")
.HasColumnType("text");
b.Property<string>("Tel")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("AuftraggeberSet");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,33 @@
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace DataStoring.EfCore.Migrations
{
public partial class Initialcommit : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AuftraggeberSet",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Name = table.Column<string>(type: "text", nullable: true),
Ort = table.Column<string>(type: "text", nullable: true),
Strasse = table.Column<string>(type: "text", nullable: true),
Tel = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AuftraggeberSet", x => x.Id);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AuftraggeberSet");
}
}
}

View File

@@ -0,0 +1,209 @@
// <auto-generated />
using System;
using DataStoring.EfCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace DataStoring.EfCore.Migrations
{
[DbContext(typeof(DPContext))]
[Migration("20210226145817_TabellenAdded")]
partial class TabellenAdded
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 63)
.HasAnnotation("ProductVersion", "5.0.3")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
modelBuilder.Entity("Models.Auftraggeber", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("Name")
.HasColumnType("text");
b.Property<string>("Ort")
.HasColumnType("text");
b.Property<string>("Strasse")
.HasColumnType("text");
b.Property<string>("Tel")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("AuftraggeberSet");
});
modelBuilder.Entity("Models.Bauvorhaben", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int?>("AuftraggeberId")
.HasColumnType("integer");
b.Property<string>("Ort")
.HasColumnType("text");
b.Property<string>("Standort")
.HasColumnType("text");
b.Property<string>("Strasse")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("AuftraggeberId");
b.ToTable("BaustellenSet");
});
modelBuilder.Entity("Models.Inspektionsobjekt", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int?>("BauvorhabenId")
.HasColumnType("integer");
b.Property<string>("Bemerkung")
.HasColumnType("text");
b.Property<decimal>("Durchmesser")
.HasColumnType("numeric");
b.Property<string>("ObereSchacht")
.HasColumnType("text");
b.Property<decimal>("ObjektLänge")
.HasColumnType("numeric");
b.Property<string>("Objektname")
.HasColumnType("text");
b.Property<string>("UntereSchacht")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("BauvorhabenId");
b.ToTable("SewerObjectsSet");
});
modelBuilder.Entity("Models.MeasureData", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTime>("Datum")
.HasColumnType("timestamp without time zone");
b.Property<int>("EintragID")
.HasColumnType("integer");
b.Property<int>("MeasureType")
.HasColumnType("integer");
b.Property<string>("Pressure")
.HasColumnType("text");
b.Property<int?>("PressureTestId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("PressureTestId");
b.ToTable("MessungenSet");
});
modelBuilder.Entity("Models.PressureTest", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int?>("InspektionsobjektId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("InspektionsobjektId");
b.ToTable("PruefungSet");
});
modelBuilder.Entity("Models.Bauvorhaben", b =>
{
b.HasOne("Models.Auftraggeber", "Auftraggeber")
.WithMany("Baustellen")
.HasForeignKey("AuftraggeberId");
b.Navigation("Auftraggeber");
});
modelBuilder.Entity("Models.Inspektionsobjekt", b =>
{
b.HasOne("Models.Bauvorhaben", "Bauvorhaben")
.WithMany("Prüfobjekte")
.HasForeignKey("BauvorhabenId");
b.Navigation("Bauvorhaben");
});
modelBuilder.Entity("Models.MeasureData", b =>
{
b.HasOne("Models.PressureTest", null)
.WithMany("Measuredatas")
.HasForeignKey("PressureTestId");
});
modelBuilder.Entity("Models.PressureTest", b =>
{
b.HasOne("Models.Inspektionsobjekt", null)
.WithMany("pressureTests")
.HasForeignKey("InspektionsobjektId");
});
modelBuilder.Entity("Models.Auftraggeber", b =>
{
b.Navigation("Baustellen");
});
modelBuilder.Entity("Models.Bauvorhaben", b =>
{
b.Navigation("Prüfobjekte");
});
modelBuilder.Entity("Models.Inspektionsobjekt", b =>
{
b.Navigation("pressureTests");
});
modelBuilder.Entity("Models.PressureTest", b =>
{
b.Navigation("Measuredatas");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,136 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace DataStoring.EfCore.Migrations
{
public partial class TabellenAdded : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "BaustellenSet",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
AuftraggeberId = table.Column<int>(type: "integer", nullable: true),
Standort = table.Column<string>(type: "text", nullable: true),
Strasse = table.Column<string>(type: "text", nullable: true),
Ort = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_BaustellenSet", x => x.Id);
table.ForeignKey(
name: "FK_BaustellenSet_AuftraggeberSet_AuftraggeberId",
column: x => x.AuftraggeberId,
principalTable: "AuftraggeberSet",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "SewerObjectsSet",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
BauvorhabenId = table.Column<int>(type: "integer", nullable: true),
Objektname = table.Column<string>(type: "text", nullable: true),
ObereSchacht = table.Column<string>(type: "text", nullable: true),
UntereSchacht = table.Column<string>(type: "text", nullable: true),
ObjektLänge = table.Column<decimal>(type: "numeric", nullable: false),
Durchmesser = table.Column<decimal>(type: "numeric", nullable: false),
Bemerkung = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_SewerObjectsSet", x => x.Id);
table.ForeignKey(
name: "FK_SewerObjectsSet_BaustellenSet_BauvorhabenId",
column: x => x.BauvorhabenId,
principalTable: "BaustellenSet",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "PruefungSet",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
InspektionsobjektId = table.Column<int>(type: "integer", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_PruefungSet", x => x.Id);
table.ForeignKey(
name: "FK_PruefungSet_SewerObjectsSet_InspektionsobjektId",
column: x => x.InspektionsobjektId,
principalTable: "SewerObjectsSet",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "MessungenSet",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
EintragID = table.Column<int>(type: "integer", nullable: false),
Datum = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
Pressure = table.Column<string>(type: "text", nullable: true),
MeasureType = table.Column<int>(type: "integer", nullable: false),
PressureTestId = table.Column<int>(type: "integer", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_MessungenSet", x => x.Id);
table.ForeignKey(
name: "FK_MessungenSet_PruefungSet_PressureTestId",
column: x => x.PressureTestId,
principalTable: "PruefungSet",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "IX_BaustellenSet_AuftraggeberId",
table: "BaustellenSet",
column: "AuftraggeberId");
migrationBuilder.CreateIndex(
name: "IX_MessungenSet_PressureTestId",
table: "MessungenSet",
column: "PressureTestId");
migrationBuilder.CreateIndex(
name: "IX_PruefungSet_InspektionsobjektId",
table: "PruefungSet",
column: "InspektionsobjektId");
migrationBuilder.CreateIndex(
name: "IX_SewerObjectsSet_BauvorhabenId",
table: "SewerObjectsSet",
column: "BauvorhabenId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "MessungenSet");
migrationBuilder.DropTable(
name: "PruefungSet");
migrationBuilder.DropTable(
name: "SewerObjectsSet");
migrationBuilder.DropTable(
name: "BaustellenSet");
}
}
}

View File

@@ -0,0 +1,207 @@
// <auto-generated />
using System;
using DataStoring.EfCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace DataStoring.EfCore.Migrations
{
[DbContext(typeof(DPContext))]
partial class DPContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 63)
.HasAnnotation("ProductVersion", "5.0.3")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
modelBuilder.Entity("Models.Auftraggeber", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("Name")
.HasColumnType("text");
b.Property<string>("Ort")
.HasColumnType("text");
b.Property<string>("Strasse")
.HasColumnType("text");
b.Property<string>("Tel")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("AuftraggeberSet");
});
modelBuilder.Entity("Models.Bauvorhaben", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int?>("AuftraggeberId")
.HasColumnType("integer");
b.Property<string>("Ort")
.HasColumnType("text");
b.Property<string>("Standort")
.HasColumnType("text");
b.Property<string>("Strasse")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("AuftraggeberId");
b.ToTable("BaustellenSet");
});
modelBuilder.Entity("Models.Inspektionsobjekt", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int?>("BauvorhabenId")
.HasColumnType("integer");
b.Property<string>("Bemerkung")
.HasColumnType("text");
b.Property<decimal>("Durchmesser")
.HasColumnType("numeric");
b.Property<string>("ObereSchacht")
.HasColumnType("text");
b.Property<decimal>("ObjektLänge")
.HasColumnType("numeric");
b.Property<string>("Objektname")
.HasColumnType("text");
b.Property<string>("UntereSchacht")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("BauvorhabenId");
b.ToTable("SewerObjectsSet");
});
modelBuilder.Entity("Models.MeasureData", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTime>("Datum")
.HasColumnType("timestamp without time zone");
b.Property<int>("EintragID")
.HasColumnType("integer");
b.Property<int>("MeasureType")
.HasColumnType("integer");
b.Property<string>("Pressure")
.HasColumnType("text");
b.Property<int?>("PressureTestId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("PressureTestId");
b.ToTable("MessungenSet");
});
modelBuilder.Entity("Models.PressureTest", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int?>("InspektionsobjektId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("InspektionsobjektId");
b.ToTable("PruefungSet");
});
modelBuilder.Entity("Models.Bauvorhaben", b =>
{
b.HasOne("Models.Auftraggeber", "Auftraggeber")
.WithMany("Baustellen")
.HasForeignKey("AuftraggeberId");
b.Navigation("Auftraggeber");
});
modelBuilder.Entity("Models.Inspektionsobjekt", b =>
{
b.HasOne("Models.Bauvorhaben", "Bauvorhaben")
.WithMany("Prüfobjekte")
.HasForeignKey("BauvorhabenId");
b.Navigation("Bauvorhaben");
});
modelBuilder.Entity("Models.MeasureData", b =>
{
b.HasOne("Models.PressureTest", null)
.WithMany("Measuredatas")
.HasForeignKey("PressureTestId");
});
modelBuilder.Entity("Models.PressureTest", b =>
{
b.HasOne("Models.Inspektionsobjekt", null)
.WithMany("pressureTests")
.HasForeignKey("InspektionsobjektId");
});
modelBuilder.Entity("Models.Auftraggeber", b =>
{
b.Navigation("Baustellen");
});
modelBuilder.Entity("Models.Bauvorhaben", b =>
{
b.Navigation("Prüfobjekte");
});
modelBuilder.Entity("Models.Inspektionsobjekt", b =>
{
b.Navigation("pressureTests");
});
modelBuilder.Entity("Models.PressureTest", b =>
{
b.Navigation("Measuredatas");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,55 @@
using DataStoring.Contract;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
namespace DataStoring.EfCore
{
public class Repository<TEntity> : IRepository<TEntity> where TEntity : class
{
private readonly DPContext _db;
public IQueryable<TEntity> Query => _db.Set<TEntity>();
public Repository(DPContext db)
{
_db = db;
}
public void Delete(int id)
{
try
{
var entity = _db.Set<TEntity>().Find(id);
if(entity == null)
{
throw new Exception("Id not found");
}
}
catch(Exception e)
{
throw new Exception("Cant delete entity with id " + id);
}
}
public void Insert(TEntity entity)
{
_db.Set<TEntity>().Add(entity);
_db.SaveChanges();
}
public void Update(TEntity entity)
{
_db.Entry(entity).State = EntityState.Modified;
_db.SaveChanges();
}
public IEnumerable<TEntity> Get(Expression<Func<TEntity, bool>> filter = null, Func<IQueryable<TEntity>, IOrderedQueryable<TEntity>> orderBy = null, string includeProperties = "")
{
IQueryable<TEntity> query = _db.Set<TEntity>();
}
}
}

View File

@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Models\Models.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,12 @@
using Models;
using System;
using System.Linq;
namespace DichtheitManagement.Contract
{
public interface IAuftraggeberManager
{
IQueryable<Auftraggeber> GetAllAuftraggeber();
void Add(Auftraggeber auftraggeber);
}
}

View File

@@ -0,0 +1,14 @@
using Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DichtheitManagement.Contract
{
public interface IBaustelleManager
{
IQueryable<Bauvorhaben> GetAllBauvorhaben();
void Add(Bauvorhaben bauvorhaben);
}
}

View File

@@ -0,0 +1,25 @@
using DataStoring.Contract;
using DichtheitManagement.Contract;
using Models;
using System;
using System.Linq;
namespace DichtheitManagement
{
public class AuftraggeberManager : IAuftraggeberManager
{
private readonly IRepository<Auftraggeber> _repository;
public AuftraggeberManager(IRepository<Auftraggeber> repository)
{
_repository = repository;
}
public void Add(Auftraggeber auftraggeber) => _repository.Insert(auftraggeber);
public IQueryable<Auftraggeber> GetAllAuftraggeber()
{
return _repository.Query.Where(p => p.Id >= 0);
}
}
}

View File

@@ -0,0 +1,27 @@
using DataStoring.Contract;
using DichtheitManagement.Contract;
using Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DichtheitManagement
{
public class BaustelleManager : IBaustelleManager
{
private readonly IRepository<Bauvorhaben> _repository;
public BaustelleManager(IRepository<Bauvorhaben> repository)
{
_repository = repository;
}
public void Add(Bauvorhaben bauvorhaben) => _repository.Insert(bauvorhaben);
public IQueryable<Bauvorhaben> GetAllBauvorhaben()
{
return _repository.Query;
}
}
}

View File

@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\DataStoring.Contract\DataStoring.Contract.csproj" />
<ProjectReference Include="..\DichtheitManagement.Contract\DichtheitManagement.Contract.csproj" />
</ItemGroup>
</Project>

View File

@@ -19,6 +19,16 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataStoring.Contract", "Dat
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataStoring.CSV", "DataStoring.CSV\DataStoring.CSV.csproj", "{18E745A2-2D17-4C21-BD6F-521E681A9834}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataStoring.CSV", "DataStoring.CSV\DataStoring.CSV.csproj", "{18E745A2-2D17-4C21-BD6F-521E681A9834}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GuiWPF", "GuiWPF\GuiWPF.csproj", "{4CEEFEE5-9AD5-48E5-9168-5C56E232EFED}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataStoring.EfCore", "DataStoring.EfCore\DataStoring.EfCore.csproj", "{E660EB07-8284-4047-B534-20FB65D76632}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DichtheitManagement", "DichtheitManagement\DichtheitManagement.csproj", "{2F84635C-4414-4B99-967D-12B8CB8C8B10}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DichtheitManagement.Contract", "DichtheitManagement.Contract\DichtheitManagement.Contract.csproj", "{29298D7D-36C6-4092-8615-1B49E0D7A74C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mappings", "Mappings\Mappings.csproj", "{CB3C8585-E6B2-42AC-BED6-9924E7CDC355}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@@ -140,5 +150,77 @@ Global
{18E745A2-2D17-4C21-BD6F-521E681A9834}.Release|x64.Build.0 = Release|Any CPU {18E745A2-2D17-4C21-BD6F-521E681A9834}.Release|x64.Build.0 = Release|Any CPU
{18E745A2-2D17-4C21-BD6F-521E681A9834}.Release|x86.ActiveCfg = Release|Any CPU {18E745A2-2D17-4C21-BD6F-521E681A9834}.Release|x86.ActiveCfg = Release|Any CPU
{18E745A2-2D17-4C21-BD6F-521E681A9834}.Release|x86.Build.0 = Release|Any CPU {18E745A2-2D17-4C21-BD6F-521E681A9834}.Release|x86.Build.0 = Release|Any CPU
{4CEEFEE5-9AD5-48E5-9168-5C56E232EFED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4CEEFEE5-9AD5-48E5-9168-5C56E232EFED}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4CEEFEE5-9AD5-48E5-9168-5C56E232EFED}.Debug|x64.ActiveCfg = Debug|Any CPU
{4CEEFEE5-9AD5-48E5-9168-5C56E232EFED}.Debug|x64.Build.0 = Debug|Any CPU
{4CEEFEE5-9AD5-48E5-9168-5C56E232EFED}.Debug|x86.ActiveCfg = Debug|Any CPU
{4CEEFEE5-9AD5-48E5-9168-5C56E232EFED}.Debug|x86.Build.0 = Debug|Any CPU
{4CEEFEE5-9AD5-48E5-9168-5C56E232EFED}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4CEEFEE5-9AD5-48E5-9168-5C56E232EFED}.Release|Any CPU.Build.0 = Release|Any CPU
{4CEEFEE5-9AD5-48E5-9168-5C56E232EFED}.Release|x64.ActiveCfg = Release|Any CPU
{4CEEFEE5-9AD5-48E5-9168-5C56E232EFED}.Release|x64.Build.0 = Release|Any CPU
{4CEEFEE5-9AD5-48E5-9168-5C56E232EFED}.Release|x86.ActiveCfg = Release|Any CPU
{4CEEFEE5-9AD5-48E5-9168-5C56E232EFED}.Release|x86.Build.0 = Release|Any CPU
{32F96484-B002-454B-97C9-8976270726C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{32F96484-B002-454B-97C9-8976270726C6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{32F96484-B002-454B-97C9-8976270726C6}.Debug|x64.ActiveCfg = Debug|Any CPU
{32F96484-B002-454B-97C9-8976270726C6}.Debug|x64.Build.0 = Debug|Any CPU
{32F96484-B002-454B-97C9-8976270726C6}.Debug|x86.ActiveCfg = Debug|Any CPU
{32F96484-B002-454B-97C9-8976270726C6}.Debug|x86.Build.0 = Debug|Any CPU
{32F96484-B002-454B-97C9-8976270726C6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{32F96484-B002-454B-97C9-8976270726C6}.Release|Any CPU.Build.0 = Release|Any CPU
{32F96484-B002-454B-97C9-8976270726C6}.Release|x64.ActiveCfg = Release|Any CPU
{32F96484-B002-454B-97C9-8976270726C6}.Release|x64.Build.0 = Release|Any CPU
{32F96484-B002-454B-97C9-8976270726C6}.Release|x86.ActiveCfg = Release|Any CPU
{32F96484-B002-454B-97C9-8976270726C6}.Release|x86.Build.0 = Release|Any CPU
{E660EB07-8284-4047-B534-20FB65D76632}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E660EB07-8284-4047-B534-20FB65D76632}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E660EB07-8284-4047-B534-20FB65D76632}.Debug|x64.ActiveCfg = Debug|Any CPU
{E660EB07-8284-4047-B534-20FB65D76632}.Debug|x64.Build.0 = Debug|Any CPU
{E660EB07-8284-4047-B534-20FB65D76632}.Debug|x86.ActiveCfg = Debug|Any CPU
{E660EB07-8284-4047-B534-20FB65D76632}.Debug|x86.Build.0 = Debug|Any CPU
{E660EB07-8284-4047-B534-20FB65D76632}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E660EB07-8284-4047-B534-20FB65D76632}.Release|Any CPU.Build.0 = Release|Any CPU
{E660EB07-8284-4047-B534-20FB65D76632}.Release|x64.ActiveCfg = Release|Any CPU
{E660EB07-8284-4047-B534-20FB65D76632}.Release|x64.Build.0 = Release|Any CPU
{E660EB07-8284-4047-B534-20FB65D76632}.Release|x86.ActiveCfg = Release|Any CPU
{E660EB07-8284-4047-B534-20FB65D76632}.Release|x86.Build.0 = Release|Any CPU
{2F84635C-4414-4B99-967D-12B8CB8C8B10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2F84635C-4414-4B99-967D-12B8CB8C8B10}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2F84635C-4414-4B99-967D-12B8CB8C8B10}.Debug|x64.ActiveCfg = Debug|Any CPU
{2F84635C-4414-4B99-967D-12B8CB8C8B10}.Debug|x64.Build.0 = Debug|Any CPU
{2F84635C-4414-4B99-967D-12B8CB8C8B10}.Debug|x86.ActiveCfg = Debug|Any CPU
{2F84635C-4414-4B99-967D-12B8CB8C8B10}.Debug|x86.Build.0 = Debug|Any CPU
{2F84635C-4414-4B99-967D-12B8CB8C8B10}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2F84635C-4414-4B99-967D-12B8CB8C8B10}.Release|Any CPU.Build.0 = Release|Any CPU
{2F84635C-4414-4B99-967D-12B8CB8C8B10}.Release|x64.ActiveCfg = Release|Any CPU
{2F84635C-4414-4B99-967D-12B8CB8C8B10}.Release|x64.Build.0 = Release|Any CPU
{2F84635C-4414-4B99-967D-12B8CB8C8B10}.Release|x86.ActiveCfg = Release|Any CPU
{2F84635C-4414-4B99-967D-12B8CB8C8B10}.Release|x86.Build.0 = Release|Any CPU
{29298D7D-36C6-4092-8615-1B49E0D7A74C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{29298D7D-36C6-4092-8615-1B49E0D7A74C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{29298D7D-36C6-4092-8615-1B49E0D7A74C}.Debug|x64.ActiveCfg = Debug|Any CPU
{29298D7D-36C6-4092-8615-1B49E0D7A74C}.Debug|x64.Build.0 = Debug|Any CPU
{29298D7D-36C6-4092-8615-1B49E0D7A74C}.Debug|x86.ActiveCfg = Debug|Any CPU
{29298D7D-36C6-4092-8615-1B49E0D7A74C}.Debug|x86.Build.0 = Debug|Any CPU
{29298D7D-36C6-4092-8615-1B49E0D7A74C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{29298D7D-36C6-4092-8615-1B49E0D7A74C}.Release|Any CPU.Build.0 = Release|Any CPU
{29298D7D-36C6-4092-8615-1B49E0D7A74C}.Release|x64.ActiveCfg = Release|Any CPU
{29298D7D-36C6-4092-8615-1B49E0D7A74C}.Release|x64.Build.0 = Release|Any CPU
{29298D7D-36C6-4092-8615-1B49E0D7A74C}.Release|x86.ActiveCfg = Release|Any CPU
{29298D7D-36C6-4092-8615-1B49E0D7A74C}.Release|x86.Build.0 = Release|Any CPU
{CB3C8585-E6B2-42AC-BED6-9924E7CDC355}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CB3C8585-E6B2-42AC-BED6-9924E7CDC355}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CB3C8585-E6B2-42AC-BED6-9924E7CDC355}.Debug|x64.ActiveCfg = Debug|Any CPU
{CB3C8585-E6B2-42AC-BED6-9924E7CDC355}.Debug|x64.Build.0 = Debug|Any CPU
{CB3C8585-E6B2-42AC-BED6-9924E7CDC355}.Debug|x86.ActiveCfg = Debug|Any CPU
{CB3C8585-E6B2-42AC-BED6-9924E7CDC355}.Debug|x86.Build.0 = Debug|Any CPU
{CB3C8585-E6B2-42AC-BED6-9924E7CDC355}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CB3C8585-E6B2-42AC-BED6-9924E7CDC355}.Release|Any CPU.Build.0 = Release|Any CPU
{CB3C8585-E6B2-42AC-BED6-9924E7CDC355}.Release|x64.ActiveCfg = Release|Any CPU
{CB3C8585-E6B2-42AC-BED6-9924E7CDC355}.Release|x64.Build.0 = Release|Any CPU
{CB3C8585-E6B2-42AC-BED6-9924E7CDC355}.Release|x86.ActiveCfg = Release|Any CPU
{CB3C8585-E6B2-42AC-BED6-9924E7CDC355}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

9
GuiWPF/App.xaml Normal file
View File

@@ -0,0 +1,9 @@
<Application x:Class="GuiWPF.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:GuiWPF"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>

17
GuiWPF/App.xaml.cs Normal file
View File

@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
namespace GuiWPF
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}

10
GuiWPF/AssemblyInfo.cs Normal file
View File

@@ -0,0 +1,10 @@
using System.Windows;
[assembly:ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]

9
GuiWPF/GuiWPF.csproj Normal file
View File

@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net5.0-windows</TargetFramework>
<UseWPF>true</UseWPF>
</PropertyGroup>
</Project>

12
GuiWPF/MainWindow.xaml Normal file
View File

@@ -0,0 +1,12 @@
<Window x:Class="GuiWPF.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:GuiWPF"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>
</Grid>
</Window>

28
GuiWPF/MainWindow.xaml.cs Normal file
View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
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;
namespace GuiWPF
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}
}

View File

@@ -0,0 +1,20 @@
using DataStoring.Contract;
using DataStoring.EfCore;
using DichtheitManagement;
using DichtheitManagement.Contract;
using Ninject;
using System;
namespace Mappings
{
public class KernelInitializer
{
public void Initialize(IKernel kernel)
{
kernel.Bind<DPContext>().ToSelf();
kernel.Bind(typeof(IRepository<>)).To(typeof(Repository<>));
kernel.Bind<IAuftraggeberManager>().To<AuftraggeberManager>();
kernel.Bind<IBaustelleManager>().To<BaustelleManager>();
}
}
}

19
Mappings/Mappings.csproj Normal file
View File

@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Ninject" Version="3.3.4" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DataStoring.Contract\DataStoring.Contract.csproj" />
<ProjectReference Include="..\DataStoring.CSV\DataStoring.CSV.csproj" />
<ProjectReference Include="..\DataStoring.EfCore\DataStoring.EfCore.csproj" />
<ProjectReference Include="..\DichtheitManagement.Contract\DichtheitManagement.Contract.csproj" />
<ProjectReference Include="..\DichtheitManagement\DichtheitManagement.csproj" />
</ItemGroup>
</Project>

View File

@@ -9,6 +9,6 @@ namespace Models {
public string Ort {get;set;} public string Ort {get;set;}
public string Strasse {get;set;} public string Strasse {get;set;}
public string Tel {get;set;} public string Tel {get;set;}
public IEnumerable<Bauvorhaben> Baustellen = new List<Bauvorhaben>(); public List<Bauvorhaben> Baustellen { get; set; }
} }
} }

View File

@@ -4,11 +4,11 @@ using System.Linq;
namespace Models { namespace Models {
public class Bauvorhaben { public class Bauvorhaben {
Auftraggeber auftraggeber; public Auftraggeber Auftraggeber { get; set; }
public Auftraggeber Auftraggeber {get => auftraggeber; set => auftraggeber = value;} public int Id { get; set; }
public string Standort = string.Empty; public string Standort { get; set; }
public string Strasse = string.Empty; public string Strasse { get; set; }
public string Ort = string.Empty; public string Ort { get; set; }
public IEnumerable<Inspektionsobjekt> Prüfobjekte = new List<Inspektionsobjekt>(); public IEnumerable<Inspektionsobjekt> Prüfobjekte { get; set; }
} }
} }

View File

@@ -5,21 +5,16 @@ namespace Models
{ {
public class Inspektionsobjekt public class Inspektionsobjekt
{ {
string objektname; public int Id { get; set; }
string obereSchacht; public Bauvorhaben Bauvorhaben { get; set; }
string untereSchacht; public string Objektname { get; set; }
decimal objektLänge; public string ObereSchacht { get; set; }
decimal durchmesser; public string UntereSchacht { get; set; }
string bemerkung; public decimal ObjektLänge { get; set; }
Bauvorhaben bauvorhaben; public decimal Durchmesser { get; set; }
List<PressureTest> pressureTests = new List<PressureTest>(); public string Bemerkung { get; set; }
public Bauvorhaben Bauvorhaben { get => bauvorhaben; set => bauvorhaben = value;}
public List<PressureTest> PressureTests { get => pressureTests; set => pressureTests = value; } public List<PressureTest> pressureTests { get; set; }
public string Objektname { get => objektname; set => objektname = value; }
public string ObereSchacht { get => obereSchacht; set => obereSchacht = value; }
public string UntereSchacht { get => untereSchacht; set => untereSchacht = value; }
public decimal ObjektLänge { get => objektLänge; set => objektLänge = value; }
public decimal Durchmesser { get => durchmesser; set => durchmesser = value; }
public string Bemerkung { get => bemerkung; set => bemerkung = value; }
} }
} }

View File

@@ -3,6 +3,7 @@ using System;
namespace Models namespace Models
{ {
public class MeasureData { public class MeasureData {
public int Id { get; set; }
public int EintragID {get;set;} public int EintragID {get;set;}
public DateTime Datum {get;set;} public DateTime Datum {get;set;}
public string Pressure {get;set;} public string Pressure {get;set;}

View File

@@ -4,11 +4,11 @@ using System.Linq;
namespace Models { namespace Models {
public class PressureTest { public class PressureTest {
List<MeasureData> measuredatas = new List<MeasureData>();
bool bestanden; bool bestanden;
public string prüfdatum {get => measuredatas.Last().Datum.ToShortDateString();} public int Id { get; set; }
public bool Bestanden {get => bestanden; set => bestanden = value;}
public List<MeasureData> Measuredatas { get => measuredatas; set => measuredatas = value; } public List<MeasureData> Measuredatas { get; set; }
} }
} }

View File

@@ -56,8 +56,9 @@ namespace ProtokollWriter {
} }
string getPrüfnummer() { string getPrüfnummer() {
string[] pruefung = inspObjekt.PressureTests[prüfungsnummer].prüfdatum.Split('.'); return "";
return string.Format("{0}{1}{2}-{3}", pruefung[2], pruefung[1], pruefung[0],prüfungsnummer); //string[] pruefung = inspObjekt.PressureTests[prüfungsnummer].prüfdatum.Split('.');
//return string.Format("{0}{1}{2}-{3}", pruefung[2], pruefung[1], pruefung[0],prüfungsnummer);
} }
double getPruefVolumen() { double getPruefVolumen() {
@@ -69,7 +70,7 @@ namespace ProtokollWriter {
} }
void Ersetzen() { void Ersetzen() {
hashtable["DATUM"] = inspObjekt.PressureTests[prüfungsnummer].prüfdatum; hashtable["DATUM"] = "heute";//inspObjekt.PressureTests[prüfungsnummer].prüfdatum;
hashtable["PRUEFNR"] = getPrüfnummer(); hashtable["PRUEFNR"] = getPrüfnummer();
hashtable["DN"] = inspObjekt.Durchmesser; hashtable["DN"] = inspObjekt.Durchmesser;
hashtable["LAENGE"] = inspObjekt.ObjektLänge; hashtable["LAENGE"] = inspObjekt.ObjektLänge;
@@ -87,7 +88,7 @@ namespace ProtokollWriter {
hashtable["BAUVORHABEN_ORT"] = inspObjekt.Bauvorhaben.Ort; hashtable["BAUVORHABEN_ORT"] = inspObjekt.Bauvorhaben.Ort;
hashtable["BAUVORHABEN_STANDORT"] = inspObjekt.Bauvorhaben.Strasse; hashtable["BAUVORHABEN_STANDORT"] = inspObjekt.Bauvorhaben.Strasse;
hashtable["BEMERKUNG"] = inspObjekt.Bemerkung; hashtable["BEMERKUNG"] = inspObjekt.Bemerkung;
hashtable["PRUEFRESULTAT"] = inspObjekt.PressureTests[prüfungsnummer].Bestanden ? "Prüfung Bestanden" : "Prüfung N I C H T Bestanden"; hashtable["PRUEFRESULTAT"] = "Cool";//inspObjekt.PressureTests[prüfungsnummer].Bestanden ? "Prüfung Bestanden" : "Prüfung N I C H T Bestanden";
} }
void WriteFile() { void WriteFile() {
string zeile; string zeile;
@@ -106,9 +107,9 @@ namespace ProtokollWriter {
if(cmd.StartsWith("@")) { if(cmd.StartsWith("@")) {
string n = ""; string n = "";
foreach(MeasureData data in inspObjekt.PressureTests[prüfungsnummer].Measuredatas) { //foreach(MeasureData data in inspObjekt.PressureTests[prüfungsnummer].Measuredatas) {
n = string.Format("{0}{1} = {2};{3};{4};{5}\r\n",n,data.EintragID,data.EintragID+2,data.Datum,data.Pressure,data.MeasureType); // n = string.Format("{0}{1} = {2};{3};{4};{5}\r\n",n,data.EintragID,data.EintragID+2,data.Datum,data.Pressure,data.MeasureType);
} //}
zeile = n; zeile = n;
} }
} }

128
SW01_SW02.txt Normal file
View File

@@ -0,0 +1,128 @@
[Allgemeines]
Datum = "25.02.2021"
Pruefnr = "20210225-0"
[Auftraggeber]
Name = "OOWV"
Strasse = "Donnerschweer"
Ort = "Oldenburg"
Tel = "029293"
[Bauvorhaben]
Bauvorhaben = "Am Schlachthof"
Pruefabschnitt = ""
Strasse = "Am Schlachthof"
Ort = "Oldenburg"
Pruefobjekt = ""
Pruefzeichen = ""
Einbaustelle = ""
Hersteller = ""
Anlagentyp = ""
Werkstoff = ""
[Messdatei]
Datei1 = "SW01.txt"
Datei2 = ""
Datei3 = ""
[Pruefung1999]
Pruefart = ""
Pegeloberflaeche = ""
Hoehewasserpegel = ""
Fuellvolumen = ""
Benetzteflaeche = ""
Zulwasserverlust = ""
Pruefzeit = ""
Zulpegelabfall = ""
Beginnsaettigung = ""
Gewaehltepruefzeit = ""
Beginnpruefung = ""
Beginnpruefungbeipegelwert = ""
Endepruefung = ""
Endepruefungbeipegelwert = ""
Messzeit = ""
Tatwasserverlust = ""
Tatpegelabfall = ""
Pruefresultat = ""
Bemerkungen = ""
Pruefdruck = ""
Gewaehltepruefdauer = ""
Zulwasserzugabe = ""
Pruefdauerbehaelter = ""
Wasserverlustbehaelter = ""
[Schachtbauwerk1999]
0 = ""
1 = ""
2 = ""
3 = ""
4 = ""
[Rohrleitungen1999]
0 = ""
1 = ""
2 = ""
3 = ""
4 = ""
[Luftprüfung]
Werkstoff = "2"
Pruefverfahren = "2"
Rohrquerschnitt = "0"
Rohrdurchmesser = "200"
Rohrlaenge = "20"
Pruefvolumen = "0,628"
Pruefdruckp0 = "100,0"
Toleranzdeltap = "15,0"
SollBeruhigungszeit = "5"
SollPruefzeit = "3,0"
BeginnBeruhigungszeit = "22.08.2018 12:13:18"
PruefdruckBeginnBeruhigungszeit = "115,951"
BeginnPruefung = "22.08.2018 12:18:19"
PruefdruckBeginnPruefung = "117,049"
EndePruefung = "22.08.2018 12:21:20"
PruefdruckEndePruefung = "117,769"
IstPruefzeit = "03:01"
Druckabfall = "0,72"
Pruefresultat = "Prüfung Bestanden"
Haltungsnummer = "SW01"
AnzahlMuffen = ""
vonSchacht = "SW01"
bisSchacht = "SW02"
[Messdaten]
0 = 2;25.02.2021 12:26:01;-3,806;LEERPHASE
1 = 3;25.02.2021 12:26:03;-11,812999999999999;LEERPHASE
2 = 4;25.02.2021 12:26:05;-19,723;LEERPHASE
3 = 5;25.02.2021 12:26:07;-27,535999999999998;LEERPHASE
4 = 6;25.02.2021 12:26:09;-30,549999999999997;LEERPHASE
5 = 7;25.02.2021 12:26:11;-37,765;LEERPHASE
6 = 8;25.02.2021 12:26:13;-44,479;LEERPHASE
7 = 9;25.02.2021 12:26:15;-45,99;LEERPHASE
8 = 10;25.02.2021 12:26:17;-51,299;LEERPHASE
9 = 11;25.02.2021 12:26:19;-56,577;LEERPHASE
10 = 12;25.02.2021 12:26:21;-61,354;LEERPHASE
11 = 13;25.02.2021 12:26:23;-65,631;LEERPHASE
12 = 14;25.02.2021 12:26:25;-74,109;LEERPHASE
13 = 15;25.02.2021 12:26:27;-82,086;LEERPHASE
14 = 16;25.02.2021 12:26:29;-89,562;LEERPHASE
15 = 17;25.02.2021 12:26:31;-92,239;LEERPHASE
16 = 18;25.02.2021 12:26:33;-98,714;LEERPHASE
17 = 19;25.02.2021 12:26:35;-100,39;LEERPHASE
18 = 20;25.02.2021 12:26:37;-102,035;LEERPHASE
19 = 21;25.02.2021 12:26:39;-107,478;LEERPHASE
20 = 22;25.02.2021 12:26:41;-112,41999999999999;LEERPHASE
21 = 23;25.02.2021 12:26:43;-121,56299999999999;LEERPHASE
22 = 24;25.02.2021 12:26:45;-129,802;LEERPHASE
23 = 25;25.02.2021 12:26:47;-137,54;LEERPHASE
24 = 26;25.02.2021 12:26:49;-137,54;BEFÜLLPHASE
25 = 27;25.02.2021 12:28:49;-137,54;PRÜFUNGSPHASE
26 = 28;25.02.2021 12:43:52;-137,54;PRÜFUNGSPHASE
27 = 29;25.02.2021 12:43:54;-137,54;BEFÜLLPHASE
28 = 30;25.02.2021 12:43:56;-137,54;LEERPHASE
29 = 31;25.02.2021 12:43:58;0,000;LEERPHASE
30 = 32;25.02.2021 12:43:59;0,000;LEERPHASE
[Protokolldatei]
Datei = "/C/Dichtheitspr<70>fger<65>t/Protokolle/000/SW01.txt"

View File

@@ -4,6 +4,5 @@
<!--To inherit the global NuGet package sources remove the <clear/> line below --> <!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear /> <clear />
<add key="nuget" value="https://api.nuget.org/v3/index.json" /> <add key="nuget" value="https://api.nuget.org/v3/index.json" />
<add key="signatureValidationMode" value="accept" />
</packageSources> </packageSources>
</configuration> </configuration>