Index.cshtml 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. @page
  2. @model WZExport.Pages.DBConfigs.IndexModel
  3. @{
  4. ViewData["Title"] = "DBConfig-Index";
  5. }
  6. <h1>Index</h1>
  7. <p>
  8. <a asp-page="Create">Create New</a>
  9. </p>
  10. <table class="table">
  11. <thead>
  12. <tr>
  13. <th>
  14. @Html.DisplayNameFor(model => model.dBConfigs[0].DBName)
  15. </th>
  16. <th>
  17. @Html.DisplayNameFor(model => model.dBConfigs[0].ConnectStr)
  18. </th>
  19. <th></th>
  20. </tr>
  21. </thead>
  22. <tbody>
  23. @foreach (var item in Model.dBConfigs) {
  24. string style=item.Choose == true ? "background:red" : "";
  25. <tr style="@style">
  26. <td>
  27. @Html.DisplayFor(modelItem => item.DBName)
  28. </td>
  29. <td>
  30. @Html.DisplayFor(modelItem => item.ConnectStr)
  31. </td>
  32. <td>
  33. <a asp-page="./Edit" asp-route-id="@item.DBName">Edit</a> |
  34. <a asp-page="./Delete" asp-route-id="@item.DBName">Delete</a> |
  35. <a asp-page="./Choose" asp-route-id="@item.DBName">Choose</a>
  36. </td>
  37. </tr>
  38. }
  39. </tbody>
  40. </table>