From 76095340385a9d5b5c2706ff3b07d98abc4dc731 Mon Sep 17 00:00:00 2001 From: ecyr20 Date: Mon, 25 Mar 2024 14:47:55 -0500 Subject: [PATCH] Fixes to the three Tag Mechanism sets of routes SQL statments The tables called in the SQL statements were for some reason Mecanism_TagMechanism instead of the proper tables. Affects MechTagMechList and the two TagMech Reaction and Species Lists. --- Services/MechTagMechListService.cs | 10 +++++----- Services/TagMechanismReactionListService.cs | 10 +++++----- Services/TagMechanismSpeciesListService.cs | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Services/MechTagMechListService.cs b/Services/MechTagMechListService.cs index a341094..cbf1b1a 100644 --- a/Services/MechTagMechListService.cs +++ b/Services/MechTagMechListService.cs @@ -12,7 +12,7 @@ public async Task> GetMechTagMechsAsync() using var connection = await database.OpenConnectionAsync(); using var command = connection.CreateCommand(); - command.CommandText = "SELECT * FROM Mechanism_TagMechanism"; + command.CommandText = "SELECT * FROM Mechanism_TagMechanism_List"; return await ReadAllAsync(await command.ExecuteReaderAsync()); } @@ -21,7 +21,7 @@ public async Task> GetMechTagMechsAsync() using var connection = await database.OpenConnectionAsync(); using var command = connection.CreateCommand(); - command.CommandText = @"SELECT * FROM Mechanism_TagMechanism WHERE uuid = @id"; + command.CommandText = @"SELECT * FROM Mechanism_TagMechanism_List WHERE uuid = @id"; command.Parameters.AddWithValue("@id", uuid); var result = await ReadAllAsync(await command.ExecuteReaderAsync()); @@ -35,7 +35,7 @@ public async Task CreateMechTagMechAsync(MechTagMechList newMechTagMech) Guid mechTagMechID = Guid.NewGuid(); - command.CommandText = @"INSERT INTO Mechanism_TagMechanism (uuid, mechanism_uuid, tag_mechanism_uuid, version) VALUES (@uuid, @mechanism_uuid, @tag_mechanism_uuid, @version);"; + command.CommandText = @"INSERT INTO Mechanism_TagMechanism_List (uuid, mechanism_uuid, tag_mechanism_uuid, version) VALUES (@uuid, @mechanism_uuid, @tag_mechanism_uuid, @version);"; command.Parameters.AddWithValue("@uuid", mechTagMechID); command.Parameters.AddWithValue("@mechanism_uuid", newMechTagMech.mechanism_uuid); @@ -49,7 +49,7 @@ public async Task UpdateMechTagMechAsync(MechTagMechList mechTagMech) using var connection = await database.OpenConnectionAsync(); using var command = connection.CreateCommand(); - command.CommandText = @"UPDATE Mechanism_TagMechanism SET mechanism_uuid = @mechanism_uuid, tag_mechanism_uuid = @tag_mechanism_uuid, version = @version, isDel = @isDel WHERE uuid = @uuid;"; + command.CommandText = @"UPDATE Mechanism_TagMechanism_List SET mechanism_uuid = @mechanism_uuid, tag_mechanism_uuid = @tag_mechanism_uuid, version = @version, isDel = @isDel WHERE uuid = @uuid;"; command.Parameters.AddWithValue("@uuid", mechTagMech.uuid); command.Parameters.AddWithValue("@mechanism_uuid", mechTagMech.mechanism_uuid); @@ -65,7 +65,7 @@ public async Task DeleteMechTagMechAsync(Guid uuid) using var connection = await database.OpenConnectionAsync(); using var command = connection.CreateCommand(); - command.CommandText = @"UPDATE Mechanism_TagMechanism SET isDel = 1 WHERE uuid = @uuid;"; + command.CommandText = @"UPDATE Mechanism_TagMechanism_List SET isDel = 1 WHERE uuid = @uuid;"; command.Parameters.AddWithValue("@uuid", uuid); diff --git a/Services/TagMechanismReactionListService.cs b/Services/TagMechanismReactionListService.cs index 59e3a97..c68f815 100644 --- a/Services/TagMechanismReactionListService.cs +++ b/Services/TagMechanismReactionListService.cs @@ -12,7 +12,7 @@ public async Task> GetTagMechanismReacti using var connection = await database.OpenConnectionAsync(); using var command = connection.CreateCommand(); - command.CommandText = "SELECT * FROM Mechanism_TagMechanism"; + command.CommandText = "SELECT * FROM TagMechanism_Reaction_List"; return await ReadAllAsync(await command.ExecuteReaderAsync()); } @@ -21,7 +21,7 @@ public async Task> GetTagMechanismReacti using var connection = await database.OpenConnectionAsync(); using var command = connection.CreateCommand(); - command.CommandText = @"SELECT * FROM Mechanism_TagMechanism WHERE uuid = @id"; + command.CommandText = @"SELECT * FROM TagMechanism_Reaction_List WHERE uuid = @id"; command.Parameters.AddWithValue("@id", uuid); var result = await ReadAllAsync(await command.ExecuteReaderAsync()); @@ -35,7 +35,7 @@ public async Task CreateTagMechanismReactionAsync(TagMechanismReactionList newTa Guid tagMechanismReactionID = Guid.NewGuid(); - command.CommandText = @"INSERT INTO Mechanism_TagMechanism (uuid, reaction_uuid, tag_mechanism_uuid, version) VALUES (@uuid, @reaction_uuid, @tag_mechanism_uuid, @version);"; + command.CommandText = @"INSERT INTO TagMechanism_Reaction_List (uuid, reaction_uuid, tag_mechanism_uuid, version) VALUES (@uuid, @reaction_uuid, @tag_mechanism_uuid, @version);"; command.Parameters.AddWithValue("@uuid", tagMechanismReactionID); command.Parameters.AddWithValue("@reaction_uuid", newTagMechanismReaction.reaction_uuid); @@ -49,7 +49,7 @@ public async Task UpdateTagMechanismReactionAsync(TagMechanismReactionList tagMe using var connection = await database.OpenConnectionAsync(); using var command = connection.CreateCommand(); - command.CommandText = @"UPDATE Mechanism_TagMechanism SET reaction_uuid = @reaction_uuid, tag_mechanism_uuid = @tag_mechanism_uuid, version = @version, isDel = @isDel WHERE uuid = @uuid;"; + command.CommandText = @"UPDATE TagMechanism_Reaction_List SET reaction_uuid = @reaction_uuid, tag_mechanism_uuid = @tag_mechanism_uuid, version = @version, isDel = @isDel WHERE uuid = @uuid;"; command.Parameters.AddWithValue("@uuid", tagMechanismReaction.uuid); command.Parameters.AddWithValue("@reaction_uuid", tagMechanismReaction.reaction_uuid); @@ -65,7 +65,7 @@ public async Task DeleteTagMechanismReactionAsync(Guid uuid) using var connection = await database.OpenConnectionAsync(); using var command = connection.CreateCommand(); - command.CommandText = @"UPDATE Mechanism_TagMechanism SET isDel = 1 WHERE uuid = @uuid;"; + command.CommandText = @"UPDATE TagMechanism_Reaction_List SET isDel = 1 WHERE uuid = @uuid;"; command.Parameters.AddWithValue("@uuid", uuid); diff --git a/Services/TagMechanismSpeciesListService.cs b/Services/TagMechanismSpeciesListService.cs index e79a19f..76d111e 100644 --- a/Services/TagMechanismSpeciesListService.cs +++ b/Services/TagMechanismSpeciesListService.cs @@ -12,7 +12,7 @@ public async Task> GetTagMechanismSpecies using var connection = await database.OpenConnectionAsync(); using var command = connection.CreateCommand(); - command.CommandText = "SELECT * FROM Mechanism_TagMechanism"; + command.CommandText = "SELECT * FROM TagMechanism_Species_List"; return await ReadAllAsync(await command.ExecuteReaderAsync()); } @@ -21,7 +21,7 @@ public async Task> GetTagMechanismSpecies using var connection = await database.OpenConnectionAsync(); using var command = connection.CreateCommand(); - command.CommandText = @"SELECT * FROM Mechanism_TagMechanism WHERE uuid = @id"; + command.CommandText = @"SELECT * FROM TagMechanism_Species_List WHERE uuid = @id"; command.Parameters.AddWithValue("@id", uuid); var result = await ReadAllAsync(await command.ExecuteReaderAsync()); @@ -35,7 +35,7 @@ public async Task CreateTagMechanismSpeciesAsync(TagMechanismSpeciesList newTagM Guid tagMechanismSpeciesID = Guid.NewGuid(); - command.CommandText = @"INSERT INTO Mechanism_TagMechanism (uuid, species_uuid, tag_mechanism_uuid, version) VALUES (@uuid, @species_uuid, @tag_mechanism_uuid, @version);"; + command.CommandText = @"INSERT INTO TagMechanism_Species_List (uuid, species_uuid, tag_mechanism_uuid, version) VALUES (@uuid, @species_uuid, @tag_mechanism_uuid, @version);"; command.Parameters.AddWithValue("@uuid", tagMechanismSpeciesID); command.Parameters.AddWithValue("@species_uuid", newTagMechanismSpecies.species_uuid); @@ -49,7 +49,7 @@ public async Task UpdateTagMechanismSpeciesAsync(TagMechanismSpeciesList tagMech using var connection = await database.OpenConnectionAsync(); using var command = connection.CreateCommand(); - command.CommandText = @"UPDATE Mechanism_TagMechanism SET species_uuid = @species_uuid, tag_mechanism_uuid = @tag_mechanism_uuid, version = @version, isDel = @isDel WHERE uuid = @uuid;"; + command.CommandText = @"UPDATE TagMechanism_Species_List SET species_uuid = @species_uuid, tag_mechanism_uuid = @tag_mechanism_uuid, version = @version, isDel = @isDel WHERE uuid = @uuid;"; command.Parameters.AddWithValue("@uuid", tagMechanismSpecies.uuid); command.Parameters.AddWithValue("@species_uuid", tagMechanismSpecies.species_uuid); @@ -65,7 +65,7 @@ public async Task DeleteTagMechanismSpeciesAsync(Guid uuid) using var connection = await database.OpenConnectionAsync(); using var command = connection.CreateCommand(); - command.CommandText = @"UPDATE Mechanism_TagMechanism SET isDel = 1 WHERE uuid = @uuid;"; + command.CommandText = @"UPDATE TagMechanism_Species_List SET isDel = 1 WHERE uuid = @uuid;"; command.Parameters.AddWithValue("@uuid", uuid);