source: PostgreSqlDotnetCore/Views/VetCenter/Index.cshtml@ 99d0ecc

main
Last change on this file since 99d0ecc was 99d0ecc, checked in by ElenaMoskova <elena.moskova99@…>, 4 weeks ago

fix update/create petcares

add new field modify functions

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