public async Task <IActionResult> Create([Bind("ID,Address,Contact,Email")] Store store) { if (ModelState.IsValid) { _context.Add(store); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(store)); }
public async Task <IActionResult> Create([Bind("ID,First_Name,Last_Name,Gender,DOB")] Customer customer) { if (ModelState.IsValid) { _context.Add(customer); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(customer)); }
public async Task <IActionResult> Create([Bind("ID,Food_Name,Food_Type,Food_Quantity,Price")] Food food) { if (ModelState.IsValid) { _context.Add(food); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(food)); }
public async Task <IActionResult> Create([Bind("ID,CustomerID,StaffID,FoodID,StoreID")] Order order) { if (ModelState.IsValid) { _context.Add(order); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["CustomerID"] = new SelectList(_context.Customer, "ID", "ID", order.CustomerID); ViewData["FoodID"] = new SelectList(_context.Food, "ID", "ID", order.FoodID); ViewData["StaffID"] = new SelectList(_context.Set <Staff>(), "ID", "ID", order.StaffID); ViewData["StoreID"] = new SelectList(_context.Set <Store>(), "ID", "ID", order.StoreID); return(View(order)); }