34 Commits

Author SHA1 Message Date
HuskyTeufel
bbb2c45eff Viewmodel projekt entfernt 2022-03-31 14:45:18 +02:00
HuskyTeufel
c2228e2321 Merge pull request 'convertViewModel_to_WPF' (#3) from convertViewModel_to_WPF into fotodokumentation
Reviewed-on: https://git.cosysda.de/Cosysda/DaSaSo/pulls/3
2022-03-30 15:19:00 +02:00
HuskyTeufel
5662502d5e Navigationbar war auskommentiert. 2022-03-30 15:17:30 +02:00
HuskyTeufel
ecda2ab44f Git version wird richtig geparsed 2022-03-30 15:16:36 +02:00
HuskyTeufel
06cb2572ff Programm compiliert nun
jedoch scheint ein fehler mit der git-version zu geben
2022-03-30 15:01:32 +02:00
HuskyTeufel
1bf0c3b615 viewmodel ins wpf gepackt, build failed 2022-03-30 14:59:12 +02:00
HuskyTeufel
f34f4517ca Fotodokumentation domain hinzugefügt zur EF 2022-03-30 14:19:03 +02:00
HuskyTeufel
f59fc036d1 Merge branch 'fotodokumentation' of https://git.cosysda.de/Cosysda/DaSaSo into fotodokumentation 2022-03-30 13:23:44 +02:00
HuskyTeufel
bb2d7be54e Fotodokumentation hinzugefügt 2022-03-30 13:23:13 +02:00
HuskyTeufel
acc577eb32 Imprägnierungen edit
Edit button erst verfügbar wenn ein Imprägnierung ausgewählt wurde
2022-03-30 13:22:57 +02:00
HuskyTeufel
9a24a4a7cd Fotodokumentation hinzugefügt 2021-11-29 10:34:29 +01:00
HuskyTeufel
4689f2e4da Client aus Registry entfernt 2021-11-29 10:22:51 +01:00
HuskyTeufel
f903da3af7 Merge branch 'ClientsNotDomain' 2021-11-29 10:08:16 +01:00
HuskyTeufel
49f9b6c496 Nuget packete geupdated 2021-11-29 10:08:07 +01:00
HuskyTeufel
1b4911e6aa GUI anpassung
Kunden sind nicht mehr ganz oben im Navigation gelistet
2021-11-02 08:04:07 +01:00
HuskyTeufel
13b4be5f5a Baustellen speichern awaite
Es wurde die unvollständige Liste erzeugt, da die speicherfunktion nicht
awaited wurde
2021-11-02 07:49:40 +01:00
HuskyTeufel
ee46751fa6 Clients sind nicht mehr als oberste Prio 2021-11-01 16:10:46 +01:00
HuskyTeufel
d4da9fd0da Imprägnierungen können gespeichert werden 2021-11-01 09:58:54 +01:00
HuskyTeufel
b4a896f5bf Imprägnierungedit weitergeschrieben 2021-10-28 15:53:35 +02:00
HuskyTeufel
e2e7fbc9c4 Imprägnierungen werden aufgelistet
Todo renavitor zur Imprägnierungsedit.
2021-10-15 12:50:35 +02:00
HuskyTeufel
6cf888c5e3 Imprägnierungsliste hinzugefügt 2021-10-15 10:43:47 +02:00
HuskyTeufel
3b97a912bc Vorbereitungen werden in Schlauchliner gespeichert 2021-10-15 09:10:32 +02:00
HuskyTeufel
ba51c3bde6 migration SQL Set excistiert nicht unter Sqlite 2021-10-14 14:12:55 +02:00
HuskyTeufel
895a5b7f0d SewerDamage null Exception
this fix #1
2021-10-13 12:10:26 +02:00
HuskyTeufel
adbbc0e528 Schlauchliner form wird vollständig verwaltet 2021-10-13 11:56:02 +02:00
HuskyTeufel
4ed6826f62 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	DaSaSo.ViewModel/SewerPipeLinerViewModel.cs
2021-10-11 07:35:18 +02:00
HuskyTeufel
b48007095e Genehmigungen hinzugefügt 2021-10-11 07:34:20 +02:00
Husky
790792174d Migrations aufgefäumt
DateOnly hinzugefügt zur Model.
2021-10-09 20:55:03 +02:00
HuskyTeufel
3388891134 SchlauchlinerView wird angezeigt 2021-10-07 13:43:01 +02:00
HuskyTeufel
cae9f38227 Model geupdated 2021-10-06 19:52:32 +02:00
HuskyTeufel
b48c012c18 Schaden kann hinzugefügt werden 2021-10-01 12:20:24 +02:00
HuskyTeufel
98494be3cf Kanalschaden werden richtig geparsed 2021-09-30 16:27:28 +02:00
HuskyTeufel
9da7090883 Merge branch 'renavigatorumbau' into sewerdamages
# Conflicts:
#	DaSaSo.Wpf/HostBuilders/AddViewModelsHostBuilderExtensions.cs
2021-09-29 18:50:32 +02:00
HuskyTeufel
4789b5f252 Sewerdamages angefangen 2021-09-29 17:02:36 +02:00
155 changed files with 2780 additions and 3450 deletions

4
.editorconfig Normal file
View File

@@ -0,0 +1,4 @@
[*.cs]
# CA1416: Validate platform compatibility
dotnet_diagnostic.CA1416.severity = none

1
.gitignore vendored
View File

@@ -18,3 +18,4 @@ project.fragment.lock.json
*.tmp *.tmp
/DaSaSo.InMemoryProvider/obj/Debug/* /DaSaSo.InMemoryProvider/obj/Debug/*
/DaSaSo.ViewModel/version.txt /DaSaSo.ViewModel/version.txt
/DaSaSo.Wpf/version.txt

View File

@@ -1,16 +1,16 @@
// See https://aka.ms/new-console-template for more information // See https://aka.ms/new-console-template for more information
using DaSaSo.ConsoleApp;
using DaSaSo.Domain.Model; using DaSaSo.Domain.Model;
using DaSaSo.Domain.Services; using DaSaSo.Domain.Services;
using DaSaSo.EntityFramework; using DaSaSo.EntityFramework;
using DaSaSo.EntityFramework.Services; using DaSaSo.EntityFramework.Services;
using System.Diagnostics; using System.Diagnostics;
IDataService<Client> clientService = new GenericDataService<Client>(new DaSaSoDbContextFactory(""));
clientService.Create(new Client() testclass test = new testclass();
{ test.data = efields.CATRA | efields.PRO;
Firstname = "Cynthia",
LastName = "Schreuder", var s = test.data.HasFlag(efields.CATRA);
Country = "Tarmstedt",
Postcode = "25445", Debugger.Break();
});

View File

@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DaSaSo.ConsoleApp
{
class testclass
{
public efields data;
}
[Flags]
enum efields : int
{
PRO = 1,
CONTRA = 2,
DESPRED = 4,
CATRA = 8
};
static class EnumerationExtensions
{
public static bool Has<T>(this System.Enum type, T value)
{
try
{
return (((int)(object)type & (int)(object)value) == (int)(object)value);
}
catch
{
return false;
}
}
}
}

View File

@@ -5,4 +5,8 @@
<Nullable>disable</Nullable> <Nullable>disable</Nullable>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<None Include="..\.editorconfig" Link=".editorconfig" />
</ItemGroup>
</Project> </Project>

View File

@@ -11,6 +11,7 @@ namespace DaSaSo.Domain.DesignModel
{ {
public string Streetname { get; set; } public string Streetname { get; set; }
public string CountryName { get; set; } public string CountryName { get; set; }
public bool IsSelected { get; set; }
public IEnumerable<SewerObject> SewerObjects { get; set; } public IEnumerable<SewerObject> SewerObjects { get; set; }
} }

View File

@@ -8,6 +8,7 @@
Projects, Projects,
Buildingsites, Buildingsites,
SewerObjects, SewerObjects,
SewerMainMenu SewerMainMenu,
Impregnierung
} }
} }

View File

@@ -3,6 +3,9 @@
public enum ESewerWindowViewType public enum ESewerWindowViewType
{ {
SewerStammdaten, SewerStammdaten,
SewerDamageList SewerDamageList,
SewerDamageEdit,
SewerPipeLiner,
SewerPictureDocumentation
} }
} }

View File

@@ -8,6 +8,7 @@ namespace DaSaSo.Domain.Model
{ {
public class Buildingsite : DomainObject public class Buildingsite : DomainObject
{ {
public Client Client { get; set; }
public Project Project { get; set; } public Project Project { get; set; }
public string BuildingSiteNumber { get; set; } public string BuildingSiteNumber { get; set; }
public string Country { get; set; } public string Country { get; set; }

View File

@@ -13,7 +13,7 @@ namespace DaSaSo.Domain.Model
public string Country { get; set; } public string Country { get; set; }
public string Street { get; set; } public string Street { get; set; }
public string Postcode { get; set; } public string Postcode { get; set; }
public ICollection<Project> Projects { get; set; } = new List<Project>(); //public ICollection<Project> Projects { get; set; } = new List<Project>();
} }
} }

View File

@@ -12,7 +12,7 @@ namespace DaSaSo.Domain.Model
public string Number { get; set; } public string Number { get; set; }
public decimal Linerlength { get; set; } public decimal Linerlength { get; set; }
public bool IsAvaible { get; set; } public bool IsAvaible { get; set; }
public DateTime Date { get; set; } public DateOnly Date { get; set; }
public string LinerNumber { get; set; } public string LinerNumber { get; set; }
public decimal WallThickness { get; set; } public decimal WallThickness { get; set; }
} }

View File

@@ -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; }
}
}

View File

@@ -10,7 +10,7 @@ namespace DaSaSo.Domain.Model
{ {
public string Name { get; set; } public string Name { get; set; }
public string Projektnummer { get; set; } public string Projektnummer { get; set; }
public Client Client { get; set; } //public Client Client { get; set; }
public ICollection<Buildingsite> BuildingSites { get; set; } = new List<Buildingsite>(); public ICollection<Buildingsite> BuildingSites { get; set; } = new List<Buildingsite>();
} }
} }

View File

@@ -1,7 +1,11 @@
namespace DaSaSo.Domain.Model using System;
namespace DaSaSo.Domain.Model
{ {
[Flags]
public enum EDamageType public enum EDamageType
{ {
NONE = 0,
Riss = 1, Riss = 1,
Bruch = 2, Bruch = 2,
Scherbe = 4, Scherbe = 4,
@@ -9,20 +13,28 @@
Inkrustation = 16, Inkrustation = 16,
Ablagerung = 32, Ablagerung = 32,
EinrageneStutzen = 64, EinrageneStutzen = 64,
Infiltration = 128 Infiltration = 128,
Static = Riss | Bruch | Scherbe,
Betrieb = Wurzel | Inkrustation | Ablagerung,
Other = EinrageneStutzen | Infiltration
} }
[Flags]
public enum EPreparationType public enum EPreparationType
{ {
NONE = 0,
CleanedHD = 1, CleanedHD = 1,
CleanedMechanisch = 2, CleanedMechanisch = 2,
CleanedRoborter = 4, CleanedRoboter = 4,
FaekalienFrei = 8 FaekalienFrei = 8,
WaterBaried = 16,
PermitNeeded = 32,
STVO = 64
} }
public class SewerDamage : DomainObject public class SewerDamage : DomainObject
{ {
public SewerObject SewerObject { get; set; } public SewerObject SewerObject { get; set; }
public decimal Distance { get; set; } public decimal Distance { get; set; }
public EDamageType DamageType { get; set; } public EDamageType DamageType { get; set; }
public EPreparationType PreparationType { get; set; }
} }
} }

View File

@@ -7,7 +7,9 @@ namespace DaSaSo.Domain.Model
public class SewerObject : DomainObject public class SewerObject : DomainObject
{ {
public Buildingsite BuildingSite { get; set; } public Buildingsite BuildingSite { get; set; }
public string SanNummer { get; set; }
public string StreetName { get; set; } public string StreetName { get; set; }
public string Hausnummer { get; set; }
public string ObjektName { get; set; } public string ObjektName { get; set; }
public SewerPoint PunktOben { get; set; } public SewerPoint PunktOben { get; set; }
public EPointType PunktObenType { get; set; } public EPointType PunktObenType { get; set; }
@@ -28,6 +30,8 @@ namespace DaSaSo.Domain.Model
[NotMapped] [NotMapped]
public bool IsSelected { get; set; } public bool IsSelected { get; set; }
[NotMapped]
public bool IsChanged { get; set; } = false;
} }
} }

View File

@@ -9,16 +9,10 @@ namespace DaSaSo.Domain.Model
public abstract class SewerRehabilation : DomainObject public abstract class SewerRehabilation : DomainObject
{ {
public string Operator { get; set; } public string Operator { get; set; }
public DateTime Date { get; set; } public DateOnly Date { get; set; }
public decimal TemperatureOutdoors { get; set; } public decimal TemperatureOutdoors { get; set; }
public decimal TemperatureSewer { get; set; } public decimal TemperatureSewer { get; set; }
public string Weather { get; set; } public string Weather { get; set; }
public bool CleanedHD { get; set; } public EPreparationType PreparationType { get; set; }
public bool CleanedMechanisch { get; set; }
public bool CleanedRoborter { get; set; }
public bool WaterBaried { get; set; }
public bool PermitNeeded { get; set; }
public bool STVO { get; set; }
} }
} }

View File

@@ -9,6 +9,6 @@ namespace DaSaSo.Domain.Services.ProjectServices
{ {
public interface IProjectService public interface IProjectService
{ {
Task<Project> CreateProject(Client Auftraggeber); Task<Project> CreateProject();
} }
} }

View File

@@ -16,16 +16,18 @@ namespace DaSaSo.Domain.Services.ProjectServices
_clientService = clientService; _clientService = clientService;
} }
public async Task<Project> CreateProject(Client Auftraggeber) public async Task<Project> CreateProject()
{ {
/*
Project project = new Project() Project project = new Project()
{ {
Client = Auftraggeber Client = Auftraggeber
}; };
*/
Auftraggeber.Projects.Add(project); /*Auftraggeber.Projects.Add(project);
await _clientService.Update(Auftraggeber.Id, Auftraggeber); await _clientService.Update(Auftraggeber.Id, Auftraggeber);*/
return project;
return new Project();
} }
} }
} }

View File

@@ -6,17 +6,21 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.0-rc.1.21452.10" /> <PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.0-rc.1.21452.10" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.0-rc.1.21452.10"> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.0">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="6.0.0-rc.1" /> <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="6.0.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\DaSaSo.Domain\DaSaSo.Domain.csproj" /> <ProjectReference Include="..\DaSaSo.Domain\DaSaSo.Domain.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="Migrations\" />
</ItemGroup>
</Project> </Project>

View File

@@ -28,6 +28,7 @@ namespace DaSaSo.EntityFramework
public DbSet<PipeLiner>? PipeLiners { get; set; } public DbSet<PipeLiner>? PipeLiners { get; set; }
public DbSet<Impregnation>? Impregnations { get; set; } public DbSet<Impregnation>? Impregnations { get; set; }
public DbSet<SewerPoint>? SewerPoints { get; set; } public DbSet<SewerPoint>? SewerPoints { get; set; }
public DbSet<PhotoDocumentation>? PhotoDocumentation { get; set;}
} }
} }

View File

