Changeset 8f8226c for PostgreSqlDotnetCore/Controllers
- Timestamp:
- 08/20/24 15:04:19 (3 months ago)
- Branches:
- main
- Children:
- 6782104
- Parents:
- ae6c071
- Location:
- PostgreSqlDotnetCore/Controllers
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
PostgreSqlDotnetCore/Controllers/BlogController.cs
rae6c071 r8f8226c 44 44 // query 45 45 var query = from st in db.BlogPostAnswersObj 46 where st. blogpostconsultationid == blogClass.id46 where st.BlogPostConsultationid == blogClass.id 47 47 select st; 48 48 //elenaaa -
PostgreSqlDotnetCore/Controllers/PetCaresController.cs
rae6c071 r8f8226c 130 130 131 131 // GET: Customer/Edit/5 132 public ActionResult Edit(int? id) 132 /* public ActionResult Edit(int? id) 133 { 134 if (id == null) 135 { 136 return RedirectToAction("NotExist", "Error"); 137 } 138 Pet_CaresClass peClass = db.PetCaresObj.Find(id); 139 if (peClass == null) 140 { 141 return RedirectToAction("NotExist", "Error"); 142 } 143 144 145 return View(peClass); 146 }*/ 147 // GET: Customer/Edit/5 148 /* public ActionResult Edit(int? id) 149 { 150 if (id == null) 151 { 152 return RedirectToAction("NotExist", "Error"); 153 } 154 Pet_CaresClass peClass = db.PetCaresObj.Find(id); 155 if (peClass == null) 156 { 157 return RedirectToAction("NotExist", "Error"); 158 } 159 160 161 return View(peClass); 162 }*/ 163 public async Task<ActionResult> Edit(int? id) 133 164 { 134 165 if (id == null) … … 136 167 return RedirectToAction("NotExist", "Error"); 137 168 } 138 Pet_CaresClass peClass = db.PetCaresObj.Find(id); 169 170 Pet_CaresClass peClass = await db.PetCaresObj.FindAsync(id); 139 171 if (peClass == null) 140 172 { 141 173 return RedirectToAction("NotExist", "Error"); 142 174 } 143 return View(peClass); 144 } 175 176 var vetCenters = await db.VetCentersObj.ToListAsync(); 177 ViewBag.VetCenters = new SelectList(vetCenters, "id", "name", peClass.vetcentersid); 178 179 return View(peClass); 180 } 181 182 145 183 146 184 // POST: Customer/Edit/5 … … 149 187 [HttpPost] 150 188 [ValidateAntiForgeryToken] 151 public async Task<ActionResult> EditAsync([Bind(include: "id,title,description,dateending, start_datevetcentersid")] Pet_CaresClass peClass)189 public async Task<ActionResult> EditAsync([Bind(include: "id,title,description,dateending, vetcentersid")] Pet_CaresClass peClass) 152 190 { 153 191 bool isAuthenticated = User.Identity.IsAuthenticated; … … 156 194 return RedirectToAction("AccessDenied", "Error"); 157 195 } 158 196 159 197 if (ModelState.IsValid) 160 198 { 161 199 peClass.dateending = DateTime.SpecifyKind(peClass.dateending, DateTimeKind.Utc); 162 peClass.start_date = DateTime.SpecifyKind(peClass.start_date, DateTimeKind.Utc);163 200 var user = await _userManager.GetUserAsync(User); 164 201 var customerClass = db.CustomerObj.SingleOrDefault(x => x.email == user.Email); … … 171 208 } 172 209 210 211 212 173 213 // GET: Customer/Delete/5 174 214 public ActionResult Delete(int? id) -
PostgreSqlDotnetCore/Controllers/PetsController.cs
rae6c071 r8f8226c 73 73 [HttpPost] 74 74 [ValidateAntiForgeryToken] 75 public async Task<ActionResult> CreateAsync([Bind(include: "id, color,description,dateofbirthday, usersid,typeofpetsid")] PetsClass peClass)75 public async Task<ActionResult> CreateAsync([Bind(include: "id,name,color,description,dateofbirthday, usersid,typeofpetsid")] PetsClass peClass) 76 76 { 77 77 bool isAuthenticated = User.Identity.IsAuthenticated; … … 116 116 [HttpPost] 117 117 [ValidateAntiForgeryToken] 118 public async Task<ActionResult> EditAsync([Bind(include: "id, color,description,dateofbirthday, usersid,typeofpetsid")] PetsClass peClass)118 public async Task<ActionResult> EditAsync([Bind(include: "id,name, color,description,dateofbirthday, usersid,typeofpetsid")] PetsClass peClass) 119 119 { 120 120 bool isAuthenticated = User.Identity.IsAuthenticated;
Note:
See TracChangeset
for help on using the changeset viewer.