diff --git a/ExamTimetable/ExamTimetable_Database/Implementation.cs b/ExamTimetable/ExamTimetable_Database/Implementation.cs index 809dadf..0ca8053 100644 --- a/ExamTimetable/ExamTimetable_Database/Implementation.cs +++ b/ExamTimetable/ExamTimetable_Database/Implementation.cs @@ -19,8 +19,7 @@ namespace ExamTimetable_Database { using var conn = GetConnection(); conn.Open(); - using var cmd = new NpgsqlCommand($"INSERT INTO university (univer_id, univer_name, univer_adress, phone_number, email_addr) VALUES (@univer_id, @univer_name ,@univer_adress, @phone_number, @email_addr)", conn); - cmd.Parameters.AddWithValue("@univer_id", university.univer_id); + using var cmd = new NpgsqlCommand($"INSERT INTO university (univer_name, univer_adress, phone_number, email_addr) VALUES (@univer_name ,@univer_adress, @phone_number, @email_addr)", conn); cmd.Parameters.AddWithValue("@univer_name", university.univer_name); cmd.Parameters.AddWithValue("@univer_adress", university.univer_adress); cmd.Parameters.AddWithValue("@phone_number", university.phone_number); @@ -85,8 +84,7 @@ namespace ExamTimetable_Database { using var conn = GetConnection(); conn.Open(); - using var cmd = new NpgsqlCommand($"INSERT INTO faculty (faculty_id, faculty_name, uni_id) VALUES (@faculty_id, @faculty_name, @uni_id)", conn); - cmd.Parameters.AddWithValue("@faculty_id", faculty.faculty_id); + using var cmd = new NpgsqlCommand($"INSERT INTO faculty (faculty_name, uni_id) VALUES (@faculty_name, @uni_id)", conn); cmd.Parameters.AddWithValue("@faculty_name", faculty.faculty_name); cmd.Parameters.AddWithValue("@uni_id", faculty.uni_id); cmd.ExecuteNonQuery(); @@ -145,8 +143,7 @@ namespace ExamTimetable_Database { using var conn = GetConnection(); conn.Open(); - using var cmd = new NpgsqlCommand($"INSERT INTO specialization (spec_id, spec_name, fuc_id) VALUES (@spec_id, @spec_name, @fuc_id)", conn); - cmd.Parameters.AddWithValue("@spec_id", specialization.spec_id); + using var cmd = new NpgsqlCommand($"INSERT INTO specialization (spec_name, fuc_id) VALUES (@spec_name, @fuc_id)", conn); cmd.Parameters.AddWithValue("@spec_name", specialization.spec_name); cmd.Parameters.AddWithValue("@fuc_id", specialization.fuc_id); cmd.ExecuteNonQuery(); @@ -205,8 +202,7 @@ namespace ExamTimetable_Database { using var conn = GetConnection(); conn.Open(); - using var cmd = new NpgsqlCommand($"INSERT INTO comission (comm_id, teaching_stuff, fu_id) VALUES (@comm_id, @teaching_stuff, @fu_id)", conn); - cmd.Parameters.AddWithValue("@comm_id", comission.comm_id); + using var cmd = new NpgsqlCommand($"INSERT INTO comission (teaching_stuff, fu_id) VALUES (@teaching_stuff, @fu_id)", conn); cmd.Parameters.AddWithValue("@teaching_stuff", comission.teaching_stuff); cmd.Parameters.AddWithValue("@fu_id", comission.fu_id); cmd.ExecuteNonQuery(); @@ -265,8 +261,7 @@ namespace ExamTimetable_Database { using var conn = GetConnection(); conn.Open(); - using var cmd = new NpgsqlCommand($"INSERT INTO exam (exam_id, exam_date, exam_place, exam_subject, com_id, exam_time) VALUES (@exam_id, @exam_date, @exam_place, @exam_subject, @com_id, @exam_time)", conn); - cmd.Parameters.AddWithValue("@exam_id", exam.exam_id); + using var cmd = new NpgsqlCommand($"INSERT INTO exam (exam_date, exam_place, exam_subject, com_id, exam_time) VALUES (@exam_date, @exam_place, @exam_subject, @com_id, @exam_time)", conn); cmd.Parameters.AddWithValue("@exam_date", exam.exam_date); cmd.Parameters.AddWithValue("@exam_place", exam.exam_place); cmd.Parameters.AddWithValue("@exam_subject", exam.exam_subject);