public async Task <IActionResult> Create([Bind("room_id,room_name,capacity")] Room room) { if (ModelState.IsValid) { _context.Add(room); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(room)); }
public async Task <IActionResult> Create([Bind("User_id,User_name")] User_s user_s) { if (ModelState.IsValid) { _context.Add(user_s); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(user_s)); }
public async Task <IActionResult> Create([Bind("booking_id,booking_title,start_time,end_time,participants,note,room_id,users_id")] Booking booking) { if (ModelState.IsValid) { _context.Add(booking); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["room_id"] = new SelectList(_context.Set <Room>(), "room_id", "room_name", booking.room_id); return(View(booking)); }