Changeset 57fc402 for PostgreSqlDotnetCore/Controllers/PetsController.cs
- Timestamp:
- 08/22/24 01:46:17 (3 months ago)
- Branches:
- main
- Children:
- 72b1da2
- Parents:
- d6040ef
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
PostgreSqlDotnetCore/Controllers/PetsController.cs
rd6040ef r57fc402 45 45 46 46 // GET: Customer/Details/5 47 public ActionResult Details(int? id) 47 /* public ActionResult Details(int? id) 48 { 49 if (id == null) 50 { 51 return RedirectToAction("NotExist", "Error"); 52 } 53 PetsClass peClass = db.PetsObj.Find(id); 54 if (peClass == null) 55 { 56 return RedirectToAction("NotExist", "Error"); 57 } 58 return View(peClass); 59 }*/ 60 61 public async Task<ActionResult> Details(int? id) 48 62 { 49 63 if (id == null) … … 51 65 return RedirectToAction("NotExist", "Error"); 52 66 } 53 PetsClass peClass = db.PetsObj.Find(id); 67 68 UsersClass customerClass = await getCrrentUser(); // Добијте ја тековната улога на корисникот 69 ViewBag.isAuthenticated = customerClass; 70 71 PetsClass peClass = await db.PetsObj.FindAsync(id); 54 72 if (peClass == null) 55 73 { 56 74 return RedirectToAction("NotExist", "Error"); 57 75 } 76 58 77 return View(peClass); 59 78 } … … 110 129 111 130 // GET: Customer/Edit/5 112 public ActionResult Edit(int? id) 131 // public ActionResult Edit(int? id) 132 public async Task<ActionResult> Edit(int? id) 113 133 { 114 134 if (id == null) … … 121 141 return RedirectToAction("NotExist", "Error"); 122 142 } 143 // додадено на 21.08 144 ViewBag.isAuthenticated = await getCrrentUser(); 123 145 return View(peClass); 124 146 } … … 132 154 { 133 155 bool isAuthenticated = User.Identity.IsAuthenticated; 156 ViewBag.isAuthenticated = await getCrrentUser(); 157 134 158 if (!isAuthenticated) 135 159 { … … 140 164 141 165 // set if is authenticated 142 ViewBag.isAuthenticated = new UsersClass(); 166 // додадено и избришено 167 ViewBag.isAuthenticated = await getCrrentUser(); 168 //ViewBag.isAuthenticated = new UsersClass(); 143 169 144 170 … … 158 184 159 185 // GET: Customer/Delete/5 160 public ActionResult Delete(int? id) 186 /* public ActionResult Delete(int? id) 187 { 188 if (id == null) 189 { 190 return RedirectToAction("NotExist", "Error"); 191 } 192 PetsClass peClass = db.PetsObj.Find(id); 193 if (peClass == null) 194 { 195 return RedirectToAction("NotExist", "Error"); 196 } 197 return View(peClass); 198 }*/ 199 200 public async Task<ActionResult> Delete(int? id) 161 201 { 162 202 if (id == null) … … 164 204 return RedirectToAction("NotExist", "Error"); 165 205 } 166 PetsClass peClass = db.PetsObj.Find(id); 206 207 UsersClass customerClass = await getCrrentUser(); // Добијте ја тековната улога на корисникот 208 ViewBag.isAuthenticated = customerClass; 209 210 PetsClass peClass = await db.PetsObj.FindAsync(id); 167 211 if (peClass == null) 168 212 { 169 213 return RedirectToAction("NotExist", "Error"); 170 214 } 215 171 216 return View(peClass); 172 217 }
Note:
See TracChangeset
for help on using the changeset viewer.