public async Task <IActionResult> Edit(int id, [Bind("Id,CustomerName,CustomerAddress,CustomerNumber,TotalWeight,NoParcels,TotalValue")] Waybill waybill) { if (id != waybill.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(waybill); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!WaybillExists(waybill.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(waybill)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,BranchName,BranchEmail,PhoneNumber,PhysicalAddress,Manager")] Branch branch) { if (id != branch.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(branch); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BranchExists(branch.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(branch)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Make,Model,Mileage,Description")] Vehicle vehicle) { if (id != vehicle.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(vehicle); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!VehicleExists(vehicle.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(vehicle)); }