Sewerpoints und Objektnummern hinzugefügt
This commit is contained in:
@@ -9,6 +9,7 @@ namespace DaSaSo.Domain.Model
|
|||||||
public class Project : DomainObject
|
public class Project : DomainObject
|
||||||
{
|
{
|
||||||
public string Name { get; set; }
|
public string Name { 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>();
|
||||||
}
|
}
|
||||||
|
|||||||
14
DaSaSo.Domain/Services/ISewerPointDataService.cs
Normal file
14
DaSaSo.Domain/Services/ISewerPointDataService.cs
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
using DaSaSo.Domain.Model;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace DaSaSo.Domain.Services
|
||||||
|
{
|
||||||
|
public interface ISewerPointDataService : IDataService<SewerPoint>
|
||||||
|
{
|
||||||
|
Task<SewerPoint> GetbyObjektname(string objektname);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
using DaSaSo.Domain.Model;
|
using DaSaSo.Domain.Model;
|
||||||
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;
|
||||||
@@ -9,20 +10,25 @@ namespace DaSaSo.Domain.Services.SewerPointServices
|
|||||||
{
|
{
|
||||||
public class SewerpointService : ISewerpointService
|
public class SewerpointService : ISewerpointService
|
||||||
{
|
{
|
||||||
private readonly IDataService<SewerPoint> _sewerPointService;
|
private readonly ISewerPointDataService _sewerPointService;
|
||||||
|
|
||||||
public SewerpointService(IDataService<SewerPoint> sewerPointService)
|
public SewerpointService(ISewerPointDataService sewerPointService)
|
||||||
{
|
{
|
||||||
_sewerPointService = sewerPointService;
|
_sewerPointService = sewerPointService;
|
||||||
|
|
||||||
}
|
}
|
||||||
public async Task<SewerPoint> CreateOrFindSewerpoint(string objektbezeichnung)
|
public async Task<SewerPoint> CreateOrFindSewerpoint(string objektbezeichnung)
|
||||||
{
|
{
|
||||||
SewerPoint result = new SewerPoint()
|
SewerPoint result = await _sewerPointService.GetbyObjektname(objektbezeichnung);
|
||||||
|
if(result == null)
|
||||||
{
|
{
|
||||||
Objektnummer = objektbezeichnung
|
SewerPoint newPoint = new SewerPoint()
|
||||||
};
|
{
|
||||||
return await _sewerPointService.Create(result);
|
Objektnummer = objektbezeichnung
|
||||||
|
};
|
||||||
|
result = await _sewerPointService.Create(newPoint);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ namespace DaSaSo.EntityFramework
|
|||||||
public DbSet<SewerDamage>? SewerDamages { get; set; }
|
public DbSet<SewerDamage>? SewerDamages { get; set; }
|
||||||
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; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,10 +8,12 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace DaSaSo.EntityFramework
|
namespace DaSaSo.EntityFramework
|
||||||
{
|
{
|
||||||
public class DaSaSoDbContextFactory
|
public class DaSaSoDbContextFactory : IDesignTimeDbContextFactory<DaSaSoDbContext>
|
||||||
{
|
{
|
||||||
private readonly Action<DbContextOptionsBuilder> _configureDbContext;
|
private readonly Action<DbContextOptionsBuilder> _configureDbContext;
|
||||||
|
|
||||||
|
public DaSaSoDbContextFactory() { }
|
||||||
|
|
||||||
public DaSaSoDbContextFactory(Action<DbContextOptionsBuilder> configureDbContext)
|
public DaSaSoDbContextFactory(Action<DbContextOptionsBuilder> configureDbContext)
|
||||||
{
|
{
|
||||||
_configureDbContext = configureDbContext;
|
_configureDbContext = configureDbContext;
|
||||||
@@ -27,14 +29,22 @@ namespace DaSaSo.EntityFramework
|
|||||||
//DaSaSoDbContext result = new DaSaSoDbContext(options.Options);
|
//DaSaSoDbContext result = new DaSaSoDbContext(options.Options);
|
||||||
return new DaSaSoDbContext(options.Options);
|
return new DaSaSoDbContext(options.Options);
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
public DaSaSoDbContext CreateDbContext(string[]? args = null)
|
public DaSaSoDbContext CreateDbContext(string[] args)
|
||||||
{
|
{
|
||||||
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 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;
|
||||||
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
403
DaSaSo.EntityFramework/Migrations/20210928140403_SewerPointsAdded.Designer.cs
generated
Normal file
403
DaSaSo.EntityFramework/Migrations/20210928140403_SewerPointsAdded.Designer.cs
generated
Normal file
@@ -0,0 +1,403 @@
|
|||||||
|
// <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;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace DaSaSo.EntityFramework.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(DaSaSoDbContext))]
|
||||||
|
[Migration("20210928140403_SewerPointsAdded")]
|
||||||
|
partial class SewerPointsAdded
|
||||||
|
{
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "6.0.0-rc.1.21452.10")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||||
|
|
||||||
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||||
|
|
||||||
|
modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
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");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
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");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("DN")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<DateTime>("Date")
|
||||||
|
.HasColumnType("timestamp with 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");
|
||||||
|
|
||||||
|
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")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<DateTime>("Date")
|
||||||
|
.HasColumnType("timestamp with 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");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
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");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
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");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
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?>("PipeLinerId")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
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("PipeLinerId");
|
||||||
|
|
||||||
|
b.HasIndex("PunktObenId");
|
||||||
|
|
||||||
|
b.HasIndex("PunktUntenId");
|
||||||
|
|
||||||
|
b.ToTable("SewerObjects");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("DaSaSo.Domain.Model.SewerPoint", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Objektnummer")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("SewerPoints");
|
||||||
|
});
|
||||||
|
|
||||||
|
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.PipeLiner", "PipeLiner")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("PipeLinerId");
|
||||||
|
|
||||||
|
b.HasOne("DaSaSo.Domain.Model.SewerPoint", "PunktOben")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("PunktObenId");
|
||||||
|
|
||||||
|
b.HasOne("DaSaSo.Domain.Model.SewerPoint", "PunktUnten")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("PunktUntenId");
|
||||||
|
|
||||||
|
b.Navigation("BuildingSite");
|
||||||
|
|
||||||
|
b.Navigation("PipeLiner");
|
||||||
|
|
||||||
|
b.Navigation("PunktOben");
|
||||||
|
|
||||||
|
b.Navigation("PunktUnten");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("SewerObjects");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("DaSaSo.Domain.Model.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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,118 @@
|
|||||||
|
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");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
406
DaSaSo.EntityFramework/Migrations/20210928153745_ProjectNumberAdded.Designer.cs
generated
Normal file
406
DaSaSo.EntityFramework/Migrations/20210928153745_ProjectNumberAdded.Designer.cs
generated
Normal file
@@ -0,0 +1,406 @@
|
|||||||
|
// <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;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace DaSaSo.EntityFramework.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(DaSaSoDbContext))]
|
||||||
|
[Migration("20210928153745_ProjectNumberAdded")]
|
||||||
|
partial class ProjectNumberAdded
|
||||||
|
{
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "6.0.0-rc.1.21452.10")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||||
|
|
||||||
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||||
|
|
||||||
|
modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
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");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
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");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("DN")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<DateTime>("Date")
|
||||||
|
.HasColumnType("timestamp with 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");
|
||||||
|
|
||||||
|
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")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<DateTime>("Date")
|
||||||
|
.HasColumnType("timestamp with 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");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int?>("ClientId")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Projektnummer")
|
||||||
|
.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");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
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");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
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?>("PipeLinerId")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
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("PipeLinerId");
|
||||||
|
|
||||||
|
b.HasIndex("PunktObenId");
|
||||||
|
|
||||||
|
b.HasIndex("PunktUntenId");
|
||||||
|
|
||||||
|
b.ToTable("SewerObjects");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("DaSaSo.Domain.Model.SewerPoint", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Objektnummer")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("SewerPoints");
|
||||||
|
});
|
||||||
|
|
||||||
|
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.PipeLiner", "PipeLiner")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("PipeLinerId");
|
||||||
|
|
||||||
|
b.HasOne("DaSaSo.Domain.Model.SewerPoint", "PunktOben")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("PunktObenId");
|
||||||
|
|
||||||
|
b.HasOne("DaSaSo.Domain.Model.SewerPoint", "PunktUnten")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("PunktUntenId");
|
||||||
|
|
||||||
|
b.Navigation("BuildingSite");
|
||||||
|
|
||||||
|
b.Navigation("PipeLiner");
|
||||||
|
|
||||||
|
b.Navigation("PunktOben");
|
||||||
|
|
||||||
|
b.Navigation("PunktUnten");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("SewerObjects");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("DaSaSo.Domain.Model.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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
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");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,6 +6,8 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
|
|||||||
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))]
|
||||||
@@ -15,16 +17,18 @@ namespace DaSaSo.EntityFramework.Migrations
|
|||||||
{
|
{
|
||||||
#pragma warning disable 612, 618
|
#pragma warning disable 612, 618
|
||||||
modelBuilder
|
modelBuilder
|
||||||
.HasAnnotation("Relational:MaxIdentifierLength", 63)
|
.HasAnnotation("ProductVersion", "6.0.0-rc.1.21452.10")
|
||||||
.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");
|
||||||
@@ -42,15 +46,16 @@ namespace DaSaSo.EntityFramework.Migrations
|
|||||||
|
|
||||||
b.HasIndex("ProjectId");
|
b.HasIndex("ProjectId");
|
||||||
|
|
||||||
b.ToTable("Buildingsites", (string)null);
|
b.ToTable("Buildingsites");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("DaSaSo.Domain.Model.Client", b =>
|
modelBuilder.Entity("DaSaSo.Domain.Model.Client", 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>("Country")
|
b.Property<string>("Country")
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
@@ -69,21 +74,22 @@ namespace DaSaSo.EntityFramework.Migrations
|
|||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
b.ToTable("Clients", (string)null);
|
b.ToTable("Clients");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("DaSaSo.Domain.Model.Impregnation", b =>
|
modelBuilder.Entity("DaSaSo.Domain.Model.Impregnation", 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<int>("DN")
|
b.Property<int>("DN")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
|
|
||||||
b.Property<DateTime>("Date")
|
b.Property<DateTime>("Date")
|
||||||
.HasColumnType("timestamp without time zone");
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
b.Property<bool>("IsAvaible")
|
b.Property<bool>("IsAvaible")
|
||||||
.HasColumnType("boolean");
|
.HasColumnType("boolean");
|
||||||
@@ -102,15 +108,16 @@ namespace DaSaSo.EntityFramework.Migrations
|
|||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
b.ToTable("Impregnations", (string)null);
|
b.ToTable("Impregnations");
|
||||||
});
|
});
|
||||||
|
|
||||||
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);
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
b.Property<bool>("CleanedHD")
|
b.Property<bool>("CleanedHD")
|
||||||
.HasColumnType("boolean");
|
.HasColumnType("boolean");
|
||||||
@@ -125,7 +132,7 @@ namespace DaSaSo.EntityFramework.Migrations
|
|||||||
.HasColumnType("boolean");
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
b.Property<DateTime>("Date")
|
b.Property<DateTime>("Date")
|
||||||
.HasColumnType("timestamp without time zone");
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
b.Property<int?>("ImpregnationId")
|
b.Property<int?>("ImpregnationId")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
@@ -170,15 +177,16 @@ namespace DaSaSo.EntityFramework.Migrations
|
|||||||
|
|
||||||
b.HasIndex("ImpregnationId");
|
b.HasIndex("ImpregnationId");
|
||||||
|
|
||||||
b.ToTable("PipeLiners", (string)null);
|
b.ToTable("PipeLiners");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("DaSaSo.Domain.Model.Project", b =>
|
modelBuilder.Entity("DaSaSo.Domain.Model.Project", 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<int?>("ClientId")
|
b.Property<int?>("ClientId")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
@@ -186,19 +194,23 @@ namespace DaSaSo.EntityFramework.Migrations
|
|||||||
b.Property<string>("Name")
|
b.Property<string>("Name")
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Projektnummer")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
b.HasIndex("ClientId");
|
b.HasIndex("ClientId");
|
||||||
|
|
||||||
b.ToTable("Projects", (string)null);
|
b.ToTable("Projects");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("DaSaSo.Domain.Model.SewerDamage", b =>
|
modelBuilder.Entity("DaSaSo.Domain.Model.SewerDamage", 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<int>("DamageType")
|
b.Property<int>("DamageType")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
@@ -216,15 +228,16 @@ namespace DaSaSo.EntityFramework.Migrations
|
|||||||
|
|
||||||
b.HasIndex("SewerObjectId");
|
b.HasIndex("SewerObjectId");
|
||||||
|
|
||||||
b.ToTable("SewerDamages", (string)null);
|
b.ToTable("SewerDamages");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("DaSaSo.Domain.Model.SewerObject", b =>
|
modelBuilder.Entity("DaSaSo.Domain.Model.SewerObject", 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<int?>("BuildingSiteId")
|
b.Property<int?>("BuildingSiteId")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
@@ -284,22 +297,23 @@ namespace DaSaSo.EntityFramework.Migrations
|
|||||||
|
|
||||||
b.HasIndex("PunktUntenId");
|
b.HasIndex("PunktUntenId");
|
||||||
|
|
||||||
b.ToTable("SewerObjects", (string)null);
|
b.ToTable("SewerObjects");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("DaSaSo.Domain.Model.SewerPoint", b =>
|
modelBuilder.Entity("DaSaSo.Domain.Model.SewerPoint", 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>("Objektnummer")
|
b.Property<string>("Objektnummer")
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
b.ToTable("SewerPoint", (string)null);
|
b.ToTable("SewerPoints");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b =>
|
modelBuilder.Entity("DaSaSo.Domain.Model.Buildingsite", b =>
|
||||||
|
|||||||
@@ -40,7 +40,11 @@ namespace DaSaSo.EntityFramework.Services
|
|||||||
{
|
{
|
||||||
using (DaSaSoDbContext context = _contextFactory.CreateDbContext())
|
using (DaSaSoDbContext context = _contextFactory.CreateDbContext())
|
||||||
{
|
{
|
||||||
SewerObject? s = await context.SewerObjects.Include("BuildingSite").FirstOrDefaultAsync((e) => e.Id == id);
|
SewerObject? s = await context.SewerObjects
|
||||||
|
.Include("BuildingSite")
|
||||||
|
.Include("PunktOben")
|
||||||
|
.Include("PunktUnten")
|
||||||
|
.FirstOrDefaultAsync((e) => e.Id == id);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using DaSaSo.Domain.Model;
|
using DaSaSo.Domain.Model;
|
||||||
using DaSaSo.Domain.Services;
|
using DaSaSo.Domain.Services;
|
||||||
using DaSaSo.EntityFramework.Services.Common;
|
using DaSaSo.EntityFramework.Services.Common;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -9,7 +10,7 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace DaSaSo.EntityFramework.Services
|
namespace DaSaSo.EntityFramework.Services
|
||||||
{
|
{
|
||||||
public class SewerpointDataService : IDataService<SewerPoint>
|
public class SewerpointDataService : ISewerPointDataService
|
||||||
{
|
{
|
||||||
private readonly DaSaSoDbContextFactory _contextFactory;
|
private readonly DaSaSoDbContextFactory _contextFactory;
|
||||||
private readonly NonQueryDataService<SewerPoint> _nonQueryDataService;
|
private readonly NonQueryDataService<SewerPoint> _nonQueryDataService;
|
||||||
@@ -45,6 +46,14 @@ namespace DaSaSo.EntityFramework.Services
|
|||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<SewerPoint> GetbyObjektname(string objektname)
|
||||||
|
{
|
||||||
|
using (DaSaSoDbContext context = _contextFactory.CreateDbContext())
|
||||||
|
{
|
||||||
|
return await context.SewerPoints.FirstOrDefaultAsync((e) => e.Objektnummer == objektname);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public async Task<SewerPoint> Update(int id, SewerPoint entity)
|
public async Task<SewerPoint> Update(int id, SewerPoint entity)
|
||||||
{
|
{
|
||||||
return await _nonQueryDataService.Update(id, entity);
|
return await _nonQueryDataService.Update(id, entity);
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ namespace DaSaSo.ViewModel.Commands
|
|||||||
{
|
{
|
||||||
|
|
||||||
Client newClient = await dataservice.Create(new Client());
|
Client newClient = await dataservice.Create(new Client());
|
||||||
actualProject.SetClient(newClient);
|
actualProject.SetClient(newClient,false);
|
||||||
//actualProject.SetClient(clientListViewModel.SelectedClient);
|
//actualProject.SetClient(clientListViewModel.SelectedClient);
|
||||||
renavigator.Renavigate(new ClientEditViewModel(dataservice, actualProject, renavigator));
|
renavigator.Renavigate(new ClientEditViewModel(dataservice, actualProject, renavigator));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ namespace DaSaSo.ViewModel.Commands
|
|||||||
private readonly IRenavigator _renavigator;
|
private readonly IRenavigator _renavigator;
|
||||||
private readonly ISewerMainNavigator _navigator;
|
private readonly ISewerMainNavigator _navigator;
|
||||||
|
|
||||||
public SaveSewerCommand(SewerMainListViewModel sewerMainListViewModel,
|
public SaveSewerCommand(
|
||||||
|
SewerMainListViewModel sewerMainListViewModel,
|
||||||
IDataService<SewerObject> dataService,
|
IDataService<SewerObject> dataService,
|
||||||
IActualProject actualProject,
|
IActualProject actualProject,
|
||||||
ISewerObjectService sewerObjectService,
|
ISewerObjectService sewerObjectService,
|
||||||
@@ -43,11 +44,11 @@ namespace DaSaSo.ViewModel.Commands
|
|||||||
public override async Task ExecuteAsync(object? parameter)
|
public override async Task ExecuteAsync(object? parameter)
|
||||||
{
|
{
|
||||||
_navigator.CurrentViewModel = null;
|
_navigator.CurrentViewModel = null;
|
||||||
var s = _navigator;
|
|
||||||
//Debugger.Break();
|
//Debugger.Break();
|
||||||
//var d = await _sewerPointService.CreateOrFindSewerpoint("123");
|
|
||||||
//_actualProject.AktuellSewerObject.PunktOben = d;
|
//_actualProject.AktuellSewerObject.PunktOben = d;
|
||||||
_ = await _dataService.Update(_actualProject.AktuellSewerObject.Id, _actualProject.AktuellSewerObject);
|
//_ = await _dataService.Update(_actualProject.AktuellSewerObject.Id, _actualProject.AktuellSewerObject);
|
||||||
_renavigator.Renavigate(new SewerObjectListViewModel(_dataService, _actualProject, _sewerObjectService));
|
_renavigator.Renavigate(new SewerObjectListViewModel(_dataService, _actualProject, _sewerObjectService));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
51
DaSaSo.ViewModel/Commands/SaveSewerStammdatenCommand.cs
Normal file
51
DaSaSo.ViewModel/Commands/SaveSewerStammdatenCommand.cs
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
using DaSaSo.Domain.Model;
|
||||||
|
using DaSaSo.Domain.Services;
|
||||||
|
using DaSaSo.Domain.Services.SewerPointServices;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace DaSaSo.ViewModel.Commands
|
||||||
|
{
|
||||||
|
class SaveSewerStammdatenCommand : AsyncCommandBase
|
||||||
|
{
|
||||||
|
private readonly SewerStammdatenViewModel _stammdatenViewModel;
|
||||||
|
private IDataService<SewerObject> _dataService;
|
||||||
|
private readonly ISewerpointService _sewerPointService;
|
||||||
|
|
||||||
|
public SaveSewerStammdatenCommand(SewerStammdatenViewModel stammdatenViewModel, IDataService<SewerObject> dataService, ISewerpointService sewerpointService)
|
||||||
|
{
|
||||||
|
_stammdatenViewModel = stammdatenViewModel;
|
||||||
|
_dataService = dataService;
|
||||||
|
_sewerPointService = sewerpointService;
|
||||||
|
}
|
||||||
|
public override async Task ExecuteAsync(object? parameter)
|
||||||
|
{
|
||||||
|
if (_stammdatenViewModel._oberepunkt != null)
|
||||||
|
{
|
||||||
|
if ((_stammdatenViewModel.Model.PunktOben == null) || (_stammdatenViewModel._oberepunkt != _stammdatenViewModel.Model.PunktOben.Objektnummer))
|
||||||
|
{
|
||||||
|
SewerPoint punktOben = await _sewerPointService.CreateOrFindSewerpoint(_stammdatenViewModel._oberepunkt);
|
||||||
|
_stammdatenViewModel.Model.PunktOben = punktOben;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (_stammdatenViewModel._unterepunkt != null)
|
||||||
|
{
|
||||||
|
if ((_stammdatenViewModel.Model.PunktUnten == null) || (_stammdatenViewModel._unterepunkt != _stammdatenViewModel.Model.PunktUnten.Objektnummer))
|
||||||
|
{
|
||||||
|
SewerPoint punktUnten = await _sewerPointService.CreateOrFindSewerpoint(_stammdatenViewModel._unterepunkt);
|
||||||
|
_stammdatenViewModel.Model.PunktUnten = punktUnten;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_stammdatenViewModel.Model = await _dataService.Update(_stammdatenViewModel.Model.Id, _stammdatenViewModel.Model);
|
||||||
|
Trace.WriteLine("Daten gespeichert");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -18,7 +18,7 @@ namespace DaSaSo.ViewModel.Interface
|
|||||||
Buildingsite AktuellBaustelle { get; }
|
Buildingsite AktuellBaustelle { get; }
|
||||||
SewerObject AktuellSewerObject { get; }
|
SewerObject AktuellSewerObject { get; }
|
||||||
|
|
||||||
void SetClient(Client client);
|
void SetClient(Client client, bool notification = true);
|
||||||
void SetProject(Project project, bool notification = true);
|
void SetProject(Project project, bool notification = true);
|
||||||
void SetBuildingSite(Buildingsite buildingsite);
|
void SetBuildingSite(Buildingsite buildingsite);
|
||||||
void SetSewerObject(SewerObject sewerObject, bool notification = true);
|
void SetSewerObject(SewerObject sewerObject, bool notification = true);
|
||||||
|
|||||||
@@ -34,6 +34,18 @@ namespace DaSaSo.ViewModel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public string ProjektNummer
|
||||||
|
{
|
||||||
|
get => _model.Projektnummer;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if(_model.Projektnummer != value)
|
||||||
|
{
|
||||||
|
_model.Projektnummer = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public ProjectEditViewModel(IDataService<Project> dataservice, IActualProject actualProject,IRenavigator renavigator, IProjectService projectService)
|
public ProjectEditViewModel(IDataService<Project> dataservice, IActualProject actualProject,IRenavigator renavigator, IProjectService projectService)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -56,14 +56,9 @@ namespace DaSaSo.ViewModel
|
|||||||
LoadProjecte();
|
LoadProjecte();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async void LoadProjecte()
|
public void LoadProjecte()
|
||||||
{
|
{
|
||||||
|
InitCollection(Projekte, actualProject.AktuellClient.Projects);
|
||||||
var projekte = await genericDataService.GetAllByClient(actualProject.AktuellClient);
|
|
||||||
//
|
|
||||||
InitCollection(Projekte, projekte);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitCollection(ObservableCollection<Project> target, IEnumerable<Project> source)
|
private void InitCollection(ObservableCollection<Project> target, IEnumerable<Project> source)
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
using DaSaSo.Domain.Model;
|
using DaSaSo.Domain.Model;
|
||||||
using DaSaSo.Domain.Services;
|
using DaSaSo.Domain.Services;
|
||||||
|
using DaSaSo.Domain.Services.SewerPointServices;
|
||||||
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;
|
||||||
@@ -8,14 +10,20 @@ 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
|
||||||
{
|
{
|
||||||
public class SewerStammdatenViewModel : BaseViewModel
|
public class SewerStammdatenViewModel : BaseViewModel
|
||||||
{
|
{
|
||||||
private readonly IActualProject _actualProject;
|
private readonly IActualProject _actualProject;
|
||||||
|
private readonly ISewerpointService _sewerpointService;
|
||||||
private SewerObject _model;
|
private SewerObject _model;
|
||||||
|
|
||||||
|
public ICommand SaveCommand { get; set; }
|
||||||
|
public string _oberepunkt { get; set; }
|
||||||
|
public string _unterepunkt { get; set; }
|
||||||
|
|
||||||
public string Haltungsname
|
public string Haltungsname
|
||||||
{
|
{
|
||||||
get => Model.ObjektName;
|
get => Model.ObjektName;
|
||||||
@@ -28,8 +36,39 @@ namespace DaSaSo.ViewModel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public string Oberepunkt { get; set; }
|
|
||||||
public string Unterepunkt { get; set; }
|
public string Oberepunkt
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (_model.PunktOben != null)
|
||||||
|
return _model.PunktOben.Objektnummer;
|
||||||
|
return _oberepunkt;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if(_oberepunkt != value)
|
||||||
|
{
|
||||||
|
_oberepunkt = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public string Unterepunkt
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (_model.PunktUnten != null)
|
||||||
|
return _model.PunktUnten.Objektnummer;
|
||||||
|
return _unterepunkt;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if(_unterepunkt != value)
|
||||||
|
{
|
||||||
|
_unterepunkt = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
public int Durchmesser
|
public int Durchmesser
|
||||||
{
|
{
|
||||||
get => Model.DN;
|
get => Model.DN;
|
||||||
@@ -110,13 +149,12 @@ namespace DaSaSo.ViewModel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public SewerStammdatenViewModel(IActualProject actualProject)
|
public SewerStammdatenViewModel(IActualProject actualProject, IDataService<SewerObject> dataService, ISewerpointService sewerpointService)
|
||||||
{
|
{
|
||||||
_actualProject = actualProject;
|
_actualProject = actualProject;
|
||||||
|
|
||||||
Model = _actualProject.AktuellSewerObject;
|
Model = _actualProject.AktuellSewerObject;
|
||||||
|
SaveCommand = new SaveSewerStammdatenCommand(this, dataService, sewerpointService);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~SewerStammdatenViewModel()
|
~SewerStammdatenViewModel()
|
||||||
|
|||||||
@@ -39,10 +39,11 @@ namespace DaSaSo.ViewModel.State.ActualState
|
|||||||
SewerObjectChanged?.Invoke(this, new EventArgs());
|
SewerObjectChanged?.Invoke(this, new EventArgs());
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
public void SetClient(Client client)
|
public void SetClient(Client client, bool notification = true)
|
||||||
{
|
{
|
||||||
AktuellClient = client;
|
AktuellClient = client;
|
||||||
OnClientChanged();
|
if(notification)
|
||||||
|
OnClientChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetProject(Project project, bool notification = true)
|
public void SetProject(Project project, bool notification = true)
|
||||||
|
|||||||
@@ -8,6 +8,10 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.0-preview.7.21378.4">
|
||||||
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.0-rc.1.21451.13" />
|
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.0-rc.1.21451.13" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ namespace DaSaSo.Wpf.HostBuilders
|
|||||||
services.AddSingleton<IBuildingsiteService, BuildingsiteService>();
|
services.AddSingleton<IBuildingsiteService, BuildingsiteService>();
|
||||||
services.AddSingleton<ISewerObjectService, SewerObjectService>();
|
services.AddSingleton<ISewerObjectService, SewerObjectService>();
|
||||||
services.AddSingleton<ISewerpointService, SewerpointService>();
|
services.AddSingleton<ISewerpointService, SewerpointService>();
|
||||||
|
services.AddSingleton<ISewerPointDataService, SewerpointDataService>();
|
||||||
});
|
});
|
||||||
return host;
|
return host;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,9 @@ namespace DaSaSo.Wpf.HostBuilders
|
|||||||
services.AddTransient<CreateViewModel<SewerStammdatenViewModel>>(services =>
|
services.AddTransient<CreateViewModel<SewerStammdatenViewModel>>(services =>
|
||||||
{
|
{
|
||||||
return () => new SewerStammdatenViewModel(
|
return () => new SewerStammdatenViewModel(
|
||||||
services.GetRequiredService<IActualProject>()
|
services.GetRequiredService<IActualProject>(),
|
||||||
|
services.GetRequiredService<IDataService<SewerObject>>(),
|
||||||
|
services.GetRequiredService<ISewerpointService>()
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
services.AddSingleton<CreateViewModel<SewerDamageListViewModel>>(services =>
|
services.AddSingleton<CreateViewModel<SewerDamageListViewModel>>(services =>
|
||||||
|
|||||||
@@ -13,8 +13,16 @@
|
|||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Label Grid.Column="0" Content="Projektname" />
|
<Grid.RowDefinitions>
|
||||||
<TextBox Grid.Column="1" Text="{Binding ProjektName}" />
|
<RowDefinition />
|
||||||
|
<RowDefinition />
|
||||||
|
</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}" />
|
||||||
|
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding ProjektNummer}" />
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
<Button Content="Speichern" Command="{Binding SaveProjectCommand}" />
|
<Button Content="Speichern" Command="{Binding SaveProjectCommand}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
<Controls:SewerObjectNavigationBar Grid.Column="0" />
|
<Controls:SewerObjectNavigationBar Grid.Column="0" />
|
||||||
<ContentControl Grid.Column="1" Content="{Binding CurrentSewerViewModel}" />
|
<ContentControl Grid.Column="1" Content="{Binding CurrentSewerViewModel}" />
|
||||||
<StackPanel Grid.Row="1" Grid.ColumnSpan="2">
|
<StackPanel Grid.Row="1" Grid.ColumnSpan="2">
|
||||||
<Button Content="Speichern und Schließen" Command="{Binding SaveCommand}" />
|
<Button Content="Schließen" Command="{Binding SaveCommand}" />
|
||||||
<StatusBar Grid.Row="1" Grid.ColumnSpan="2">
|
<StatusBar Grid.Row="1" Grid.ColumnSpan="2">
|
||||||
<StatusBarItem Content="Dada" />
|
<StatusBarItem Content="Dada" />
|
||||||
</StatusBar>
|
</StatusBar>
|
||||||
|
|||||||
@@ -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:local="clr-namespace:DaSaSo.Wpf.View.SewerObject" xmlns:viewmodel="clr-namespace:DaSaSo.ViewModel;assembly=DaSaSo.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>
|
||||||
@@ -11,6 +11,10 @@
|
|||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition />
|
||||||
|
<RowDefinition Height="auto" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
<Grid Grid.Column="0">
|
<Grid Grid.Column="0">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
@@ -51,5 +55,6 @@
|
|||||||
<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 Ort}" Margin="20"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
<Button Grid.Row="1" Grid.ColumnSpan="2" FontSize="20" Content="Speichern" Command="{Binding SaveCommand}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"databaseToUse": "sqlite",
|
"databaseToUse": "default",
|
||||||
"default": "Host = localhost; Database = dasaso; Username = kansan; Password = kansan",
|
"default": "Host = localhost; Database = dasaso; Username = kansan; Password = kansan",
|
||||||
"sqlite": "Data Source=database.db"
|
"sqlite": "Data Source=database.db"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user