Changeset 99d0ecc for PostgreSqlDotnetCore
- Timestamp:
- 08/30/24 02:20:42 (3 months ago)
- Branches:
- main
- Children:
- a3ce071
- Parents:
- e90ba32
- Location:
- PostgreSqlDotnetCore
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
PostgreSqlDotnetCore/Controllers/PetCaresController.cs
re90ba32 r99d0ecc 131 131 return RedirectToAction("AccessDenied", "Error"); 132 132 } 133 ModelState.Remove("PetsClass"); 133 134 ViewBag.isAuthenticated = new UsersClass(); 134 135 // no access for standard user … … 150 151 ViewBag.VetCenters = new SelectList(vetCenters, "id", "name"); 151 152 152 153 var queryPetsByUser = from st in db.PetsObj 154 where st.usersid == customerClass.id 155 select st; 156 var userPets =await queryPetsByUser.ToListAsync<PetsClass>(); 157 ViewBag.Pets= new SelectList(userPets, "id", "name"); 158 153 if (customerClass != null) 154 { 155 var queryPetsByUser = from st in db.PetsObj 156 where st.usersid == customerClass.id 157 select st; 158 var userPets = await queryPetsByUser.ToListAsync<PetsClass>(); 159 ViewBag.Pets = new SelectList(userPets, "id", "name"); 160 161 } 159 162 160 163 return View(peClass); … … 240 243 return RedirectToAction("AccessDenied", "Error"); 241 244 } 245 246 ModelState.Remove("PetsClass"); 242 247 ViewBag.isAuthenticated = await getCrrentUser(); 243 248 // no access for standard user -
PostgreSqlDotnetCore/Controllers/VetCenterController.cs
re90ba32 r99d0ecc 73 73 public async Task<ActionResult> Index() 74 74 { 75 ViewBag.isAuthenticated = await getCrrentUser(); 76 ViewBag.hasAccess = await checkAuthorizationAsync(); 75 77 var vetCenters = await db.VetCentersWithCity.ToListAsync(); 76 ViewBag.isAuthenticated = User.Identity.IsAuthenticated;78 // ViewBag.isAuthenticated = User.Identity.IsAuthenticated; 77 79 // no access for standard user 78 80 ViewBag.OnlyAdminManager = await checkAuthorizationSpecificRoleAsync(RoleConstants.Admin) ?? await checkAuthorizationSpecificRoleAsync(RoleConstants.Manager); -
PostgreSqlDotnetCore/Views/PetCares/Edit.cshtml
re90ba32 r99d0ecc 56 56 </div> 57 57 58 <div class="form-group"> 59 @Html.LabelFor(model => model.pet_id, htmlAttributes: new { @class = "control-label col-md-2" }) 60 <div class="col-md-10"> 61 @Html.DropDownListFor(model => model.pet_id, (SelectList)ViewBag.Pets, "Select Pet", new { @class = "form-control" }) 62 @Html.ValidationMessageFor(model => model.pet_id, "", new { @class = "text-danger" }) 63 </div> 64 </div> 58 65 59 66 @*<div class="form-group"> -
PostgreSqlDotnetCore/Views/VetCenter/Index.cshtml
re90ba32 r99d0ecc 34 34 @Html.DisplayNameFor(model => model.workinghours) 35 35 </th> 36 @* 36 37 <th> 37 38 @Html.DisplayNameFor(model => model.description) 38 39 </th> 40 *@ 39 41 <th> 40 42 @Html.DisplayNameFor(model => model.phonenumber) … … 64 66 @Html.DisplayFor(modelItem => item.workinghours) 65 67 </td> 66 <td>68 @* <td> 67 69 @Html.DisplayFor(modelItem => item.description) 68 70 </td> 69 71 *@ 70 72 <td> 71 73 @Html.DisplayFor(modelItem => item.phonenumber)
Note:
See TracChangeset
for help on using the changeset viewer.