ObjekteListe angefangen

This commit is contained in:
Husky
2020-03-17 14:26:11 +01:00
parent 009c54cc84
commit 8b1336a014
15 changed files with 1422 additions and 167 deletions

View File

@@ -0,0 +1,12 @@
using KanSan.Base.Models;
using System;
using System.Collections.Generic;
using System.Text;
namespace KanSan.Base.Interfaces.UI
{
public interface IObjekteListViewModel
{
List<object> KanalObjekte { get; }
}
}

View File

@@ -0,0 +1,592 @@
// <auto-generated />
using System;
using KanSan.Base;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace KanSan.Base.Migrations
{
[DbContext(typeof(KanSanContext))]
[Migration("20200317101951_Güteschutzverlinkungen")]
partial class Güteschutzverlinkungen
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn)
.HasAnnotation("ProductVersion", "3.1.2")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
modelBuilder.Entity("KanSan.Base.Models.Baustelle", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("BaustelleNummer")
.HasColumnType("text");
b.Property<Guid>("GuidNr")
.HasColumnType("uuid");
b.Property<string>("OrtTeil")
.HasColumnType("text");
b.Property<int?>("ProjektID")
.HasColumnType("integer");
b.HasKey("ID");
b.HasIndex("ProjektID");
b.ToTable("Baustelle");
});
modelBuilder.Entity("KanSan.Base.Models.Fahrzeug", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<Guid>("GuidNr")
.HasColumnType("uuid");
b.Property<string>("Kennzeichen")
.HasColumnType("text");
b.HasKey("ID");
b.ToTable("Fahrzeuge");
});
modelBuilder.Entity("KanSan.Base.Models.GueteschutzProtokoll", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int>("AussenTemp")
.HasColumnType("integer");
b.Property<bool>("Bericht")
.HasColumnType("boolean");
b.Property<bool>("Dichtheit")
.HasColumnType("boolean");
b.Property<string>("Discriminator")
.IsRequired()
.HasColumnType("text");
b.Property<bool>("Film")
.HasColumnType("boolean");
b.Property<Guid>("GuidNr")
.HasColumnType("uuid");
b.Property<int>("KanalTemp")
.HasColumnType("integer");
b.Property<int?>("SchadPositionID")
.HasColumnType("integer");
b.Property<bool>("Sichtkontrolle")
.HasColumnType("boolean");
b.Property<bool>("Video")
.HasColumnType("boolean");
b.Property<int>("Wetter")
.HasColumnType("integer");
b.HasKey("ID");
b.HasIndex("SchadPositionID");
b.ToTable("GueteschutzProtokoll");
b.HasDiscriminator<string>("Discriminator").HasValue("GueteschutzProtokoll");
});
modelBuilder.Entity("KanSan.Base.Models.Kunde", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<Guid>("GuidNr")
.HasColumnType("uuid");
b.Property<string>("Nachname")
.HasColumnType("text");
b.Property<string>("Ort")
.HasColumnType("text");
b.Property<string>("PLZ")
.HasColumnType("text");
b.Property<string>("Strasse")
.HasColumnType("text");
b.Property<string>("Vorname")
.HasColumnType("text");
b.HasKey("ID");
b.ToTable("Kunden");
});
modelBuilder.Entity("KanSan.Base.Models.LeitungsverzeichnisPosition", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("Beschreibung")
.HasColumnType("text");
b.Property<string>("Einheit")
.HasColumnType("text");
b.Property<Guid>("GuidNr")
.HasColumnType("uuid");
b.Property<string>("Positionsnummer")
.HasColumnType("text");
b.HasKey("ID");
b.ToTable("LeitungsverzeichnisPositionen");
});
modelBuilder.Entity("KanSan.Base.Models.Projekt", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<Guid>("GuidNr")
.HasColumnType("uuid");
b.Property<int?>("KundeID")
.HasColumnType("integer");
b.Property<string>("Ort")
.HasColumnType("text");
b.Property<string>("Projektnummer")
.HasColumnType("text");
b.HasKey("ID");
b.HasIndex("KundeID");
b.ToTable("Projekte");
});
modelBuilder.Entity("KanSan.Base.Models.Sanierungskonzept", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<Guid>("GuidNr")
.HasColumnType("uuid");
b.Property<int>("SanierungsTyp")
.HasColumnType("integer");
b.HasKey("ID");
b.ToTable("Sanierungskonzept");
});
modelBuilder.Entity("KanSan.Base.Models.Schaeden", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<Guid>("GuidNr")
.HasColumnType("uuid");
b.Property<bool>("Infiltation")
.HasColumnType("boolean");
b.Property<bool>("RissBruchScherbe")
.HasColumnType("boolean");
b.Property<int>("SanierungsTyp")
.HasColumnType("integer");
b.Property<int?>("SanierungskonzeptID")
.HasColumnType("integer");
b.Property<bool>("SchadstelleFaekalienFrei")
.HasColumnType("boolean");
b.Property<int?>("SewerID")
.HasColumnType("integer");
b.Property<bool>("StutzenEinragend")
.HasColumnType("boolean");
b.Property<bool>("VorbehandeltFraeser")
.HasColumnType("boolean");
b.Property<bool>("VorbehandeltHD")
.HasColumnType("boolean");
b.Property<bool>("VorbehandeltMech")
.HasColumnType("boolean");
b.Property<bool>("WurzelInkrustationAblagerungen")
.HasColumnType("boolean");
b.HasKey("ID");
b.HasIndex("SanierungskonzeptID");
b.HasIndex("SewerID");
b.ToTable("Schaeden");
});
modelBuilder.Entity("KanSan.Base.Models.Sewer", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int?>("BaustelleID")
.HasColumnType("integer");
b.Property<bool>("BaustellensicherungErforderlich")
.HasColumnType("boolean");
b.Property<int>("DN")
.HasColumnType("integer");
b.Property<bool>("GenehmigungErforderlich")
.HasColumnType("boolean");
b.Property<Guid>("GuidNr")
.HasColumnType("uuid");
b.Property<bool>("HaltungGespuelt")
.HasColumnType("boolean");
b.Property<int>("Material")
.HasColumnType("integer");
b.Property<string>("ObjektNummer")
.HasColumnType("text");
b.Property<int?>("PunktObenID")
.HasColumnType("integer");
b.Property<int>("PunktTypeOben")
.HasColumnType("integer");
b.Property<int>("PunktTypeUnten")
.HasColumnType("integer");
b.Property<int?>("PunktUntenID")
.HasColumnType("integer");
b.Property<bool>("RohrleitungInBetrieb")
.HasColumnType("boolean");
b.Property<int>("SewerType")
.HasColumnType("integer");
b.Property<string>("StrasseName")
.HasColumnType("text");
b.Property<bool>("WasserHaltungDurchgefuehrt")
.HasColumnType("boolean");
b.HasKey("ID");
b.HasIndex("BaustelleID");
b.HasIndex("PunktObenID");
b.HasIndex("PunktUntenID");
b.ToTable("Kanaele");
});
modelBuilder.Entity("KanSan.Base.Models.SewerPoint", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<Guid>("GuidNr")
.HasColumnType("uuid");
b.Property<string>("Objektnummer")
.HasColumnType("text");
b.HasKey("ID");
b.ToTable("SewerPoints");
});
modelBuilder.Entity("KanSan.Base.Models.Taetigkeiten", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<decimal>("Anzahl")
.HasColumnType("numeric");
b.Property<int?>("FahrzeugID")
.HasColumnType("integer");
b.Property<int?>("GueteschutzProtokolID")
.HasColumnType("integer");
b.Property<Guid>("GuidNr")
.HasColumnType("uuid");
b.Property<int?>("LeitungsverzeichnisPositionID")
.HasColumnType("integer");
b.Property<string>("Mitarbeiter")
.HasColumnType("text");
b.Property<decimal>("Position")
.HasColumnType("numeric");
b.Property<int?>("SanierungskonzeptID")
.HasColumnType("integer");
b.Property<DateTime>("ZeitStempel")
.HasColumnType("timestamp without time zone");
b.HasKey("ID");
b.HasIndex("FahrzeugID");
b.HasIndex("GueteschutzProtokolID");
b.HasIndex("LeitungsverzeichnisPositionID");
b.HasIndex("SanierungskonzeptID");
b.ToTable("Taetigkeiten");
});
modelBuilder.Entity("KanSan.Base.Models.HutprofilSan", b =>
{
b.HasBaseType("KanSan.Base.Models.GueteschutzProtokoll");
b.Property<DateTime>("AnpressenPacker")
.HasColumnType("timestamp without time zone");
b.Property<bool>("Auffaelligkeit")
.HasColumnType("boolean");
b.Property<DateTime>("EntlueftenPacker")
.HasColumnType("timestamp without time zone");
b.Property<bool>("FixierungAufPacker")
.HasColumnType("boolean");
b.Property<int>("Flaechengewicht")
.HasColumnType("integer");
b.Property<string>("HarzMaterialArt")
.HasColumnType("text");
b.Property<string>("HarzmaterialHersteller")
.HasColumnType("text");
b.Property<bool>("InnenBeschichtung")
.HasColumnType("boolean");
b.Property<string>("KompACharge")
.HasColumnType("text");
b.Property<string>("KompBCharge")
.HasColumnType("text");
b.Property<DateTime>("MischZeit")
.HasColumnType("timestamp without time zone");
b.Property<double>("PackerDruckAnfang")
.HasColumnType("double precision");
b.Property<double>("PackerDruckEnde")
.HasColumnType("double precision");
b.Property<string>("RohrDN")
.HasColumnType("text");
b.Property<double>("SeitenKanalDruckAnfang")
.HasColumnType("double precision");
b.Property<double>("SeitenKanalDruckEnde")
.HasColumnType("double precision");
b.Property<string>("TraegerCharge")
.HasColumnType("text");
b.Property<string>("TraegerHersteller")
.HasColumnType("text");
b.Property<string>("TraegerKurzliner")
.HasColumnType("text");
b.Property<string>("Winkel")
.HasColumnType("text");
b.HasDiscriminator().HasValue("HutprofilSan");
});
modelBuilder.Entity("KanSan.Base.Models.KurzlinerSan", b =>
{
b.HasBaseType("KanSan.Base.Models.GueteschutzProtokoll");
b.Property<DateTime>("AnpressenPacker")
.HasColumnType("timestamp without time zone");
b.Property<bool>("Auffaelligkeit")
.HasColumnType("boolean");
b.Property<double>("Breit")
.HasColumnType("double precision");
b.Property<DateTime>("EntlueftenPacker")
.HasColumnType("timestamp without time zone");
b.Property<bool>("FixierungAufPacker")
.HasColumnType("boolean");
b.Property<int>("Flaechengewicht")
.HasColumnType("integer");
b.Property<string>("HarzMaterialArt")
.HasColumnType("text");
b.Property<string>("HarzmaterialHersteller")
.HasColumnType("text");
b.Property<string>("KompACharge")
.HasColumnType("text");
b.Property<string>("KompBCharge")
.HasColumnType("text");
b.Property<double>("Lang")
.HasColumnType("double precision");
b.Property<DateTime>("MischZeit")
.HasColumnType("timestamp without time zone");
b.Property<double>("PackerDruckAnfang")
.HasColumnType("double precision");
b.Property<double>("PackerDruckEnde")
.HasColumnType("double precision");
b.Property<string>("TraegerCharge")
.HasColumnType("text");
b.Property<string>("TraegerHersteller")
.HasColumnType("text");
b.Property<string>("TraegerKurzliner")
.HasColumnType("text");
b.HasDiscriminator().HasValue("KurzlinerSan");
});
modelBuilder.Entity("KanSan.Base.Models.Baustelle", b =>
{
b.HasOne("KanSan.Base.Models.Projekt", "Projekt")
.WithMany()
.HasForeignKey("ProjektID");
});
modelBuilder.Entity("KanSan.Base.Models.GueteschutzProtokoll", b =>
{
b.HasOne("KanSan.Base.Models.Schaeden", "SchadPosition")
.WithMany()
.HasForeignKey("SchadPositionID");
});
modelBuilder.Entity("KanSan.Base.Models.Projekt", b =>
{
b.HasOne("KanSan.Base.Models.Kunde", "Kunde")
.WithMany("Baustellen")
.HasForeignKey("KundeID");
});
modelBuilder.Entity("KanSan.Base.Models.Schaeden", b =>
{
b.HasOne("KanSan.Base.Models.Sanierungskonzept", "Sanierungskonzept")
.WithMany()
.HasForeignKey("SanierungskonzeptID");
b.HasOne("KanSan.Base.Models.Sewer", "Sewer")
.WithMany("Schaeden")
.HasForeignKey("SewerID");
});
modelBuilder.Entity("KanSan.Base.Models.Sewer", b =>
{
b.HasOne("KanSan.Base.Models.Baustelle", "Baustelle")
.WithMany("Kanaele")
.HasForeignKey("BaustelleID");
b.HasOne("KanSan.Base.Models.SewerPoint", "PunktOben")
.WithMany()
.HasForeignKey("PunktObenID");
b.HasOne("KanSan.Base.Models.SewerPoint", "PunktUnten")
.WithMany()
.HasForeignKey("PunktUntenID");
});
modelBuilder.Entity("KanSan.Base.Models.Taetigkeiten", b =>
{
b.HasOne("KanSan.Base.Models.Fahrzeug", "Fahrzeug")
.WithMany()
.HasForeignKey("FahrzeugID");
b.HasOne("KanSan.Base.Models.GueteschutzProtokoll", "GueteschutzProtokol")
.WithMany()
.HasForeignKey("GueteschutzProtokolID");
b.HasOne("KanSan.Base.Models.LeitungsverzeichnisPosition", "LeitungsverzeichnisPosition")
.WithMany()
.HasForeignKey("LeitungsverzeichnisPositionID");
b.HasOne("KanSan.Base.Models.Sanierungskonzept", "Sanierungskonzept")
.WithMany("Taetigkeiten")
.HasForeignKey("SanierungskonzeptID");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,366 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace KanSan.Base.Migrations
{
public partial class Güteschutzverlinkungen : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_KurzlinerSanierung_Schaeden_SchadPositionID",
table: "KurzlinerSanierung");
migrationBuilder.DropTable(
name: "HutprofilSanierung");
migrationBuilder.DropPrimaryKey(
name: "PK_KurzlinerSanierung",
table: "KurzlinerSanierung");
migrationBuilder.RenameTable(
name: "KurzlinerSanierung",
newName: "GueteschutzProtokoll");
migrationBuilder.RenameIndex(
name: "IX_KurzlinerSanierung_SchadPositionID",
table: "GueteschutzProtokoll",
newName: "IX_GueteschutzProtokoll_SchadPositionID");
migrationBuilder.AddColumn<int>(
name: "GueteschutzProtokolID",
table: "Taetigkeiten",
nullable: true);
migrationBuilder.AlterColumn<double>(
name: "PackerDruckEnde",
table: "GueteschutzProtokoll",
nullable: true,
oldClrType: typeof(double),
oldType: "double precision");
migrationBuilder.AlterColumn<double>(
name: "PackerDruckAnfang",
table: "GueteschutzProtokoll",
nullable: true,
oldClrType: typeof(double),
oldType: "double precision");
migrationBuilder.AlterColumn<DateTime>(
name: "MischZeit",
table: "GueteschutzProtokoll",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<double>(
name: "Lang",
table: "GueteschutzProtokoll",
nullable: true,
oldClrType: typeof(double),
oldType: "double precision");
migrationBuilder.AlterColumn<int>(
name: "Flaechengewicht",
table: "GueteschutzProtokoll",
nullable: true,
oldClrType: typeof(int),
oldType: "integer");
migrationBuilder.AlterColumn<bool>(
name: "FixierungAufPacker",
table: "GueteschutzProtokoll",
nullable: true,
oldClrType: typeof(bool),
oldType: "boolean");
migrationBuilder.AlterColumn<DateTime>(
name: "EntlueftenPacker",
table: "GueteschutzProtokoll",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<double>(
name: "Breit",
table: "GueteschutzProtokoll",
nullable: true,
oldClrType: typeof(double),
oldType: "double precision");
migrationBuilder.AlterColumn<bool>(
name: "Auffaelligkeit",
table: "GueteschutzProtokoll",
nullable: true,
oldClrType: typeof(bool),
oldType: "boolean");
migrationBuilder.AlterColumn<DateTime>(
name: "AnpressenPacker",
table: "GueteschutzProtokoll",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AddColumn<string>(
name: "Discriminator",
table: "GueteschutzProtokoll",
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<bool>(
name: "InnenBeschichtung",
table: "GueteschutzProtokoll",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "RohrDN",
table: "GueteschutzProtokoll",
nullable: true);
migrationBuilder.AddColumn<double>(
name: "SeitenKanalDruckAnfang",
table: "GueteschutzProtokoll",
nullable: true);
migrationBuilder.AddColumn<double>(
name: "SeitenKanalDruckEnde",
table: "GueteschutzProtokoll",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Winkel",
table: "GueteschutzProtokoll",
nullable: true);
migrationBuilder.AddPrimaryKey(
name: "PK_GueteschutzProtokoll",
table: "GueteschutzProtokoll",
column: "ID");
migrationBuilder.CreateIndex(
name: "IX_Taetigkeiten_GueteschutzProtokolID",
table: "Taetigkeiten",
column: "GueteschutzProtokolID");
migrationBuilder.AddForeignKey(
name: "FK_GueteschutzProtokoll_Schaeden_SchadPositionID",
table: "GueteschutzProtokoll",
column: "SchadPositionID",
principalTable: "Schaeden",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_Taetigkeiten_GueteschutzProtokoll_GueteschutzProtokolID",
table: "Taetigkeiten",
column: "GueteschutzProtokolID",
principalTable: "GueteschutzProtokoll",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_GueteschutzProtokoll_Schaeden_SchadPositionID",
table: "GueteschutzProtokoll");
migrationBuilder.DropForeignKey(
name: "FK_Taetigkeiten_GueteschutzProtokoll_GueteschutzProtokolID",
table: "Taetigkeiten");
migrationBuilder.DropIndex(
name: "IX_Taetigkeiten_GueteschutzProtokolID",
table: "Taetigkeiten");
migrationBuilder.DropPrimaryKey(
name: "PK_GueteschutzProtokoll",
table: "GueteschutzProtokoll");
migrationBuilder.DropColumn(
name: "GueteschutzProtokolID",
table: "Taetigkeiten");
migrationBuilder.DropColumn(
name: "Discriminator",
table: "GueteschutzProtokoll");
migrationBuilder.DropColumn(
name: "InnenBeschichtung",
table: "GueteschutzProtokoll");
migrationBuilder.DropColumn(
name: "RohrDN",
table: "GueteschutzProtokoll");
migrationBuilder.DropColumn(
name: "SeitenKanalDruckAnfang",
table: "GueteschutzProtokoll");
migrationBuilder.DropColumn(
name: "SeitenKanalDruckEnde",
table: "GueteschutzProtokoll");
migrationBuilder.DropColumn(
name: "Winkel",
table: "GueteschutzProtokoll");
migrationBuilder.RenameTable(
name: "GueteschutzProtokoll",
newName: "KurzlinerSanierung");
migrationBuilder.RenameIndex(
name: "IX_GueteschutzProtokoll_SchadPositionID",
table: "KurzlinerSanierung",
newName: "IX_KurzlinerSanierung_SchadPositionID");
migrationBuilder.AlterColumn<double>(
name: "Lang",
table: "KurzlinerSanierung",
type: "double precision",
nullable: false,
oldClrType: typeof(double),
oldNullable: true);
migrationBuilder.AlterColumn<double>(
name: "Breit",
table: "KurzlinerSanierung",
type: "double precision",
nullable: false,
oldClrType: typeof(double),
oldNullable: true);
migrationBuilder.AlterColumn<double>(
name: "PackerDruckEnde",
table: "KurzlinerSanierung",
type: "double precision",
nullable: false,
oldClrType: typeof(double),
oldNullable: true);
migrationBuilder.AlterColumn<double>(
name: "PackerDruckAnfang",
table: "KurzlinerSanierung",
type: "double precision",
nullable: false,
oldClrType: typeof(double),
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "MischZeit",
table: "KurzlinerSanierung",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldNullable: true);
migrationBuilder.AlterColumn<int>(
name: "Flaechengewicht",
table: "KurzlinerSanierung",
type: "integer",
nullable: false,
oldClrType: typeof(int),
oldNullable: true);
migrationBuilder.AlterColumn<bool>(
name: "FixierungAufPacker",
table: "KurzlinerSanierung",
type: "boolean",
nullable: false,
oldClrType: typeof(bool),
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "EntlueftenPacker",
table: "KurzlinerSanierung",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldNullable: true);
migrationBuilder.AlterColumn<bool>(
name: "Auffaelligkeit",
table: "KurzlinerSanierung",
type: "boolean",
nullable: false,
oldClrType: typeof(bool),
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "AnpressenPacker",
table: "KurzlinerSanierung",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldNullable: true);
migrationBuilder.AddPrimaryKey(
name: "PK_KurzlinerSanierung",
table: "KurzlinerSanierung",
column: "ID");
migrationBuilder.CreateTable(
name: "HutprofilSanierung",
columns: table => new
{
ID = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
AnpressenPacker = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
Auffaelligkeit = table.Column<bool>(type: "boolean", nullable: false),
AussenTemp = table.Column<int>(type: "integer", nullable: false),
Bericht = table.Column<bool>(type: "boolean", nullable: false),
Dichtheit = table.Column<bool>(type: "boolean", nullable: false),
EntlueftenPacker = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
Film = table.Column<bool>(type: "boolean", nullable: false),
FixierungAufPacker = table.Column<bool>(type: "boolean", nullable: false),
Flaechengewicht = table.Column<int>(type: "integer", nullable: false),
GuidNr = table.Column<Guid>(type: "uuid", nullable: false),
HarzMaterialArt = table.Column<string>(type: "text", nullable: true),
HarzmaterialHersteller = table.Column<string>(type: "text", nullable: true),
InnenBeschichtung = table.Column<bool>(type: "boolean", nullable: false),
KanalTemp = table.Column<int>(type: "integer", nullable: false),
KompACharge = table.Column<string>(type: "text", nullable: true),
KompBCharge = table.Column<string>(type: "text", nullable: true),
MischZeit = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
PackerDruckAnfang = table.Column<double>(type: "double precision", nullable: false),
PackerDruckEnde = table.Column<double>(type: "double precision", nullable: false),
RohrDN = table.Column<string>(type: "text", nullable: true),
SchadPositionID = table.Column<int>(type: "integer", nullable: true),
SeitenKanalDruckAnfang = table.Column<double>(type: "double precision", nullable: false),
SeitenKanalDruckEnde = table.Column<double>(type: "double precision", nullable: false),
Sichtkontrolle = table.Column<bool>(type: "boolean", nullable: false),
TraegerCharge = table.Column<string>(type: "text", nullable: true),
TraegerHersteller = table.Column<string>(type: "text", nullable: true),
TraegerKurzliner = table.Column<string>(type: "text", nullable: true),
Video = table.Column<bool>(type: "boolean", nullable: false),
Wetter = table.Column<int>(type: "integer", nullable: false),
Winkel = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_HutprofilSanierung", x => x.ID);
table.ForeignKey(
name: "FK_HutprofilSanierung_Schaeden_SchadPositionID",
column: x => x.SchadPositionID,
principalTable: "Schaeden",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "IX_HutprofilSanierung_SchadPositionID",
table: "HutprofilSanierung",
column: "SchadPositionID");
migrationBuilder.AddForeignKey(
name: "FK_KurzlinerSanierung_Schaeden_SchadPositionID",
table: "KurzlinerSanierung",
column: "SchadPositionID",
principalTable: "Schaeden",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
}
}
}

View File

@@ -63,19 +63,13 @@ namespace KanSan.Base.Migrations
b.ToTable("Fahrzeuge");
});
modelBuilder.Entity("KanSan.Base.Models.HutprofilSan", b =>
modelBuilder.Entity("KanSan.Base.Models.GueteschutzProtokoll", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTime>("AnpressenPacker")
.HasColumnType("timestamp without time zone");
b.Property<bool>("Auffaelligkeit")
.HasColumnType("boolean");
b.Property<int>("AussenTemp")
.HasColumnType("integer");
@@ -85,86 +79,38 @@ namespace KanSan.Base.Migrations
b.Property<bool>("Dichtheit")
.HasColumnType("boolean");
b.Property<DateTime>("EntlueftenPacker")
.HasColumnType("timestamp without time zone");
b.Property<string>("Discriminator")
.IsRequired()
.HasColumnType("text");
b.Property<bool>("Film")
.HasColumnType("boolean");
b.Property<bool>("FixierungAufPacker")
.HasColumnType("boolean");
b.Property<int>("Flaechengewicht")
.HasColumnType("integer");
b.Property<Guid>("GuidNr")
.HasColumnType("uuid");
b.Property<string>("HarzMaterialArt")
.HasColumnType("text");
b.Property<string>("HarzmaterialHersteller")
.HasColumnType("text");
b.Property<bool>("InnenBeschichtung")
.HasColumnType("boolean");
b.Property<int>("KanalTemp")
.HasColumnType("integer");
b.Property<string>("KompACharge")
.HasColumnType("text");
b.Property<string>("KompBCharge")
.HasColumnType("text");
b.Property<DateTime>("MischZeit")
.HasColumnType("timestamp without time zone");
b.Property<double>("PackerDruckAnfang")
.HasColumnType("double precision");
b.Property<double>("PackerDruckEnde")
.HasColumnType("double precision");
b.Property<string>("RohrDN")
.HasColumnType("text");
b.Property<int?>("SchadPositionID")
.HasColumnType("integer");
b.Property<double>("SeitenKanalDruckAnfang")
.HasColumnType("double precision");
b.Property<double>("SeitenKanalDruckEnde")
.HasColumnType("double precision");
b.Property<bool>("Sichtkontrolle")
.HasColumnType("boolean");
b.Property<string>("TraegerCharge")
.HasColumnType("text");
b.Property<string>("TraegerHersteller")
.HasColumnType("text");
b.Property<string>("TraegerKurzliner")
.HasColumnType("text");
b.Property<bool>("Video")
.HasColumnType("boolean");
b.Property<int>("Wetter")
.HasColumnType("integer");
b.Property<string>("Winkel")
.HasColumnType("text");
b.HasKey("ID");
b.HasIndex("SchadPositionID");
b.ToTable("HutprofilSanierung");
b.ToTable("GueteschutzProtokoll");
b.HasDiscriminator<string>("Discriminator").HasValue("GueteschutzProtokoll");
});
modelBuilder.Entity("KanSan.Base.Models.Kunde", b =>
@@ -197,101 +143,6 @@ namespace KanSan.Base.Migrations
b.ToTable("Kunden");
});
modelBuilder.Entity("KanSan.Base.Models.KurzlinerSan", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTime>("AnpressenPacker")
.HasColumnType("timestamp without time zone");
b.Property<bool>("Auffaelligkeit")
.HasColumnType("boolean");
b.Property<int>("AussenTemp")
.HasColumnType("integer");
b.Property<bool>("Bericht")
.HasColumnType("boolean");
b.Property<double>("Breit")
.HasColumnType("double precision");
b.Property<bool>("Dichtheit")
.HasColumnType("boolean");
b.Property<DateTime>("EntlueftenPacker")
.HasColumnType("timestamp without time zone");
b.Property<bool>("Film")
.HasColumnType("boolean");
b.Property<bool>("FixierungAufPacker")
.HasColumnType("boolean");
b.Property<int>("Flaechengewicht")
.HasColumnType("integer");
b.Property<Guid>("GuidNr")
.HasColumnType("uuid");
b.Property<string>("HarzMaterialArt")
.HasColumnType("text");
b.Property<string>("HarzmaterialHersteller")
.HasColumnType("text");
b.Property<int>("KanalTemp")
.HasColumnType("integer");
b.Property<string>("KompACharge")
.HasColumnType("text");
b.Property<string>("KompBCharge")
.HasColumnType("text");
b.Property<double>("Lang")
.HasColumnType("double precision");
b.Property<DateTime>("MischZeit")
.HasColumnType("timestamp without time zone");
b.Property<double>("PackerDruckAnfang")
.HasColumnType("double precision");
b.Property<double>("PackerDruckEnde")
.HasColumnType("double precision");
b.Property<int?>("SchadPositionID")
.HasColumnType("integer");
b.Property<bool>("Sichtkontrolle")
.HasColumnType("boolean");
b.Property<string>("TraegerCharge")
.HasColumnType("text");
b.Property<string>("TraegerHersteller")
.HasColumnType("text");
b.Property<string>("TraegerKurzliner")
.HasColumnType("text");
b.Property<bool>("Video")
.HasColumnType("boolean");
b.Property<int>("Wetter")
.HasColumnType("integer");
b.HasKey("ID");
b.HasIndex("SchadPositionID");
b.ToTable("KurzlinerSanierung");
});
modelBuilder.Entity("KanSan.Base.Models.LeitungsverzeichnisPosition", b =>
{
b.Property<int>("ID")
@@ -509,6 +360,9 @@ namespace KanSan.Base.Migrations
b.Property<int?>("FahrzeugID")
.HasColumnType("integer");
b.Property<int?>("GueteschutzProtokolID")
.HasColumnType("integer");
b.Property<Guid>("GuidNr")
.HasColumnType("uuid");
@@ -531,6 +385,8 @@ namespace KanSan.Base.Migrations
b.HasIndex("FahrzeugID");
b.HasIndex("GueteschutzProtokolID");
b.HasIndex("LeitungsverzeichnisPositionID");
b.HasIndex("SanierungskonzeptID");
@@ -538,6 +394,131 @@ namespace KanSan.Base.Migrations
b.ToTable("Taetigkeiten");
});
modelBuilder.Entity("KanSan.Base.Models.HutprofilSan", b =>
{
b.HasBaseType("KanSan.Base.Models.GueteschutzProtokoll");
b.Property<DateTime>("AnpressenPacker")
.HasColumnType("timestamp without time zone");
b.Property<bool>("Auffaelligkeit")
.HasColumnType("boolean");
b.Property<DateTime>("EntlueftenPacker")
.HasColumnType("timestamp without time zone");
b.Property<bool>("FixierungAufPacker")
.HasColumnType("boolean");
b.Property<int>("Flaechengewicht")
.HasColumnType("integer");
b.Property<string>("HarzMaterialArt")
.HasColumnType("text");
b.Property<string>("HarzmaterialHersteller")
.HasColumnType("text");
b.Property<bool>("InnenBeschichtung")
.HasColumnType("boolean");
b.Property<string>("KompACharge")
.HasColumnType("text");
b.Property<string>("KompBCharge")
.HasColumnType("text");
b.Property<DateTime>("MischZeit")
.HasColumnType("timestamp without time zone");
b.Property<double>("PackerDruckAnfang")
.HasColumnType("double precision");
b.Property<double>("PackerDruckEnde")
.HasColumnType("double precision");
b.Property<string>("RohrDN")
.HasColumnType("text");
b.Property<double>("SeitenKanalDruckAnfang")
.HasColumnType("double precision");
b.Property<double>("SeitenKanalDruckEnde")
.HasColumnType("double precision");
b.Property<string>("TraegerCharge")
.HasColumnType("text");
b.Property<string>("TraegerHersteller")
.HasColumnType("text");
b.Property<string>("TraegerKurzliner")
.HasColumnType("text");
b.Property<string>("Winkel")
.HasColumnType("text");
b.HasDiscriminator().HasValue("HutprofilSan");
});
modelBuilder.Entity("KanSan.Base.Models.KurzlinerSan", b =>
{
b.HasBaseType("KanSan.Base.Models.GueteschutzProtokoll");
b.Property<DateTime>("AnpressenPacker")
.HasColumnType("timestamp without time zone");
b.Property<bool>("Auffaelligkeit")
.HasColumnType("boolean");
b.Property<double>("Breit")
.HasColumnType("double precision");
b.Property<DateTime>("EntlueftenPacker")
.HasColumnType("timestamp without time zone");
b.Property<bool>("FixierungAufPacker")
.HasColumnType("boolean");
b.Property<int>("Flaechengewicht")
.HasColumnType("integer");
b.Property<string>("HarzMaterialArt")
.HasColumnType("text");
b.Property<string>("HarzmaterialHersteller")
.HasColumnType("text");
b.Property<string>("KompACharge")
.HasColumnType("text");
b.Property<string>("KompBCharge")
.HasColumnType("text");
b.Property<double>("Lang")
.HasColumnType("double precision");
b.Property<DateTime>("MischZeit")
.HasColumnType("timestamp without time zone");
b.Property<double>("PackerDruckAnfang")
.HasColumnType("double precision");
b.Property<double>("PackerDruckEnde")
.HasColumnType("double precision");
b.Property<string>("TraegerCharge")
.HasColumnType("text");
b.Property<string>("TraegerHersteller")
.HasColumnType("text");
b.Property<string>("TraegerKurzliner")
.HasColumnType("text");
b.HasDiscriminator().HasValue("KurzlinerSan");
});
modelBuilder.Entity("KanSan.Base.Models.Baustelle", b =>
{
b.HasOne("KanSan.Base.Models.Projekt", "Projekt")
@@ -545,14 +526,7 @@ namespace KanSan.Base.Migrations
.HasForeignKey("ProjektID");
});
modelBuilder.Entity("KanSan.Base.Models.HutprofilSan", b =>
{
b.HasOne("KanSan.Base.Models.Schaeden", "SchadPosition")
.WithMany()
.HasForeignKey("SchadPositionID");
});
modelBuilder.Entity("KanSan.Base.Models.KurzlinerSan", b =>
modelBuilder.Entity("KanSan.Base.Models.GueteschutzProtokoll", b =>
{
b.HasOne("KanSan.Base.Models.Schaeden", "SchadPosition")
.WithMany()
@@ -598,6 +572,10 @@ namespace KanSan.Base.Migrations
.WithMany()
.HasForeignKey("FahrzeugID");
b.HasOne("KanSan.Base.Models.GueteschutzProtokoll", "GueteschutzProtokol")
.WithMany()
.HasForeignKey("GueteschutzProtokolID");
b.HasOne("KanSan.Base.Models.LeitungsverzeichnisPosition", "LeitungsverzeichnisPosition")
.WithMany()
.HasForeignKey("LeitungsverzeichnisPositionID");

View File

@@ -14,5 +14,6 @@ namespace KanSan.Base.Models
public decimal Position { get; set; }
public LeitungsverzeichnisPosition LeitungsverzeichnisPosition { get; set; }
public decimal Anzahl { get; set; }
public GueteschutzProtokoll GueteschutzProtokol { get; set; }
}
}

View File

@@ -0,0 +1,72 @@
using KanSan.Base;
using KanSan.Base.Interfaces;
using KanSan.Base.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace KanSan.ViewModel.Objekte
{
public class ObjekteAddViewModel
{
IUnitOfWork unitOfWork;
private Baustelle baustelle;
public string PunktOben { get; set; }
public string PunktUnten { get; set; }
public string Strasse { get; set; }
public int DN { get; set; }
public bool InBetrieb { get; set; }
public ObjekteAddViewModel(Baustelle baustelle)
{
this.baustelle = baustelle;
unitOfWork = new UnitOfWork(new KanSanContext());
}
public void Hinzufügen()
{
SewerPoint PointOben = getPoint(PunktOben,true);
SewerPoint PointUnten = getPoint(PunktUnten,true);
Sewer newSewer = new Sewer();
newSewer.Baustelle = baustelle;
newSewer.GuidNr = Guid.NewGuid();
newSewer.PunktOben = PointOben;
newSewer.PunktUnten = PointUnten;
newSewer.DN = DN;
newSewer.RohrleitungInBetrieb = InBetrieb;
newSewer.StrasseName = Strasse;
newSewer.ObjektNummer = PunktOben;
unitOfWork.KanaeleRepository.Update(newSewer);
unitOfWork.Commit();
}
private SewerPoint getPoint(string objektnummer, bool createIfNotFound = false)
{
List<SewerPoint> sewerPoints = unitOfWork.ObjekteRepository.Get(x => x.Objektnummer.Equals(objektnummer)).ToList();
if (sewerPoints.Count < 1)
{
if (createIfNotFound == false)
return null;
else
{
Guid guidNr = Guid.NewGuid();
unitOfWork.ObjekteRepository.Update(new SewerPoint()
{
Objektnummer = objektnummer,
GuidNr = guidNr
});
unitOfWork.Commit();
return unitOfWork.ObjekteRepository.Get(x => x.GuidNr.Equals(guidNr)).ToList().First();
}
}
return sewerPoints.First();
}
}
}

View File

@@ -1,10 +1,58 @@
using System;
using KanSan.Base;
using KanSan.Base.Interfaces;
using KanSan.Base.Interfaces.UI;
using KanSan.Base.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace KanSan.ViewModel
{
class ObjekteListViewModel
public class ObjekteTransfer
{
public string Strassename { get; set; }
public IEnumerable<Sewer> Objekte { get; set; }
}
public class ObjekteListViewModel
{
IUnitOfWork unitOfWork = new UnitOfWork(new KanSanContext());
List<ObjekteTransfer> kanalObjekte = new List<ObjekteTransfer>();
private Baustelle selectedBaustelle;
public List<ObjekteTransfer> KanalObjekte => kanalObjekte;
public ObjekteListViewModel(Baustelle selectedBaustelle)
{
this.selectedBaustelle = selectedBaustelle;
//
List<Sewer> list = unitOfWork.KanaeleRepository.Get(x => x.Baustelle.Equals(selectedBaustelle)).ToList();
var x = list.GroupBy(x => x.StrasseName).Select(x => new ObjekteTransfer
{
Strassename = x.Key,
Objekte = x
}).ToList();
kanalObjekte = x;
//kanalObjekte = unitOfWork.KanaeleRepository.Get(x => x.Baustelle.Equals(selectedBaustelle)).ToList();
}
public Sewer NeueObjektHinzufügen()
{
Guid guid = Guid.NewGuid();
Sewer sewer = new Sewer()
{
Baustelle = selectedBaustelle,
GuidNr = guid
};
unitOfWork.KanaeleRepository.Update(sewer);
unitOfWork.Commit();
List<Sewer> t = unitOfWork.KanaeleRepository.Get(x => x.GuidNr.Equals(guid)).ToList();
if(t.Count < 1) throw new Exception("Der zuvor eingefügte Objekt konnte nicht in der Datenbank gefunden werden");
return t.First();
}
}
}

View File

@@ -7,6 +7,9 @@
</ApplicationDefinition>
</ItemGroup>
<ItemGroup>
<Compile Update="UI\Objekte\FrmNewObjekt.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="UI\Kunde\UCKundeList.xaml.cs">
<SubType>Code</SubType>
</Compile>
@@ -28,11 +31,17 @@
<Compile Update="UI\Baustelle\UCBaustelleList.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="UI\Objekte\UCObjekteList.xaml.cs">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Page Update="MainWindow.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="UI\Objekte\FrmNewObjekt.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="UI\Kunde\UCKundeList.xaml">
<SubType>Designer</SubType>
</Page>
@@ -54,5 +63,8 @@
<Page Update="UI\Baustelle\UCBaustelleList.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="UI\Objekte\UCObjekteList.xaml">
<SubType>Designer</SubType>
</Page>
</ItemGroup>
</Project>

View File

@@ -20,7 +20,7 @@
<Button Content="Kunden" Name="btnKunden" Click="btnKunden_Click" />
<Button Content="Projekte" Name="btnProjekte" Click="btnProjekte_Click" />
<Button Content="Baustellen" Name="btnBaustellen" Click="btnBaustellen_Click" />
<Button Content="Objekte" Name="btnObjekte" />
<Button Content="Objekte" Name="btnObjekte" Click="btnObjekte_Click" />
</StackPanel>
<ContentControl Grid.Column="1" Name="ContentController" Content="KanSan"/>
<StatusBar Grid.ColumnSpan="2" Margin="0,1,0,0" Grid.Row="1">

View File

@@ -127,6 +127,12 @@ namespace KanSan
uBaustelleEdit.SpeichernClicked += Edit_SpeichernClicked;
ContentController.Content = uBaustelleEdit;
}
private void btnObjekte_Click(object sender, RoutedEventArgs e)
{
UI.UCObjekteList uCObjekteList = new UI.UCObjekteList((DataContext as MainWindowViewModel).SelectedBaustelle);
ContentController.Content = uCObjekteList;
}
}
}

