public async Task <IActionResult> Edit(int id, [Bind("ID,VehicleTypesID,MemberID,RegNum,Color,Make,Model")] ParkedVehicle parkedVehicle) { if (id != parkedVehicle.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(parkedVehicle); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ParkedVehicleExists(parkedVehicle.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["MemberID"] = new SelectList(_context.Set <Member>(), "Id", "ConfirmPassword", parkedVehicle.MemberID); ViewData["VehicleTypeID"] = new SelectList(_context.Set <VehicleTypes>(), "ID", "VehicleTYpe", parkedVehicle.VehicleTypeID); return(View(parkedVehicle)); }
public async Task <IActionResult> Edit(int id, [Bind("MemberID,PersonalIdentityNumber,FirstName,LastName,Joined,ExtendedMemberShipEndDate")] Member member) { if (id != member.MemberID) { return(NotFound()); } if (ModelState.IsValid) { try { db.Update(member); await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MemberExists(member.MemberID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(member)); }
public async Task <IActionResult> Edit(string id, [Bind("Type,Size,imgSrc")] VehicleType vehicleType) { if (id != vehicleType.Type) { return(NotFound()); } if (ModelState.IsValid) { try { db.Update(vehicleType); await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!VehicleTypeExists(vehicleType.Type)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(vehicleType)); }
public async Task <IActionResult> Edit(int id, [Bind("MembershiptTypeID,Type,Discount")] MembershipType membershipType) { if (id != membershipType.MembershiptTypeID) { return(NotFound()); } if (ModelState.IsValid) { try { db.Update(membershipType); await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MembershipTypeExists(membershipType.MembershiptTypeID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(membershipType)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,PersonNr,FristName,LastName")] Members members) { if (id != members.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(members); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MembersExists(members.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(members)); }