AuftraggeberListview intial
This commit is contained in:
@@ -19,10 +19,8 @@ namespace SewerStammGen.DAL.Services.PostgresqlData
|
||||
|
||||
public async Task<Kanal> Create(Kanal entity)
|
||||
{
|
||||
string command = "INSERT INTO " + tableName + " (" +
|
||||
"objektbezeichnung,ref_startschacht_id,ref_endschacht_id," +
|
||||
"dn,material,haltungslaenge, entwaesserung,ref_projekt_id) VALUES " +
|
||||
"(@1,@2,@3,@4,@5,@6,@7,@8) RETURNING haltung_id";
|
||||
string command = $"INSERT INTO {tableName} (objektbezeichnung,ref_startschacht_id,ref_endschacht_id,dn,material,haltungslaenge, entwaesserung,ref_projekt_id)" +
|
||||
$"VALUES (@1,@2,@3,@4,@5,@6,@7,@8) RETURNING haltung_id";
|
||||
using (var cmd = new NpgsqlCommand(command, conn))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("1", entity.Objektbezeichnung);
|
||||
@@ -56,7 +54,7 @@ namespace SewerStammGen.DAL.Services.PostgresqlData
|
||||
ISchachtDataService schachtDataService = new SchachtDataService(connString);
|
||||
IEnumerable<Schacht> schaechte = await schachtDataService.GetAllByProjekt(projektID);
|
||||
|
||||
string command = "SELECT * FROM " + tableName + " WHERE ref_projekt_id = @1";
|
||||
string command = $"SELECT * FROM {tableName} WHERE ref_projekt_id = @1";
|
||||
using (var cmd = new NpgsqlCommand(command, conn))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("1", projektID);
|
||||
@@ -103,15 +101,8 @@ namespace SewerStammGen.DAL.Services.PostgresqlData
|
||||
public async Task<Kanal> Update(Kanal entity)
|
||||
{
|
||||
|
||||
string command = "UPDATE " + tableName + " SET " +
|
||||
" objektbezeichnung=@1, " +
|
||||
" ref_startschacht_id=@2, " +
|
||||
" ref_endschacht_id=@3, " +
|
||||
" dn=@4, " +
|
||||
" material=@5, " +
|
||||
" haltungslaenge=@6, " +
|
||||
" entwaesserung=@7 " +
|
||||
" WHERE haltung_id = @8";
|
||||
string command = $"UPDATE {tableName} SET objektbezeichnung=@1, " +
|
||||
$"ref_startschacht_id=@2, ref_endschacht_id=@3, dn=@4, material=@5, haltungslaenge=@6, entwaesserung=@7 WHERE haltung_id = @8";
|
||||
using(var cmd = new NpgsqlCommand(command,conn))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("1", entity.Objektbezeichnung);
|
||||
|
||||
Reference in New Issue
Block a user