Verifying.razor 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. @page "/verifying"
  2. @using Microsoft.AspNetCore.Components.Web;
  3. @attribute [Authorize]
  4. <h1>Верификация</h1>
  5. <table class="table">
  6. <thead>
  7. <tr>
  8. <th>Файл</th>
  9. <th>Название</th>
  10. <th>Дата издания</th>
  11. <th>Авторы</th>
  12. <th>Проверка</th>
  13. </tr>
  14. </thead>
  15. <tbody>
  16. @foreach (var articleModel in articleModels)
  17. {
  18. <tr>
  19. <td>@articleModel.Value.Filename</td>
  20. <td>@articleModel.Value.Name</td>
  21. <td>@articleModel.Value.PublishDate</td>
  22. <td>@articleModel.Value.Authors</td>
  23. <td><button @onclick="(() => VerifyArticle(articleModel.Key))">Верифицировать</button></td>
  24. </tr>
  25. }
  26. </tbody>
  27. </table>
  28. @code {
  29. private Dictionary<int, Models.ArticleModel> articleModels;
  30. protected override async Task OnInitializedAsync()
  31. {
  32. MySQLConnector dbCon = MySQLConnector.Instance();
  33. string stringSQL = $"SELECT id, filename, article_name, date_publish, authors FROM articles";
  34. articleModels = await dbCon.SQLSelectArticles(stringSQL);
  35. dbCon.Close();
  36. //status = results;
  37. }
  38. private void VerifyArticle(int id)
  39. {
  40. Console.WriteLine($"Verifyed arcticle ID: {id}!");
  41. }
  42. }