From f34f4517ca3af8a0d732e99d6c78099406f6a7c2 Mon Sep 17 00:00:00 2001 From: HuskyTeufel Date: Wed, 30 Mar 2022 14:19:03 +0200 Subject: [PATCH] =?UTF-8?q?Fotodokumentation=20domain=20hinzugef=C3=BCgt?= =?UTF-8?q?=20zur=20EF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DaSaSo.Domain/Model/PhotoDocumentation.cs | 14 + DaSaSo.EntityFramework/DaSaSoDbContext.cs | 1 + ...20614_PhotoDocumentation_Added.Designer.cs | 405 ++++++++++++++++++ ...20220330120614_PhotoDocumentation_Added.cs | 33 ++ .../DaSaSoDbContextModelSnapshot.cs | 21 +- DaSaSo.ViewModel/DaSaSo.ViewModel.csproj | 2 + .../SewerPictureDocumentationViewModel.cs | 21 + DaSaSo.Wpf/DaSaSo.Wpf.csproj.user | 6 + .../SewerObject/PhotodocumentationView.xaml | 28 ++ .../PhotodocumentationView.xaml.cs | 28 ++ .../View/SewerObject/SewerMainView.xaml | 5 +- 11 files changed, 562 insertions(+), 2 deletions(-) create mode 100644 DaSaSo.Domain/Model/PhotoDocumentation.cs create mode 100644 DaSaSo.EntityFramework/Migrations/20220330120614_PhotoDocumentation_Added.Designer.cs create mode 100644 DaSaSo.EntityFramework/Migrations/20220330120614_PhotoDocumentation_Added.cs create mode 100644 DaSaSo.Wpf/View/SewerObject/PhotodocumentationView.xaml create mode 100644 DaSaSo.Wpf/View/SewerObject/PhotodocumentationView.xaml.cs diff --git a/DaSaSo.Domain/Model/PhotoDocumentation.cs b/DaSaSo.Domain/Model/PhotoDocumentation.cs new file mode 100644 index 0000000..c72fa0d --- /dev/null +++ b/DaSaSo.Domain/Model/PhotoDocumentation.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DaSaSo.Domain.Model +{ + public class PhotoDocumentation : DomainObject + { + public string PicturePath { get; set; } + public string Description { get; set; } + } +} diff --git a/DaSaSo.EntityFramework/DaSaSoDbContext.cs b/DaSaSo.EntityFramework/DaSaSoDbContext.cs index eca15d1..a18026d 100644 --- a/DaSaSo.EntityFramework/DaSaSoDbContext.cs +++ b/DaSaSo.EntityFramework/DaSaSoDbContext.cs @@ -28,6 +28,7 @@ namespace DaSaSo.EntityFramework public DbSet? PipeLiners { get; set; } public DbSet? Impregnations { get; set; } public DbSet? SewerPoints { get; set; } + public DbSet? PhotoDocumentation { get; set;} } } diff --git a/DaSaSo.EntityFramework/Migrations/20220330120614_PhotoDocumentation_Added.Designer.cs b/DaSaSo.EntityFramework/Migrations/20220330120614_PhotoDocumentation_Added.Designer.cs new file mode 100644 index 0000000..1edaa19 --- /dev/null +++ b/DaSaSo.EntityFramework/Migrations/20220330120614_PhotoDocumentation_Added.Designer.cs @@ -0,0 +1,405 @@ +// +using System; +using DaSaSo.EntityFramework; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace DaSaSo.EntityFramework.Migrations +{ + [DbContext(typeof(DaSaSoDbContext))] + [Migration("20220330120614_PhotoDocumentation_Added")] + partial class PhotoDocumentation_Added + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.0") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("BuildingSiteNumber") + .HasColumnType("text"); + + b.Property("ClientId") + .HasColumnType("integer"); + + b.Property("ContactPerson") + .HasColumnType("text"); + + b.Property("Country") + .HasColumnType("text"); + + b.Property("ProjectId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.HasIndex("ProjectId"); + + b.ToTable("Buildingsites"); + }); + + modelBuilder.Entity("DaSaSo.Domain.Model.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Country") + .HasColumnType("text"); + + b.Property("Firstname") + .HasColumnType("text"); + + b.Property("LastName") + .HasColumnType("text"); + + b.Property("Postcode") + .HasColumnType("text"); + + b.Property("Street") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Clients"); + }); + + modelBuilder.Entity("DaSaSo.Domain.Model.Impregnation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DN") + .HasColumnType("integer"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("IsAvaible") + .HasColumnType("boolean"); + + b.Property("LinerNumber") + .HasColumnType("text"); + + b.Property("Linerlength") + .HasColumnType("numeric"); + + b.Property("Number") + .HasColumnType("text"); + + b.Property("WallThickness") + .HasColumnType("numeric"); + + b.HasKey("Id"); + + b.ToTable("Impregnations"); + }); + + modelBuilder.Entity("DaSaSo.Domain.Model.PhotoDocumentation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("PicturePath") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("PhotoDocumentation"); + }); + + modelBuilder.Entity("DaSaSo.Domain.Model.PipeLiner", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ClosedEnd") + .HasColumnType("boolean"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("ImpregnationId") + .HasColumnType("integer"); + + b.Property("InversionPressure") + .HasColumnType("numeric"); + + b.Property("LinerLength") + .HasColumnType("numeric"); + + b.Property("Operator") + .HasColumnType("text"); + + b.Property("Preliner") + .HasColumnType("boolean"); + + b.Property("PreparationType") + .HasColumnType("integer"); + + b.Property("TemperaturAssembly") + .HasColumnType("numeric"); + + b.Property("TemperaturStorage") + .HasColumnType("numeric"); + + b.Property("TemperatureOutdoors") + .HasColumnType("numeric"); + + b.Property("TemperatureSewer") + .HasColumnType("numeric"); + + b.Property("Weather") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ImpregnationId"); + + b.ToTable("PipeLiners"); + }); + + modelBuilder.Entity("DaSaSo.Domain.Model.Project", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("Projektnummer") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Projects"); + }); + + modelBuilder.Entity("DaSaSo.Domain.Model.SewerDamage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DamageType") + .HasColumnType("integer"); + + b.Property("Distance") + .HasColumnType("numeric"); + + b.Property("SewerObjectId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("SewerObjectId"); + + b.ToTable("SewerDamages"); + }); + + modelBuilder.Entity("DaSaSo.Domain.Model.SewerObject", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("BuildingSiteId") + .HasColumnType("integer"); + + b.Property("BuildingsiteBarier") + .HasColumnType("boolean"); + + b.Property("DN") + .HasColumnType("integer"); + + b.Property("Hausnummer") + .HasColumnType("text"); + + b.Property("Material") + .HasColumnType("text"); + + b.Property("ObjektName") + .HasColumnType("text"); + + b.Property("PermitNeeded") + .HasColumnType("boolean"); + + b.Property("PipeLinerId") + .HasColumnType("integer"); + + b.Property("PunktObenId") + .HasColumnType("integer"); + + b.Property("PunktObenType") + .HasColumnType("integer"); + + b.Property("PunktUntenId") + .HasColumnType("integer"); + + b.Property("PunktUntenType") + .HasColumnType("integer"); + + b.Property("SanNummer") + .HasColumnType("text"); + + b.Property("SewerActivated") + .HasColumnType("boolean"); + + b.Property("SewerCleaned") + .HasColumnType("boolean"); + + b.Property("SewerLength") + .HasColumnType("numeric"); + + b.Property("StreetName") + .HasColumnType("text"); + + b.Property("WaterBarrier") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.HasIndex("BuildingSiteId"); + + b.HasIndex("PipeLinerId"); + + b.HasIndex("PunktObenId"); + + b.HasIndex("PunktUntenId"); + + b.ToTable("SewerObjects"); + }); + + modelBuilder.Entity("DaSaSo.Domain.Model.SewerPoint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Objektnummer") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("SewerPoints"); + }); + + modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b => + { + b.HasOne("DaSaSo.Domain.Model.Client", "Client") + .WithMany() + .HasForeignKey("ClientId"); + + b.HasOne("DaSaSo.Domain.Model.Project", "Project") + .WithMany("BuildingSites") + .HasForeignKey("ProjectId"); + + b.Navigation("Client"); + + b.Navigation("Project"); + }); + + modelBuilder.Entity("DaSaSo.Domain.Model.PipeLiner", b => + { + b.HasOne("DaSaSo.Domain.Model.Impregnation", "Impregnation") + .WithMany() + .HasForeignKey("ImpregnationId"); + + b.Navigation("Impregnation"); + }); + + modelBuilder.Entity("DaSaSo.Domain.Model.SewerDamage", b => + { + b.HasOne("DaSaSo.Domain.Model.SewerObject", "SewerObject") + .WithMany("SewerDamages") + .HasForeignKey("SewerObjectId"); + + b.Navigation("SewerObject"); + }); + + modelBuilder.Entity("DaSaSo.Domain.Model.SewerObject", b => + { + b.HasOne("DaSaSo.Domain.Model.Buildingsite", "BuildingSite") + .WithMany("SewerObjects") + .HasForeignKey("BuildingSiteId"); + + b.HasOne("DaSaSo.Domain.Model.PipeLiner", "PipeLiner") + .WithMany() + .HasForeignKey("PipeLinerId"); + + b.HasOne("DaSaSo.Domain.Model.SewerPoint", "PunktOben") + .WithMany() + .HasForeignKey("PunktObenId"); + + b.HasOne("DaSaSo.Domain.Model.SewerPoint", "PunktUnten") + .WithMany() + .HasForeignKey("PunktUntenId"); + + b.Navigation("BuildingSite"); + + b.Navigation("PipeLiner"); + + b.Navigation("PunktOben"); + + b.Navigation("PunktUnten"); + }); + + modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b => + { + b.Navigation("SewerObjects"); + }); + + modelBuilder.Entity("DaSaSo.Domain.Model.Project", b => + { + b.Navigation("BuildingSites"); + }); + + modelBuilder.Entity("DaSaSo.Domain.Model.SewerObject", b => + { + b.Navigation("SewerDamages"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/DaSaSo.EntityFramework/Migrations/20220330120614_PhotoDocumentation_Added.cs b/DaSaSo.EntityFramework/Migrations/20220330120614_PhotoDocumentation_Added.cs new file mode 100644 index 0000000..c766acf --- /dev/null +++ b/DaSaSo.EntityFramework/Migrations/20220330120614_PhotoDocumentation_Added.cs @@ -0,0 +1,33 @@ +using Microsoft.EntityFrameworkCore.Migrations; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace DaSaSo.EntityFramework.Migrations +{ + public partial class PhotoDocumentation_Added : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "PhotoDocumentation", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + PicturePath = table.Column(type: "text", nullable: true), + Description = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_PhotoDocumentation", x => x.Id); + }); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "PhotoDocumentation"); + } + } +} diff --git a/DaSaSo.EntityFramework/Migrations/DaSaSoDbContextModelSnapshot.cs b/DaSaSo.EntityFramework/Migrations/DaSaSoDbContextModelSnapshot.cs index dee3080..cc0fa9d 100644 --- a/DaSaSo.EntityFramework/Migrations/DaSaSoDbContextModelSnapshot.cs +++ b/DaSaSo.EntityFramework/Migrations/DaSaSoDbContextModelSnapshot.cs @@ -17,7 +17,7 @@ namespace DaSaSo.EntityFramework.Migrations { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "6.0.0-rc.1.21452.10") + .HasAnnotation("ProductVersion", "6.0.0") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); @@ -116,6 +116,25 @@ namespace DaSaSo.EntityFramework.Migrations b.ToTable("Impregnations"); }); + modelBuilder.Entity("DaSaSo.Domain.Model.PhotoDocumentation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("PicturePath") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("PhotoDocumentation"); + }); + modelBuilder.Entity("DaSaSo.Domain.Model.PipeLiner", b => { b.Property("Id") diff --git a/DaSaSo.ViewModel/DaSaSo.ViewModel.csproj b/DaSaSo.ViewModel/DaSaSo.ViewModel.csproj index e3ec143..316c104 100644 --- a/DaSaSo.ViewModel/DaSaSo.ViewModel.csproj +++ b/DaSaSo.ViewModel/DaSaSo.ViewModel.csproj @@ -17,6 +17,8 @@ + + diff --git a/DaSaSo.ViewModel/SewerPictureDocumentationViewModel.cs b/DaSaSo.ViewModel/SewerPictureDocumentationViewModel.cs index 4114468..6e5f539 100644 --- a/DaSaSo.ViewModel/SewerPictureDocumentationViewModel.cs +++ b/DaSaSo.ViewModel/SewerPictureDocumentationViewModel.cs @@ -1,12 +1,33 @@ using System; using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DaSaSo.ViewModel { + public static class BitmapConversion + { + //BitmapSource + } public class SewerPictureDocumentationViewModel : BaseViewModel { + + public ObservableCollection Tabs { get; set; } + + public SewerPictureDocumentationViewModel() + { + Tabs = new ObservableCollection(); + Tabs.Add(new TabItem { Header = "One", Content = "One's content" }); + Tabs.Add(new TabItem { Header = "Two", Content = "Two content" }); + } + } + + public sealed class TabItem + { + public string Header { get; set; } + public string Content { get; set; } } } diff --git a/DaSaSo.Wpf/DaSaSo.Wpf.csproj.user b/DaSaSo.Wpf/DaSaSo.Wpf.csproj.user index 8e7f7c6..d51b02b 100644 --- a/DaSaSo.Wpf/DaSaSo.Wpf.csproj.user +++ b/DaSaSo.Wpf/DaSaSo.Wpf.csproj.user @@ -52,6 +52,9 @@ Code + + Code + Code @@ -120,6 +123,9 @@ Designer + + Designer + Designer diff --git a/DaSaSo.Wpf/View/SewerObject/PhotodocumentationView.xaml b/DaSaSo.Wpf/View/SewerObject/PhotodocumentationView.xaml new file mode 100644 index 0000000..f7ed630 --- /dev/null +++ b/DaSaSo.Wpf/View/SewerObject/PhotodocumentationView.xaml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + +