public async Task <IActionResult> Edit(int id, [Bind("Id,Mac,Type,Name,Location")] Gateways gateways) { if (id != gateways.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(gateways); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GatewaysExists(gateways.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(gateways)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Location,Phone")] Persons persons) { if (id != persons.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(persons); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PersonsExists(persons.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(persons)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Mac,Type,Name,Location,Date,Rssi1,Rssi2,Rssi3,Rssi4")] Beacons beacons) { if (id != beacons.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(beacons); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BeaconsExists(beacons.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(beacons)); }