@@ -22,7 +22,7 @@ namespace DaSaSo.EntityFramework
public DaSaSoDbContext CreateDbContext() public DaSaSoDbContext CreateDbContext()
{ {
DbContextOptionsBuilder<DaSaSoDbContext>? options = new DbContextOptionsBuilder<DaSaSoDbContext>(); DbContextOptionsBuilder<DaSaSoDbContext>? options = new();
_configureDbContext(options); _configureDbContext(options);
//_connectionString = "Host = localhost; Database = dasaso; Username = kansan; Password = kansan"; //_connectionString = "Host = localhost; Database = dasaso; Username = kansan; Password = kansan";
//options.UseNpgsql(_connectionString); //options.UseNpgsql(_connectionString);
@@ -34,7 +34,7 @@ namespace DaSaSo.EntityFramework
{ {
var options = new DbContextOptionsBuilder<DaSaSoDbContext>(); var options = new DbContextOptionsBuilder<DaSaSoDbContext>();
options.UseNpgsql("Host = localhost; Database = dasaso; Username = kansan; Password = kansan"); options.UseNpgsql("Host = localhost; Database = dasaso; Username = kansan; Password = kansan");
DaSaSoDbContext result = new DaSaSoDbContext(options.Options); DaSaSoDbContext result = new(options.Options);
return result; return result;
} }
/* /*

View File

@@ -1,187 +0,0 @@
// <auto-generated />
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;
namespace DaSaSo.EntityFramework.Migrations
{
[DbContext(typeof(DaSaSoDbContext))]
[Migration("20210912175956_InitialCommit")]
partial class InitialCommit
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 63)
.HasAnnotation("ProductVersion", "6.0.0-preview.7.21378.4")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("BuildingSiteNumber")
.IsRequired()
.HasColumnType("text");
b.Property<string>("ContactPerson")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Country")
.IsRequired()
.HasColumnType("text");
b.Property<int?>("ProjectId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("ProjectId");
b.ToTable("Buildingsites");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Client", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("Country")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Firstname")
.IsRequired()
.HasColumnType("text");
b.Property<string>("LastName")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Postcode")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Clients");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Project", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int>("ClientId")
.HasColumnType("integer");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("ClientId");
b.ToTable("Projects");
});
modelBuilder.Entity("DaSaSo.Domain.Model.SewerObjects", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int>("BuildingSiteId")
.HasColumnType("integer");
b.Property<int>("DN")
.HasColumnType("integer");
b.Property<string>("ObjektName")
.IsRequired()
.HasColumnType("text");
b.Property<string>("PointFrom")
.IsRequired()
.HasColumnType("text");
b.Property<string>("PointTo")
.IsRequired()
.HasColumnType("text");
b.Property<decimal>("SewerLength")
.HasColumnType("numeric");
b.Property<string>("StreetName")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("BuildingSiteId");
b.ToTable("SewerObjects");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b =>
{
b.HasOne("DaSaSo.Domain.Model.Project", null)
.WithMany("BuildingSites")
.HasForeignKey("ProjectId");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Project", b =>
{
b.HasOne("DaSaSo.Domain.Model.Client", "Client")
.WithMany("Projects")
.HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Client");
});
modelBuilder.Entity("DaSaSo.Domain.Model.SewerObjects", b =>
{
b.HasOne("DaSaSo.Domain.Model.Buildingsite", "BuildingSite")
.WithMany("SewerObjects")
.HasForeignKey("BuildingSiteId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("BuildingSite");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b =>
{
b.Navigation("SewerObjects");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Client", b =>
{
b.Navigation("Projects");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Project", b =>
{
b.Navigation("BuildingSites");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -1,124 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace DaSaSo.EntityFramework.Migrations
{
public partial class InitialCommit : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Clients",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Firstname = table.Column<string>(type: "text", nullable: false),
LastName = table.Column<string>(type: "text", nullable: false),
Country = table.Column<string>(type: "text", nullable: false),
Postcode = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Clients", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Projects",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Name = table.Column<string>(type: "text", nullable: false),
ClientId = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Projects", x => x.Id);
table.ForeignKey(
name: "FK_Projects_Clients_ClientId",
column: x => x.ClientId,
principalTable: "Clients",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Buildingsites",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
BuildingSiteNumber = table.Column<string>(type: "text", nullable: false),
Country = table.Column<string>(type: "text", nullable: false),
ContactPerson = table.Column<string>(type: "text", nullable: false),
ProjectId = table.Column<int>(type: "integer", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Buildingsites", x => x.Id);
table.ForeignKey(
name: "FK_Buildingsites_Projects_ProjectId",
column: x => x.ProjectId,
principalTable: "Projects",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "SewerObjects",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
BuildingSiteId = table.Column<int>(type: "integer", nullable: false),
StreetName = table.Column<string>(type: "text", nullable: false),
ObjektName = table.Column<string>(type: "text", nullable: false),
PointFrom = table.Column<string>(type: "text", nullable: false),
PointTo = table.Column<string>(type: "text", nullable: false),
DN = table.Column<int>(type: "integer", nullable: false),
SewerLength = table.Column<decimal>(type: "numeric", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_SewerObjects", x => x.Id);
table.ForeignKey(
name: "FK_SewerObjects_Buildingsites_BuildingSiteId",
column: x => x.BuildingSiteId,
principalTable: "Buildingsites",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_Buildingsites_ProjectId",
table: "Buildingsites",
column: "ProjectId");
migrationBuilder.CreateIndex(
name: "IX_Projects_ClientId",
table: "Projects",
column: "ClientId");
migrationBuilder.CreateIndex(
name: "IX_SewerObjects_BuildingSiteId",
table: "SewerObjects",
column: "BuildingSiteId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "SewerObjects");
migrationBuilder.DropTable(
name: "Buildingsites");
migrationBuilder.DropTable(
name: "Projects");
migrationBuilder.DropTable(
name: "Clients");
}
}
}

View File

@@ -1,191 +0,0 @@
// <auto-generated />
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;
namespace DaSaSo.EntityFramework.Migrations
{
[DbContext(typeof(DaSaSoDbContext))]
[Migration("20210913113208_StreetAdded")]
partial class StreetAdded
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 63)
.HasAnnotation("ProductVersion", "6.0.0-preview.7.21378.4")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("BuildingSiteNumber")
.IsRequired()
.HasColumnType("text");
b.Property<string>("ContactPerson")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Country")
.IsRequired()
.HasColumnType("text");
b.Property<int?>("ProjectId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("ProjectId");
b.ToTable("Buildingsites");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Client", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("Country")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Firstname")
.IsRequired()
.HasColumnType("text");
b.Property<string>("LastName")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Postcode")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Street")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Clients");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Project", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int>("ClientId")
.HasColumnType("integer");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("ClientId");
b.ToTable("Projects");
});
modelBuilder.Entity("DaSaSo.Domain.Model.SewerObjects", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int>("BuildingSiteId")
.HasColumnType("integer");
b.Property<int>("DN")
.HasColumnType("integer");
b.Property<string>("ObjektName")
.IsRequired()
.HasColumnType("text");
b.Property<string>("PointFrom")
.IsRequired()
.HasColumnType("text");
b.Property<string>("PointTo")
.IsRequired()
.HasColumnType("text");
b.Property<decimal>("SewerLength")
.HasColumnType("numeric");
b.Property<string>("StreetName")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("BuildingSiteId");
b.ToTable("SewerObjects");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b =>
{
b.HasOne("DaSaSo.Domain.Model.Project", null)
.WithMany("BuildingSites")
.HasForeignKey("ProjectId");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Project", b =>
{
b.HasOne("DaSaSo.Domain.Model.Client", "Client")
.WithMany("Projects")
.HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Client");
});
modelBuilder.Entity("DaSaSo.Domain.Model.SewerObjects", b =>
{
b.HasOne("DaSaSo.Domain.Model.Buildingsite", "BuildingSite")
.WithMany("SewerObjects")
.HasForeignKey("BuildingSiteId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("BuildingSite");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b =>
{
b.Navigation("SewerObjects");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Client", b =>
{
b.Navigation("Projects");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Project", b =>
{
b.Navigation("BuildingSites");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -1,24 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace DaSaSo.EntityFramework.Migrations
{
public partial class StreetAdded : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "Street",
table: "Clients",
type: "text",
nullable: false,
defaultValue: "");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Street",
table: "Clients");
}
}
}

View File

@@ -1,176 +0,0 @@
// <auto-generated />
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;
namespace DaSaSo.EntityFramework.Migrations
{
[DbContext(typeof(DaSaSoDbContext))]
[Migration("20210915174236_ProjectReferenzAdded")]
partial class ProjectReferenzAdded
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 63)
.HasAnnotation("ProductVersion", "6.0.0-preview.7.21378.4")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("BuildingSiteNumber")
.HasColumnType("text");
b.Property<string>("ContactPerson")
.HasColumnType("text");
b.Property<string>("Country")
.HasColumnType("text");
b.Property<int?>("ProjectId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("ProjectId");
b.ToTable("Buildingsites");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Client", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("Country")
.HasColumnType("text");
b.Property<string>("Firstname")
.HasColumnType("text");
b.Property<string>("LastName")
.HasColumnType("text");
b.Property<string>("Postcode")
.HasColumnType("text");
b.Property<string>("Street")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Clients");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Project", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int?>("ClientId")
.HasColumnType("integer");
b.Property<string>("Name")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("ClientId");
b.ToTable("Projects");
});
modelBuilder.Entity("DaSaSo.Domain.Model.SewerObjects", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int?>("BuildingSiteId")
.HasColumnType("integer");
b.Property<int>("DN")
.HasColumnType("integer");
b.Property<string>("ObjektName")
.HasColumnType("text");
b.Property<string>("PointFrom")
.HasColumnType("text");
b.Property<string>("PointTo")
.HasColumnType("text");
b.Property<decimal>("SewerLength")
.HasColumnType("numeric");
b.Property<string>("StreetName")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("BuildingSiteId");
b.ToTable("SewerObjects");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b =>
{
b.HasOne("DaSaSo.Domain.Model.Project", "Project")
.WithMany("BuildingSites")
.HasForeignKey("ProjectId");
b.Navigation("Project");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Project", b =>
{
b.HasOne("DaSaSo.Domain.Model.Client", "Client")
.WithMany("Projects")
.HasForeignKey("ClientId");
b.Navigation("Client");
});
modelBuilder.Entity("DaSaSo.Domain.Model.SewerObjects", b =>
{
b.HasOne("DaSaSo.Domain.Model.Buildingsite", "BuildingSite")
.WithMany("SewerObjects")
.HasForeignKey("BuildingSiteId");
b.Navigation("BuildingSite");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b =>
{
b.Navigation("SewerObjects");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Client", b =>
{
b.Navigation("Projects");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Project", b =>
{
b.Navigation("BuildingSites");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -1,331 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace DaSaSo.EntityFramework.Migrations
{
public partial class ProjectReferenzAdded : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Projects_Clients_ClientId",
table: "Projects");
migrationBuilder.DropForeignKey(
name: "FK_SewerObjects_Buildingsites_BuildingSiteId",
table: "SewerObjects");
migrationBuilder.AlterColumn<string>(
name: "StreetName",
table: "SewerObjects",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "PointTo",
table: "SewerObjects",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "PointFrom",
table: "SewerObjects",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "ObjektName",
table: "SewerObjects",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<int>(
name: "BuildingSiteId",
table: "SewerObjects",
type: "integer",
nullable: true,
oldClrType: typeof(int),
oldType: "integer");
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "Projects",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<int>(
name: "ClientId",
table: "Projects",
type: "integer",
nullable: true,
oldClrType: typeof(int),
oldType: "integer");
migrationBuilder.AlterColumn<string>(
name: "Street",
table: "Clients",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "Postcode",
table: "Clients",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "LastName",
table: "Clients",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "Firstname",
table: "Clients",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "Country",
table: "Clients",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "Country",
table: "Buildingsites",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "ContactPerson",
table: "Buildingsites",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "BuildingSiteNumber",
table: "Buildingsites",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AddForeignKey(
name: "FK_Projects_Clients_ClientId",
table: "Projects",
column: "ClientId",
principalTable: "Clients",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_SewerObjects_Buildingsites_BuildingSiteId",
table: "SewerObjects",
column: "BuildingSiteId",
principalTable: "Buildingsites",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Projects_Clients_ClientId",
table: "Projects");
migrationBuilder.DropForeignKey(
name: "FK_SewerObjects_Buildingsites_BuildingSiteId",
table: "SewerObjects");
migrationBuilder.AlterColumn<string>(
name: "StreetName",
table: "SewerObjects",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "PointTo",
table: "SewerObjects",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "PointFrom",
table: "SewerObjects",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ObjektName",
table: "SewerObjects",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<int>(
name: "BuildingSiteId",
table: "SewerObjects",
type: "integer",
nullable: false,
defaultValue: 0,
oldClrType: typeof(int),
oldType: "integer",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "Projects",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<int>(
name: "ClientId",
table: "Projects",
type: "integer",
nullable: false,
defaultValue: 0,
oldClrType: typeof(int),
oldType: "integer",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Street",
table: "Clients",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Postcode",
table: "Clients",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "LastName",
table: "Clients",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Firstname",
table: "Clients",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Country",
table: "Clients",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Country",
table: "Buildingsites",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ContactPerson",
table: "Buildingsites",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "BuildingSiteNumber",
table: "Buildingsites",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AddForeignKey(
name: "FK_Projects_Clients_ClientId",
table: "Projects",
column: "ClientId",
principalTable: "Clients",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_SewerObjects_Buildingsites_BuildingSiteId",
table: "SewerObjects",
column: "BuildingSiteId",
principalTable: "Buildingsites",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

View File

@@ -1,234 +0,0 @@
// <auto-generated />
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;
namespace DaSaSo.EntityFramework.Migrations
{
[DbContext(typeof(DaSaSoDbContext))]
[Migration("20210916075225_SewerDamageAdded")]
partial class SewerDamageAdded
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 63)
.HasAnnotation("ProductVersion", "6.0.0-preview.7.21378.4")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("BuildingSiteNumber")
.HasColumnType("text");
b.Property<string>("ContactPerson")
.HasColumnType("text");
b.Property<string>("Country")
.HasColumnType("text");
b.Property<int?>("ProjectId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("ProjectId");
b.ToTable("Buildingsites");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Client", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("Country")
.HasColumnType("text");
b.Property<string>("Firstname")
.HasColumnType("text");
b.Property<string>("LastName")
.HasColumnType("text");
b.Property<string>("Postcode")
.HasColumnType("text");
b.Property<string>("Street")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Clients");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Project", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int?>("ClientId")
.HasColumnType("integer");
b.Property<string>("Name")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("ClientId");
b.ToTable("Projects");
});
modelBuilder.Entity("DaSaSo.Domain.Model.SewerDamage", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int>("DamageType")
.HasColumnType("integer");
b.Property<decimal>("Distance")
.HasColumnType("numeric");
b.Property<int>("PreparationType")
.HasColumnType("integer");
b.Property<int?>("SewerObjectId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("SewerObjectId");
b.ToTable("SewerDamages");
});
modelBuilder.Entity("DaSaSo.Domain.Model.SewerObjects", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int?>("BuildingSiteId")
.HasColumnType("integer");
b.Property<bool>("BuildingsiteBarier")
.HasColumnType("boolean");
b.Property<int>("DN")
.HasColumnType("integer");
b.Property<string>("Material")
.HasColumnType("text");
b.Property<string>("ObjektName")
.HasColumnType("text");
b.Property<bool>("PermitNeeded")
.HasColumnType("boolean");
b.Property<string>("PointFrom")
.HasColumnType("text");
b.Property<string>("PointTo")
.HasColumnType("text");
b.Property<bool>("SewerActivated")
.HasColumnType("boolean");
b.Property<bool>("SewerCleaned")
.HasColumnType("boolean");
b.Property<decimal>("SewerLength")
.HasColumnType("numeric");
b.Property<string>("StreetName")
.HasColumnType("text");
b.Property<bool>("WaterBarrier")
.HasColumnType("boolean");
b.HasKey("Id");
b.HasIndex("BuildingSiteId");
b.ToTable("SewerObjects");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b =>
{
b.HasOne("DaSaSo.Domain.Model.Project", "Project")
.WithMany("BuildingSites")
.HasForeignKey("ProjectId");
b.Navigation("Project");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Project", b =>
{
b.HasOne("DaSaSo.Domain.Model.Client", "Client")
.WithMany("Projects")
.HasForeignKey("ClientId");
b.Navigation("Client");
});
modelBuilder.Entity("DaSaSo.Domain.Model.SewerDamage", b =>
{
b.HasOne("DaSaSo.Domain.Model.SewerObjects", "SewerObject")
.WithMany("SewerDamages")
.HasForeignKey("SewerObjectId");
b.Navigation("SewerObject");
});
modelBuilder.Entity("DaSaSo.Domain.Model.SewerObjects", b =>
{
b.HasOne("DaSaSo.Domain.Model.Buildingsite", "BuildingSite")
.WithMany("SewerObjects")
.HasForeignKey("BuildingSiteId");
b.Navigation("BuildingSite");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b =>
{
b.Navigation("SewerObjects");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Client", b =>
{
b.Navigation("Projects");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Project", b =>
{
b.Navigation("BuildingSites");
});
modelBuilder.Entity("DaSaSo.Domain.Model.SewerObjects", b =>
{
b.Navigation("SewerDamages");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -1,109 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace DaSaSo.EntityFramework.Migrations
{
public partial class SewerDamageAdded : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "BuildingsiteBarier",
table: "SewerObjects",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<string>(
name: "Material",
table: "SewerObjects",
type: "text",
nullable: true);
migrationBuilder.AddColumn<bool>(
name: "PermitNeeded",
table: "SewerObjects",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "SewerActivated",
table: "SewerObjects",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "SewerCleaned",
table: "SewerObjects",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "WaterBarrier",
table: "SewerObjects",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.CreateTable(
name: "SewerDamages",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
SewerObjectId = table.Column<int>(type: "integer", nullable: true),
Distance = table.Column<decimal>(type: "numeric", nullable: false),
DamageType = table.Column<int>(type: "integer", nullable: false),
PreparationType = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_SewerDamages", x => x.Id);
table.ForeignKey(
name: "FK_SewerDamages_SewerObjects_SewerObjectId",
column: x => x.SewerObjectId,
principalTable: "SewerObjects",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "IX_SewerDamages_SewerObjectId",
table: "SewerDamages",
column: "SewerObjectId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "SewerDamages");
migrationBuilder.DropColumn(
name: "BuildingsiteBarier",
table: "SewerObjects");
migrationBuilder.DropColumn(
name: "Material",
table: "SewerObjects");
migrationBuilder.DropColumn(
name: "PermitNeeded",
table: "SewerObjects");
migrationBuilder.DropColumn(
name: "SewerActivated",
table: "SewerObjects");
migrationBuilder.DropColumn(
name: "SewerCleaned",
table: "SewerObjects");
migrationBuilder.DropColumn(
name: "WaterBarrier",
table: "SewerObjects");
}
}
}

View File

@@ -1,234 +0,0 @@
// <auto-generated />
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;
namespace DaSaSo.EntityFramework.Migrations
{
[DbContext(typeof(DaSaSoDbContext))]
[Migration("20210916135239_SewerObjectsAdded")]
partial class SewerObjectsAdded
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 63)
.HasAnnotation("ProductVersion", "6.0.0-preview.7.21378.4")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("BuildingSiteNumber")
.HasColumnType("text");
b.Property<string>("ContactPerson")
.HasColumnType("text");
b.Property<string>("Country")
.HasColumnType("text");
b.Property<int?>("ProjectId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("ProjectId");
b.ToTable("Buildingsites");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Client", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("Country")
.HasColumnType("text");
b.Property<string>("Firstname")
.HasColumnType("text");
b.Property<string>("LastName")
.HasColumnType("text");
b.Property<string>("Postcode")
.HasColumnType("text");
b.Property<string>("Street")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Clients");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Project", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int?>("ClientId")
.HasColumnType("integer");
b.Property<string>("Name")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("ClientId");
b.ToTable("Projects");
});
modelBuilder.Entity("DaSaSo.Domain.Model.SewerDamage", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int>("DamageType")
.HasColumnType("integer");
b.Property<decimal>("Distance")
.HasColumnType("numeric");
b.Property<int>("PreparationType")
.HasColumnType("integer");
b.Property<int?>("SewerObjectId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("SewerObjectId");
b.ToTable("SewerDamages");
});
modelBuilder.Entity("DaSaSo.Domain.Model.SewerObject", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int?>("BuildingSiteId")
.HasColumnType("integer");
b.Property<bool>("BuildingsiteBarier")
.HasColumnType("boolean");
b.Property<int>("DN")
.HasColumnType("integer");
b.Property<string>("Material")
.HasColumnType("text");
b.Property<string>("ObjektName")
.HasColumnType("text");
b.Property<bool>("PermitNeeded")
.HasColumnType("boolean");
b.Property<string>("PointFrom")
.HasColumnType("text");
b.Property<string>("PointTo")
.HasColumnType("text");
b.Property<bool>("SewerActivated")
.HasColumnType("boolean");
b.Property<bool>("SewerCleaned")
.HasColumnType("boolean");
b.Property<decimal>("SewerLength")
.HasColumnType("numeric");
b.Property<string>("StreetName")
.HasColumnType("text");
b.Property<bool>("WaterBarrier")
.HasColumnType("boolean");
b.HasKey("Id");
b.HasIndex("BuildingSiteId");
b.ToTable("SewerObjects");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b =>
{
b.HasOne("DaSaSo.Domain.Model.Project", "Project")
.WithMany("BuildingSites")
.HasForeignKey("ProjectId");
b.Navigation("Project");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Project", b =>
{
b.HasOne("DaSaSo.Domain.Model.Client", "Client")
.WithMany("Projects")
.HasForeignKey("ClientId");
b.Navigation("Client");
});
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.Navigation("BuildingSite");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b =>
{
b.Navigation("SewerObjects");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Client", b =>
{
b.Navigation("Projects");
});
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
}
}
}

View File

@@ -1,17 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace DaSaSo.EntityFramework.Migrations
{
public partial class SewerObjectsAdded : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
}
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}

View File

@@ -1,271 +0,0 @@
// <auto-generated />
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;
namespace DaSaSo.EntityFramework.Migrations
{
[DbContext(typeof(DaSaSoDbContext))]
[Migration("20210920062903_transfertoenum")]
partial class transfertoenum
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 63)
.HasAnnotation("ProductVersion", "6.0.0-preview.7.21378.4")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("BuildingSiteNumber")
.HasColumnType("text");
b.Property<string>("ContactPerson")
.HasColumnType("text");
b.Property<string>("Country")
.HasColumnType("text");
b.Property<int?>("ProjectId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("ProjectId");
b.ToTable("Buildingsites");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Client", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("Country")
.HasColumnType("text");
b.Property<string>("Firstname")
.HasColumnType("text");
b.Property<string>("LastName")
.HasColumnType("text");
b.Property<string>("Postcode")
.HasColumnType("text");
b.Property<string>("Street")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Clients");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Project", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int?>("ClientId")
.HasColumnType("integer");
b.Property<string>("Name")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("ClientId");
b.ToTable("Projects");
});
modelBuilder.Entity("DaSaSo.Domain.Model.SewerDamage", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int>("DamageType")
.HasColumnType("integer");
b.Property<decimal>("Distance")
.HasColumnType("numeric");
b.Property<int>("PreparationType")
.HasColumnType("integer");
b.Property<int?>("SewerObjectId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("SewerObjectId");
b.ToTable("SewerDamages");
});
modelBuilder.Entity("DaSaSo.Domain.Model.SewerObject", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int?>("BuildingSiteId")
.HasColumnType("integer");
b.Property<bool>("BuildingsiteBarier")
.HasColumnType("boolean");
b.Property<int>("DN")
.HasColumnType("integer");
b.Property<string>("Material")
.HasColumnType("text");
b.Property<string>("ObjektName")
.HasColumnType("text");
b.Property<bool>("PermitNeeded")
.HasColumnType("boolean");
b.Property<int?>("PunktObenId")
.HasColumnType("integer");
b.Property<int>("PunktObenType")
.HasColumnType("integer");
b.Property<int?>("PunktUntenId")
.HasColumnType("integer");
b.Property<int>("PunktUntenType")
.HasColumnType("integer");
b.Property<bool>("SewerActivated")
.HasColumnType("boolean");
b.Property<bool>("SewerCleaned")
.HasColumnType("boolean");
b.Property<decimal>("SewerLength")
.HasColumnType("numeric");
b.Property<string>("StreetName")
.HasColumnType("text");
b.Property<bool>("WaterBarrier")
.HasColumnType("boolean");
b.HasKey("Id");
b.HasIndex("BuildingSiteId");
b.HasIndex("PunktObenId");
b.HasIndex("PunktUntenId");
b.ToTable("SewerObjects");
});
modelBuilder.Entity("DaSaSo.Domain.Model.SewerPoint", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("Objektnummer")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("SewerPoint");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b =>
{
b.HasOne("DaSaSo.Domain.Model.Project", "Project")
.WithMany("BuildingSites")
.HasForeignKey("ProjectId");
b.Navigation("Project");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Project", b =>
{
b.HasOne("DaSaSo.Domain.Model.Client", "Client")
.WithMany("Projects")
.HasForeignKey("ClientId");
b.Navigation("Client");
});
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.SewerPoint", "PunktOben")
.WithMany()
.HasForeignKey("PunktObenId");
b.HasOne("DaSaSo.Domain.Model.SewerPoint", "PunktUnten")
.WithMany()
.HasForeignKey("PunktUntenId");
b.Navigation("BuildingSite");
b.Navigation("PunktOben");
b.Navigation("PunktUnten");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b =>
{
b.Navigation("SewerObjects");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Client", b =>
{
b.Navigation("Projects");
});
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
}
}
}

View File

@@ -1,134 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace DaSaSo.EntityFramework.Migrations
{
public partial class transfertoenum : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "PointFrom",
table: "SewerObjects");
migrationBuilder.DropColumn(
name: "PointTo",
table: "SewerObjects");
migrationBuilder.AddColumn<int>(
name: "PunktObenId",
table: "SewerObjects",
type: "integer",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "PunktObenType",
table: "SewerObjects",
type: "integer",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<int>(
name: "PunktUntenId",
table: "SewerObjects",
type: "integer",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "PunktUntenType",
table: "SewerObjects",
type: "integer",
nullable: false,
defaultValue: 0);
migrationBuilder.CreateTable(
name: "SewerPoint",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Objektnummer = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_SewerPoint", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_SewerObjects_PunktObenId",
table: "SewerObjects",
column: "PunktObenId");
migrationBuilder.CreateIndex(
name: "IX_SewerObjects_PunktUntenId",
table: "SewerObjects",
column: "PunktUntenId");
migrationBuilder.AddForeignKey(
name: "FK_SewerObjects_SewerPoint_PunktObenId",
table: "SewerObjects",
column: "PunktObenId",
principalTable: "SewerPoint",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_SewerObjects_SewerPoint_PunktUntenId",
table: "SewerObjects",
column: "PunktUntenId",
principalTable: "SewerPoint",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_SewerObjects_SewerPoint_PunktObenId",
table: "SewerObjects");
migrationBuilder.DropForeignKey(
name: "FK_SewerObjects_SewerPoint_PunktUntenId",
table: "SewerObjects");
migrationBuilder.DropTable(
name: "SewerPoint");
migrationBuilder.DropIndex(
name: "IX_SewerObjects_PunktObenId",
table: "SewerObjects");
migrationBuilder.DropIndex(
name: "IX_SewerObjects_PunktUntenId",
table: "SewerObjects");
migrationBuilder.DropColumn(
name: "PunktObenId",
table: "SewerObjects");
migrationBuilder.DropColumn(
name: "PunktObenType",
table: "SewerObjects");
migrationBuilder.DropColumn(
name: "PunktUntenId",
table: "SewerObjects");
migrationBuilder.DropColumn(
name: "PunktUntenType",
table: "SewerObjects");
migrationBuilder.AddColumn<string>(
name: "PointFrom",
table: "SewerObjects",
type: "text",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "PointTo",
table: "SewerObjects",
type: "text",
nullable: true);
}
}
}

View File

@@ -1,381 +0,0 @@
// <auto-generated />
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;
namespace DaSaSo.EntityFramework.Migrations
{
[DbContext(typeof(DaSaSoDbContext))]
[Migration("20210921145350_Lineradded")]
partial class Lineradded
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 63)
.HasAnnotation("ProductVersion", "6.0.0-preview.7.21378.4")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("BuildingSiteNumber")
.HasColumnType("text");
b.Property<string>("ContactPerson")
.HasColumnType("text");
b.Property<string>("Country")
.HasColumnType("text");
b.Property<int?>("ProjectId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("ProjectId");
b.ToTable("Buildingsites");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Client", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("Country")
.HasColumnType("text");
b.Property<string>("Firstname")
.HasColumnType("text");
b.Property<string>("LastName")
.HasColumnType("text");
b.Property<string>("Postcode")
.HasColumnType("text");
b.Property<string>("Street")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Clients");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Impregnation", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int>("DN")
.HasColumnType("integer");
b.Property<DateTime>("Date")
.HasColumnType("timestamp without time zone");
b.Property<bool>("IsAvaible")
.HasColumnType("boolean");
b.Property<string>("LinerNumber")
.HasColumnType("text");
b.Property<decimal>("Linerlength")
.HasColumnType("numeric");
b.Property<string>("Number")
.HasColumnType("text");
b.Property<decimal>("WallThickness")
.HasColumnType("numeric");
b.HasKey("Id");
b.ToTable("Impregnations");
});
modelBuilder.Entity("DaSaSo.Domain.Model.PipeLiner", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<bool>("CleanedHD")
.HasColumnType("boolean");
b.Property<bool>("CleanedMechanisch")
.HasColumnType("boolean");
b.Property<bool>("CleanedRoborter")
.HasColumnType("boolean");
b.Property<bool>("ClosedEnd")
.HasColumnType("boolean");
b.Property<DateTime>("Date")
.HasColumnType("timestamp without time zone");
b.Property<int?>("ImpregnationId")
.HasColumnType("integer");
b.Property<decimal>("InversionPressure")
.HasColumnType("numeric");
b.Property<decimal>("LinerLength")
.HasColumnType("numeric");
b.Property<string>("Operator")
.HasColumnType("text");
b.Property<bool>("PermitNeeded")
.HasColumnType("boolean");
b.Property<bool>("Preliner")
.HasColumnType("boolean");
b.Property<bool>("STVO")
.HasColumnType("boolean");
b.Property<decimal>("TemperaturAssembly")
.HasColumnType("numeric");
b.Property<decimal>("TemperaturStorage")
.HasColumnType("numeric");
b.Property<decimal>("TemperatureOutdoors")
.HasColumnType("numeric");
b.Property<decimal>("TemperatureSewer")
.HasColumnType("numeric");
b.Property<bool>("WaterBaried")
.HasColumnType("boolean");
b.Property<string>("Weather")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("ImpregnationId");
b.ToTable("PipeLiners");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Project", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int?>("ClientId")
.HasColumnType("integer");
b.Property<string>("Name")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("ClientId");
b.ToTable("Projects");
});
modelBuilder.Entity("DaSaSo.Domain.Model.SewerDamage", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int>("DamageType")
.HasColumnType("integer");
b.Property<decimal>("Distance")
.HasColumnType("numeric");
b.Property<int>("PreparationType")
.HasColumnType("integer");
b.Property<int?>("SewerObjectId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("SewerObjectId");
b.ToTable("SewerDamages");
});
modelBuilder.Entity("DaSaSo.Domain.Model.SewerObject", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int?>("BuildingSiteId")
.HasColumnType("integer");
b.Property<bool>("BuildingsiteBarier")
.HasColumnType("boolean");
b.Property<int>("DN")
.HasColumnType("integer");
b.Property<string>("Material")
.HasColumnType("text");
b.Property<string>("ObjektName")
.HasColumnType("text");
b.Property<bool>("PermitNeeded")
.HasColumnType("boolean");
b.Property<int?>("PunktObenId")
.HasColumnType("integer");
b.Property<int>("PunktObenType")
.HasColumnType("integer");
b.Property<int?>("PunktUntenId")
.HasColumnType("integer");
b.Property<int>("PunktUntenType")
.HasColumnType("integer");
b.Property<bool>("SewerActivated")
.HasColumnType("boolean");
b.Property<bool>("SewerCleaned")
.HasColumnType("boolean");
b.Property<decimal>("SewerLength")
.HasColumnType("numeric");
b.Property<string>("StreetName")
.HasColumnType("text");
b.Property<bool>("WaterBarrier")
.HasColumnType("boolean");
b.HasKey("Id");
b.HasIndex("BuildingSiteId");
b.HasIndex("PunktObenId");
b.HasIndex("PunktUntenId");
b.ToTable("SewerObjects");
});
modelBuilder.Entity("DaSaSo.Domain.Model.SewerPoint", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("Objektnummer")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("SewerPoint");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b =>
{
b.HasOne("DaSaSo.Domain.Model.Project", "Project")
.WithMany("BuildingSites")
.HasForeignKey("ProjectId");
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.Project", b =>
{
b.HasOne("DaSaSo.Domain.Model.Client", "Client")
.WithMany("Projects")
.HasForeignKey("ClientId");
b.Navigation("Client");
});
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.SewerPoint", "PunktOben")
.WithMany()
.HasForeignKey("PunktObenId");
b.HasOne("DaSaSo.Domain.Model.SewerPoint", "PunktUnten")
.WithMany()
.HasForeignKey("PunktUntenId");
b.Navigation("BuildingSite");
b.Navigation("PunktOben");
b.Navigation("PunktUnten");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b =>
{
b.Navigation("SewerObjects");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Client", b =>
{
b.Navigation("Projects");
});
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
}
}
}

View File

@@ -1,81 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace DaSaSo.EntityFramework.Migrations
{
public partial class Lineradded : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Impregnations",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
DN = table.Column<int>(type: "integer", nullable: false),
Number = table.Column<string>(type: "text", nullable: true),
Linerlength = table.Column<decimal>(type: "numeric", nullable: false),
IsAvaible = table.Column<bool>(type: "boolean", nullable: false),
Date = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
LinerNumber = table.Column<string>(type: "text", nullable: true),
WallThickness = table.Column<decimal>(type: "numeric", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Impregnations", x => x.Id);
});
migrationBuilder.CreateTable(
name: "PipeLiners",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
InversionPressure = table.Column<decimal>(type: "numeric", nullable: false),
ImpregnationId = table.Column<int>(type: "integer", nullable: true),
ClosedEnd = table.Column<bool>(type: "boolean", nullable: false),
Preliner = table.Column<bool>(type: "boolean", nullable: false),
TemperaturAssembly = table.Column<decimal>(type: "numeric", nullable: false),
TemperaturStorage = table.Column<decimal>(type: "numeric", nullable: false),
LinerLength = table.Column<decimal>(type: "numeric", nullable: false),
Operator = table.Column<string>(type: "text", nullable: true),
Date = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
TemperatureOutdoors = table.Column<decimal>(type: "numeric", nullable: false),
TemperatureSewer = table.Column<decimal>(type: "numeric", nullable: false),
Weather = table.Column<string>(type: "text", nullable: true),
CleanedHD = table.Column<bool>(type: "boolean", nullable: false),
CleanedMechanisch = table.Column<bool>(type: "boolean", nullable: false),
CleanedRoborter = table.Column<bool>(type: "boolean", nullable: false),
WaterBaried = table.Column<bool>(type: "boolean", nullable: false),
PermitNeeded = table.Column<bool>(type: "boolean", nullable: false),
STVO = table.Column<bool>(type: "boolean", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_PipeLiners", x => x.Id);
table.ForeignKey(
name: "FK_PipeLiners_Impregnations_ImpregnationId",
column: x => x.ImpregnationId,
principalTable: "Impregnations",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "IX_PipeLiners_ImpregnationId",
table: "PipeLiners",
column: "ImpregnationId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "PipeLiners");
migrationBuilder.DropTable(
name: "Impregnations");
}
}
}

View File

@@ -1,44 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace DaSaSo.EntityFramework.Migrations
{
public partial class LineraddedToSewer : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "PipeLinerId",
table: "SewerObjects",
type: "integer",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_SewerObjects_PipeLinerId",
table: "SewerObjects",
column: "PipeLinerId");
migrationBuilder.AddForeignKey(
name: "FK_SewerObjects_PipeLiners_PipeLinerId",
table: "SewerObjects",
column: "PipeLinerId",
principalTable: "PipeLiners",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_SewerObjects_PipeLiners_PipeLinerId",
table: "SewerObjects");
migrationBuilder.DropIndex(
name: "IX_SewerObjects_PipeLinerId",
table: "SewerObjects");
migrationBuilder.DropColumn(
name: "PipeLinerId",
table: "SewerObjects");
}
}
}

View File

@@ -1,118 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace DaSaSo.EntityFramework.Migrations
{
public partial class SewerPointsAdded : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_SewerObjects_SewerPoint_PunktObenId",
table: "SewerObjects");
migrationBuilder.DropForeignKey(
name: "FK_SewerObjects_SewerPoint_PunktUntenId",
table: "SewerObjects");
migrationBuilder.DropPrimaryKey(
name: "PK_SewerPoint",
table: "SewerPoint");
migrationBuilder.RenameTable(
name: "SewerPoint",
newName: "SewerPoints");
migrationBuilder.AlterColumn<DateTime>(
name: "Date",
table: "PipeLiners",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "Date",
table: "Impregnations",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AddPrimaryKey(
name: "PK_SewerPoints",
table: "SewerPoints",
column: "Id");
migrationBuilder.AddForeignKey(
name: "FK_SewerObjects_SewerPoints_PunktObenId",
table: "SewerObjects",
column: "PunktObenId",
principalTable: "SewerPoints",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_SewerObjects_SewerPoints_PunktUntenId",
table: "SewerObjects",
column: "PunktUntenId",
principalTable: "SewerPoints",
principalColumn: "Id");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_SewerObjects_SewerPoints_PunktObenId",
table: "SewerObjects");
migrationBuilder.DropForeignKey(
name: "FK_SewerObjects_SewerPoints_PunktUntenId",
table: "SewerObjects");
migrationBuilder.DropPrimaryKey(
name: "PK_SewerPoints",
table: "SewerPoints");
migrationBuilder.RenameTable(
name: "SewerPoints",
newName: "SewerPoint");
migrationBuilder.AlterColumn<DateTime>(
name: "Date",
table: "PipeLiners",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "Date",
table: "Impregnations",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AddPrimaryKey(
name: "PK_SewerPoint",
table: "SewerPoint",
column: "Id");
migrationBuilder.AddForeignKey(
name: "FK_SewerObjects_SewerPoint_PunktObenId",
table: "SewerObjects",
column: "PunktObenId",
principalTable: "SewerPoint",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_SewerObjects_SewerPoint_PunktUntenId",
table: "SewerObjects",
column: "PunktUntenId",
principalTable: "SewerPoint",
principalColumn: "Id");
}
}
}

View File

@@ -1,25 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace DaSaSo.EntityFramework.Migrations
{
public partial class ProjectNumberAdded : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "Projektnummer",
table: "Projects",
type: "text",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Projektnummer",
table: "Projects");
}
}
}

View File

@@ -12,8 +12,8 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace DaSaSo.EntityFramework.Migrations namespace DaSaSo.EntityFramework.Migrations
{ {
[DbContext(typeof(DaSaSoDbContext))] [DbContext(typeof(DaSaSoDbContext))]
[Migration("20210928153745_ProjectNumberAdded")] [Migration("20211009183922_Initial")]
partial class ProjectNumberAdded partial class Initial
{ {
protected override void BuildTargetModel(ModelBuilder modelBuilder) protected override void BuildTargetModel(ModelBuilder modelBuilder)
{ {
@@ -121,15 +121,6 @@ namespace DaSaSo.EntityFramework.Migrations
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<bool>("CleanedHD")
.HasColumnType("boolean");
b.Property<bool>("CleanedMechanisch")
.HasColumnType("boolean");
b.Property<bool>("CleanedRoborter")
.HasColumnType("boolean");
b.Property<bool>("ClosedEnd") b.Property<bool>("ClosedEnd")
.HasColumnType("boolean"); .HasColumnType("boolean");
@@ -148,14 +139,11 @@ namespace DaSaSo.EntityFramework.Migrations
b.Property<string>("Operator") b.Property<string>("Operator")
.HasColumnType("text"); .HasColumnType("text");
b.Property<bool>("PermitNeeded")
.HasColumnType("boolean");
b.Property<bool>("Preliner") b.Property<bool>("Preliner")
.HasColumnType("boolean"); .HasColumnType("boolean");
b.Property<bool>("STVO") b.Property<int>("PreparationType")
.HasColumnType("boolean"); .HasColumnType("integer");
b.Property<decimal>("TemperaturAssembly") b.Property<decimal>("TemperaturAssembly")
.HasColumnType("numeric"); .HasColumnType("numeric");
@@ -169,9 +157,6 @@ namespace DaSaSo.EntityFramework.Migrations
b.Property<decimal>("TemperatureSewer") b.Property<decimal>("TemperatureSewer")
.HasColumnType("numeric"); .HasColumnType("numeric");
b.Property<bool>("WaterBaried")
.HasColumnType("boolean");
b.Property<string>("Weather") b.Property<string>("Weather")
.HasColumnType("text"); .HasColumnType("text");
@@ -220,9 +205,6 @@ namespace DaSaSo.EntityFramework.Migrations
b.Property<decimal>("Distance") b.Property<decimal>("Distance")
.HasColumnType("numeric"); .HasColumnType("numeric");
b.Property<int>("PreparationType")
.HasColumnType("integer");
b.Property<int?>("SewerObjectId") b.Property<int?>("SewerObjectId")
.HasColumnType("integer"); .HasColumnType("integer");
@@ -250,6 +232,9 @@ namespace DaSaSo.EntityFramework.Migrations
b.Property<int>("DN") b.Property<int>("DN")
.HasColumnType("integer"); .HasColumnType("integer");
b.Property<string>("Hausnummer")
.HasColumnType("text");
b.Property<string>("Material") b.Property<string>("Material")
.HasColumnType("text"); .HasColumnType("text");
@@ -274,6 +259,9 @@ namespace DaSaSo.EntityFramework.Migrations
b.Property<int>("PunktUntenType") b.Property<int>("PunktUntenType")
.HasColumnType("integer"); .HasColumnType("integer");
b.Property<string>("SanNummer")
.HasColumnType("text");
b.Property<bool>("SewerActivated") b.Property<bool>("SewerActivated")
.HasColumnType("boolean"); .HasColumnType("boolean");

View File

@@ -0,0 +1,271 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace DaSaSo.EntityFramework.Migrations
{
public partial class Initial : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Clients",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Firstname = table.Column<string>(type: "text", nullable: true),
LastName = table.Column<string>(type: "text", nullable: true),
Country = table.Column<string>(type: "text", nullable: true),
Street = table.Column<string>(type: "text", nullable: true),
Postcode = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Clients", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Impregnations",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
DN = table.Column<int>(type: "integer", nullable: false),
Number = table.Column<string>(type: "text", nullable: true),
Linerlength = table.Column<decimal>(type: "numeric", nullable: false),
IsAvaible = table.Column<bool>(type: "boolean", nullable: false),
Date = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
LinerNumber = table.Column<string>(type: "text", nullable: true),
WallThickness = table.Column<decimal>(type: "numeric", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Impregnations", x => x.Id);
});
migrationBuilder.CreateTable(
name: "SewerPoints",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Objektnummer = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_SewerPoints", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Projects",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Name = table.Column<string>(type: "text", nullable: true),
Projektnummer = table.Column<string>(type: "text", nullable: true),
ClientId = table.Column<int>(type: "integer", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Projects", x => x.Id);
table.ForeignKey(
name: "FK_Projects_Clients_ClientId",
column: x => x.ClientId,
principalTable: "Clients",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "PipeLiners",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
InversionPressure = table.Column<decimal>(type: "numeric", nullable: false),
ImpregnationId = table.Column<int>(type: "integer", nullable: true),
ClosedEnd = table.Column<bool>(type: "boolean", nullable: false),
Preliner = table.Column<bool>(type: "boolean", nullable: false),
TemperaturAssembly = table.Column<decimal>(type: "numeric", nullable: false),
TemperaturStorage = table.Column<decimal>(type: "numeric", nullable: false),
LinerLength = table.Column<decimal>(type: "numeric", nullable: false),
Operator = table.Column<string>(type: "text", nullable: true),
Date = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
TemperatureOutdoors = table.Column<decimal>(type: "numeric", nullable: false),
TemperatureSewer = table.Column<decimal>(type: "numeric", nullable: false),
Weather = table.Column<string>(type: "text", nullable: true),
PreparationType = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_PipeLiners", x => x.Id);
table.ForeignKey(
name: "FK_PipeLiners_Impregnations_ImpregnationId",
column: x => x.ImpregnationId,
principalTable: "Impregnations",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "Buildingsites",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
ProjectId = table.Column<int>(type: "integer", nullable: true),
BuildingSiteNumber = table.Column<string>(type: "text", nullable: true),
Country = table.Column<string>(type: "text", nullable: true),
ContactPerson = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Buildingsites", x => x.Id);
table.ForeignKey(
name: "FK_Buildingsites_Projects_ProjectId",
column: x => x.ProjectId,
principalTable: "Projects",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "SewerObjects",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
BuildingSiteId = table.Column<int>(type: "integer", nullable: true),
SanNummer = table.Column<string>(type: "text", nullable: true),
StreetName = table.Column<string>(type: "text", nullable: true),
Hausnummer = table.Column<string>(type: "text", nullable: true),
ObjektName = table.Column<string>(type: "text", nullable: true),
PunktObenId = table.Column<int>(type: "integer", nullable: true),
PunktObenType = table.Column<int>(type: "integer", nullable: false),
PunktUntenId = table.Column<int>(type: "integer", nullable: true),
PunktUntenType = table.Column<int>(type: "integer", nullable: false),
Material = table.Column<string>(type: "text", nullable: true),
DN = table.Column<int>(type: "integer", nullable: false),
SewerLength = table.Column<decimal>(type: "numeric", nullable: false),
SewerActivated = table.Column<bool>(type: "boolean", nullable: false),
SewerCleaned = table.Column<bool>(type: "boolean", nullable: false),
WaterBarrier = table.Column<bool>(type: "boolean", nullable: false),
PermitNeeded = table.Column<bool>(type: "boolean", nullable: false),
BuildingsiteBarier = table.Column<bool>(type: "boolean", nullable: false),
PipeLinerId = table.Column<int>(type: "integer", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_SewerObjects", x => x.Id);
table.ForeignKey(
name: "FK_SewerObjects_Buildingsites_BuildingSiteId",
column: x => x.BuildingSiteId,
principalTable: "Buildingsites",
principalColumn: "Id");
table.ForeignKey(
name: "FK_SewerObjects_PipeLiners_PipeLinerId",
column: x => x.PipeLinerId,
principalTable: "PipeLiners",
principalColumn: "Id");
table.ForeignKey(
name: "FK_SewerObjects_SewerPoints_PunktObenId",
column: x => x.PunktObenId,
principalTable: "SewerPoints",
principalColumn: "Id");
table.ForeignKey(
name: "FK_SewerObjects_SewerPoints_PunktUntenId",
column: x => x.PunktUntenId,
principalTable: "SewerPoints",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "SewerDamages",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
SewerObjectId = table.Column<int>(type: "integer", nullable: true),
Distance = table.Column<decimal>(type: "numeric", nullable: false),
DamageType = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_SewerDamages", x => x.Id);
table.ForeignKey(
name: "FK_SewerDamages_SewerObjects_SewerObjectId",
column: x => x.SewerObjectId,
principalTable: "SewerObjects",
principalColumn: "Id");
});
migrationBuilder.CreateIndex(
name: "IX_Buildingsites_ProjectId",
table: "Buildingsites",
column: "ProjectId");
migrationBuilder.CreateIndex(
name: "IX_PipeLiners_ImpregnationId",
table: "PipeLiners",
column: "ImpregnationId");
migrationBuilder.CreateIndex(
name: "IX_Projects_ClientId",
table: "Projects",
column: "ClientId");
migrationBuilder.CreateIndex(
name: "IX_SewerDamages_SewerObjectId",
table: "SewerDamages",
column: "SewerObjectId");
migrationBuilder.CreateIndex(
name: "IX_SewerObjects_BuildingSiteId",
table: "SewerObjects",
column: "BuildingSiteId");
migrationBuilder.CreateIndex(
name: "IX_SewerObjects_PipeLinerId",
table: "SewerObjects",
column: "PipeLinerId");
migrationBuilder.CreateIndex(
name: "IX_SewerObjects_PunktObenId",
table: "SewerObjects",
column: "PunktObenId");
migrationBuilder.CreateIndex(
name: "IX_SewerObjects_PunktUntenId",
table: "SewerObjects",
column: "PunktUntenId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "SewerDamages");
migrationBuilder.DropTable(
name: "SewerObjects");
migrationBuilder.DropTable(
name: "Buildingsites");
migrationBuilder.DropTable(
name: "PipeLiners");
migrationBuilder.DropTable(
name: "SewerPoints");
migrationBuilder.DropTable(
name: "Projects");
migrationBuilder.DropTable(
name: "Impregnations");
migrationBuilder.DropTable(
name: "Clients");
}
}
}

View File

@@ -12,8 +12,8 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace DaSaSo.EntityFramework.Migrations namespace DaSaSo.EntityFramework.Migrations
{ {
[DbContext(typeof(DaSaSoDbContext))] [DbContext(typeof(DaSaSoDbContext))]
[Migration("20210928140403_SewerPointsAdded")] [Migration("20211101090936_RemoveClientAsDomain")]
partial class SewerPointsAdded partial class RemoveClientAsDomain
{ {
protected override void BuildTargetModel(ModelBuilder modelBuilder) protected override void BuildTargetModel(ModelBuilder modelBuilder)
{ {
@@ -35,6 +35,9 @@ namespace DaSaSo.EntityFramework.Migrations
b.Property<string>("BuildingSiteNumber") b.Property<string>("BuildingSiteNumber")
.HasColumnType("text"); .HasColumnType("text");
b.Property<int?>("ClientId")
.HasColumnType("integer");
b.Property<string>("ContactPerson") b.Property<string>("ContactPerson")
.HasColumnType("text"); .HasColumnType("text");
@@ -46,6 +49,8 @@ namespace DaSaSo.EntityFramework.Migrations
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("ClientId");
b.HasIndex("ProjectId"); b.HasIndex("ProjectId");
b.ToTable("Buildingsites"); b.ToTable("Buildingsites");
@@ -90,8 +95,8 @@ namespace DaSaSo.EntityFramework.Migrations
b.Property<int>("DN") b.Property<int>("DN")
.HasColumnType("integer"); .HasColumnType("integer");
b.Property<DateTime>("Date") b.Property<DateOnly>("Date")
.HasColumnType("timestamp with time zone"); .HasColumnType("date");
b.Property<bool>("IsAvaible") b.Property<bool>("IsAvaible")
.HasColumnType("boolean"); .HasColumnType("boolean");
@@ -121,20 +126,11 @@ namespace DaSaSo.EntityFramework.Migrations
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<bool>("CleanedHD")
.HasColumnType("boolean");
b.Property<bool>("CleanedMechanisch")
.HasColumnType("boolean");
b.Property<bool>("CleanedRoborter")
.HasColumnType("boolean");
b.Property<bool>("ClosedEnd") b.Property<bool>("ClosedEnd")
.HasColumnType("boolean"); .HasColumnType("boolean");
b.Property<DateTime>("Date") b.Property<DateOnly>("Date")
.HasColumnType("timestamp with time zone"); .HasColumnType("date");
b.Property<int?>("ImpregnationId") b.Property<int?>("ImpregnationId")
.HasColumnType("integer"); .HasColumnType("integer");
@@ -148,14 +144,11 @@ namespace DaSaSo.EntityFramework.Migrations
b.Property<string>("Operator") b.Property<string>("Operator")
.HasColumnType("text"); .HasColumnType("text");
b.Property<bool>("PermitNeeded")
.HasColumnType("boolean");
b.Property<bool>("Preliner") b.Property<bool>("Preliner")
.HasColumnType("boolean"); .HasColumnType("boolean");
b.Property<bool>("STVO") b.Property<int>("PreparationType")
.HasColumnType("boolean"); .HasColumnType("integer");
b.Property<decimal>("TemperaturAssembly") b.Property<decimal>("TemperaturAssembly")
.HasColumnType("numeric"); .HasColumnType("numeric");
@@ -169,9 +162,6 @@ namespace DaSaSo.EntityFramework.Migrations
b.Property<decimal>("TemperatureSewer") b.Property<decimal>("TemperatureSewer")
.HasColumnType("numeric"); .HasColumnType("numeric");
b.Property<bool>("WaterBaried")
.HasColumnType("boolean");
b.Property<string>("Weather") b.Property<string>("Weather")
.HasColumnType("text"); .HasColumnType("text");
@@ -190,15 +180,13 @@ namespace DaSaSo.EntityFramework.Migrations
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int?>("ClientId")
.HasColumnType("integer");
b.Property<string>("Name") b.Property<string>("Name")
.HasColumnType("text"); .HasColumnType("text");
b.HasKey("Id"); b.Property<string>("Projektnummer")
.HasColumnType("text");
b.HasIndex("ClientId"); b.HasKey("Id");
b.ToTable("Projects"); b.ToTable("Projects");
}); });
@@ -217,9 +205,6 @@ namespace DaSaSo.EntityFramework.Migrations
b.Property<decimal>("Distance") b.Property<decimal>("Distance")
.HasColumnType("numeric"); .HasColumnType("numeric");
b.Property<int>("PreparationType")
.HasColumnType("integer");
b.Property<int?>("SewerObjectId") b.Property<int?>("SewerObjectId")
.HasColumnType("integer"); .HasColumnType("integer");
@@ -247,6 +232,9 @@ namespace DaSaSo.EntityFramework.Migrations
b.Property<int>("DN") b.Property<int>("DN")
.HasColumnType("integer"); .HasColumnType("integer");
b.Property<string>("Hausnummer")
.HasColumnType("text");
b.Property<string>("Material") b.Property<string>("Material")
.HasColumnType("text"); .HasColumnType("text");
@@ -271,6 +259,9 @@ namespace DaSaSo.EntityFramework.Migrations
b.Property<int>("PunktUntenType") b.Property<int>("PunktUntenType")
.HasColumnType("integer"); .HasColumnType("integer");
b.Property<string>("SanNummer")
.HasColumnType("text");
b.Property<bool>("SewerActivated") b.Property<bool>("SewerActivated")
.HasColumnType("boolean"); .HasColumnType("boolean");
@@ -317,10 +308,16 @@ namespace DaSaSo.EntityFramework.Migrations
modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b => modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b =>
{ {
b.HasOne("DaSaSo.Domain.Model.Client", "Client")
.WithMany()
.HasForeignKey("ClientId");
b.HasOne("DaSaSo.Domain.Model.Project", "Project") b.HasOne("DaSaSo.Domain.Model.Project", "Project")
.WithMany("BuildingSites") .WithMany("BuildingSites")
.HasForeignKey("ProjectId"); .HasForeignKey("ProjectId");
b.Navigation("Client");
b.Navigation("Project"); b.Navigation("Project");
}); });
@@ -333,15 +330,6 @@ namespace DaSaSo.EntityFramework.Migrations
b.Navigation("Impregnation"); b.Navigation("Impregnation");
}); });
modelBuilder.Entity("DaSaSo.Domain.Model.Project", b =>
{
b.HasOne("DaSaSo.Domain.Model.Client", "Client")
.WithMany("Projects")
.HasForeignKey("ClientId");
b.Navigation("Client");
});
modelBuilder.Entity("DaSaSo.Domain.Model.SewerDamage", b => modelBuilder.Entity("DaSaSo.Domain.Model.SewerDamage", b =>
{ {
b.HasOne("DaSaSo.Domain.Model.SewerObject", "SewerObject") b.HasOne("DaSaSo.Domain.Model.SewerObject", "SewerObject")
@@ -383,11 +371,6 @@ namespace DaSaSo.EntityFramework.Migrations
b.Navigation("SewerObjects"); b.Navigation("SewerObjects");
}); });
modelBuilder.Entity("DaSaSo.Domain.Model.Client", b =>
{
b.Navigation("Projects");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Project", b => modelBuilder.Entity("DaSaSo.Domain.Model.Project", b =>
{ {
b.Navigation("BuildingSites"); b.Navigation("BuildingSites");

View File

@@ -0,0 +1,92 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace DaSaSo.EntityFramework.Migrations
{
public partial class RemoveClientAsDomain : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Projects_Clients_ClientId",
table: "Projects");
migrationBuilder.DropIndex(
name: "IX_Projects_ClientId",
table: "Projects");
migrationBuilder.DropColumn(
name: "ClientId",
table: "Projects");
migrationBuilder.AlterColumn<DateOnly>(
name: "Date",
table: "Impregnations",
type: "date",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AddColumn<int>(
name: "ClientId",
table: "Buildingsites",
type: "integer",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_Buildingsites_ClientId",
table: "Buildingsites",
column: "ClientId");
migrationBuilder.AddForeignKey(
name: "FK_Buildingsites_Clients_ClientId",
table: "Buildingsites",
column: "ClientId",
principalTable: "Clients",
principalColumn: "Id");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Buildingsites_Clients_ClientId",
table: "Buildingsites");
migrationBuilder.DropIndex(
name: "IX_Buildingsites_ClientId",
table: "Buildingsites");
migrationBuilder.DropColumn(
name: "ClientId",
table: "Buildingsites");
migrationBuilder.AddColumn<int>(
name: "ClientId",
table: "Projects",
type: "integer",
nullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "Date",
table: "Impregnations",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateOnly),
oldType: "date");
migrationBuilder.CreateIndex(
name: "IX_Projects_ClientId",
table: "Projects",
column: "ClientId");
migrationBuilder.AddForeignKey(
name: "FK_Projects_Clients_ClientId",
table: "Projects",
column: "ClientId",
principalTable: "Clients",
principalColumn: "Id");
}
}
}

View File

@@ -7,30 +7,37 @@ using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace DaSaSo.EntityFramework.Migrations namespace DaSaSo.EntityFramework.Migrations
{ {
[DbContext(typeof(DaSaSoDbContext))] [DbContext(typeof(DaSaSoDbContext))]
[Migration("20210921145447_LineraddedToSewer")] [Migration("20220330120614_PhotoDocumentation_Added")]
partial class LineraddedToSewer partial class PhotoDocumentation_Added
{ {
protected override void BuildTargetModel(ModelBuilder modelBuilder) protected override void BuildTargetModel(ModelBuilder modelBuilder)
{ {
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 63) .HasAnnotation("ProductVersion", "6.0.0")
.HasAnnotation("ProductVersion", "6.0.0-preview.7.21378.4") .HasAnnotation("Relational:MaxIdentifierLength", 63);
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b => modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("integer") .HasColumnType("integer");
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("BuildingSiteNumber") b.Property<string>("BuildingSiteNumber")
.HasColumnType("text"); .HasColumnType("text");
b.Property<int?>("ClientId")
.HasColumnType("integer");
b.Property<string>("ContactPerson") b.Property<string>("ContactPerson")
.HasColumnType("text"); .HasColumnType("text");
@@ -42,6 +49,8 @@ namespace DaSaSo.EntityFramework.Migrations
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("ClientId");
b.HasIndex("ProjectId"); b.HasIndex("ProjectId");
b.ToTable("Buildingsites"); b.ToTable("Buildingsites");
@@ -51,8 +60,9 @@ namespace DaSaSo.EntityFramework.Migrations
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("integer") .HasColumnType("integer");
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Country") b.Property<string>("Country")
.HasColumnType("text"); .HasColumnType("text");
@@ -78,14 +88,15 @@ namespace DaSaSo.EntityFramework.Migrations
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("integer") .HasColumnType("integer");
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int>("DN") b.Property<int>("DN")
.HasColumnType("integer"); .HasColumnType("integer");
b.Property<DateTime>("Date") b.Property<DateOnly>("Date")
.HasColumnType("timestamp without time zone"); .HasColumnType("date");
b.Property<bool>("IsAvaible") b.Property<bool>("IsAvaible")
.HasColumnType("boolean"); .HasColumnType("boolean");
@@ -107,27 +118,38 @@ namespace DaSaSo.EntityFramework.Migrations
b.ToTable("Impregnations"); b.ToTable("Impregnations");
}); });
modelBuilder.Entity("DaSaSo.Domain.Model.PhotoDocumentation", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Description")
.HasColumnType("text");
b.Property<string>("PicturePath")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("PhotoDocumentation");
});
modelBuilder.Entity("DaSaSo.Domain.Model.PipeLiner", b => modelBuilder.Entity("DaSaSo.Domain.Model.PipeLiner", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("integer") .HasColumnType("integer");
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<bool>("CleanedHD") NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
.HasColumnType("boolean");
b.Property<bool>("CleanedMechanisch")
.HasColumnType("boolean");
b.Property<bool>("CleanedRoborter")
.HasColumnType("boolean");
b.Property<bool>("ClosedEnd") b.Property<bool>("ClosedEnd")
.HasColumnType("boolean"); .HasColumnType("boolean");
b.Property<DateTime>("Date") b.Property<DateOnly>("Date")
.HasColumnType("timestamp without time zone"); .HasColumnType("date");
b.Property<int?>("ImpregnationId") b.Property<int?>("ImpregnationId")
.HasColumnType("integer"); .HasColumnType("integer");
@@ -141,14 +163,11 @@ namespace DaSaSo.EntityFramework.Migrations
b.Property<string>("Operator") b.Property<string>("Operator")
.HasColumnType("text"); .HasColumnType("text");
b.Property<bool>("PermitNeeded")
.HasColumnType("boolean");
b.Property<bool>("Preliner") b.Property<bool>("Preliner")
.HasColumnType("boolean"); .HasColumnType("boolean");
b.Property<bool>("STVO") b.Property<int>("PreparationType")
.HasColumnType("boolean"); .HasColumnType("integer");
b.Property<decimal>("TemperaturAssembly") b.Property<decimal>("TemperaturAssembly")
.HasColumnType("numeric"); .HasColumnType("numeric");
@@ -162,9 +181,6 @@ namespace DaSaSo.EntityFramework.Migrations
b.Property<decimal>("TemperatureSewer") b.Property<decimal>("TemperatureSewer")
.HasColumnType("numeric"); .HasColumnType("numeric");
b.Property<bool>("WaterBaried")
.HasColumnType("boolean");
b.Property<string>("Weather") b.Property<string>("Weather")
.HasColumnType("text"); .HasColumnType("text");
@@ -179,18 +195,17 @@ namespace DaSaSo.EntityFramework.Migrations
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int?>("ClientId")
.HasColumnType("integer"); .HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Name") b.Property<string>("Name")
.HasColumnType("text"); .HasColumnType("text");
b.HasKey("Id"); b.Property<string>("Projektnummer")
.HasColumnType("text");
b.HasIndex("ClientId"); b.HasKey("Id");
b.ToTable("Projects"); b.ToTable("Projects");
}); });
@@ -199,8 +214,9 @@ namespace DaSaSo.EntityFramework.Migrations
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("integer") .HasColumnType("integer");
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int>("DamageType") b.Property<int>("DamageType")
.HasColumnType("integer"); .HasColumnType("integer");
@@ -208,9 +224,6 @@ namespace DaSaSo.EntityFramework.Migrations
b.Property<decimal>("Distance") b.Property<decimal>("Distance")
.HasColumnType("numeric"); .HasColumnType("numeric");
b.Property<int>("PreparationType")
.HasColumnType("integer");
b.Property<int?>("SewerObjectId") b.Property<int?>("SewerObjectId")
.HasColumnType("integer"); .HasColumnType("integer");
@@ -225,8 +238,9 @@ namespace DaSaSo.EntityFramework.Migrations
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("integer") .HasColumnType("integer");
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int?>("BuildingSiteId") b.Property<int?>("BuildingSiteId")
.HasColumnType("integer"); .HasColumnType("integer");
@@ -237,6 +251,9 @@ namespace DaSaSo.EntityFramework.Migrations
b.Property<int>("DN") b.Property<int>("DN")
.HasColumnType("integer"); .HasColumnType("integer");
b.Property<string>("Hausnummer")
.HasColumnType("text");
b.Property<string>("Material") b.Property<string>("Material")
.HasColumnType("text"); .HasColumnType("text");
@@ -261,6 +278,9 @@ namespace DaSaSo.EntityFramework.Migrations
b.Property<int>("PunktUntenType") b.Property<int>("PunktUntenType")
.HasColumnType("integer"); .HasColumnType("integer");
b.Property<string>("SanNummer")
.HasColumnType("text");
b.Property<bool>("SewerActivated") b.Property<bool>("SewerActivated")
.HasColumnType("boolean"); .HasColumnType("boolean");
@@ -293,23 +313,30 @@ namespace DaSaSo.EntityFramework.Migrations
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("integer") .HasColumnType("integer");
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Objektnummer") b.Property<string>("Objektnummer")
.HasColumnType("text"); .HasColumnType("text");
b.HasKey("Id"); b.HasKey("Id");
b.ToTable("SewerPoint"); b.ToTable("SewerPoints");
}); });
modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b => modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b =>
{ {
b.HasOne("DaSaSo.Domain.Model.Client", "Client")
.WithMany()
.HasForeignKey("ClientId");
b.HasOne("DaSaSo.Domain.Model.Project", "Project") b.HasOne("DaSaSo.Domain.Model.Project", "Project")
.WithMany("BuildingSites") .WithMany("BuildingSites")
.HasForeignKey("ProjectId"); .HasForeignKey("ProjectId");
b.Navigation("Client");
b.Navigation("Project"); b.Navigation("Project");
}); });
@@ -322,15 +349,6 @@ namespace DaSaSo.EntityFramework.Migrations
b.Navigation("Impregnation"); b.Navigation("Impregnation");
}); });
modelBuilder.Entity("DaSaSo.Domain.Model.Project", b =>
{
b.HasOne("DaSaSo.Domain.Model.Client", "Client")
.WithMany("Projects")
.HasForeignKey("ClientId");
b.Navigation("Client");
});
modelBuilder.Entity("DaSaSo.Domain.Model.SewerDamage", b => modelBuilder.Entity("DaSaSo.Domain.Model.SewerDamage", b =>
{ {
b.HasOne("DaSaSo.Domain.Model.SewerObject", "SewerObject") b.HasOne("DaSaSo.Domain.Model.SewerObject", "SewerObject")
@@ -372,11 +390,6 @@ namespace DaSaSo.EntityFramework.Migrations
b.Navigation("SewerObjects"); b.Navigation("SewerObjects");
}); });
modelBuilder.Entity("DaSaSo.Domain.Model.Client", b =>
{
b.Navigation("Projects");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Project", b => modelBuilder.Entity("DaSaSo.Domain.Model.Project", b =>
{ {
b.Navigation("BuildingSites"); b.Navigation("BuildingSites");

View File

@@ -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<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
PicturePath = table.Column<string>(type: "text", nullable: true),
Description = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_PhotoDocumentation", x => x.Id);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "PhotoDocumentation");
}
}
}

View File

@@ -17,7 +17,7 @@ namespace DaSaSo.EntityFramework.Migrations
{ {
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder modelBuilder
.HasAnnotation("ProductVersion", "6.0.0-rc.1.21452.10") .HasAnnotation("ProductVersion", "6.0.0")
.HasAnnotation("Relational:MaxIdentifierLength", 63); .HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
@@ -33,6 +33,9 @@ namespace DaSaSo.EntityFramework.Migrations
b.Property<string>("BuildingSiteNumber") b.Property<string>("BuildingSiteNumber")
.HasColumnType("text"); .HasColumnType("text");
b.Property<int?>("ClientId")
.HasColumnType("integer");
b.Property<string>("ContactPerson") b.Property<string>("ContactPerson")
.HasColumnType("text"); .HasColumnType("text");
@@ -44,6 +47,8 @@ namespace DaSaSo.EntityFramework.Migrations
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("ClientId");
b.HasIndex("ProjectId"); b.HasIndex("ProjectId");
b.ToTable("Buildingsites"); b.ToTable("Buildingsites");
@@ -88,8 +93,8 @@ namespace DaSaSo.EntityFramework.Migrations
b.Property<int>("DN") b.Property<int>("DN")
.HasColumnType("integer"); .HasColumnType("integer");
b.Property<DateTime>("Date") b.Property<DateOnly>("Date")
.HasColumnType("timestamp with time zone"); .HasColumnType("date");
b.Property<bool>("IsAvaible") b.Property<bool>("IsAvaible")
.HasColumnType("boolean"); .HasColumnType("boolean");
@@ -111,6 +116,25 @@ namespace DaSaSo.EntityFramework.Migrations
b.ToTable("Impregnations"); b.ToTable("Impregnations");
}); });
modelBuilder.Entity("DaSaSo.Domain.Model.PhotoDocumentation", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Description")
.HasColumnType("text");
b.Property<string>("PicturePath")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("PhotoDocumentation");
});
modelBuilder.Entity("DaSaSo.Domain.Model.PipeLiner", b => modelBuilder.Entity("DaSaSo.Domain.Model.PipeLiner", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
@@ -119,20 +143,11 @@ namespace DaSaSo.EntityFramework.Migrations
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<bool>("CleanedHD")
.HasColumnType("boolean");
b.Property<bool>("CleanedMechanisch")
.HasColumnType("boolean");
b.Property<bool>("CleanedRoborter")
.HasColumnType("boolean");
b.Property<bool>("ClosedEnd") b.Property<bool>("ClosedEnd")
.HasColumnType("boolean"); .HasColumnType("boolean");
b.Property<DateTime>("Date") b.Property<DateOnly>("Date")
.HasColumnType("timestamp with time zone"); .HasColumnType("date");
b.Property<int?>("ImpregnationId") b.Property<int?>("ImpregnationId")
.HasColumnType("integer"); .HasColumnType("integer");
@@ -146,14 +161,11 @@ namespace DaSaSo.EntityFramework.Migrations
b.Property<string>("Operator") b.Property<string>("Operator")
.HasColumnType("text"); .HasColumnType("text");
b.Property<bool>("PermitNeeded")
.HasColumnType("boolean");
b.Property<bool>("Preliner") b.Property<bool>("Preliner")
.HasColumnType("boolean"); .HasColumnType("boolean");
b.Property<bool>("STVO") b.Property<int>("PreparationType")
.HasColumnType("boolean"); .HasColumnType("integer");
b.Property<decimal>("TemperaturAssembly") b.Property<decimal>("TemperaturAssembly")
.HasColumnType("numeric"); .HasColumnType("numeric");
@@ -167,9 +179,6 @@ namespace DaSaSo.EntityFramework.Migrations
b.Property<decimal>("TemperatureSewer") b.Property<decimal>("TemperatureSewer")
.HasColumnType("numeric"); .HasColumnType("numeric");
b.Property<bool>("WaterBaried")
.HasColumnType("boolean");
b.Property<string>("Weather") b.Property<string>("Weather")
.HasColumnType("text"); .HasColumnType("text");
@@ -188,9 +197,6 @@ namespace DaSaSo.EntityFramework.Migrations
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int?>("ClientId")
.HasColumnType("integer");
b.Property<string>("Name") b.Property<string>("Name")
.HasColumnType("text"); .HasColumnType("text");
@@ -199,8 +205,6 @@ namespace DaSaSo.EntityFramework.Migrations
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("ClientId");
b.ToTable("Projects"); b.ToTable("Projects");
}); });
@@ -218,9 +222,6 @@ namespace DaSaSo.EntityFramework.Migrations
b.Property<decimal>("Distance") b.Property<decimal>("Distance")
.HasColumnType("numeric"); .HasColumnType("numeric");
b.Property<int>("PreparationType")
.HasColumnType("integer");
b.Property<int?>("SewerObjectId") b.Property<int?>("SewerObjectId")
.HasColumnType("integer"); .HasColumnType("integer");
@@ -248,6 +249,9 @@ namespace DaSaSo.EntityFramework.Migrations
b.Property<int>("DN") b.Property<int>("DN")
.HasColumnType("integer"); .HasColumnType("integer");
b.Property<string>("Hausnummer")
.HasColumnType("text");
b.Property<string>("Material") b.Property<string>("Material")
.HasColumnType("text"); .HasColumnType("text");
@@ -272,6 +276,9 @@ namespace DaSaSo.EntityFramework.Migrations
b.Property<int>("PunktUntenType") b.Property<int>("PunktUntenType")
.HasColumnType("integer"); .HasColumnType("integer");
b.Property<string>("SanNummer")
.HasColumnType("text");
b.Property<bool>("SewerActivated") b.Property<bool>("SewerActivated")
.HasColumnType("boolean"); .HasColumnType("boolean");
@@ -318,10 +325,16 @@ namespace DaSaSo.EntityFramework.Migrations
modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b => modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b =>
{ {
b.HasOne("DaSaSo.Domain.Model.Client", "Client")
.WithMany()
.HasForeignKey("ClientId");
b.HasOne("DaSaSo.Domain.Model.Project", "Project") b.HasOne("DaSaSo.Domain.Model.Project", "Project")
.WithMany("BuildingSites") .WithMany("BuildingSites")
.HasForeignKey("ProjectId"); .HasForeignKey("ProjectId");
b.Navigation("Client");
b.Navigation("Project"); b.Navigation("Project");
}); });
@@ -334,15 +347,6 @@ namespace DaSaSo.EntityFramework.Migrations
b.Navigation("Impregnation"); b.Navigation("Impregnation");
}); });
modelBuilder.Entity("DaSaSo.Domain.Model.Project", b =>
{
b.HasOne("DaSaSo.Domain.Model.Client", "Client")
.WithMany("Projects")
.HasForeignKey("ClientId");
b.Navigation("Client");
});
modelBuilder.Entity("DaSaSo.Domain.Model.SewerDamage", b => modelBuilder.Entity("DaSaSo.Domain.Model.SewerDamage", b =>
{ {
b.HasOne("DaSaSo.Domain.Model.SewerObject", "SewerObject") b.HasOne("DaSaSo.Domain.Model.SewerObject", "SewerObject")
@@ -384,11 +388,6 @@ namespace DaSaSo.EntityFramework.Migrations
b.Navigation("SewerObjects"); b.Navigation("SewerObjects");
}); });
modelBuilder.Entity("DaSaSo.Domain.Model.Client", b =>
{
b.Navigation("Projects");
});
modelBuilder.Entity("DaSaSo.Domain.Model.Project", b => modelBuilder.Entity("DaSaSo.Domain.Model.Project", b =>
{ {
b.Navigation("BuildingSites"); b.Navigation("BuildingSites");

View File

@@ -37,12 +37,10 @@ namespace DaSaSo.EntityFramework.Services
public async Task<Buildingsite> Get(int id) public async Task<Buildingsite> Get(int id)
{ {
using (DaSaSoDbContext context = _contextFactory.CreateDbContext()) using DaSaSoDbContext context = _contextFactory.CreateDbContext();
{ Buildingsite entity = await context.Buildingsites.FirstOrDefaultAsync((e) => e.Id == id);
Buildingsite entity = await context.Buildingsites.FirstOrDefaultAsync((e) => e.Id == id);
return entity; return entity;
}
} }
public Task<IEnumerable<Buildingsite>> GetAll() public Task<IEnumerable<Buildingsite>> GetAll()
@@ -54,11 +52,9 @@ namespace DaSaSo.EntityFramework.Services
{ {
// Get Clientid // Get Clientid
int id = project.Id; int id = project.Id;
using (DaSaSoDbContext context = _contextFactory.CreateDbContext()) using DaSaSoDbContext context = _contextFactory.CreateDbContext();
{ IEnumerable<Buildingsite> entities = await context.Buildingsites.Where(x => x.Project.Id == id).ToListAsync();
IEnumerable<Buildingsite> entities = await context.Buildingsites.Where(x => x.Project.Id == id).ToListAsync(); return entities;
return entities;
}
} }
public async Task<Buildingsite> Update(int id, Buildingsite entity) public async Task<Buildingsite> Update(int id, Buildingsite entity)

View File

@@ -39,22 +39,18 @@ namespace DaSaSo.EntityFramework.Services
public async Task<Client> Get(int id) public async Task<Client> Get(int id)
{ {
using (DaSaSoDbContext context = _contextFactory.CreateDbContext()) using DaSaSoDbContext context = _contextFactory.CreateDbContext();
{ Client entity = await context.Clients.FirstOrDefaultAsync((e) => e.Id == id);
Client entity = await context.Clients.Include(a => a.Projects).FirstOrDefaultAsync((e) => e.Id == id);
return entity; return entity;
}
} }
public async Task<IEnumerable<Client>> GetAll() public async Task<IEnumerable<Client>> GetAll()
{ {
using (DaSaSoDbContext context = _contextFactory.CreateDbContext()) using DaSaSoDbContext context = _contextFactory.CreateDbContext();
{ IEnumerable<Client> entities = await context.Clients.ToListAsync();
IEnumerable<Client> entities = await context.Clients.ToListAsync();
return entities; return entities;
}
} }
public async Task<Client> Update(int id, Client entity) public async Task<Client> Update(int id, Client entity)

View File

@@ -3,6 +3,7 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.ChangeTracking; using Microsoft.EntityFrameworkCore.ChangeTracking;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
@@ -19,43 +20,35 @@ namespace DaSaSo.EntityFramework.Services.Common
} }
public async Task<T> Create(T entity) public async Task<T> Create(T entity)
{ {
using (DaSaSoDbContext context = _contextFactory.CreateDbContext()) using DaSaSoDbContext context = _contextFactory.CreateDbContext();
{ EntityEntry<T> createdEntity = await context.Set<T>().AddAsync(entity);
EntityEntry<T> createdEntity = await context.Set<T>().AddAsync(entity); await context.SaveChangesAsync();
await context.SaveChangesAsync(); return createdEntity.Entity;
return createdEntity.Entity;
}
} }
public T CreateNonAsync(T entity) public T CreateNonAsync(T entity)
{ {
using (DaSaSoDbContext context = _contextFactory.CreateDbContext()) using DaSaSoDbContext context = _contextFactory.CreateDbContext();
{ EntityEntry<T> createdEntity = context.Set<T>().Add(entity);
EntityEntry<T> createdEntity = context.Set<T>().Add(entity); context.SaveChanges();
context.SaveChanges(); return createdEntity.Entity;
return createdEntity.Entity;
}
} }
public async Task<bool> Delete(int id) public async Task<bool> Delete(int id)
{ {
using (DaSaSoDbContext context = _contextFactory.CreateDbContext()) using DaSaSoDbContext context = _contextFactory.CreateDbContext();
{ T entity = await context.Set<T>().FirstOrDefaultAsync((e) => e.Id == id);
T entity = await context.Set<T>().FirstOrDefaultAsync((e) => e.Id == id); context.Set<T>().Remove(entity);
context.Set<T>().Remove(entity); await context.SaveChangesAsync();
await context.SaveChangesAsync(); return true;
return true;
}
} }
public async Task<T> Update(int id, T entity) public async Task<T> Update(int id, T entity)
{ {
using (DaSaSoDbContext context = _contextFactory.CreateDbContext()) using DaSaSoDbContext context = _contextFactory.CreateDbContext();
{ entity.Id = id;
entity.Id = id; context.Set<T>().Update(entity);
context.Set<T>().Update(entity); await context.SaveChangesAsync();
await context.SaveChangesAsync(); return entity;
return entity;
}
} }
} }
} }

View File

@@ -0,0 +1,56 @@
using DaSaSo.Domain.Model;
using DaSaSo.Domain.Services;
using DaSaSo.EntityFramework.Services.Common;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DaSaSo.EntityFramework.Services
{
public class ImpregnationDataService : IDataService<Impregnation>
{
private readonly DaSaSoDbContextFactory _contextFactory;
private readonly NonQueryDataService<Impregnation> _nonQueryDataService;
public ImpregnationDataService(DaSaSoDbContextFactory contextFactory)
{
_contextFactory = contextFactory;
_nonQueryDataService = new NonQueryDataService<Impregnation>(contextFactory);
}
public async Task<Impregnation> Create(Impregnation entity)
{
return await _nonQueryDataService.Create(entity);
}
public Impregnation CreateNonAsync(Impregnation entity)
{
throw new NotImplementedException();
}
public async Task<bool> Delete(int id)
{
return await _nonQueryDataService.Delete(id);
}
public Task<Impregnation> Get(int id)
{
throw new NotImplementedException();
}
public async Task<IEnumerable<Impregnation>> GetAll()
{
using DaSaSoDbContext context = _contextFactory.CreateDbContext();
IEnumerable<Impregnation> entities = await context.Impregnations.ToListAsync();
return entities;
}
public Task<Impregnation> Update(int id, Impregnation entity)
{
return _nonQueryDataService.Update(id, entity);
}
}
}

View File

@@ -41,22 +41,16 @@ namespace DaSaSo.EntityFramework.Services
} }
} }
public async Task<IEnumerable<Project>> GetAllByClient(Client client)
public async Task<IEnumerable<Project>> GetAll()
{ {
// Get Clientid using(DaSaSoDbContext context = _contextFactory.CreateDbContext())
int id = client.Id;
using (DaSaSoDbContext context = _contextFactory.CreateDbContext())
{ {
IEnumerable<Project> entities = await context.Projects.Where(x => x.Client.Id == id).ToListAsync(); IEnumerable<Project> entities = await context.Projects.ToListAsync();
return entities; return entities;
} }
} }
public Task<IEnumerable<Project>> GetAll()
{
throw new NotImplementedException();
}
public async Task<Project> Update(int id, Project entity) public async Task<Project> Update(int id, Project entity)
{ {
return await _nonQueryDataService.Update(id, entity); return await _nonQueryDataService.Update(id, entity);

View File

@@ -45,6 +45,8 @@ namespace DaSaSo.EntityFramework.Services
.Include("PunktOben") .Include("PunktOben")
.Include("PunktUnten") .Include("PunktUnten")
.Include("SewerDamages") .Include("SewerDamages")
.Include("PipeLiner")
.Include("PipeLiner.Impregnation")
.FirstOrDefaultAsync((e) => e.Id == id); .FirstOrDefaultAsync((e) => e.Id == id);
return s; return s;
} }

View File

@@ -1,32 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<None Remove="version.txt" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="version.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Toolkit.Mvvm" Version="7.1.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DaSaSo.Domain\DaSaSo.Domain.csproj" />
<ProjectReference Include="..\DaSaSo.EntityFramework\DaSaSo.EntityFramework.csproj" />
<ProjectReference Include="..\DaSaSo.InMemoryProvider\DaSaSo.InMemoryProvider.csproj" />
</ItemGroup>
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
<Exec Command="git rev-parse HEAD &gt; $(ProjectDir)\version.txt&#xD;&#xA;" />
</Target>
</Project>

View File

@@ -1,75 +0,0 @@
using DaSaSo.Domain.Model;
using DaSaSo.Domain.Services;
using DaSaSo.Domain.Services.SewerObjectService;
using DaSaSo.Domain.Services.SewerPointServices;
using DaSaSo.EntityFramework.Services;
using DaSaSo.ViewModel.Commands;
using DaSaSo.ViewModel.Interface;
using Microsoft.Toolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
namespace DaSaSo.ViewModel
{
public class SewerMainListViewModel : BaseViewModel
{
private ISewerMainNavigator _navigator { get; set; }
private readonly SewerObjectDataService _dataservice;
private readonly ISewerObjectService _sewerObjectService;
private readonly IRenavigator _renavigator;
private IActualProject _actualProject { get; set; }
public ICommand UpdateCurrentSewerViewModelCommand { get; }
public ICommand CloseCommand { get; set; }
public BaseViewModel CurrentSewerViewModel => _navigator.CurrentViewModel;
public bool IsLoading
{
get => _isLoading;
set
{
if (_isLoading != value)
{
_isLoading = value;
OnPropertyChanged();
}
}
}
public string Strasse { get => _actualProject.AktuellSewerObject.StreetName; }
public string AktualObject { get => _actualProject.AktuellSewerObject.ObjektName; }
bool _isLoading = true;
public bool CanSaveSewer => !string.IsNullOrEmpty(_actualProject.AktuellSewerObject.StreetName);
public SewerMainListViewModel(IDataService<SewerObject> dataService, ISewerMainNavigator navigator,IActualProject actualProject, IViewModelSewerMainFactory viewModelFactory, IRenavigator renavigator, ISewerObjectService sewerObjectService, ISewerpointService sewerpointService)
{
_navigator = navigator;
_actualProject = actualProject;
_dataservice = (SewerObjectDataService)dataService;
_renavigator = renavigator;
_sewerObjectService = sewerObjectService;
CloseCommand = new SaveSewerCommand(_dataservice,_actualProject,_sewerObjectService,_renavigator,_navigator); //RelayCommand(SaveSewer);
LoadModel();
UpdateCurrentSewerViewModelCommand = new UpdateCurrentSewerViewModelCommand(_navigator, viewModelFactory);
_navigator.StateChanged += () => OnPropertyChanged(nameof(CurrentSewerViewModel));
}
private async void LoadModel()
{
IsLoading = true;
SewerObject sewer = await _dataservice.Get(_actualProject.AktuellSewerObject.Id);
_actualProject.SetSewerObject(sewer,false);
IsLoading = false;
}
public override void Dispose()
{
_navigator.StateChanged -= () => OnPropertyChanged(nameof(CurrentSewerViewModel));
base.Dispose();
}
}
}

View File

@@ -5,11 +5,11 @@ using DaSaSo.Domain.Services.ProjectServices;
using DaSaSo.Domain.Services.SewerObjectService; using DaSaSo.Domain.Services.SewerObjectService;
using DaSaSo.EntityFramework; using DaSaSo.EntityFramework;
using DaSaSo.EntityFramework.Services; using DaSaSo.EntityFramework.Services;
using DaSaSo.ViewModel; using DaSaSo.Wpf.ViewModel;
using DaSaSo.ViewModel.Factories; using DaSaSo.Wpf.ViewModel.Factories;
using DaSaSo.ViewModel.Interface; using DaSaSo.Wpf.ViewModel.Interface;
using DaSaSo.ViewModel.State.ActualState; using DaSaSo.Wpf.ViewModel.State.ActualState;
using DaSaSo.ViewModel.State.Navigation; using DaSaSo.Wpf.ViewModel.State.Navigation;
using DaSaSo.Wpf.HostBuilders; using DaSaSo.Wpf.HostBuilders;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
@@ -41,119 +41,7 @@ namespace DaSaSo.Wpf
.AddDBContext(); .AddDBContext();
} }
/* return Host.CreateDefaultBuilder(args)
.ConfigureAppConfiguration(c=>
{
c.AddJsonFile("appsettings.json");
c.AddEnvironmentVariables();
})
.ConfigureServices((context, services) =>
{
string connectionString = context.Configuration.GetConnectionString("default");
services.AddDbContext<DaSaSoDbContext>(o => o.UseSqlServer(connectionString));
services.AddSingleton<DaSaSoDbContextFactory>(new DaSaSoDbContextFactory(connectionString));
services.AddSingleton<IDataService<Client>, ClientDataService>();
services.AddSingleton<IDataService<Project>, ProjectDataService>();
services.AddSingleton<IDataService<Buildingsite>, BuildingsiteDataService>();
services.AddSingleton<IDataService<SewerObject>, SewerObjectDataService>();
services.AddSingleton<ClientListViewModel>();
services.AddSingleton<IProjectService, ProjectService>();
services.AddSingleton<IBuildingsiteService, BuildingsiteService>();
services.AddSingleton<ISewerObjectService, SewerObjectService>();
services.AddSingleton<IViewModelAbstractFactory, MainWindowViewModelFactory>();
services.AddSingleton<IViewModelSewerMainFactory, SewerWindowViewModelFactory>();
services.AddSingleton<CreateViewModel<ClientEditViewModel>>(services =>
{
return () => new ClientEditViewModel(
services.GetRequiredService<IDataService<Client>>(),
services.GetRequiredService<IActualProject>(),
new ViewModelDelegateRenavigator(
services.GetRequiredService<IMainWindowNavigator>()
));
});
services.AddSingleton<CreateViewModel<HomeViewModel>>(services =>
{
return () => new HomeViewModel();
});
services.AddSingleton<CreateViewModel<SewerStammdatenViewModel>>(services =>
{
return () => new SewerStammdatenViewModel(
services.GetRequiredService<IActualProject>()
);
});
services.AddSingleton<CreateViewModel<SewerDamageListViewModel>>(services =>
{
return () => new SewerDamageListViewModel();
});
services.AddSingleton<CreateViewModel<ClientListViewModel>>(services =>
{
return () => new ClientListViewModel(
services.GetRequiredService<IDataService<Client>>(),
services.GetRequiredService<IActualProject>(),
new ViewModelDelegateRenavigator(
services.GetRequiredService<IMainWindowNavigator>()
));
});
services.AddSingleton<CreateViewModel<SewerMainListViewModel>>(services =>
{
return () => new SewerMainListViewModel(
services.GetRequiredService<IDataService<SewerObject>>(),
services.GetRequiredService<ISewerMainNavigator>(),
services.GetRequiredService<IActualProject>(),
services.GetRequiredService<IViewModelSewerMainFactory>(),
new ViewModelDelegateRenavigator(
services.GetRequiredService<IMainWindowNavigator>()
),
services.GetRequiredService<ISewerObjectService>()
);
});
services.AddSingleton<CreateViewModel<ProjectListViewModel>>(services =>
{
return () => new ProjectListViewModel(
services.GetRequiredService<IDataService<Project>>(),
services.GetRequiredService<IActualProject>(),
new ViewModelDelegateRenavigator(
services.GetRequiredService<IMainWindowNavigator>()),
services.GetRequiredService<IProjectService>()
);
});
services.AddSingleton<CreateViewModel<BuildingsiteListViewModel>>(services =>
{
return () => new BuildingsiteListViewModel(
services.GetRequiredService<IDataService<Buildingsite>>(),
services.GetRequiredService<IActualProject>(),
new ViewModelDelegateRenavigator(
services.GetRequiredService<IMainWindowNavigator>()),
services.GetRequiredService<IBuildingsiteService>()
);
});
services.AddSingleton<CreateViewModel<SewerObjectListViewModel>>(services =>
{
return () => new SewerObjectListViewModel(
services.GetRequiredService<IDataService<SewerObject>>(),
services.GetRequiredService<IActualProject>(),
services.GetRequiredService<ISewerObjectService>()
);
});
//services.AddSingleton<INavigator, Navigator>();
services.AddScoped<IActualProject, ActualProject>();
services.AddScoped<IMainWindowNavigator, MainWindowNavigator>();
services.AddScoped<ISewerMainNavigator, SewerMainNavigator>();
services.AddScoped<MainWindowViewModel>();
});
}
*/
protected override void OnStartup(StartupEventArgs e) protected override void OnStartup(StartupEventArgs e)
{ {
Application.Current.DispatcherUnhandledException += Current_DispatcherUnhandledException; Application.Current.DispatcherUnhandledException += Current_DispatcherUnhandledException;
@@ -165,6 +53,7 @@ namespace DaSaSo.Wpf
using (DaSaSoDbContext context = contextFactory.CreateDbContext()) using (DaSaSoDbContext context = contextFactory.CreateDbContext())
{ {
context.Database.Migrate(); context.Database.Migrate();
} }
MainWindow? window = new MainWindow() { DataContext = _host.Services.GetRequiredService<MainWindowViewModel>() }; MainWindow? window = new MainWindow() { DataContext = _host.Services.GetRequiredService<MainWindowViewModel>() };
window.Show(); window.Show();
@@ -176,7 +65,7 @@ namespace DaSaSo.Wpf
protected override async void OnExit(ExitEventArgs e) protected override async void OnExit(ExitEventArgs e)
{ {
_host.StopAsync(); await _host.StopAsync();
_host.Dispose(); _host.Dispose();
base.OnExit(e); base.OnExit(e);
} }

View File

@@ -5,12 +5,12 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:DaSaSo.Wpf.Controls" xmlns:local="clr-namespace:DaSaSo.Wpf.Controls"
xmlns:nav="clr-namespace:DaSaSo.Domain.Enums;assembly=DaSaSo.Domain" xmlns:nav="clr-namespace:DaSaSo.Domain.Enums;assembly=DaSaSo.Domain"
xmlns:viewmodel="clr-namespace:DaSaSo.ViewModel;assembly=DaSaSo.ViewModel" xmlns:viewmodel="clr-namespace:DaSaSo.Wpf.ViewModel"
xmlns:converters="clr-namespace:DaSaSo.Wpf.Converters" xmlns:converters="clr-namespace:DaSaSo.Wpf.Converters"
d:DataContext="{d:DesignInstance Type=viewmodel:MainWindowViewModel}"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="200"> d:DesignHeight="375" d:DesignWidth="200">
<UserControl.Resources> <UserControl.Resources>
<converters:EqualValueToParameterConverter x:Key="EqualValueToParameterConverter" /> <converters:EqualValueToParameterConverter x:Key="EqualValueToParameterConverter" />
<converters:EqualValueToBooleanConverter x:Key="EqualValueToBooleanConverter" /> <converters:EqualValueToBooleanConverter x:Key="EqualValueToBooleanConverter" />
@@ -21,13 +21,14 @@
<RowDefinition Height="auto" /> <RowDefinition Height="auto" />
<RowDefinition Height="auto" /> <RowDefinition Height="auto" />
<RowDefinition Height="auto" /> <RowDefinition Height="auto" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<RadioButton Grid.Row="0" IsChecked="{Binding CurrentViewModel, Mode=OneWay, Converter={StaticResource EqualValueToParameterConverter}, ConverterParameter={x:Type viewmodel:ClientListViewModel}}" Content="Kunden" Style="{StaticResource ToggleButtonList}" Command="{Binding UpdateCurrentViewModelCommand}" IsEnabled="True" CommandParameter="{x:Static nav:EMainWindowViewType.Clients}"/> <RadioButton Grid.Row="0" IsChecked="{Binding CurrentViewModel, Mode=OneWay, Converter={StaticResource EqualValueToParameterConverter}, ConverterParameter={x:Type viewmodel:ProjectListViewModel}}" Content="Projekte" Style="{StaticResource ToggleButtonList}" Command="{Binding UpdateCurrentViewModelCommand}" CommandParameter="{x:Static nav:EMainWindowViewType.Projects}" />
<RadioButton Grid.Row="1" IsChecked="{Binding CurrentViewModel, Mode=OneWay, Converter={StaticResource EqualValueToParameterConverter}, ConverterParameter={x:Type viewmodel:ProjectListViewModel}}" Content="Projekte" Style="{StaticResource ToggleButtonList}" Command="{Binding UpdateCurrentViewModelCommand}" IsEnabled="{Binding CanSelectProject}" CommandParameter="{x:Static nav:EMainWindowViewType.Projects}" /> <RadioButton Grid.Row="1" IsChecked="{Binding CurrentViewModel, Mode=OneWay, Converter={StaticResource EqualValueToParameterConverter}, ConverterParameter={x:Type viewmodel:BuildingsiteListViewModel}}" Content="Baustellen" Style="{StaticResource ToggleButtonList}" Command="{Binding UpdateCurrentViewModelCommand}" IsEnabled="{Binding CanSelectBuildingSite}" CommandParameter="{x:Static nav:EMainWindowViewType.Buildingsites}" />
<RadioButton Grid.Row="2" IsChecked="{Binding CurrentViewModel, Mode=OneWay, Converter={StaticResource EqualValueToParameterConverter}, ConverterParameter={x:Type viewmodel:BuildingsiteListViewModel}}" Content="Baustellen" Style="{StaticResource ToggleButtonList}" Command="{Binding UpdateCurrentViewModelCommand}" IsEnabled="{Binding CanSelectBuildingSite}" CommandParameter="{x:Static nav:EMainWindowViewType.Buildingsites}" /> <RadioButton Grid.Row="2" IsChecked="{Binding CurrentViewModel, Mode=OneWay, Converter={StaticResource EqualValueToParameterConverter}, ConverterParameter={x:Type viewmodel:SewerObjectListViewModel}}" Content="Objekten" Style="{StaticResource ToggleButtonList}" Command="{Binding UpdateCurrentViewModelCommand}" IsEnabled="{Binding CanSelectSewerObjects}" CommandParameter="{x:Static nav:EMainWindowViewType.SewerObjects}" />
<RadioButton Grid.Row="3" IsChecked="{Binding CurrentViewModel, Mode=OneWay, Converter={StaticResource EqualValueToParameterConverter}, ConverterParameter={x:Type viewmodel:SewerObjectListViewModel}}" Content="Objekten" Style="{StaticResource ToggleButtonList}" Command="{Binding UpdateCurrentViewModelCommand}" IsEnabled="{Binding CanSelectSewerObjects}" CommandParameter="{x:Static nav:EMainWindowViewType.SewerObjects}" /> <RadioButton Grid.Row="3" IsChecked="{Binding CurrentViewModel, Mode=OneWay, Converter={StaticResource EqualValueToParameterConverter}, ConverterParameter={x:Type viewmodel:ClientListViewModel}}" Content="Kunden" Style="{StaticResource ToggleButtonList}" Command="{Binding UpdateCurrentViewModelCommand}" IsEnabled="True" CommandParameter="{x:Static nav:EMainWindowViewType.Clients}"/>
<RadioButton Grid.Row="4" IsChecked="{Binding CurrentViewModel, Mode=OneWay, Converter={StaticResource EqualValueToParameterConverter}, ConverterParameter={x:Type viewmodel:ImpregnierungListViewModel}}" Content="Imprägnierungen" Style="{StaticResource ToggleButtonList}" Command="{Binding UpdateCurrentViewModelCommand}" CommandParameter="{x:Static nav:EMainWindowViewType.Impregnierung}" />
<Border Grid.RowSpan="4" Background="LightBlue" Visibility="{Binding CurrentViewModel, Mode=OneWay, Converter={StaticResource EqualValueToBooleanConverter}, ConverterParameter={x:Type viewmodel:SewerMainListViewModel}}" d:Visibility="Hidden"> <Border Grid.RowSpan="5" Background="LightBlue" Visibility="{Binding CurrentViewModel, Mode=OneWay, Converter={StaticResource EqualValueToBooleanConverter}, ConverterParameter={x:Type viewmodel:SewerMainListViewModel}}" d:Visibility="Hidden">
<TextBlock Foreground="WhiteSmoke" FontSize="18" Text="Editing Sewer" /> <TextBlock Foreground="WhiteSmoke" FontSize="18" Text="Editing Sewer" />
</Border> </Border>
</Grid> </Grid>

View File

@@ -4,15 +4,20 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:nav="clr-namespace:DaSaSo.Domain.Enums;assembly=DaSaSo.Domain" xmlns:nav="clr-namespace:DaSaSo.Domain.Enums;assembly=DaSaSo.Domain"
xmlns:local="clr-namespace:DaSaSo.Wpf.Controls" xmlns:viewmodel="clr-namespace:DaSaSo.ViewModel;assembly=DaSaSo.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:SewerMainListViewModel}" xmlns:local="clr-namespace:DaSaSo.Wpf.Controls" xmlns:viewmodel="clr-namespace:DaSaSo.Wpf.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:SewerMainListViewModel}"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="200"> d:DesignHeight="647.5" d:DesignWidth="200">
<Grid> <Grid>
<StackPanel> <StackPanel>
<RadioButton Content="Stammdaten" Style="{StaticResource ToggleButtonList}" Command="{Binding UpdateCurrentSewerViewModelCommand}" CommandParameter="{x:Static nav:ESewerWindowViewType.SewerStammdaten}" Margin="20" /> <RadioButton Content="Stammdaten" Style="{StaticResource ToggleButtonList}" Command="{Binding UpdateCurrentSewerViewModelCommand}" CommandParameter="{x:Static nav:ESewerWindowViewType.SewerStammdaten}" Margin="20" />
<RadioButton Content="Schäden" Style="{StaticResource ToggleButtonList}" Command="{Binding UpdateCurrentSewerViewModelCommand}" CommandParameter="{x:Static nav:ESewerWindowViewType.SewerDamageList}" Margin="20" /> <RadioButton Content="Schäden" Style="{StaticResource ToggleButtonList}" Command="{Binding UpdateCurrentSewerViewModelCommand}" CommandParameter="{x:Static nav:ESewerWindowViewType.SewerDamageList}" Margin="20" />
<RadioButton Content="Schließen" Style="{StaticResource ToggleButtonList}" Command="{Binding CloseCommand}" Margin="20" />
</StackPanel>
<RadioButton Content="Schließen" Style="{StaticResource ToggleButtonList}" Command="{Binding CloseCommand}" Margin="20" />
<RadioButton Content="{Binding Schaden.Distance,FallbackValue='Damage'}" Command="{Binding UpdateCurrentSewerViewModelCommand}" IsEnabled="{Binding CanSelectDamage}" CommandParameter="{x:Static nav:ESewerWindowViewType.SewerDamageEdit}" Style="{StaticResource ToggleButtonList}" Margin="20" />
<RadioButton Content="Schlauchliner" Style="{StaticResource ToggleButtonList}" Command="{Binding UpdateCurrentSewerViewModelCommand}" CommandParameter="{x:Static nav:ESewerWindowViewType.SewerPipeLiner}" Margin="20" />
<RadioButton Content="Fotodokumentation" Style="{StaticResource ToggleButtonList}" Command="{Binding UpdateCurrentSewerViewModelCommand}" CommandParameter="{x:Static nav:ESewerWindowViewType.SewerPictureDocumentation}" Margin="20" />
</StackPanel>
</Grid> </Grid>
</UserControl> </UserControl>

View File

@@ -0,0 +1,26 @@
using DaSaSo.Domain.Model;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
namespace DaSaSo.Wpf.Converters
{
class EqualDamageTypeToBooleanConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
bool result = (((int)value & (int)parameter) == (int)value);
return result;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
//EDamageType result = (EDamageType)parameter;
return null;
}
}
}

View File

@@ -0,0 +1,26 @@
using DaSaSo.Domain.Model;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
namespace DaSaSo.Wpf.Converters
{
class EqualPreperationTypeToBooleanConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
EPreparationType damagevalue = (EPreparationType)value;
EPreparationType damageParameter = (EPreparationType)parameter;
return damagevalue.HasFlag(damageParameter);
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

View File

@@ -8,16 +8,28 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.0-preview.7.21378.4"> <None Remove="version.txt" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="version.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.0">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.0-rc.1.21451.13" /> <PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.0" />
<PackageReference Include="Microsoft.Toolkit.Mvvm" Version="7.1.2" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\DaSaSo.Domain\DaSaSo.Domain.csproj" /> <ProjectReference Include="..\DaSaSo.Domain\DaSaSo.Domain.csproj" />
<ProjectReference Include="..\DaSaSo.ViewModel\DaSaSo.ViewModel.csproj" /> <ProjectReference Include="..\DaSaSo.EntityFramework\DaSaSo.EntityFramework.csproj" />
<ProjectReference Include="..\DaSaSo.InMemoryProvider\DaSaSo.InMemoryProvider.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@@ -26,4 +38,8 @@
</None> </None>
</ItemGroup> </ItemGroup>
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
<Exec Command="git rev-parse HEAD &gt; $(ProjectDir)\version.txt" />
</Target>
</Project> </Project>

View File

@@ -28,6 +28,12 @@
<Compile Update="View\HomeView.xaml.cs"> <Compile Update="View\HomeView.xaml.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
<Compile Update="View\Impregnation\ImpregnationEditView.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="View\Impregnation\ImpregnationListView.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="View\Project\ProjectEditView.xaml.cs"> <Compile Update="View\Project\ProjectEditView.xaml.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
@@ -37,6 +43,24 @@
<Compile Update="View\SewerObjecte\SewerObjecteListView.xaml.cs"> <Compile Update="View\SewerObjecte\SewerObjecteListView.xaml.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
<Compile Update="View\SewerObject\Controls\SewerDamage.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="View\SewerObject\Controls\SewerDamagePreparation.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="View\SewerObject\Controls\SewerRehabilation.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="View\SewerObject\PhotodocumentationView.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="View\SewerObject\SewerPipeLinerView.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="View\SewerObject\SewerDamageEditView.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="View\SewerObject\SewerDamageListView.xaml.cs"> <Compile Update="View\SewerObject\SewerDamageListView.xaml.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
@@ -75,6 +99,12 @@
<Page Update="View\HomeView.xaml"> <Page Update="View\HomeView.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Page> </Page>
<Page Update="View\Impregnation\ImpregnationEditView.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="View\Impregnation\ImpregnationListView.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="View\Project\ProjectEditView.xaml"> <Page Update="View\Project\ProjectEditView.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Page> </Page>
@@ -84,6 +114,24 @@
<Page Update="View\SewerObjecte\SewerObjecteListView.xaml"> <Page Update="View\SewerObjecte\SewerObjecteListView.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Page> </Page>
<Page Update="View\SewerObject\Controls\SewerDamage.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="View\SewerObject\Controls\SewerDamagePreparation.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="View\SewerObject\Controls\SewerRehabilation.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="View\SewerObject\PhotodocumentationView.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="View\SewerObject\SewerPipeLinerView.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="View\SewerObject\SewerDamageEditView.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="View\SewerObject\SewerDamageListView.xaml"> <Page Update="View\SewerObject\SewerDamageListView.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Page> </Page>

View File

@@ -5,6 +5,7 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
@@ -20,6 +21,7 @@ namespace DaSaSo.Wpf.HostBuilders
string connectionString = ""; string connectionString = "";
Action<DbContextOptionsBuilder> configureDbContext = null; Action<DbContextOptionsBuilder> configureDbContext = null;
string databaseToUse = context.Configuration.GetConnectionString("databaseToUse"); string databaseToUse = context.Configuration.GetConnectionString("databaseToUse");
Trace.WriteLine(databaseToUse);
if(databaseToUse.Equals("default")) if(databaseToUse.Equals("default"))
{ {
connectionString = context.Configuration.GetConnectionString("default"); connectionString = context.Configuration.GetConnectionString("default");

View File

@@ -21,11 +21,12 @@ namespace DaSaSo.Wpf.HostBuilders
{ {
host.ConfigureServices(services => host.ConfigureServices(services =>
{ {
services.AddSingleton<IDataService<Client>, ClientDataService>(); services.AddTransient<IDataService<Client>, ClientDataService>();
services.AddSingleton<IDataService<Project>, ProjectDataService>(); services.AddSingleton<IDataService<Project>, ProjectDataService>();
services.AddTransient<IDataService<Buildingsite>, BuildingsiteDataService>(); services.AddTransient<IDataService<Buildingsite>, BuildingsiteDataService>();
services.AddSingleton<IDataService<SewerObject>, SewerObjectDataService>(); services.AddSingleton<IDataService<SewerObject>, SewerObjectDataService>();
services.AddSingleton<IDataService<SewerPoint>, SewerpointDataService>(); services.AddSingleton<IDataService<SewerPoint>, SewerpointDataService>();
services.AddSingleton<IDataService<Impregnation>, ImpregnationDataService>();
services.AddSingleton<IProjectService, ProjectService>(); services.AddSingleton<IProjectService, ProjectService>();
services.AddSingleton<IBuildingsiteService, BuildingsiteService>(); services.AddSingleton<IBuildingsiteService, BuildingsiteService>();
services.AddSingleton<ISewerObjectService, SewerObjectService>(); services.AddSingleton<ISewerObjectService, SewerObjectService>();

View File

@@ -1,6 +1,6 @@
using DaSaSo.ViewModel.Interface; using DaSaSo.Wpf.ViewModel.Interface;
using DaSaSo.ViewModel.State.ActualState; using DaSaSo.Wpf.ViewModel.State.ActualState;
using DaSaSo.ViewModel.State.Navigation; using DaSaSo.Wpf.ViewModel.State.Navigation;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
using System; using System;

View File

@@ -4,10 +4,10 @@ using DaSaSo.Domain.Services.BuildingsiteServices;
using DaSaSo.Domain.Services.ProjectServices; using DaSaSo.Domain.Services.ProjectServices;
using DaSaSo.Domain.Services.SewerObjectService; using DaSaSo.Domain.Services.SewerObjectService;
using DaSaSo.Domain.Services.SewerPointServices; using DaSaSo.Domain.Services.SewerPointServices;
using DaSaSo.ViewModel; using DaSaSo.Wpf.ViewModel;
using DaSaSo.ViewModel.Factories; using DaSaSo.Wpf.ViewModel.Factories;
using DaSaSo.ViewModel.Interface; using DaSaSo.Wpf.ViewModel.Interface;
using DaSaSo.ViewModel.State.Navigation; using DaSaSo.Wpf.ViewModel.State.Navigation;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
using System; using System;
@@ -38,6 +38,9 @@ namespace DaSaSo.Wpf.HostBuilders
services.AddSingleton<ViewModelDelegateRenavigator<BuildingsiteEditViewModel>>(); services.AddSingleton<ViewModelDelegateRenavigator<BuildingsiteEditViewModel>>();
services.AddSingleton<ViewModelDelegateRenavigator<SewerObjectListViewModel>>(); services.AddSingleton<ViewModelDelegateRenavigator<SewerObjectListViewModel>>();
services.AddTransient<ViewModelDelegateRenavigator<SewerDamageEditViewModel>>();
services.AddSingleton<ViewModelDelegateRenavigator<ImpregnierungEditViewModel>>();
services.AddSingleton<CreateViewModel<HomeViewModel>>(services => services.AddSingleton<CreateViewModel<HomeViewModel>>(services =>
{ {
@@ -65,6 +68,23 @@ namespace DaSaSo.Wpf.HostBuilders
{ {
return () => new HomeViewModel(); return () => new HomeViewModel();
}); });
services.AddSingleton<CreateViewModel<ImpregnierungListViewModel>>(services =>
{
return () => new ImpregnierungListViewModel(
services.GetRequiredService<IDataService<Impregnation>>(),
services.GetRequiredService<IActualProject>(),
services.GetRequiredService<ViewModelDelegateRenavigator<ImpregnierungEditViewModel>>()
);
});
services.AddTransient<CreateViewModel<ImpregnierungEditViewModel>>(services =>
{
return () => new ImpregnierungEditViewModel(
services.GetRequiredService<IActualProject>(),
services.GetRequiredService<IDataService<Impregnation>>()
);
});
services.AddTransient<CreateViewModel<SewerStammdatenViewModel>>(services => services.AddTransient<CreateViewModel<SewerStammdatenViewModel>>(services =>
{ {
return () => new SewerStammdatenViewModel( return () => new SewerStammdatenViewModel(
@@ -77,7 +97,26 @@ namespace DaSaSo.Wpf.HostBuilders
{ {
return () => new SewerDamageListViewModel( return () => new SewerDamageListViewModel(
services.GetRequiredService<IActualProject>(), services.GetRequiredService<IActualProject>(),
services.GetRequiredService<IDataService<SewerObject>>()); services.GetRequiredService<IDataService<SewerObject>>(),
services.GetRequiredService<ViewModelDelegateRenavigator<SewerDamageEditViewModel>>()
);
});
services.AddTransient<CreateViewModel<SewerDamageEditViewModel>>(services =>
{
return () => new SewerDamageEditViewModel(
services.GetRequiredService<IActualProject>()
);
});
services.AddTransient<CreateViewModel<SewerPipeLinerViewModel>>(services =>
{
return () => new SewerPipeLinerViewModel(
services.GetRequiredService<IActualProject>()
);
});
services.AddTransient<CreateViewModel<SewerPictureDocumentationViewModel>>(services =>
{
return () => new SewerPictureDocumentationViewModel();
}); });
services.AddTransient<CreateViewModel<ClientListViewModel>>(services => services.AddTransient<CreateViewModel<ClientListViewModel>>(services =>
@@ -96,7 +135,7 @@ namespace DaSaSo.Wpf.HostBuilders
services.GetRequiredService<ISewerMainNavigator>(), services.GetRequiredService<ISewerMainNavigator>(),
services.GetRequiredService<IActualProject>(), services.GetRequiredService<IActualProject>(),
services.GetRequiredService<IViewModelSewerMainFactory>(), services.GetRequiredService<IViewModelSewerMainFactory>(),
services.GetRequiredService<ViewModelDelegateRenavigator<SewerObjectListViewModel>>(), services.GetRequiredService<ViewModelDelegateRenavigator<SewerObjectListViewModel>>(),
services.GetRequiredService<ISewerObjectService>(), services.GetRequiredService<ISewerObjectService>(),
services.GetRequiredService<ISewerpointService>() services.GetRequiredService<ISewerpointService>()
); );

View File

@@ -0,0 +1,24 @@
using DaSaSo.Domain.Model;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DaSaSo.Wpf.Sampledata
{
public class SewerDamageListSampleData
{
public ObservableCollection<SewerDamage> Damages { get; private set; } = new ObservableCollection<SewerDamage>();
public SewerDamageListSampleData()
{
Damages.Add(new SewerDamage()
{
DamageType = EDamageType.Bruch | EDamageType.EinrageneStutzen,
Distance = 12.5m
});
}
}
}

View File

@@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:DaSaSo.Wpf.View.Buildingsites" xmlns:viewmodel="clr-namespace:DaSaSo.ViewModel;assembly=DaSaSo.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:BuildingsiteEditViewModel}" xmlns:local="clr-namespace:DaSaSo.Wpf.View.Buildingsites" xmlns:viewmodel="clr-namespace:DaSaSo.Wpf.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:BuildingsiteEditViewModel}"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"> d:DesignHeight="450" d:DesignWidth="800">
<Grid> <Grid>

View File

@@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:DaSaSo.Wpf.View.Buildingsites" xmlns:viewmodel="clr-namespace:DaSaSo.ViewModel;assembly=DaSaSo.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:BuildingsiteListViewModel}" xmlns:local="clr-namespace:DaSaSo.Wpf.View.Buildingsites" xmlns:viewmodel="clr-namespace:DaSaSo.Wpf.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:BuildingsiteListViewModel}"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"> d:DesignHeight="450" d:DesignWidth="800">
<Grid> <Grid>

View File

@@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:DaSaSo.Wpf.View.Client" xmlns:viewmodel="clr-namespace:DaSaSo.ViewModel;assembly=DaSaSo.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:ClientEditViewModel}" xmlns:local="clr-namespace:DaSaSo.Wpf.View.Client" xmlns:viewmodel="clr-namespace:DaSaSo.Wpf.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:ClientEditViewModel}"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"> d:DesignHeight="450" d:DesignWidth="800">
<Grid> <Grid>

View File

@@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:DaSaSo.Wpf.View.Client" xmlns:viewmodel="clr-namespace:DaSaSo.ViewModel;assembly=DaSaSo.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:ClientListViewModel}" xmlns:local="clr-namespace:DaSaSo.Wpf.View.Client" xmlns:viewmodel="clr-namespace:DaSaSo.Wpf.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:ClientListViewModel}"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"> d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources> <UserControl.Resources>
@@ -13,7 +13,6 @@
<StackPanel> <StackPanel>
<TextBlock Text="Kundenliste" /> <TextBlock Text="Kundenliste" />
<ListView Margin="20" ItemsSource="{Binding Clients}" DisplayMemberPath="Firstname" SelectedItem="{Binding SelectedClient, Mode=TwoWay}"/> <ListView Margin="20" ItemsSource="{Binding Clients}" DisplayMemberPath="Firstname" SelectedItem="{Binding SelectedClient, Mode=TwoWay}"/>
<Button Content="Kunde auswählen" Command="{Binding SelectCommand}" />
<Button Content="Kunde Editieren" Command="{Binding EditCommand}"/> <Button Content="Kunde Editieren" Command="{Binding EditCommand}"/>
<Button Content="Kunde Hinzufügen" Command="{Binding AddNewClientCommand}" /> <Button Content="Kunde Hinzufügen" Command="{Binding AddNewClientCommand}" />
</StackPanel> </StackPanel>

View File

@@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:DaSaSo.Wpf.View" xmlns:viewmodel="clr-namespace:DaSaSo.ViewModel;assembly=DaSaSo.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:HomeViewModel}" xmlns:local="clr-namespace:DaSaSo.Wpf.View" xmlns:viewmodel="clr-namespace:DaSaSo.Wpf.ViewModel"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"> d:DesignHeight="450" d:DesignWidth="800">
<Grid> <Grid>

View File

@@ -0,0 +1,42 @@
<UserControl x:Class="DaSaSo.Wpf.View.Impregnation.ImpregnationEditView"
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:DaSaSo.Wpf.View.Impregnation" xmlns:viewmodel="clr-namespace:DaSaSo.Wpf.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:ImpregnierungEditViewModel}"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<Label Grid.Column="0" Grid.Row="0" Content="Imprägniernummer" />
<Label Grid.Column="0" Grid.Row="1" Content="Linercharge" />
<Label Grid.Column="0" Grid.Row="2" Content="Liner Länge" />
<Label Grid.Column="0" Grid.Row="3" Content="Durchmesser" />
<Label Grid.Column="0" Grid.Row="4" Content="Wandstärke" />
<Label Grid.Column="0" Grid.Row="5" Content="Datum" />
<Label Grid.Column="0" Grid.Row="6" Content="Vorhanden" />
<TextBox Grid.Column="1" Grid.Row="0" Text="{Binding Imprägniernummer}" />
<TextBox Grid.Column="1" Grid.Row="1" Text="{Binding LinerCharge}" />
<TextBox Grid.Column="1" Grid.Row="2" Text="{Binding LinerLänge}" />
<TextBox Grid.Column="1" Grid.Row="3" Text="{Binding DN}" />
<TextBox Grid.Column="1" Grid.Row="4" Text="{Binding Wandstärke}" />
<TextBox Grid.Column="1" Grid.Row="5" Text="" />
<CheckBox Grid.Column="1" Grid.Row="6" Content="Ja" Style="{StaticResource checkBoxCircleSmall}"/>
<Button Grid.Row="7" Grid.ColumnSpan="2" Content="Speichern" Command="{Binding SaveImpregnation}" />
</Grid>
</UserControl>

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 DaSaSo.Wpf.View.Impregnation
{
/// <summary>
/// Interaction logic for ImpregnationEditView.xaml
/// </summary>
public partial class ImpregnationEditView : UserControl
{
public ImpregnationEditView()
{
InitializeComponent();
}
}
}

View File

@@ -0,0 +1,23 @@
<UserControl x:Class="DaSaSo.Wpf.View.Impregnation.ImpregnationListView"
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:DaSaSo.Wpf.View.Impregnation" xmlns:viewmodel="clr-namespace:DaSaSo.Wpf.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:ImpregnierungListViewModel}"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources>
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
</UserControl.Resources>
<Grid>
<StackPanel>
<TextBlock Text="Imprägnierungen" />
<ListView ItemsSource="{Binding Impregnations}" DisplayMemberPath="Number" SelectedItem="{Binding SelectedImpregnation, Mode=TwoWay}" />
<Button Content="Editieren" Command="{Binding EditImpregnationCommand}" CommandParameter="{Binding SelectedImpregnation}" />
<Button Content="Neue Hinzufügen" Command="{Binding AddImpregnationCommand}" />
</StackPanel>
<Border Background="Gray" d:Visibility="Hidden" Visibility="{Binding IsLoading, Converter={StaticResource BooleanToVisibilityConverter}}">
<TextBlock Foreground="White" FontSize="40" Text="Loading" />
</Border>
</Grid>
</UserControl>

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 DaSaSo.Wpf.View.Impregnation
{
/// <summary>
/// Interaction logic for ImpregnationListView.xaml
/// </summary>
public partial class ImpregnationListView : UserControl
{
public ImpregnationListView()
{
InitializeComponent();
}
}
}

View File

@@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:DaSaSo.Wpf.View.Project" xmlns:viewmodel="clr-namespace:DaSaSo.ViewModel;assembly=DaSaSo.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:ProjectEditViewModel}" xmlns:local="clr-namespace:DaSaSo.Wpf.View.Project" xmlns:viewmodel="clr-namespace:DaSaSo.Wpf.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:ProjectEditViewModel}"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"> d:DesignHeight="450" d:DesignWidth="800">
<Grid> <Grid>
@@ -17,11 +17,12 @@
<RowDefinition /> <RowDefinition />
<RowDefinition /> <RowDefinition />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Label Grid.Row="0" Grid.Column="0" Content="Projektname" />
<Label Grid.Row="1" Grid.Column="0" Content="Projektnummer" />
<TextBox Grid.Row="0" Grid.Column="1" Text="{Binding ProjektName}" /> <Label Grid.Row="0" Grid.Column="0" Content="Projektnummer" />
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding ProjektNummer}" /> <Label Grid.Row="1" Grid.Column="0" Content="Projektname" />
<TextBox Grid.Row="0" Grid.Column="1" Text="{Binding ProjektNummer}" />
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding ProjektName}" />
</Grid> </Grid>
<Button Content="Speichern" Command="{Binding SaveProjectCommand}" /> <Button Content="Speichern" Command="{Binding SaveProjectCommand}" />

View File

@@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:DaSaSo.Wpf.View.Project" xmlns:viewmodel="clr-namespace:DaSaSo.ViewModel;assembly=DaSaSo.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:ProjectListViewModel}" xmlns:local="clr-namespace:DaSaSo.Wpf.View.Project" xmlns:viewmodel="clr-namespace:DaSaSo.Wpf.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:ProjectListViewModel}"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"> d:DesignHeight="450" d:DesignWidth="800">
<Grid> <Grid>

