Skip to content

Commit c5ebd3c

Browse files
committed
put update aussi l'event
1 parent 126b1d8 commit c5ebd3c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Zenergy/Zenergy/Controllers/ApiControllers/ponctualEventsController.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ public async Task<IHttpActionResult> findPonctualEventsByManagerId(int managerId
5959
}
6060

6161
// PUT: api/ponctualEvents/5
62+
[HttpPut]
63+
[Route("api/ponctualEvents/{id}")]
6264
[ResponseType(typeof(void))]
6365
public async Task<IHttpActionResult> PutponctualEvent(int id, ponctualEvent ponctualEvent)
6466
{
@@ -72,8 +74,7 @@ public async Task<IHttpActionResult> PutponctualEvent(int id, ponctualEvent ponc
7274
return BadRequest();
7375
}
7476

75-
//eventServices.updateEvent(ponctualEvent.@event);
76-
db.ponctualEvent.SqlQuery("UPDATE event SET roomId={0}, activityId={1}, eventName={2}, eventPrice={3}, eventDurationHours={4}, eventMaxPeople={5}, eventDescription={6}, timeBegin={7} WHERE eventId={8}", ponctualEvent.@event.roomId, ponctualEvent.@event.activityId, ponctualEvent.@event.eventName, ponctualEvent.@event.eventPrice, ponctualEvent.@event.eventDurationHours, ponctualEvent.@event.eventMaxPeople, ponctualEvent.@event.eventDescription, ponctualEvent.@event.timeBegin, ponctualEvent.@event.eventId);
77+
db.Entry(ponctualEvent.@event).State = EntityState.Modified;
7778
db.Entry(ponctualEvent).State = EntityState.Modified;
7879

7980
try

0 commit comments

Comments
 (0)