public async Task <IActionResult> Edit(int id, [Bind("ID,CustomerName,DrinkName,PaidStatus,DrinkStatus")] orderDrinks orderDrinks) { if (id != orderDrinks.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(orderDrinks); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!orderDrinksExists(orderDrinks.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } return(View(orderDrinks)); }
public async Task <IActionResult> Create([Bind("ID,CustomerName,DrinkName,PaidStatus,DrinkStatus")] orderDrinks orderDrinks) { if (ModelState.IsValid) { _context.Add(orderDrinks); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(orderDrinks)); }
public ActionResult Create([Bind("CustName,Drink,Qty")] orderDrinks orderDrinks) { if (ModelState.IsValid) { _context.Add(orderDrinks); _context.SaveChanges(); return(RedirectToAction("Create")); } //ViewBag.Category = new SelectList(_context) return(View(orderDrinks)); }