View File

@@ -0,0 +1,52 @@
<UserControl x:Class="DaSaSo.Wpf.View.SewerObject.Controls.SewerDamage"
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:damagetype="clr-namespace:DaSaSo.Domain.Model;assembly=DaSaSo.Domain"
xmlns:local="clr-namespace:DaSaSo.Wpf.View.SewerObject.Controls" xmlns:controls="clr-namespace:DaSaSo.Wpf.ViewModel.Controls" d:DataContext="{d:DesignInstance Type=controls:SewerDamageControllViewModel}"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid Background="LightBlue">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition />
</Grid.RowDefinitions>
<Border Grid.Row="0" Grid.ColumnSpan="3" BorderBrush="Black" BorderThickness="3">
<TextBlock TextAlignment="Center" Text="Schaden" />
</Border>
<Border Grid.Column="0" Grid.Row="1" BorderBrush="Black" BorderThickness="2,1" Margin="3">
<StackPanel>
<Label />
<Label Content="Rohrstatik schaden" />
<CheckBox Content="Riss" Style="{StaticResource checkBoxCircleSmall}" IsChecked="{Binding Riss}" />
<CheckBox Content="Bruch" Style="{StaticResource checkBoxCircleSmall}" IsChecked="{Binding Bruch}" />
<CheckBox Content="Scherbe" Style="{StaticResource checkBoxCircleSmall}" IsChecked="{Binding Scherbe}" />
</StackPanel>
</Border>
<Border Grid.Column="1" Grid.Row="1" BorderBrush="Black" BorderThickness="1,2" Margin="3">
<StackPanel>
<Label Content="Rohr Betrieb Hinderniss" />
<CheckBox Content="Wurzeln" Style="{StaticResource checkBoxCircleSmall}" IsChecked="{Binding Wurzel }"/>
<CheckBox Content="Inkrustation" Style="{StaticResource checkBoxCircleSmall}" IsChecked="{Binding Inkrustation }" />
<CheckBox Content="Ablagerungen" Style="{StaticResource checkBoxCircleSmall}" IsChecked="{Binding Ablagerungen}" />
</StackPanel>
</Border>
<Border Grid.Column="2" Grid.Row="1" BorderBrush="Black" BorderThickness="1,2" Margin="3">
<StackPanel>
<Label Content="Sonstiges" />
<CheckBox Content="Einragende Anschluss" Style="{StaticResource checkBoxCircleSmall}" IsChecked="{Binding EinrageneStutzen }" />
<CheckBox Content="Infiltration" Style="{StaticResource checkBoxCircleSmall}" IsChecked="{Binding Infiltration }"/>
</StackPanel>
</Border>
</Grid>
</UserControl>

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 DaSaSo.Wpf.View.SewerObject.Controls
{
/// <summary>
/// Interaction logic for SewerDamage.xaml
/// </summary>
public partial class SewerDamage : UserControl
{
public SewerDamage()
{
InitializeComponent();
}
}
}

