Убрал ошибку в обновлении ученика и учителя

This commit is contained in:
Илья 2024-05-08 00:31:03 +04:00
parent c11be4161b
commit 6d61920b77
2 changed files with 2 additions and 2 deletions

View File

@ -74,7 +74,7 @@ namespace ElectronicDiaryPostgresImplementation.WorkImplementation
{
using var con = SqlConnection.GetConnection();
con.Open();
using var cmd = new NpgsqlCommand($"UPDATE student SET last_name = '{student.LastName}', first_name = '{student.FirstName}', patronymic = '{student.Patronymic}', fk_grade_id = {student.GradeId}, fk_user_id = {student.UserId} WHERE student_id = {student.Id}", con);
using var cmd = new NpgsqlCommand($"UPDATE student SET last_name = '{student.LastName}', first_name = '{student.FirstName}', patronymic = '{student.Patronymic}', fk_grade_id = {student.GradeId} WHERE student_id = {student.Id}", con);
cmd.ExecuteNonQuery();
var element = Get(student.Id);
return element;

View File

@ -71,7 +71,7 @@ namespace ElectronicDiaryPostgresImplementation.WorkImplementation
{
using var con = SqlConnection.GetConnection();
con.Open();
using var cmd = new NpgsqlCommand($"UPDATE teacher SET last_name = '{teacher.LastName}', first_name = '{teacher.FirstName}', patronymic = '{teacher.Patronymic}', fk_user_id = {teacher.UserId} WHERE teacher_id = {teacher.Id}", con);
using var cmd = new NpgsqlCommand($"UPDATE teacher SET last_name = '{teacher.LastName}', first_name = '{teacher.FirstName}', patronymic = '{teacher.Patronymic}' WHERE teacher_id = {teacher.Id}", con);
cmd.ExecuteNonQuery();
var element = Get(teacher.Id);
return element;