View File

@@ -0,0 +1,32 @@
using KanSan.Base.Interfaces.UI;
using KanSan.Base.Models;
using System;
using System.Collections.Generic;
using System.Text;
namespace KanSan.SampleData
{
class ObjekteListViewModelSampleData
{
List<Sewer> kanalObjekte = new List<Sewer>();
public List<Sewer> KanalObjekte => kanalObjekte;
BaustelleListViewModelSampleData baustellen = new BaustelleListViewModelSampleData();
public ObjekteListViewModelSampleData()
{
for (int i = 0; i < 10; i++)
{
kanalObjekte.Add(new Sewer()
{
Material = Base.Enums.EMaterial.Steinzeug,
Baustelle = baustellen.Baustellen[0],
ObjektNummer = i.ToString(),
StrasseName = "Grambergstrasse",
DN = 150
});
}
}
}
}

View File

@@ -0,0 +1,28 @@
<Window x:Class="KanSan.UI.FrmNewObjekt"
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:KanSan.UI"
mc:Ignorable="d"
Title="FrmNewObjekt" Height="450" Width="800">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Button Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="0" Content="Speichern" Name="Speichern" Click="Speichern_Click" />
<TextBox Grid.Column="1" Grid.Row="1" Text="{Binding PunktOben}" />
<TextBox Grid.Column="1" Grid.Row="2" Text="{Binding PunktUnten}" />
<TextBox Grid.Column="1" Grid.Row="3" Text="{Binding Strasse}" />
<TextBox Grid.Column="1" Grid.Row="4" Text="{Binding DN}" />
</Grid>
</Window>