View File

@@ -0,0 +1,29 @@
<UserControl x:Class="DaSaSo.Wpf.View.SewerObject.Controls.SewerDamagePreparation"
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:DaSaSo.Wpf.View.SewerObject.Controls" xmlns:controls="clr-namespace:DaSaSo.Wpf.ViewModel.Controls" d:DataContext="{d:DesignInstance Type=controls:SewerPreperationControllViewModel}"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid Background="LightBlue">
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition />
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderThickness="3" BorderBrush="Black">
<TextBlock Text="Vorbereitungen" TextAlignment="Center"/>
</Border>
<Border BorderBrush="Black" Grid.Row="1" BorderThickness="2" Margin="3">
<StackPanel>
<CheckBox Margin="5" Content="HD Gereinigt" Style="{StaticResource checkBoxCircleSmall}" IsChecked="{Binding HD}" />
<CheckBox Margin="5" Content="Mechanisch Gereinigt" Style="{StaticResource checkBoxCircleSmall}" IsChecked="{Binding Mechanisch}" />
<CheckBox Margin="5" Content="Mit Roboter Gereinigt" Style="{StaticResource checkBoxCircleSmall}" IsChecked="{Binding Roboter}" />
<CheckBox Margin="5" Content="Schadstelle Fäkalienfrei" Style="{StaticResource checkBoxCircleSmall}" IsChecked="{Binding Faekalienfrei}" />
<CheckBox Margin="5" Content="Genehmigung wurde eingeholt" Style="{StaticResource checkBoxCircleSmall}" IsChecked="{Binding Genehmigung}" />
<CheckBox Margin="5" Content="Wasserhaltung wurde eingerichtet" Style="{StaticResource checkBoxCircleSmall}" IsChecked="{Binding WaterBaried}" />
<CheckBox Margin="5" Content="Es wurde nach StVO abgesichert" Style="{StaticResource checkBoxCircleSmall}" IsChecked="{Binding STVO}" />
</StackPanel>
</Border>
</Grid>
</UserControl>

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 DaSaSo.Wpf.View.SewerObject.Controls
{
/// <summary>
/// Interaction logic for SewerDamagePreparation.xaml
/// </summary>
public partial class SewerDamagePreparation : UserControl
{
public SewerDamagePreparation()
{
InitializeComponent();
}
}
}

