Buildingsite list hinzugefügt
This commit is contained in:
@@ -6,7 +6,7 @@ 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());
|
IDataService<Client> clientService = new GenericDataService<Client>(new DaSaSoDbContextFactory(""));
|
||||||
clientService.Create(new Client()
|
clientService.Create(new Client()
|
||||||
{
|
{
|
||||||
Firstname = "Cynthia",
|
Firstname = "Cynthia",
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ namespace DaSaSo.Domain.Model
|
|||||||
{
|
{
|
||||||
public class Buildingsite : DomainObject
|
public class Buildingsite : DomainObject
|
||||||
{
|
{
|
||||||
|
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; }
|
||||||
public string ContactPerson { get; set; }
|
public string ContactPerson { get; set; }
|
||||||
|
|||||||
@@ -8,10 +8,14 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace DaSaSo.EntityFramework
|
namespace DaSaSo.EntityFramework
|
||||||
{
|
{
|
||||||
public class DaSaSoDbContextFactory
|
public class DaSaSoDbContextFactory : IDesignTimeDbContextFactory<DaSaSoDbContext>
|
||||||
{
|
{
|
||||||
private readonly string _connectionString;
|
private readonly string _connectionString;
|
||||||
|
|
||||||
|
public DaSaSoDbContextFactory()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
public DaSaSoDbContextFactory(string connectionString)
|
public DaSaSoDbContextFactory(string connectionString)
|
||||||
{
|
{
|
||||||
_connectionString = connectionString;
|
_connectionString = connectionString;
|
||||||
@@ -20,9 +24,18 @@ namespace DaSaSo.EntityFramework
|
|||||||
public DaSaSoDbContext CreateDbContext()
|
public DaSaSoDbContext CreateDbContext()
|
||||||
{
|
{
|
||||||
var options = new DbContextOptionsBuilder<DaSaSoDbContext>();
|
var options = new DbContextOptionsBuilder<DaSaSoDbContext>();
|
||||||
|
//_connectionString = "Host = localhost; Database = dasaso; Username = kansan; Password = kansan";
|
||||||
options.UseNpgsql(_connectionString);
|
options.UseNpgsql(_connectionString);
|
||||||
DaSaSoDbContext result = new DaSaSoDbContext(options.Options);
|
DaSaSoDbContext result = new DaSaSoDbContext(options.Options);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DaSaSoDbContext CreateDbContext(string[]? args = null)
|
||||||
|
{
|
||||||
|
var options = new DbContextOptionsBuilder<DaSaSoDbContext>();
|
||||||
|
options.UseNpgsql("Host = localhost; Database = dasaso; Username = kansan; Password = kansan");
|
||||||
|
DaSaSoDbContext result = new DaSaSoDbContext(options.Options);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
176
DaSaSo.EntityFramework/Migrations/20210915174236_ProjectReferenzAdded.Designer.cs
generated
Normal file
176
DaSaSo.EntityFramework/Migrations/20210915174236_ProjectReferenzAdded.Designer.cs
generated
Normal file
@@ -0,0 +1,176 @@
|
|||||||
|
// <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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,331 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -27,15 +27,12 @@ namespace DaSaSo.EntityFramework.Migrations
|
|||||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||||
|
|
||||||
b.Property<string>("BuildingSiteNumber")
|
b.Property<string>("BuildingSiteNumber")
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<string>("ContactPerson")
|
b.Property<string>("ContactPerson")
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<string>("Country")
|
b.Property<string>("Country")
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<int?>("ProjectId")
|
b.Property<int?>("ProjectId")
|
||||||
@@ -56,23 +53,18 @@ namespace DaSaSo.EntityFramework.Migrations
|
|||||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||||
|
|
||||||
b.Property<string>("Country")
|
b.Property<string>("Country")
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<string>("Firstname")
|
b.Property<string>("Firstname")
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<string>("LastName")
|
b.Property<string>("LastName")
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<string>("Postcode")
|
b.Property<string>("Postcode")
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<string>("Street")
|
b.Property<string>("Street")
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
@@ -87,11 +79,10 @@ namespace DaSaSo.EntityFramework.Migrations
|
|||||||
.HasColumnType("integer")
|
.HasColumnType("integer")
|
||||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||||
|
|
||||||
b.Property<int>("ClientId")
|
b.Property<int?>("ClientId")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
|
|
||||||
b.Property<string>("Name")
|
b.Property<string>("Name")
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
@@ -108,29 +99,25 @@ namespace DaSaSo.EntityFramework.Migrations
|
|||||||
.HasColumnType("integer")
|
.HasColumnType("integer")
|
||||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||||
|
|
||||||
b.Property<int>("BuildingSiteId")
|
b.Property<int?>("BuildingSiteId")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
|
|
||||||
b.Property<int>("DN")
|
b.Property<int>("DN")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
|
|
||||||
b.Property<string>("ObjektName")
|
b.Property<string>("ObjektName")
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<string>("PointFrom")
|
b.Property<string>("PointFrom")
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<string>("PointTo")
|
b.Property<string>("PointTo")
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<decimal>("SewerLength")
|
b.Property<decimal>("SewerLength")
|
||||||
.HasColumnType("numeric");
|
.HasColumnType("numeric");
|
||||||
|
|
||||||
b.Property<string>("StreetName")
|
b.Property<string>("StreetName")
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
@@ -142,18 +129,18 @@ namespace DaSaSo.EntityFramework.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b =>
|
modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("DaSaSo.Domain.Model.Project", null)
|
b.HasOne("DaSaSo.Domain.Model.Project", "Project")
|
||||||
.WithMany("BuildingSites")
|
.WithMany("BuildingSites")
|
||||||
.HasForeignKey("ProjectId");
|
.HasForeignKey("ProjectId");
|
||||||
|
|
||||||
|
b.Navigation("Project");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("DaSaSo.Domain.Model.Project", b =>
|
modelBuilder.Entity("DaSaSo.Domain.Model.Project", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("DaSaSo.Domain.Model.Client", "Client")
|
b.HasOne("DaSaSo.Domain.Model.Client", "Client")
|
||||||
.WithMany("Projects")
|
.WithMany("Projects")
|
||||||
.HasForeignKey("ClientId")
|
.HasForeignKey("ClientId");
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Client");
|
b.Navigation("Client");
|
||||||
});
|
});
|
||||||
@@ -162,9 +149,7 @@ namespace DaSaSo.EntityFramework.Migrations
|
|||||||
{
|
{
|
||||||
b.HasOne("DaSaSo.Domain.Model.Buildingsite", "BuildingSite")
|
b.HasOne("DaSaSo.Domain.Model.Buildingsite", "BuildingSite")
|
||||||
.WithMany("SewerObjects")
|
.WithMany("SewerObjects")
|
||||||
.HasForeignKey("BuildingSiteId")
|
.HasForeignKey("BuildingSiteId");
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("BuildingSite");
|
b.Navigation("BuildingSite");
|
||||||
});
|
});
|
||||||
|
|||||||
59
DaSaSo.EntityFramework/Services/BuildingsiteDataService.cs
Normal file
59
DaSaSo.EntityFramework/Services/BuildingsiteDataService.cs
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
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 BuildingsiteDataService : IDataService<Buildingsite>
|
||||||
|
{
|
||||||
|
private readonly DaSaSoDbContextFactory _contextFactory;
|
||||||
|
private readonly NonQueryDataService<Buildingsite> _nonQueryDataService;
|
||||||
|
|
||||||
|
public BuildingsiteDataService(DaSaSoDbContextFactory contextFactory)
|
||||||
|
{
|
||||||
|
_contextFactory = contextFactory;
|
||||||
|
_nonQueryDataService = new NonQueryDataService<Buildingsite>(contextFactory);
|
||||||
|
}
|
||||||
|
public async Task<Buildingsite> Create(Buildingsite entity)
|
||||||
|
{
|
||||||
|
return await _nonQueryDataService.Create(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<bool> Delete(int id)
|
||||||
|
{
|
||||||
|
return await _nonQueryDataService.Delete(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task<Buildingsite> Get(int id)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task<IEnumerable<Buildingsite>> GetAll()
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<IEnumerable<Buildingsite>> GetAllByProjekt(Project project)
|
||||||
|
{
|
||||||
|
// Get Clientid
|
||||||
|
int id = project.Id;
|
||||||
|
using (DaSaSoDbContext context = _contextFactory.CreateDbContext())
|
||||||
|
{
|
||||||
|
IEnumerable<Buildingsite> entities = await context.Buildingsites.Where(x => x.Project.Id == id).ToListAsync();
|
||||||
|
return entities;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<Buildingsite> Update(int id, Buildingsite entity)
|
||||||
|
{
|
||||||
|
return await _nonQueryDataService.Update(id, entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
45
DaSaSo.ViewModel/BuildingsiteListViewModel.cs
Normal file
45
DaSaSo.ViewModel/BuildingsiteListViewModel.cs
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
using DaSaSo.Domain.Model;
|
||||||
|
using DaSaSo.Domain.Services;
|
||||||
|
using DaSaSo.EntityFramework.Services;
|
||||||
|
using DaSaSo.ViewModel.Interface;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace DaSaSo.ViewModel
|
||||||
|
{
|
||||||
|
public class BuildingsiteListViewModel: BaseViewModel
|
||||||
|
{
|
||||||
|
public ObservableCollection<Buildingsite> Buildingsites { get; }
|
||||||
|
|
||||||
|
private readonly IActualProject _actualProject;
|
||||||
|
private readonly IRenavigator _renavigator;
|
||||||
|
private readonly BuildingsiteDataService _buildingSiteDataService;
|
||||||
|
|
||||||
|
public BuildingsiteListViewModel(IDataService<Buildingsite> buildingSiteDataService, IActualProject actualProject, IRenavigator renavigator)
|
||||||
|
{
|
||||||
|
_actualProject = actualProject;
|
||||||
|
_renavigator = renavigator;
|
||||||
|
_buildingSiteDataService = buildingSiteDataService as BuildingsiteDataService;
|
||||||
|
Buildingsites = new ObservableCollection<Buildingsite>();
|
||||||
|
|
||||||
|
LoadBuildingsites();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void LoadBuildingsites()
|
||||||
|
{
|
||||||
|
var buildingsites = await _buildingSiteDataService.GetAllByProjekt(_actualProject.AktuellProjekt);
|
||||||
|
InitCollection(Buildingsites, buildingsites);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InitCollection(ObservableCollection<Buildingsite> target, IEnumerable<Buildingsite> source)
|
||||||
|
{
|
||||||
|
target.Clear();
|
||||||
|
foreach (var i in source)
|
||||||
|
target.Add(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
27
DaSaSo.ViewModel/Commands/SelectProjectCommand.cs
Normal file
27
DaSaSo.ViewModel/Commands/SelectProjectCommand.cs
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
using DaSaSo.ViewModel.Interface;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace DaSaSo.ViewModel.Commands
|
||||||
|
{
|
||||||
|
public class SelectProjectCommand : AsyncCommandBase
|
||||||
|
{
|
||||||
|
private readonly IActualProject _actualProject;
|
||||||
|
private readonly ProjectListViewModel _projectListViewModel;
|
||||||
|
|
||||||
|
public SelectProjectCommand(IActualProject actualProject, ProjectListViewModel projectListViewModel)
|
||||||
|
{
|
||||||
|
_actualProject = actualProject;
|
||||||
|
_projectListViewModel = projectListViewModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task ExecuteAsync(object? parameter)
|
||||||
|
{
|
||||||
|
var s = _projectListViewModel.SelectedProject;
|
||||||
|
_actualProject.SetProject(s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -17,18 +17,20 @@ namespace DaSaSo.ViewModel.Factories
|
|||||||
private CreateViewModel<ClientListViewModel> _createClientListViewModel;
|
private CreateViewModel<ClientListViewModel> _createClientListViewModel;
|
||||||
private CreateViewModel<ClientEditViewModel> _createClientEditViewModel;
|
private CreateViewModel<ClientEditViewModel> _createClientEditViewModel;
|
||||||
private CreateViewModel<ProjectListViewModel> _createProjektListViewModel;
|
private CreateViewModel<ProjectListViewModel> _createProjektListViewModel;
|
||||||
|
private CreateViewModel<BuildingsiteListViewModel> _createBuildingsiteListViewModel;
|
||||||
|
|
||||||
public ViewModelAbstractFactory(
|
public ViewModelAbstractFactory(
|
||||||
CreateViewModel<HomeViewModel> createHomeViewModel,
|
CreateViewModel<HomeViewModel> createHomeViewModel,
|
||||||
CreateViewModel<ClientListViewModel> createClientListViewModel,
|
CreateViewModel<ClientListViewModel> createClientListViewModel,
|
||||||
CreateViewModel<ClientEditViewModel> createClientEditViewModel,
|
CreateViewModel<ClientEditViewModel> createClientEditViewModel,
|
||||||
CreateViewModel<ProjectListViewModel> createProjektListViewModel
|
CreateViewModel<ProjectListViewModel> createProjektListViewModel,
|
||||||
)
|
CreateViewModel<BuildingsiteListViewModel> createBuildingsiteListViewModel)
|
||||||
{
|
{
|
||||||
_createHomeViewModel = createHomeViewModel;
|
_createHomeViewModel = createHomeViewModel;
|
||||||
_createClientListViewModel = createClientListViewModel;
|
_createClientListViewModel = createClientListViewModel;
|
||||||
_createClientEditViewModel = createClientEditViewModel;
|
_createClientEditViewModel = createClientEditViewModel;
|
||||||
_createProjektListViewModel = createProjektListViewModel;
|
_createProjektListViewModel = createProjektListViewModel;
|
||||||
|
_createBuildingsiteListViewModel = createBuildingsiteListViewModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BaseViewModel CreateViewModel(EViewType viewType)
|
public BaseViewModel CreateViewModel(EViewType viewType)
|
||||||
@@ -44,9 +46,9 @@ namespace DaSaSo.ViewModel.Factories
|
|||||||
return _createClientEditViewModel();
|
return _createClientEditViewModel();
|
||||||
case EViewType.Projects:
|
case EViewType.Projects:
|
||||||
return _createProjektListViewModel();
|
return _createProjektListViewModel();
|
||||||
/*case EViewType.Buildingsites:
|
case EViewType.Buildingsites:
|
||||||
break;
|
return _createBuildingsiteListViewModel();
|
||||||
case EViewType.SewerObjects:
|
/*case EViewType.SewerObjects:
|
||||||
break;
|
break;
|
||||||
*/
|
*/
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using DaSaSo.Domain.Model;
|
using DaSaSo.Domain.Model;
|
||||||
using DaSaSo.Domain.Services;
|
using DaSaSo.Domain.Services;
|
||||||
using DaSaSo.EntityFramework.Services;
|
using DaSaSo.EntityFramework.Services;
|
||||||
|
using DaSaSo.ViewModel.Commands;
|
||||||
using DaSaSo.ViewModel.Interface;
|
using DaSaSo.ViewModel.Interface;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -9,6 +10,7 @@ using System.Diagnostics;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Input;
|
||||||
|
|
||||||
namespace DaSaSo.ViewModel
|
namespace DaSaSo.ViewModel
|
||||||
{
|
{
|
||||||
@@ -19,15 +21,31 @@ namespace DaSaSo.ViewModel
|
|||||||
private IActualProject actualProject;
|
private IActualProject actualProject;
|
||||||
private IRenavigator renavigator;
|
private IRenavigator renavigator;
|
||||||
public ObservableCollection<Project> Projekte { get; }
|
public ObservableCollection<Project> Projekte { get; }
|
||||||
|
private Project? _selectedProject;
|
||||||
|
|
||||||
|
public Project SelectedProject
|
||||||
|
{
|
||||||
|
get => _selectedProject;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if(_selectedProject != value)
|
||||||
|
{
|
||||||
|
_selectedProject = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ICommand SelectCommand { get; set; }
|
||||||
public ProjectListViewModel(IDataService<Project> genericDataService, IActualProject actualProject, IRenavigator renavigator)
|
public ProjectListViewModel(IDataService<Project> genericDataService, IActualProject actualProject, IRenavigator renavigator)
|
||||||
{
|
{
|
||||||
Projekte = new ObservableCollection<Project>();
|
Projekte = new ObservableCollection<Project>();
|
||||||
|
if (genericDataService == null) throw new ArgumentNullException("genericDataService");
|
||||||
|
|
||||||
this.genericDataService = (genericDataService as ProjectDataService);
|
this.genericDataService = (genericDataService as ProjectDataService);
|
||||||
this.actualProject = actualProject;
|
this.actualProject = actualProject;
|
||||||
this.renavigator = renavigator;
|
this.renavigator = renavigator;
|
||||||
|
SelectCommand = new SelectProjectCommand(actualProject, this);
|
||||||
LoadProjecte();
|
LoadProjecte();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ namespace DaSaSo.Wpf
|
|||||||
services.AddSingleton<DaSaSoDbContextFactory>(new DaSaSoDbContextFactory(connectionString));
|
services.AddSingleton<DaSaSoDbContextFactory>(new DaSaSoDbContextFactory(connectionString));
|
||||||
services.AddSingleton<IDataService<Client>, ClientDataService>();
|
services.AddSingleton<IDataService<Client>, ClientDataService>();
|
||||||
services.AddSingleton<IDataService<Project>, ProjectDataService>();
|
services.AddSingleton<IDataService<Project>, ProjectDataService>();
|
||||||
|
services.AddSingleton<IDataService<Buildingsite>, BuildingsiteDataService>();
|
||||||
services.AddSingleton<ClientListViewModel>();
|
services.AddSingleton<ClientListViewModel>();
|
||||||
|
|
||||||
|
|
||||||
@@ -79,6 +80,15 @@ namespace DaSaSo.Wpf
|
|||||||
services.GetRequiredService<INavigator>()));
|
services.GetRequiredService<INavigator>()));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
services.AddSingleton<CreateViewModel<BuildingsiteListViewModel>>(services =>
|
||||||
|
{
|
||||||
|
return () => new BuildingsiteListViewModel(
|
||||||
|
services.GetRequiredService<IDataService<Buildingsite>>(),
|
||||||
|
services.GetRequiredService<IActualProject>(),
|
||||||
|
new ViewModelDelegateRenavigator(
|
||||||
|
services.GetRequiredService<INavigator>()));
|
||||||
|
});
|
||||||
|
|
||||||
//services.AddSingleton<INavigator, Navigator>();
|
//services.AddSingleton<INavigator, Navigator>();
|
||||||
services.AddScoped<IActualProject, ActualProject>();
|
services.AddScoped<IActualProject, ActualProject>();
|
||||||
services.AddScoped<INavigator, Navigator>();
|
services.AddScoped<INavigator, Navigator>();
|
||||||
|
|||||||
@@ -10,6 +10,9 @@
|
|||||||
<Compile Update="Controls\NavigationBar.xaml.cs">
|
<Compile Update="Controls\NavigationBar.xaml.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Update="View\Buildingsites\BuildingSiteListView.xaml.cs">
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
<Compile Update="View\Client\ClientEditView.xaml.cs">
|
<Compile Update="View\Client\ClientEditView.xaml.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -33,6 +36,9 @@
|
|||||||
<Page Update="Styles\Navigation_Style.xaml">
|
<Page Update="Styles\Navigation_Style.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Update="View\Buildingsites\BuildingSiteListView.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
<Page Update="View\Client\ClientEditView.xaml">
|
<Page Update="View\Client\ClientEditView.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
|
|||||||
12
DaSaSo.Wpf/View/Buildingsites/BuildingSiteListView.xaml
Normal file
12
DaSaSo.Wpf/View/Buildingsites/BuildingSiteListView.xaml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<UserControl x:Class="DaSaSo.Wpf.View.Buildingsites.BuildingSiteListView"
|
||||||
|
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.Buildingsites"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="450" d:DesignWidth="800">
|
||||||
|
<Grid>
|
||||||
|
<DataGrid ItemsSource="{Binding Buildingsites}" />
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
28
DaSaSo.Wpf/View/Buildingsites/BuildingSiteListView.xaml.cs
Normal file
28
DaSaSo.Wpf/View/Buildingsites/BuildingSiteListView.xaml.cs
Normal 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.Buildingsites
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for BuildingSiteListView.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class BuildingSiteListView : UserControl
|
||||||
|
{
|
||||||
|
public BuildingSiteListView()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,8 +7,12 @@
|
|||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="450" d:DesignWidth="800">
|
d:DesignHeight="450" d:DesignWidth="800">
|
||||||
<Grid>
|
<Grid>
|
||||||
<DataGrid ItemsSource="{Binding Projekte}">
|
<StackPanel>
|
||||||
|
<DataGrid IsReadOnly="True" ItemsSource="{Binding Projekte}" SelectedItem="{Binding SelectedProject}">
|
||||||
|
|
||||||
|
</DataGrid>
|
||||||
|
<Button Content="Selektiere" Command="{Binding SelectCommand}" />
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
</DataGrid>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:ClientViews="clr-namespace:DaSaSo.Wpf.View.Client"
|
xmlns:ClientViews="clr-namespace:DaSaSo.Wpf.View.Client"
|
||||||
xmlns:ProjektViews="clr-namespace:DaSaSo.Wpf.View.Project"
|
xmlns:ProjektViews="clr-namespace:DaSaSo.Wpf.View.Project"
|
||||||
|
xmlns:BuildingsiteViews="clr-namespace:DaSaSo.Wpf.View.Buildingsites"
|
||||||
xmlns:controls="clr-namespace:DaSaSo.Wpf.Controls"
|
xmlns:controls="clr-namespace:DaSaSo.Wpf.Controls"
|
||||||
xmlns:View="clr-namespace:DaSaSo.Wpf.View"
|
xmlns:View="clr-namespace:DaSaSo.Wpf.View"
|
||||||
xmlns:local="clr-namespace:DaSaSo.Wpf" xmlns:viewmodel="clr-namespace:DaSaSo.ViewModel;assembly=DaSaSo.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:MainWindowViewModel}"
|
xmlns:local="clr-namespace:DaSaSo.Wpf" xmlns:viewmodel="clr-namespace:DaSaSo.ViewModel;assembly=DaSaSo.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:MainWindowViewModel}"
|
||||||
@@ -23,6 +24,9 @@
|
|||||||
<DataTemplate DataType="{x:Type viewmodel:HomeViewModel}">
|
<DataTemplate DataType="{x:Type viewmodel:HomeViewModel}">
|
||||||
<View:HomeView />
|
<View:HomeView />
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
|
<DataTemplate DataType="{x:Type viewmodel:BuildingsiteListViewModel}">
|
||||||
|
<BuildingsiteViews:BuildingSiteListView />
|
||||||
|
</DataTemplate>
|
||||||
</Window.Resources>
|
</Window.Resources>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"default": "Host = localhoste; Database = dasaso; Username = kansan; Password = kansan"
|
"default": "Host = localhost; Database = dasaso; Username = kansan; Password = kansan"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user