source: PostgreSqlDotnetCore/Views/VetCenter/Index.cshtml@ a850333

main
Last change on this file since a850333 was e9bb9d1, checked in by ElenaMoskova <elena.moskova99@…>, 3 months ago

Use of views

  1. Use of views in VetCenters.
  2. Ability to provide a response to a given response.
  • Property mode set to 100644
File size: 3.0 KB
Line 
1@using Microsoft.AspNetCore.Identity
2@inject SignInManager<IdentityUser> SignInManager
3@* IEnumerable<PostgreSqlDotnetCore.Models.VetCenter>*@
4@model IEnumerable<PostgreSqlDotnetCore.Models.VetCenterWithCity>
5
6
7@{
8 ViewBag.Title = "VetCenter";
9}
10
11<h2>Vet Center</h2>
12
13@*<p>
14 @Html.ActionLink("Create New", "Create")
15</p>
16*@
17@if (ViewBag.hasAccess != null && ViewBag.hasAccess == true)
18{
19 <p>
20 @Html.ActionLink("Create New", "Create")
21 </p>
22}
23
24<table class="table">
25 <tr>
26 <th>
27 @Html.DisplayNameFor(model => model.vet_center_name)
28 </th>
29 <th>
30 @Html.DisplayNameFor(model => model.adress)
31 </th>
32
33 <th>
34 @Html.DisplayNameFor(model => model.workinghours)
35 </th>
36 <th>
37 @Html.DisplayNameFor(model => model.description)
38 </th>
39 <th>
40 @Html.DisplayNameFor(model => model.phonenumber)
41 </th>
42 <th>
43 @Html.DisplayNameFor(model => model.latitude)
44 </th>
45 <th>
46 @Html.DisplayNameFor(model => model.longitude)
47 </th>
48 <th>
49 @Html.DisplayNameFor(model => model.city_name)
50 </th>
51 <th></th>
52 </tr>
53
54 @foreach (var item in Model)
55 {
56 <tr>
57 <td>
58 @Html.DisplayFor(modelItem => item.vet_center_name)
59 </td>
60 <td>
61 @Html.DisplayFor(modelItem => item.adress)
62 </td>
63 <td>
64 @Html.DisplayFor(modelItem => item.workinghours)
65 </td>
66 <td>
67 @Html.DisplayFor(modelItem => item.description)
68 </td>
69
70 <td>
71 @Html.DisplayFor(modelItem => item.phonenumber)
72 </td>
73 <td>
74 @Html.DisplayFor(modelItem => item.latitude)
75 </td>
76 <td>
77 @Html.DisplayFor(modelItem => item.longitude)
78 </td>
79 <td>
80 @Html.DisplayFor(modelItem => item.city_name)
81 </td>
82 <td>
83 @*@Html.DisplayFor(modelItem => item.email)*@
84 </td>
85 <td>
86 @*@Html.DisplayFor(modelItem => item.number)*@
87 </td>
88
89
90
91 @* @if ((SignInManager.IsSignedIn(User)))
92 {
93 <td>
94
95 @Html.ActionLink("Edit", "Edit", new { id = item.id }) |
96 @Html.ActionLink("Details", "Details", new { id = item.id }) |
97 @Html.ActionLink("Delete", "Delete", new { id = item.id })
98
99 </td>
100 }
101 *@
102
103 @* Додадете условие за проверка на улогите *@
104 @if (SignInManager.IsSignedIn(User) && (ViewBag.hasAccess != null && ViewBag.hasAccess == true))
105 {
106 <td>
107 @Html.ActionLink("Edit", "Edit", new { id = item.id }) |
108 @Html.ActionLink("Details", "Details", new { id = item.id }) |
109 @Html.ActionLink("Delete", "Delete", new { id = item.id })
110 </td>
111 }
112
113 </tr>
114 }
115
116</table>
Note: See TracBrowser for help on using the repository browser.