public async Task <IActionResult> Edit(int id, [Bind("Id,OrderNumber,CustomerName,CustomerLastname,OrderLocaton,PizzaPrice,PizzaFprice,OrderDate,StoreName,CustomerPhoneNumber")] MVOrders orders) { if (id != orders.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(orders); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!OrdersExists(orders.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(orders)); }
//Get: placeAnOrder public IActionResult PlaceAnOrder() { MVPizza pizza = new MVPizza(); MVOrders order = new MVOrders(); return(ViewBag(pizza, order)); }
public async Task <IActionResult> Create([Bind("Id,OrderNumber,CustomerName,CustomerLastname,OrderLocaton,PizzaPrice,PizzaFprice,OrderDate,StoreName,CustomerPhoneNumber")] MVOrders orders) { if (ModelState.IsValid) { _context.Add(orders); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(orders)); }