Merge branch 'LabWork_2' of https://git.is.ulstu.ru/pyzhov.egor/PIbd-22_Pyzhov_E.A._ITServiceManager into LabWork_2
This commit is contained in:
commit
de3f8e5029
@ -64,8 +64,8 @@ public class ServiceRepository : IServiceRepository
|
||||
{
|
||||
using var connection = new NpgsqlConnection(_connectionString.ConnectionString);
|
||||
var queryInsert = @"
|
||||
INSERT INTO Services (ServiceType, Description)
|
||||
VALUES (@ServiceType, @Description)";
|
||||
INSERT INTO Services (ServiceType, ServiceName, Description)
|
||||
VALUES (@ServiceType, @ServiceName, @Description)";
|
||||
connection.Execute(queryInsert, service);
|
||||
}
|
||||
catch (Exception ex)
|
||||
@ -85,6 +85,7 @@ public class ServiceRepository : IServiceRepository
|
||||
UPDATE Services
|
||||
SET
|
||||
ServiceType=@ServiceType,
|
||||
ServiceName=@ServiceName,
|
||||
Description=@Description
|
||||
WHERE Id=@Id";
|
||||
connection.Execute(queryUpdate, service);
|
||||
|
Loading…
x
Reference in New Issue
Block a user