Haltung Edit hinzugefügt
This commit is contained in:
@@ -3,6 +3,7 @@ using SewerStammGen.Shared.Contracts;
|
||||
using SewerStammGen.Shared.Domain;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
@@ -77,9 +78,32 @@ namespace SewerStammGen.DAL.Services.PostgresqlData
|
||||
return await GetAllByProjekt(projekt.Id);
|
||||
}
|
||||
|
||||
public Task<Kanal> Update(Kanal entity)
|
||||
public async Task<Kanal> Update(Kanal entity)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
||||
string command = "UPDATE " + tableName + " SET " +
|
||||
" \"Objektbezeichnung\"=@1, " +
|
||||
" \"StartSchachtId\"=@2, " +
|
||||
" \"EndSchachtId\"=@3, " +
|
||||
" \"DN\"=@4, " +
|
||||
" \"Material\"=@5, " +
|
||||
" \"Haltungslaenge\"=@6, " +
|
||||
" \"Entwaesserung\"=@7 " +
|
||||
" WHERE \"Id\" = @8";
|
||||
using(var cmd = new NpgsqlCommand(command,conn))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("1", entity.Objektbezeichnung);
|
||||
cmd.Parameters.AddWithValue("2", entity.StartSchacht.Id);
|
||||
cmd.Parameters.AddWithValue("3", entity.EndSchacht.Id);
|
||||
cmd.Parameters.AddWithValue("4", entity.DN);
|
||||
cmd.Parameters.AddWithValue("5", entity.Material);
|
||||
cmd.Parameters.AddWithValue("6", entity.Haltungslaenge);
|
||||
cmd.Parameters.AddWithValue("7", (int)entity.Entwaesserung);
|
||||
cmd.Parameters.AddWithValue("8", entity.Id);
|
||||
|
||||
await cmd.ExecuteNonQueryAsync();
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user