Verifying.razor 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. @*<th></th>*@
  14. </tr>
  15. </thead>
  16. <tbody>
  17. @foreach (var articleModel in articleModels)
  18. {
  19. <tr>
  20. <td>@(counter++)</td>
  21. <td>@articleModel.Value.Filename</td>
  22. <td><a href="@($"/docedit/{articleModel.Key}")">@articleModel.Value.Name</a></td>
  23. <td>@articleModel.Value.PublishDate.ToString("d")</td>
  24. <td>@articleModel.Value.Authors</td>
  25. @*<td><button @onclick="(() => VerifyArticle(articleModel.Key))">Верифицировать</button></td>*@
  26. </tr>
  27. }
  28. </tbody>
  29. </table>
  30. @code {
  31. private Dictionary<int, Models.ArticleModel> articleModels;
  32. private int counter = 1;
  33. protected override async Task OnInitializedAsync()
  34. {
  35. MySQLConnector dbCon = MySQLConnector.Instance();
  36. string stringSQL = $"SELECT id, filename, article_name, date_publish, authors FROM articles";
  37. articleModels = await dbCon.SQLSelectArticles(stringSQL);
  38. dbCon.Close();
  39. //status = results;
  40. }
  41. //private void VerifyArticle(int id)
  42. //{
  43. // Console.WriteLine($"Verifyed arcticle ID: {id}!");
  44. //}
  45. }