Daten um Vermesser und Aufnahmedatum erweitert
This commit is contained in:
@@ -1,7 +1,3 @@
|
|||||||
-- Table: public.schacht
|
|
||||||
|
|
||||||
-- DROP TABLE IF EXISTS public.schacht;
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS public.schacht
|
CREATE TABLE IF NOT EXISTS public.schacht
|
||||||
(
|
(
|
||||||
schacht_id integer NOT NULL GENERATED BY DEFAULT AS IDENTITY ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 2147483647 CACHE 1 ),
|
schacht_id integer NOT NULL GENERATED BY DEFAULT AS IDENTITY ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 2147483647 CACHE 1 ),
|
||||||
@@ -13,6 +9,8 @@ CREATE TABLE IF NOT EXISTS public.schacht
|
|||||||
sohlhochwert numeric(18,4),
|
sohlhochwert numeric(18,4),
|
||||||
sohlhoehe numeric(18,4) NOT NULL,
|
sohlhoehe numeric(18,4) NOT NULL,
|
||||||
entwaesserung integer NOT NULL,
|
entwaesserung integer NOT NULL,
|
||||||
|
vermesser text COLLATE pg_catalog."default",
|
||||||
|
aufnahmedatum text COLLATE pg_catalog."default",
|
||||||
ref_projekt_id integer,
|
ref_projekt_id integer,
|
||||||
CONSTRAINT "PK_schacht" PRIMARY KEY (schacht_id),
|
CONSTRAINT "PK_schacht" PRIMARY KEY (schacht_id),
|
||||||
CONSTRAINT "FK_schacht_Projekte_ProjektId" FOREIGN KEY (ref_projekt_id)
|
CONSTRAINT "FK_schacht_Projekte_ProjektId" FOREIGN KEY (ref_projekt_id)
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ namespace SewerStammGen.DAL.Services.PostgresqlData
|
|||||||
{
|
{
|
||||||
string command = "INSERT INTO " + tableName + " (" +
|
string command = "INSERT INTO " + tableName + " (" +
|
||||||
"objektbezeichnung,deckelrechtswert,deckelhochwert," +
|
"objektbezeichnung,deckelrechtswert,deckelhochwert," +
|
||||||
"sohlrechtswert,sohlhochwert,sohlhoehe,deckelhoehe,entwaesserung,ref_projekt_id) VALUES " +
|
"sohlrechtswert,sohlhochwert,sohlhoehe,deckelhoehe,entwaesserung,vermesser,aufnahmedatum,ref_projekt_id) VALUES " +
|
||||||
"(@1,@2,@3,@4,@5,@6,@7,@8,@9) RETURNING schacht_id";
|
"(@1,@2,@3,@4,@5,@6,@7,@8,@9,@10,@11) RETURNING schacht_id";
|
||||||
using(var cmd = new NpgsqlCommand(command,conn))
|
using(var cmd = new NpgsqlCommand(command,conn))
|
||||||
{
|
{
|
||||||
cmd.Parameters.AddWithValue("1", entity.Objektbezeichnung);
|
cmd.Parameters.AddWithValue("1", entity.Objektbezeichnung);
|
||||||
@@ -32,7 +32,9 @@ namespace SewerStammGen.DAL.Services.PostgresqlData
|
|||||||
cmd.Parameters.AddWithValue("6", entity.SohlHoehe);
|
cmd.Parameters.AddWithValue("6", entity.SohlHoehe);
|
||||||
cmd.Parameters.AddWithValue("7", entity.DeckelHoehe);
|
cmd.Parameters.AddWithValue("7", entity.DeckelHoehe);
|
||||||
cmd.Parameters.AddWithValue("8", (int)entity.Entwaesserung);
|
cmd.Parameters.AddWithValue("8", (int)entity.Entwaesserung);
|
||||||
cmd.Parameters.AddWithValue("9", entity.Projekt.Id);
|
cmd.Parameters.AddWithValue("9", entity.Vermesser);
|
||||||
|
cmd.Parameters.AddWithValue("10", entity.AufnahmeDatum);
|
||||||
|
cmd.Parameters.AddWithValue("11", entity.Projekt.Id);
|
||||||
using var reader = await cmd.ExecuteReaderAsync();
|
using var reader = await cmd.ExecuteReaderAsync();
|
||||||
reader.Read();
|
reader.Read();
|
||||||
entity.Id = reader.GetInt32(0);
|
entity.Id = reader.GetInt32(0);
|
||||||
@@ -63,7 +65,9 @@ namespace SewerStammGen.DAL.Services.PostgresqlData
|
|||||||
SohlHochWert = reader.GetDecimal(6),
|
SohlHochWert = reader.GetDecimal(6),
|
||||||
SohlHoehe = reader.GetDecimal(7),
|
SohlHoehe = reader.GetDecimal(7),
|
||||||
Entwaesserung = (EEntwaeserung)reader.GetInt32(8),
|
Entwaesserung = (EEntwaeserung)reader.GetInt32(8),
|
||||||
Projekt = new Projekt() { Id = reader.GetInt32(9) },
|
Vermesser = reader.GetString(9),
|
||||||
|
AufnahmeDatum = reader.GetString(10),
|
||||||
|
Projekt = new Projekt() { Id = reader.GetInt32(11) },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,7 +99,7 @@ namespace SewerStammGen.DAL.Services.PostgresqlData
|
|||||||
{
|
{
|
||||||
string command = @"UPDATE " + tableName + " SET " +
|
string command = @"UPDATE " + tableName + " SET " +
|
||||||
"objektbezeichnung=@1, deckelrechtswert=@2, deckelhochwert=@3, deckelhoehe=@4, " +
|
"objektbezeichnung=@1, deckelrechtswert=@2, deckelhochwert=@3, deckelhoehe=@4, " +
|
||||||
"sohlrechtswert=@5, sohlhochwert=@6, sohlhoehe=@7, entwaesserung=@8, ref_projekt_id=@9 WHERE schacht_id=@10";
|
"sohlrechtswert=@5, sohlhochwert=@6, sohlhoehe=@7, entwaesserung=@8, vermesser=@9, aufnahmedatum=@10, ref_projekt_id=@11 WHERE schacht_id=@12";
|
||||||
using(var cmd = new NpgsqlCommand(command,conn))
|
using(var cmd = new NpgsqlCommand(command,conn))
|
||||||
{
|
{
|
||||||
cmd.Parameters.AddWithValue("1", entity.Objektbezeichnung);
|
cmd.Parameters.AddWithValue("1", entity.Objektbezeichnung);
|
||||||
@@ -106,8 +110,10 @@ namespace SewerStammGen.DAL.Services.PostgresqlData
|
|||||||
cmd.Parameters.AddWithValue("6", entity.SohlHochWert);
|
cmd.Parameters.AddWithValue("6", entity.SohlHochWert);
|
||||||
cmd.Parameters.AddWithValue("7", entity.SohlHoehe);
|
cmd.Parameters.AddWithValue("7", entity.SohlHoehe);
|
||||||
cmd.Parameters.AddWithValue("8", (int)entity.Entwaesserung);
|
cmd.Parameters.AddWithValue("8", (int)entity.Entwaesserung);
|
||||||
cmd.Parameters.AddWithValue("9", entity.Projekt.Id);
|
cmd.Parameters.AddWithValue("9", entity.Vermesser);
|
||||||
cmd.Parameters.AddWithValue("10", entity.Id);
|
cmd.Parameters.AddWithValue("10", entity.AufnahmeDatum);
|
||||||
|
cmd.Parameters.AddWithValue("11", entity.Projekt.Id);
|
||||||
|
cmd.Parameters.AddWithValue("12", entity.Id);
|
||||||
|
|
||||||
await cmd.ExecuteNonQueryAsync();
|
await cmd.ExecuteNonQueryAsync();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,5 +19,7 @@ namespace SewerStammGen.Shared.Domain
|
|||||||
public decimal SohlHoehe { get; set; }
|
public decimal SohlHoehe { get; set; }
|
||||||
public Projekt Projekt { get; set; } = new Projekt();
|
public Projekt Projekt { get; set; } = new Projekt();
|
||||||
public EEntwaeserung Entwaesserung { get; set; }
|
public EEntwaeserung Entwaesserung { get; set; }
|
||||||
|
public string Vermesser { get; set; } = String.Empty;
|
||||||
|
public string AufnahmeDatum { get; set; } = String.Empty;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,7 +89,6 @@ namespace StammGenerator.ViewModel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public decimal SohlHoehe
|
public decimal SohlHoehe
|
||||||
{
|
{
|
||||||
get => _model.SohlHoehe;
|
get => _model.SohlHoehe;
|
||||||
@@ -102,6 +101,30 @@ namespace StammGenerator.ViewModel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public string Vermesser
|
||||||
|
{
|
||||||
|
get => _model.Vermesser;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if(_model.Vermesser != value)
|
||||||
|
{
|
||||||
|
_model.Vermesser = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public string AufnahmeDatum
|
||||||
|
{
|
||||||
|
get => _model.AufnahmeDatum;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if(_model.AufnahmeDatum != value)
|
||||||
|
{
|
||||||
|
_model.AufnahmeDatum = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
public EEntwaeserung Entwaeserung
|
public EEntwaeserung Entwaeserung
|
||||||
{
|
{
|
||||||
get => _model.Entwaesserung;
|
get => _model.Entwaesserung;
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
</DataGrid>
|
</DataGrid>
|
||||||
<Button Content="Hinzufügen" Command="{Binding AddCommand}" />
|
<Button Content="Hinzufügen" Command="{Binding AddCommand}" />
|
||||||
<Button Content="Editieren" Command="{Binding EditCommand}" />
|
<Button Content="Editieren" Command="{Binding EditCommand}" />
|
||||||
<Button Content="Daten Exportieren" Command="{Binding ExportCommand}" Width="220" Height="220" BorderBrush="AliceBlue" BorderThickness="5" HorizontalAlignment="Left" />
|
<!--<Button Content="Daten Exportieren" Command="{Binding ExportCommand}" Width="220" Height="220" BorderBrush="AliceBlue" BorderThickness="5" HorizontalAlignment="Left" />-->
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
@@ -27,6 +27,8 @@
|
|||||||
<RowDefinition Height="auto" />
|
<RowDefinition Height="auto" />
|
||||||
<RowDefinition Height="auto" />
|
<RowDefinition Height="auto" />
|
||||||
<RowDefinition Height="auto" />
|
<RowDefinition Height="auto" />
|
||||||
|
<RowDefinition Height="auto" />
|
||||||
|
<RowDefinition Height="auto" />
|
||||||
<RowDefinition />
|
<RowDefinition />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
@@ -37,8 +39,9 @@
|
|||||||
<Label Grid.Column="0" Grid.Row="4" Content="Sohl Rechtswert" />
|
<Label Grid.Column="0" Grid.Row="4" Content="Sohl Rechtswert" />
|
||||||
<Label Grid.Column="0" Grid.Row="5" Content="Sohl Hochwert" />
|
<Label Grid.Column="0" Grid.Row="5" Content="Sohl Hochwert" />
|
||||||
<Label Grid.Column="0" Grid.Row="6" Content="Sohl Höhe" />
|
<Label Grid.Column="0" Grid.Row="6" Content="Sohl Höhe" />
|
||||||
<!--<Label Grid.Column="0" Grid.Row="7" Content="Deckelhöhe" />-->
|
<Label Grid.Column="0" Grid.Row="7" Content="Vermesser" />
|
||||||
<Label Grid.Column="0" Grid.Row="7" Content="Entwässerungsart" />
|
<Label Grid.Column="0" Grid.Row="8" Content="Aufnahmedatum" />
|
||||||
|
<Label Grid.Column="0" Grid.Row="9" Content="Entwässerungsart" />
|
||||||
|
|
||||||
<TextBox Margin="2" Grid.Column="1" Grid.Row="0" Text="{Binding Objektbezeichnung}" />
|
<TextBox Margin="2" Grid.Column="1" Grid.Row="0" Text="{Binding Objektbezeichnung}" />
|
||||||
<TextBox Margin="2" Grid.Column="1" Grid.Row="1" Text="{Binding DeckelRechtsWert}" />
|
<TextBox Margin="2" Grid.Column="1" Grid.Row="1" Text="{Binding DeckelRechtsWert}" />
|
||||||
@@ -47,15 +50,17 @@
|
|||||||
<TextBox Margin="2" Grid.Column="1" Grid.Row="4" Text="{Binding SohlRechtsWert}" />
|
<TextBox Margin="2" Grid.Column="1" Grid.Row="4" Text="{Binding SohlRechtsWert}" />
|
||||||
<TextBox Margin="2" Grid.Column="1" Grid.Row="5" Text="{Binding SohlHochWert}" />
|
<TextBox Margin="2" Grid.Column="1" Grid.Row="5" Text="{Binding SohlHochWert}" />
|
||||||
<TextBox Margin="2" Grid.Column="1" Grid.Row="6" Text="{Binding SohlHoehe}" />
|
<TextBox Margin="2" Grid.Column="1" Grid.Row="6" Text="{Binding SohlHoehe}" />
|
||||||
|
<TextBox Margin="2" Grid.Column="1" Grid.Row="7" Text="{Binding Vermesser}" />
|
||||||
|
<TextBox Margin="2" Grid.Column="1" Grid.Row="8" Text="{Binding AufnahmeDatum}" />
|
||||||
|
|
||||||
<DockPanel Grid.Column="1" Grid.Row="7">
|
<DockPanel Grid.Column="1" Grid.Row="9">
|
||||||
<RadioButton Style="{StaticResource ToggleButtonList}" Content="Regenwasser" IsChecked="{Binding Entwaeserung, Converter={StaticResource EqualValueToParameterConverter},ConverterParameter={x:Static stat:EEntwaeserung.Regenwasser}}" />
|
<RadioButton Style="{StaticResource ToggleButtonList}" Content="Regenwasser" IsChecked="{Binding Entwaeserung, Converter={StaticResource EqualValueToParameterConverter},ConverterParameter={x:Static stat:EEntwaeserung.Regenwasser}}" />
|
||||||
<RadioButton Style="{StaticResource ToggleButtonList}" Content="Schmutzwasser" IsChecked="{Binding Entwaeserung, Converter={StaticResource EqualValueToParameterConverter},ConverterParameter={x:Static stat:EEntwaeserung.Schmutzwasser}}" />
|
<RadioButton Style="{StaticResource ToggleButtonList}" Content="Schmutzwasser" IsChecked="{Binding Entwaeserung, Converter={StaticResource EqualValueToParameterConverter},ConverterParameter={x:Static stat:EEntwaeserung.Schmutzwasser}}" />
|
||||||
<RadioButton Style="{StaticResource ToggleButtonList}" Content="Mischwasser" IsChecked="{Binding Entwaeserung, Converter={StaticResource EqualValueToParameterConverter},ConverterParameter={x:Static stat:EEntwaeserung.Mischwasser}}" />
|
<RadioButton Style="{StaticResource ToggleButtonList}" Content="Mischwasser" IsChecked="{Binding Entwaeserung, Converter={StaticResource EqualValueToParameterConverter},ConverterParameter={x:Static stat:EEntwaeserung.Mischwasser}}" />
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
|
|
||||||
|
|
||||||
<StackPanel Grid.ColumnSpan="2" Grid.Row="8">
|
<StackPanel Grid.ColumnSpan="2" Grid.Row="10">
|
||||||
<Button Content="Speichern" Command="{Binding Speichern}" />
|
<Button Content="Speichern" Command="{Binding Speichern}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ namespace WWTech_KanalSchnittstelle.Exporter.Kandis
|
|||||||
WriteContent(new Tuple<uint, uint>(386, 400), schacht.DeckelHochWert.ToString());
|
WriteContent(new Tuple<uint, uint>(386, 400), schacht.DeckelHochWert.ToString());
|
||||||
WriteContent(new Tuple<uint, uint>(402, 411), "1"); // Status der Deckelkoordinaten
|
WriteContent(new Tuple<uint, uint>(402, 411), "1"); // Status der Deckelkoordinaten
|
||||||
|
|
||||||
WriteContent(new Tuple<uint, uint>(1222, 1231), "Marwede"); // Vermesser
|
WriteContent(new Tuple<uint, uint>(1222, 1231), schacht.Vermesser); // Vermesser
|
||||||
WriteContent(new Tuple<uint, uint>(1319, 1328), "19.04.2023"); // Aufnahmedatum
|
WriteContent(new Tuple<uint, uint>(1319, 1328), schacht.AufnahmeDatum); // Aufnahmedatum
|
||||||
WriteLineInFile();
|
WriteLineInFile();
|
||||||
}
|
}
|
||||||
CloseStream();
|
CloseStream();
|
||||||
|
|||||||
@@ -72,6 +72,8 @@ namespace WWTech_KanalSchnittstelle.Importer
|
|||||||
|
|
||||||
schacht.Projekt = projekt;
|
schacht.Projekt = projekt;
|
||||||
schacht.Entwaesserung = entwaeserung;
|
schacht.Entwaesserung = entwaeserung;
|
||||||
|
schacht.Vermesser = "Marwede";
|
||||||
|
schacht.AufnahmeDatum = DateTime.Now.ToShortDateString();
|
||||||
|
|
||||||
if (neueSchacht)
|
if (neueSchacht)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user