- Timestamp:
- 08/15/24 20:01:13 (3 months ago)
- Branches:
- main
- Children:
- 8f8226c
- Parents:
- 2639fab
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
PostgreSqlDotnetCore/Controllers/PetCaresController.cs
r2639fab rae6c071 2 2 using Microsoft.AspNetCore.Mvc; 3 3 using Microsoft.EntityFrameworkCore; 4 using Microsoft.AspNetCore.Mvc.Rendering; 4 5 using PostgreSqlDotnetCore.Models; 5 6 using System; … … 14 15 } 15 16 17 18 [HttpGet] 19 public async Task<ActionResult> Create() 20 { 21 22 var vetCenters = await db.VetCentersObj.ToListAsync(); 23 24 ViewBag.VetCenters = new SelectList(vetCenters, "id", "name"); 25 26 return View(); 27 } 28 16 29 // GET: Customer 17 30 public async Task<ActionResult> IndexAsync() … … 83 96 //} 84 97 85 public ActionResult Create()98 /*public ActionResult Create() 86 99 { 87 100 88 101 return View(); 89 } 102 }*/ 90 103 91 104 // POST: Customer/Create … … 94 107 [HttpPost] 95 108 [ValidateAntiForgeryToken] 96 public async Task<ActionResult> CreateAsync([Bind(include: "id,title,description,dateending, usersid, vetcentersid")] Pet_CaresClass peClass)109 public async Task<ActionResult> CreateAsync([Bind(include: "id,title,description,dateending, start_date, usersid, vetcentersid")] Pet_CaresClass peClass) 97 110 { 98 111 bool isAuthenticated = User.Identity.IsAuthenticated; … … 104 117 { 105 118 peClass.dateending = DateTime.SpecifyKind(peClass.dateending, DateTimeKind.Utc); 119 peClass.start_date = DateTime.SpecifyKind(peClass.start_date, DateTimeKind.Utc); 106 120 var user = await _userManager.GetUserAsync(User); 107 121 var customerClass = db.CustomerObj.SingleOrDefault(x => x.email == user.Email); … … 135 149 [HttpPost] 136 150 [ValidateAntiForgeryToken] 137 public async Task<ActionResult> EditAsync([Bind(include: "id,title,description,dateending, vetcentersid")] Pet_CaresClass peClass)151 public async Task<ActionResult> EditAsync([Bind(include: "id,title,description,dateending, start_date vetcentersid")] Pet_CaresClass peClass) 138 152 { 139 153 bool isAuthenticated = User.Identity.IsAuthenticated; … … 146 160 { 147 161 peClass.dateending = DateTime.SpecifyKind(peClass.dateending, DateTimeKind.Utc); 162 peClass.start_date = DateTime.SpecifyKind(peClass.start_date, DateTimeKind.Utc); 148 163 var user = await _userManager.GetUserAsync(User); 149 164 var customerClass = db.CustomerObj.SingleOrDefault(x => x.email == user.Email);
Note:
See TracChangeset
for help on using the changeset viewer.