public async Task <IActionResult> Edit(int id, [Bind("order_id,id,userName,phone")] LandproOrder landproOrder) { if (id != landproOrder.order_id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(landproOrder); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LandproOrderExists(landproOrder.order_id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(landproOrder)); }
public async Task <IActionResult> Create([Bind("order_id,id,userName,phone")] LandproOrder landproOrder) { if (ModelState.IsValid) { _context.Add(landproOrder); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(landproOrder)); }