View File

@@ -0,0 +1,44 @@
<UserControl x:Class="DaSaSo.Wpf.View.SewerObject.Controls.SewerRehabilation"
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:DaSaSo.Wpf.View.SewerObject.Controls" xmlns:viewmodel="clr-namespace:DaSaSo.Wpf.ViewModel" xmlns:controls="clr-namespace:DaSaSo.Wpf.ViewModel.Controls" d:DataContext="{d:DesignInstance Type=controls:SewerRhebalationControllViewModel}"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Border>
<local:SewerDamagePreparation DataContext="{Binding SewerPreperationControllViewModel}" />
</Border>
<Border Grid.Column="1" BorderBrush="Black" BorderThickness="2">
<Grid Grid.Column="1" Background="LightBlue">
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Label Margin="5" Grid.Column="0" Grid.Row="0" Content="Operator" />
<Label Margin="5" Grid.Column="0" Grid.Row="1" Content="Datum" />
<Label Margin="5" Grid.Column="0" Grid.Row="2" Content="Temperatur Aussen" />
<Label Margin="5" Grid.Column="0" Grid.Row="3" Content="Temperatur Kanal" />
<Label Margin="5" Grid.Column="0" Grid.Row="4" Content="Wetter" />
<TextBox Grid.Column="1" Grid.Row="0" Margin="5" Text="{Binding Bediener}" />
<DatePicker Grid.Column="1" Grid.Row="1" Margin="5" SelectedDate="{Binding Datum}" />
<TextBox Grid.Column="1" Grid.Row="2" Margin="5" Text="{Binding TemperaturAussen}" />
<TextBox Grid.Column="1" Grid.Row="3" Margin="5" Text="{Binding TemperaturSewer}" />
<TextBox Grid.Column="1" Grid.Row="4" Margin="5" Text="{Binding Weather}" />
</Grid>
</Border>
</Grid>
</UserControl>

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 DaSaSo.Wpf.View.SewerObject.Controls
{
/// <summary>
/// Interaction logic for SewerRehabilation.xaml
/// </summary>
public partial class SewerRehabilation : UserControl
{
public SewerRehabilation()
{
InitializeComponent();
}
}
}

