Fehlerbehebung im Export (Database) nach Testing
This commit is contained in:
@@ -126,21 +126,24 @@ internal static class Database
|
||||
|
||||
// set wasBilled to 1 for all retrieved activities
|
||||
|
||||
string activityIdsString = string.Join(',', activityIds.Select((_, i) => $"@activityId{i}"));
|
||||
var updateWasBilledCommand =
|
||||
new MySqlCommand
|
||||
{
|
||||
Connection = dbConnection,
|
||||
Transaction = transaction,
|
||||
CommandText = $"UPDATE activity SET wasBilled = 1 WHERE id IN ({activityIdsString})"
|
||||
};
|
||||
|
||||
for (int i = 0; i < activityIds.Count; i++)
|
||||
if (activityIds.Any())
|
||||
{
|
||||
updateWasBilledCommand.Parameters.AddWithValue($"@activityId{i}", activityIds[i]);
|
||||
}
|
||||
string activityIdsString = string.Join(',', activityIds.Select((_, i) => $"@activityId{i}"));
|
||||
var updateWasBilledCommand =
|
||||
new MySqlCommand
|
||||
{
|
||||
Connection = dbConnection,
|
||||
Transaction = transaction,
|
||||
CommandText = $"UPDATE activity SET wasBilled = 1 WHERE id IN ({activityIdsString})"
|
||||
};
|
||||
|
||||
await updateWasBilledCommand.ExecuteNonQueryAsync();
|
||||
for (int i = 0; i < activityIds.Count; i++)
|
||||
{
|
||||
updateWasBilledCommand.Parameters.AddWithValue($"@activityId{i}", activityIds[i]);
|
||||
}
|
||||
|
||||
await updateWasBilledCommand.ExecuteNonQueryAsync();
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
Reference in New Issue
Block a user