View File

@@ -0,0 +1,34 @@
using KanSan.Base.Models;
using KanSan.ViewModel.Objekte;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
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.Shapes;
namespace KanSan.UI
{
/// <summary>
/// Interaktionslogik für FrmNewObjekt.xaml
/// </summary>
public partial class FrmNewObjekt : Window
{
public FrmNewObjekt(Baustelle baustelle)
{
InitializeComponent();
this.DataContext = new ObjekteAddViewModel(baustelle);
}
private void Speichern_Click(object sender, RoutedEventArgs e)
{
(DataContext as ObjekteAddViewModel).Hinzufügen();
}
}
}

View File

@@ -0,0 +1,37 @@
<UserControl x:Class="KanSan.UI.UCObjekteList"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:KanSan.UI"
xmlns:sd ="clr-namespace:KanSan.SampleData"
mc:Ignorable="d"
d:DesignHeight="1024" d:DesignWidth="5000">
<d:UserControl.DataContext>
<sd:ObjekteListViewModelSampleData />
</d:UserControl.DataContext>
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="50" />
<RowDefinition Height="50" />
<RowDefinition Height="50" />
</Grid.RowDefinitions>
<TreeView ItemsSource="{Binding KanalObjekte}">
</TreeView>
<!--<DataGrid ItemsSource="{Binding KanalObjekte}" Name="dgObjekte" AutoGenerateColumns="False">
<DataGrid.Columns>
<DataGridTextColumn Header="Strasse" Binding="{Binding StrasseName}" />
<DataGridTextColumn Header="Objektnummer" Binding="{Binding ObjektNummer}" />
<DataGridTextColumn Header="Durchmesser" Binding="{Binding DN}" />
<DataGridTextColumn Header="Material" Binding="{Binding Material}" />
</DataGrid.Columns>
</DataGrid>-->
<Button Grid.Row="1" x:Name="ProjektSelect" Content="Objekt Auswählen" />
<Button Grid.Row="2" Name="ProjektEdit" Content="Objekt Editieren" />
<Button Grid.Row="3" Name="ObjektNew" Content="Neue Objekt Hinzufügen" Click="ObjektNew_Click" />
</Grid>
</UserControl>

View File

@@ -0,0 +1,37 @@
using KanSan.Base.Models;
using KanSan.ViewModel;
using System;
using System.Collections.Generic;
using System.Text;
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 KanSan.UI
{
/// <summary>
/// Interaktionslogik für UCObjekteList.xaml
/// </summary>
public partial class UCObjekteList : UserControl
{
Baustelle baustelle;
public UCObjekteList(Baustelle baustelle)
{
InitializeComponent();
this.baustelle = baustelle;
this.DataContext = new ObjekteListViewModel(baustelle);
}
private void ObjektNew_Click(object sender, RoutedEventArgs e)
{
FrmNewObjekt frmNewObjekt = new FrmNewObjekt(baustelle);
frmNewObjekt.ShowDialog();
}
}
}