View File

@@ -0,0 +1,28 @@
<UserControl x:Class="DaSaSo.Wpf.View.SewerObject.PhotodocumentationView"
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:DaSaSo.Wpf.View.SewerObject" xmlns:viewmodel="clr-namespace:DaSaSo.Wpf.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:SewerPictureDocumentationViewModel}"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="9*" />
<RowDefinition Height="1*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="60" />
<ColumnDefinition Width="300" />
</Grid.ColumnDefinitions>
<TabControl ItemsSource="{Binding Tabs}" Name="tabImages" Grid.Column="1" Background="#00FFFFFF" TabStripPlacement="Bottom" MinHeight="150" AllowDrop="False" Focusable="False" TextOptions.TextFormattingMode="Display">
<TabControl.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Header}" />
</DataTemplate>
</TabControl.ItemTemplate>
</TabControl>
<TextBlock Name="txtBemerkung" Grid.Column="1" Grid.Row="1" TextWrapping="Wrap" Background="#FFFFFFFF" Foreground="#FF000000" VerticalAlignment="Center" Text="Kommentar" />
<Button Name="btnAddPhoto" Content="Hinzufügen" Width="50" Grid.RowSpan="2" VerticalAlignment="Top" />
</Grid>
</UserControl>

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 DaSaSo.Wpf.View.SewerObject
{
/// <summary>
/// Interaction logic for PhotodocumentationView.xaml
/// </summary>
public partial class PhotodocumentationView : UserControl
{
public PhotodocumentationView()
{
InitializeComponent();
}
}
}

