public async Task <IActionResult> PutRoomPlan(int id, RoomPlan roomPlan) { if (id != roomPlan.Id) { return(BadRequest()); } _context.Entry(roomPlan).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RoomPlanExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public ActionResult Edit([Bind(Include = "Id,Name,Capacity")] Room room) { if (ModelState.IsValid) { db.Entry(room).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(room)); }
public ActionResult Edit([Bind(Include = "Id,Name,Subject,StartDate,EndDate,RoomId")] Reservation reservation) { if (ModelState.IsValid) { db.Entry(reservation).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.RoomId = new SelectList(db.Rooms, "Id", "Name", reservation.RoomId); return(View(reservation)); }