diff --git a/Program.cs b/Program.cs index 2348c2f..bdc47c6 100644 --- a/Program.cs +++ b/Program.cs @@ -580,11 +580,14 @@ class Program } // Сортируем заявки по приоритету - reports.Sort((x, y) => string.Compare(y.Priority, x.Priority, StringComparison.Ordinal)); + var sortedReports = reports.OrderByDescending(r => r.Priority == "высокий") + .ThenByDescending(r => r.Priority == "средний") + .ThenByDescending(r => r.Priority == "низкий") + .ToList(); var buttons = new List(); - foreach (var report in reports) + foreach (var report in sortedReports) { string statusEmoji = GetStatusEmoji(report.Status); string priorityMarker = report.Priority.ToLower() == "высокий" ? "⚠️" : ""; @@ -623,6 +626,7 @@ class Program + private static async Task ViewArchivedReports(ITelegramBotClient botClient, long chatId) { string connectionString = "Data Source=bot.db"; @@ -651,11 +655,14 @@ class Program } // Сортируем заявки по приоритету - reports.Sort((x, y) => string.Compare(y.Priority, x.Priority, StringComparison.Ordinal)); + var sortedReports = reports.OrderByDescending(r => r.Priority == "высокий") + .ThenByDescending(r => r.Priority == "средний") + .ThenByDescending(r => r.Priority == "низкий") + .ToList(); var buttons = new List(); - foreach (var report in reports) + foreach (var report in sortedReports) { string statusEmoji = GetStatusEmoji(report.Status); string priorityMarker = report.Priority.ToLower() == "высокий" ? "⚠️" : ""; @@ -693,6 +700,7 @@ class Program + private static async Task ShowReportDetails(ITelegramBotClient botClient, long chatId, long reportId, int messageId) { try