View File

@@ -0,0 +1,41 @@
<UserControl x:Class="DaSaSo.Wpf.View.SewerObject.SewerDamageEditView"
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:selfControls="clr-namespace:DaSaSo.Wpf.View.SewerObject.Controls"
xmlns:local="clr-namespace:DaSaSo.Wpf.View.SewerObject" xmlns:viewmodel="clr-namespace:DaSaSo.Wpf.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:SewerDamageEditViewModel}"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<selfControls:SewerDamage Grid.Column="0" Grid.Row="0" DataContext="{Binding damageControllViewModel}" Margin="3" />
<!--<selfControls:SewerDamagePreparation Grid.Column="1" Grid.Row="0" DataContext="{Binding preperationControllViewModel}" Margin="3" />-->
<Grid Grid.Row="1" Grid.Column="0">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="200" />
</Grid.RowDefinitions>
<Label Grid.Column="0" Grid.Row="0" Content="Entfernung" />
<TextBox Grid.Column="1" Grid.Row="0" Text="{Binding Damage.Distance,StringFormat={}{0:#.##}}" />
</Grid>
<Button Grid.Column="1" Grid.Row="1" Content="Sanierung Zeigen" Command="{Binding Berechne}" />
</Grid>
</UserControl>

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 DaSaSo.Wpf.View.SewerObject
{
/// <summary>
/// Interaction logic for SewerDamageEditView.xaml
/// </summary>
public partial class SewerDamageEditView : UserControl
{
public SewerDamageEditView()
{
InitializeComponent();
}
}
}

View File

@@ -2,12 +2,37 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:DaSaSo.Wpf.View.SewerObject" xmlns:viewmodel="clr-namespace:DaSaSo.ViewModel;assembly=DaSaSo.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:SewerDamageListViewModel}" xmlns:sd="clr-namespace:DaSaSo.Wpf.Sampledata"
mc:Ignorable="d" xmlns:damagetype ="clr-namespace:DaSaSo.Domain.Model;assembly=DaSaSo.Domain"
d:DesignHeight="450" d:DesignWidth="800"> xmlns:local="clr-namespace:DaSaSo.Wpf.View.SewerObject" xmlns:viewmodel="clr-namespace:DaSaSo.Wpf.ViewModel"
xmlns:converters="clr-namespace:DaSaSo.Wpf.Converters"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="1020">
<UserControl.Resources>
<converters:EqualDamageTypeToBooleanConverter x:Key="EqualDamageTypeToBooleanConverter" />
<converters:EqualPreperationTypeToBooleanConverter x:Key="EqualPreperationTypeToBooleanConverter" />
</UserControl.Resources>
<d:UserControl.DataContext>
<sd:SewerDamageListSampleData />
</d:UserControl.DataContext>
<Grid> <Grid>
<DataGrid ItemsSource="{Binding Damages}" /> <StackPanel>
<DataGrid ItemsSource="{Binding Damages}" AutoGenerateColumns="False" IsReadOnly="True" SelectedItem="{Binding SelectedDamage}">
<DataGrid.Columns>
<DataGridTextColumn Header="Entfernung" Binding="{Binding Distance}" />
<DataGridCheckBoxColumn Header="Statik (Riss / Bruch / Scherbe)" Binding="{Binding DamageType, Converter={StaticResource EqualDamageTypeToBooleanConverter}, ConverterParameter={x:Static damagetype:EDamageType.Static}}" />
<DataGridCheckBoxColumn Header="Betrieb (Wurzeln / Inkrustation / Ablagerungen)" Binding="{Binding DamageType, Converter={StaticResource EqualDamageTypeToBooleanConverter}, ConverterParameter={x:Static damagetype:EDamageType.Betrieb}}" />
<DataGridCheckBoxColumn Header="Sonstiges (Infiltration / Einragene Stutzen)" Binding="{Binding DamageType, Converter={StaticResource EqualDamageTypeToBooleanConverter}, ConverterParameter={x:Static damagetype:EDamageType.Other}}" />
<DataGridCheckBoxColumn Header="HD Reinigung" Binding="{Binding PreparationType, Converter={StaticResource EqualPreperationTypeToBooleanConverter}, ConverterParameter={x:Static damagetype:EPreparationType.CleanedHD}}" />
<DataGridCheckBoxColumn Header="Mechanisch gereinigt" Binding="{Binding PreparationType, Converter={StaticResource EqualPreperationTypeToBooleanConverter}, ConverterParameter={x:Static damagetype:EPreparationType.CleanedMechanisch}}" />
<DataGridCheckBoxColumn Header="Roboter" Binding="{Binding PreparationType, Converter={StaticResource EqualPreperationTypeToBooleanConverter}, ConverterParameter={x:Static damagetype:EPreparationType.CleanedRoboter}}" />
<DataGridCheckBoxColumn Header="Fäkalienfrei" Binding="{Binding PreparationType, Converter={StaticResource EqualPreperationTypeToBooleanConverter}, ConverterParameter={x:Static damagetype:EPreparationType.FaekalienFrei}}" />
</DataGrid.Columns>
</DataGrid>
<Button Content="Neue Schaden Aufnehmen" Command="{Binding AddNewDamage}" />
</StackPanel>
</Grid> </Grid>
</UserControl> </UserControl>

