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