public IActionResult NewFeedback([Bind("Id,Comments")] Feedbacks feedbacks) { if (ModelState.IsValid) { _context.Add(feedbacks); _context.SaveChanges(); return(RedirectToAction(nameof(Feedbacks))); } return(View(feedbacks)); }
public async Task <IActionResult> Create([Bind("Id,Name,Comments")] Meal meal) { if (ModelState.IsValid) { _context.Add(meal); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(meal)); }
public async Task <IActionResult> Create([Bind("Id,Name")] Chef chef) { if (ModelState.IsValid) { _context.Add(chef); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(chef)); }
public async Task <IActionResult> Create([Bind("TableCategoryId,TableCapacity")] TableCategory tableCategory) { if (ModelState.IsValid) { _context.Add(tableCategory); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(tableCategory)); }
public async Task <IActionResult> Create([Bind("TableId,TableCategoryId,IsBooked")] Table table) { if (ModelState.IsValid) { _context.Add(table); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["TableCategoryId"] = new SelectList(_context.TableCategories, "TableCategoryId", "TableCategoryId", table.TableCategoryId); return(View(table)); }
public async Task <IActionResult> Create([Bind("CustomerId,CustomerName,Address,PhoneNumber,EmailAddress,GroupCount")] Customer customer) { if (ModelState.IsValid) { _context.Add(customer); await _context.SaveChangesAsync(); //return RedirectToAction(nameof(Index)); return(RedirectToAction("IndexAvailable", "Tables")); } return(View(customer)); }
public async Task <IActionResult> Create([Bind("BookingId,BookingDate,CustomerId,TableId")] Booking booking) { if (ModelState.IsValid) { _context.Add(booking); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["CustomerId"] = new SelectList(_context.Customers, "CustomerId", "CustomerId", booking.CustomerId); ViewData["TableId"] = new SelectList(_context.Tables, "TableId", "TableId", booking.TableId); return(View(booking)); }
public IActionResult CreateMenu([FromBody] Menu menu) { _context.Add(menu); _context.SaveChanges(); return(CreatedAtAction(nameof(Menu), new { id = menu.Id }, menu)); }
public void Insert(MenuItem item) { context.Add(item); context.SaveChanges(); }
public IActionResult CreateVoucher([FromBody] Vouchers voucher) { _context.Add(voucher); _context.SaveChanges(); return(CreatedAtAction(nameof(Vouchers), new { id = voucher.Id }, voucher)); }