View File

@@ -3,11 +3,11 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:viewModel="clr-namespace:DaSaSo.ViewModel;assembly=DaSaSo.ViewModel" xmlns:viewModel="clr-namespace:DaSaSo.Wpf.ViewModel"
xmlns:local="clr-namespace:DaSaSo.Wpf.View.SewerObject" xmlns:Controls="clr-namespace:DaSaSo.Wpf.Controls" xmlns:viewmodel="clr-namespace:DaSaSo.ViewModel;assembly=DaSaSo.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:SewerMainListViewModel}" xmlns:local="clr-namespace:DaSaSo.Wpf.View.SewerObject" xmlns:Controls="clr-namespace:DaSaSo.Wpf.Controls" xmlns:viewmodel="clr-namespace:DaSaSo.Wpf.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:SewerMainListViewModel}"
mc:Ignorable="d" mc:Ignorable="d"
xmlns:views ="clr-namespace:DaSaSo.Wpf.View.SewerObject" xmlns:views ="clr-namespace:DaSaSo.Wpf.View.SewerObject"
d:DesignHeight="450" d:DesignWidth="800"> d:DesignHeight="900" d:DesignWidth="800">
<UserControl.Resources> <UserControl.Resources>
<DataTemplate DataType="{x:Type viewmodel:SewerStammdatenViewModel}"> <DataTemplate DataType="{x:Type viewmodel:SewerStammdatenViewModel}">
<views:SewerStammdatenView /> <views:SewerStammdatenView />
@@ -15,6 +15,15 @@
<DataTemplate DataType="{x:Type viewmodel:SewerDamageListViewModel}"> <DataTemplate DataType="{x:Type viewmodel:SewerDamageListViewModel}">
<views:SewerDamageListView /> <views:SewerDamageListView />
</DataTemplate> </DataTemplate>
<DataTemplate DataType="{x:Type viewmodel:SewerDamageEditViewModel}">
<views:SewerDamageEditView />
</DataTemplate>
<DataTemplate DataType="{x:Type viewmodel:SewerPipeLinerViewModel}">
<views:SewerPipeLinerView />
</DataTemplate>
<DataTemplate DataType="{x:Type viewmodel:SewerPictureDocumentationViewModel}">
<views:PhotodocumentationView />
</DataTemplate>
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" /> <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
</UserControl.Resources> </UserControl.Resources>
<Grid> <Grid>

View File

@@ -0,0 +1,48 @@
<UserControl x:Class="DaSaSo.Wpf.View.SewerObject.SewerPipeLinerView"
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:DaSaSo.Wpf.View.SewerObject"
xmlns:controls="clr-namespace:DaSaSo.Wpf.View.SewerObject.Controls" xmlns:viewmodel="clr-namespace:DaSaSo.Wpf.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:SewerPipeLinerViewModel}"
mc:Ignorable="d" d:DesignWidth="800" Height="722">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition />
</Grid.RowDefinitions>
<Border Grid.Row="0">
<controls:SewerRehabilation DataContext="{Binding SewerRhebalationControllViewModel}" />
</Border>
<Border BorderBrush="Black" BorderThickness="2" Grid.Row="1">
<Grid Background="LightBlue">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<Label Margin="10" Grid.Column="0" Grid.Row="0" Content="Geschlossene Ende" />
<Label Margin="10" Grid.Column="0" Grid.Row="1" Content="Preliner verwendet?" />
<Label Margin="10" Grid.Column="0" Grid.Row="2" Content="Liner-Charge" />
<Label Margin="10" Grid.Column="0" Grid.Row="3" Content="Lagerung Temperatur" />
<Label Margin="10" Grid.Column="0" Grid.Row="4" Content="Temperatur beim Einbau" />
<Label Margin="10" Grid.Column="0" Grid.Row="5" Content="Einbaudruck" />
<CheckBox Style="{StaticResource checkBoxCircleSmall}" Grid.Column="1" Grid.Row="0" Margin="10" Content="Ja" IsChecked="{Binding ClosedEnd}" />
<CheckBox Style="{StaticResource checkBoxCircleSmall}" Grid.Column="1" Grid.Row="1" Margin="10" Content="Ja" IsChecked="{Binding Preliner}" />
<TextBox BorderThickness="0" Grid.Column="1" Grid.Row="2" Margin="10" />
<TextBox BorderThickness="0" Grid.Column="1" Grid.Row="3" Margin="10" Text="{Binding LagerungTemperatur}" />
<TextBox BorderThickness="0" Grid.Column="1" Grid.Row="4" Margin="10" Text="{Binding EinbauTemperatur}" />
<TextBox BorderThickness="0" Grid.Column="1" Grid.Row="5" Margin="10" Text="{Binding EinbauDruck}" />
</Grid>
</Border>
</Grid>
</UserControl>

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 DaSaSo.Wpf.View.SewerObject
{
/// <summary>
/// Interaction logic for Pipeliner.xaml
/// </summary>
public partial class SewerPipeLinerView : UserControl
{
public SewerPipeLinerView()
{
InitializeComponent();
}
}
}

View File

@@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:DaSaSo.Wpf.View.SewerObject" xmlns:viewmodel="clr-namespace:DaSaSo.ViewModel;assembly=DaSaSo.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:SewerStammdatenViewModel}" xmlns:local="clr-namespace:DaSaSo.Wpf.View.SewerObject" xmlns:viewmodel="clr-namespace:DaSaSo.Wpf.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:SewerStammdatenViewModel}"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"> d:DesignHeight="450" d:DesignWidth="800">
<Grid> <Grid>
@@ -27,19 +27,22 @@
<RowDefinition Height="auto" /> <RowDefinition Height="auto" />
<RowDefinition Height="auto" /> <RowDefinition Height="auto" />
<RowDefinition Height="auto" /> <RowDefinition Height="auto" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Label Grid.Column="0" Grid.Row="0" Content="Haltungsname" Margin="20" /> <Label Grid.Column="0" Grid.Row="0" Content="Sanierung ID" Margin="20" />
<Label Grid.Column="0" Grid.Row="1" Content="Punkt Oben" Margin="20" /> <Label Grid.Column="0" Grid.Row="1" Content="Haltungsname" Margin="20" />
<Label Grid.Column="0" Grid.Row="2" Content="Punkt Unten" Margin="20" /> <Label Grid.Column="0" Grid.Row="2" Content="Punkt Oben" Margin="20" />
<Label Grid.Column="0" Grid.Row="3" Content="Durchmesser" Margin="20" /> <Label Grid.Column="0" Grid.Row="3" Content="Punkt Unten" Margin="20" />
<Label Grid.Column="0" Grid.Row="4" Content="Material" Margin="20" /> <Label Grid.Column="0" Grid.Row="4" Content="Durchmesser" Margin="20" />
<Label Grid.Column="0" Grid.Row="5" Content="Leitungslänge" Margin="20" /> <Label Grid.Column="0" Grid.Row="5" Content="Material" Margin="20" />
<TextBox Grid.Column="1" Grid.Row="0" Text="{Binding Haltungsname }" Margin="20" /> <Label Grid.Column="0" Grid.Row="6" Content="Leitungslänge" Margin="20" />
<TextBox Grid.Column="1" Grid.Row="1" Text="{Binding Oberepunkt }" Margin="20" /> <TextBox Grid.Column="1" Grid.Row="0" Text="{Binding Sanierungsid}" Margin="20" />
<TextBox Grid.Column="1" Grid.Row="2" Text="{Binding Unterepunkt }" Margin="20" /> <TextBox Grid.Column="1" Grid.Row="1" Text="{Binding Haltungsname }" Margin="20" />
<TextBox Grid.Column="1" Grid.Row="3" Text="{Binding Durchmesser }" Margin="20" /> <TextBox Grid.Column="1" Grid.Row="2" Text="{Binding Oberepunkt }" Margin="20" />
<TextBox Grid.Column="1" Grid.Row="4" Text="{Binding Material }" Margin="20" /> <TextBox Grid.Column="1" Grid.Row="3" Text="{Binding Unterepunkt }" Margin="20" />
<TextBox Grid.Column="1" Grid.Row="5" Text="{Binding Leitungslength }" Margin="20" /> <TextBox Grid.Column="1" Grid.Row="4" Text="{Binding Durchmesser }" Margin="20" />
<TextBox Grid.Column="1" Grid.Row="5" Text="{Binding Material }" Margin="20" />
<TextBox Grid.Column="1" Grid.Row="6" Text="{Binding Leitungslength }" Margin="20" />
</Grid> </Grid>
<Grid Grid.Column="1"> <Grid Grid.Column="1">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
@@ -49,11 +52,14 @@
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="auto"/> <RowDefinition Height="auto"/>
<RowDefinition Height="auto" /> <RowDefinition Height="auto" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Label Grid.Row="0" Grid.Column="0" Content="Strasse" Margin="20" /> <Label Grid.Row="0" Grid.Column="0" Content="Strasse" Margin="20" />
<Label Grid.Row="1" Grid.Column="0" Content="Ort" Margin="20" /> <Label Grid.Row="1" Grid.Column="0" Content="Hausnummer" Margin="20" />
<Label Grid.Row="2" Grid.Column="0" Content="Ort" Margin="20" />
<TextBox Grid.Row="0" Grid.Column="1" Text="{Binding Strasse}" Margin="20"/> <TextBox Grid.Row="0" Grid.Column="1" Text="{Binding Strasse}" Margin="20"/>
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding Ort}" Margin="20"/> <TextBox Grid.Row="1" Grid.Column="1" Text="{Binding Hausnummer}" Margin="20" />
<TextBox Grid.Row="2" Grid.Column="1" Text="{Binding Ort}" Margin="20"/>
</Grid> </Grid>
<Button Grid.Row="1" Grid.ColumnSpan="2" FontSize="20" Content="Speichern" Command="{Binding SaveCommand}" /> <Button Grid.Row="1" Grid.ColumnSpan="2" FontSize="20" Content="Speichern" Command="{Binding SaveCommand}" />
</Grid> </Grid>

View File

@@ -26,8 +26,15 @@
<DataTemplate DataType="{x:Type model:SewerObject}"> <DataTemplate DataType="{x:Type model:SewerObject}">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding ObjektName}" /> <TextBlock Text="SanID [" />
<TextBlock Text="{Binding Material}" /> <TextBlock Text="{Binding SanNummer}" Foreground="Red" />
<TextBlock Text="] Hausnummer [" />
<TextBlock Text="{Binding Hausnummer}" Foreground="Red" />
<TextBlock Text="] Haltung [" />
<TextBlock Foreground="Blue" Text="{Binding ObjektName}" />
<TextBlock Text="] DN [" />
<TextBlock Text="{Binding DN}" Foreground="Blue" />
<TextBlock Text="]" />
</StackPanel> </StackPanel>
</DataTemplate> </DataTemplate>
<Style TargetType="{x:Type TreeViewItem}"> <Style TargetType="{x:Type TreeViewItem}">

View File

@@ -1,4 +1,5 @@
namespace DaSaSo.ViewModel 
namespace DaSaSo.Wpf.ViewModel
{ {
public delegate TViewModel CreateViewModel<TViewModel>() where TViewModel : BaseViewModel; public delegate TViewModel CreateViewModel<TViewModel>() where TViewModel : BaseViewModel;
public class BaseViewModel : ObservableObject public class BaseViewModel : ObservableObject

View File

@@ -1,7 +1,7 @@
using DaSaSo.Domain.Model; using DaSaSo.Domain.Model;
using DaSaSo.Domain.Services; using DaSaSo.Domain.Services;
using DaSaSo.Domain.Services.BuildingsiteServices; using DaSaSo.Domain.Services.BuildingsiteServices;
using DaSaSo.ViewModel.Interface; using DaSaSo.Wpf.ViewModel.Interface;
using Microsoft.Toolkit.Mvvm.Input; using Microsoft.Toolkit.Mvvm.Input;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@@ -10,7 +10,7 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Input; using System.Windows.Input;
namespace DaSaSo.ViewModel namespace DaSaSo.Wpf.ViewModel
{ {
public class BuildingsiteEditViewModel : BaseViewModel public class BuildingsiteEditViewModel : BaseViewModel
{ {
@@ -69,12 +69,12 @@ namespace DaSaSo.ViewModel
_renavigator = renavigator; _renavigator = renavigator;
_model = actualProject.AktuellBaustelle; _model = actualProject.AktuellBaustelle;
SaveBuildingsiteCommand = new RelayCommand(SaveBuildingsite); SaveBuildingsiteCommand = new RelayCommand(SaveBuildingsiteAsync);
} }
private void SaveBuildingsite() private async void SaveBuildingsiteAsync()
{ {
_buildingsiteService.Update(Model.Id, Model); await _buildingsiteService.Update(Model.Id, Model);
_renavigator.Renavigate(); _renavigator.Renavigate();
} }
} }

View File

@@ -2,8 +2,8 @@
using DaSaSo.Domain.Services; using DaSaSo.Domain.Services;
using DaSaSo.Domain.Services.BuildingsiteServices; using DaSaSo.Domain.Services.BuildingsiteServices;
using DaSaSo.EntityFramework.Services; using DaSaSo.EntityFramework.Services;
using DaSaSo.ViewModel.Commands; using DaSaSo.Wpf.ViewModel.Commands;
using DaSaSo.ViewModel.Interface; using DaSaSo.Wpf.ViewModel.Interface;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
@@ -12,7 +12,7 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Input; using System.Windows.Input;
namespace DaSaSo.ViewModel namespace DaSaSo.Wpf.ViewModel
{ {
public class BuildingsiteListViewModel: BaseViewModel public class BuildingsiteListViewModel: BaseViewModel
{ {
@@ -47,7 +47,7 @@ namespace DaSaSo.ViewModel
{ {
_actualProject = actualProject; _actualProject = actualProject;
_renavigator = renavigator; _renavigator = renavigator;
_buildingSiteDataService = buildingSiteDataService as BuildingsiteDataService; _buildingSiteDataService = (BuildingsiteDataService)buildingSiteDataService;
Buildingsites = new ObservableCollection<Buildingsite>(); Buildingsites = new ObservableCollection<Buildingsite>();
EditCommand = new EditBuildingsiteCommand(buildingSiteDataService,actualProject,renavigator,buildingsiteService,this); EditCommand = new EditBuildingsiteCommand(buildingSiteDataService,actualProject,renavigator,buildingsiteService,this);
SelectCommand = new SelectBuildingsiteCommand(actualProject, this); SelectCommand = new SelectBuildingsiteCommand(actualProject, this);

View File

@@ -1,6 +1,6 @@
using DaSaSo.Domain.Model; using DaSaSo.Domain.Model;
using DaSaSo.Domain.Services; using DaSaSo.Domain.Services;
using DaSaSo.ViewModel.Interface; using DaSaSo.Wpf.ViewModel.Interface;
using Microsoft.Toolkit.Mvvm.Input; using Microsoft.Toolkit.Mvvm.Input;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@@ -9,12 +9,12 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace DaSaSo.ViewModel namespace DaSaSo.Wpf.ViewModel
{ {
public class ClientEditViewModel : BaseViewModel public class ClientEditViewModel : BaseViewModel
{ {
private Client _model; private Client _model;
private IDataService<Client> _dataService; private readonly IDataService<Client> _dataService;
private readonly IActualProject _actualProject; private readonly IActualProject _actualProject;
private readonly IRenavigator renavigator; private readonly IRenavigator renavigator;
@@ -32,9 +32,9 @@ namespace DaSaSo.ViewModel
this._model = _actualProject.AktuellClient; this._model = _actualProject.AktuellClient;
} }
private void SaveClient() private async void SaveClient()
{ {
_dataService.Update(Model.Id, Model); await _dataService.Update(Model.Id, Model);
renavigator.Renavigate(); renavigator.Renavigate();
} }
} }

View File

@@ -1,8 +1,8 @@
using DaSaSo.Domain.Model; using DaSaSo.Domain.Model;
using DaSaSo.Domain.Services; using DaSaSo.Domain.Services;
using DaSaSo.ViewModel.Commands; using DaSaSo.Wpf.ViewModel.Commands;
using DaSaSo.ViewModel.Enums; using DaSaSo.Wpf.ViewModel.Enums;
using DaSaSo.ViewModel.Interface; using DaSaSo.Wpf.ViewModel.Interface;
using Microsoft.Toolkit.Mvvm.Input; using Microsoft.Toolkit.Mvvm.Input;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@@ -13,18 +13,15 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Input; using System.Windows.Input;
namespace DaSaSo.ViewModel namespace DaSaSo.Wpf.ViewModel
{ {
public class ClientListViewModel : BaseViewModel public class ClientListViewModel : BaseViewModel
{ {
public ObservableCollection<Client> Clients { get; } public ObservableCollection<Client> Clients { get; }
private Client? _selectedClient; private Client? _selectedClient;
private IDataService<Client> _dataService; private readonly IDataService<Client> _dataService;
private readonly IRenavigator renavigator;
IEnumerable<Client>? result;
bool _isLoading = true; bool _isLoading = true;
public ICommand SelectCommand { get; set; }
public ICommand EditCommand { get; set; } public ICommand EditCommand { get; set; }
public ICommand AddNewClientCommand { get; set; } public ICommand AddNewClientCommand { get; set; }
@@ -63,19 +60,14 @@ namespace DaSaSo.ViewModel
{ {
Clients = new ObservableCollection<Client>(); Clients = new ObservableCollection<Client>();
_dataService = dataService; _dataService = dataService;
this.renavigator = renavigator;
LoadClient(); LoadClient();
SelectCommand = new SelectClientCommand(actualProject, this); //= new RelayCommand(SelectClient, () => SelectedClient != null);
EditCommand = new EditClientCommand(_dataService,actualProject, editRenavigator, this); EditCommand = new EditClientCommand(_dataService,actualProject, editRenavigator, this);
AddNewClientCommand = new AddClientCommand(_dataService, actualProject, editRenavigator, this); AddNewClientCommand = new AddClientCommand(_dataService, actualProject, editRenavigator, this);
} }
~ClientListViewModel()
{
}
public async void LoadClient() public async void LoadClient()
{ {
IsLoading = true; IsLoading = true;
@@ -86,7 +78,7 @@ namespace DaSaSo.ViewModel
IsLoading = false; IsLoading = false;
} }
private void InitCollection(ObservableCollection<Client> target, IEnumerable<Client> source) private static void InitCollection(ObservableCollection<Client> target, IEnumerable<Client> source)
{ {
target.Clear(); target.Clear();
foreach (var i in source) foreach (var i in source)

View File

@@ -1,14 +1,10 @@
using DaSaSo.Domain.Model; using DaSaSo.Domain.Model;
using DaSaSo.Domain.Services; using DaSaSo.Domain.Services;
using DaSaSo.Domain.Services.BuildingsiteServices; using DaSaSo.Domain.Services.BuildingsiteServices;
using DaSaSo.ViewModel.Interface; using DaSaSo.Wpf.ViewModel.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace DaSaSo.ViewModel.Commands namespace DaSaSo.Wpf.ViewModel.Commands
{ {
public class AddBuildingsiteCommand: AsyncCommandBase public class AddBuildingsiteCommand: AsyncCommandBase
{ {

View File

@@ -1,13 +1,9 @@
using DaSaSo.Domain.Model; using DaSaSo.Domain.Model;
using DaSaSo.Domain.Services; using DaSaSo.Domain.Services;
using DaSaSo.ViewModel.Interface; using DaSaSo.Wpf.ViewModel.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace DaSaSo.ViewModel.Commands namespace DaSaSo.Wpf.ViewModel.Commands
{ {
public class AddClientCommand : AsyncCommandBase public class AddClientCommand : AsyncCommandBase
{ {

View File

@@ -0,0 +1,36 @@
using DaSaSo.Domain.Model;
using DaSaSo.Wpf.ViewModel.Interface;
using System.Linq;
using System.Threading.Tasks;
namespace DaSaSo.Wpf.ViewModel.Commands
{
class AddDamageCommand : AsyncCommandBase
{
private readonly IActualProject actualProject;
private readonly IRenavigator addedNavigator;
public AddDamageCommand(IActualProject actualProject, IRenavigator addedNavigator)
{
this.actualProject = actualProject;
this.addedNavigator = addedNavigator;
}
public override async Task ExecuteAsync(object? parameter)
{
SewerDamage newSewerDamage = new SewerDamage();
//newSewerDamage.SewerObject = actualProject.AktuellSewerObject; // Führt zur Exception, dass EF versucht doppelte einträge vorzunehmen
actualProject.AktuellSewerObject.SewerDamages.Add(newSewerDamage);
SewerDamage? lastInsertedDamage = actualProject.AktuellSewerObject.SewerDamages.Last();
lastInsertedDamage.SewerObject = actualProject.AktuellSewerObject;
actualProject.SetSewerDamage(lastInsertedDamage);
//addedNavigator.Renavigate(); // Bug führt zur generellen umnavigation...
}
}
}

Some files were not shown because too many files have changed in this diff Show More