public async Task <IActionResult> Edit(int id, [Bind("BranchId,Name,PhoneNumber,AddressNumStreet,TownCity")] Branch branch) { if (id != branch.BranchId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(branch); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BranchExists(branch.BranchId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(branch)); }
public async Task <IActionResult> Edit(int id, [Bind("StatusId,Content")] OrderStatus orderStatus) { if (id != orderStatus.StatusId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(orderStatus); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!OrderStatusExists(orderStatus.StatusId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(orderStatus)); }
public async Task <IActionResult> Edit(int id, [Bind("VolunteerId,PoliceVetDate,PoliceVetVerified")] VolunteerPoliceInfo volunteerPoliceInfo) { if (id != volunteerPoliceInfo.VolunteerId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(volunteerPoliceInfo); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!VolunteerPoliceInfoExists(volunteerPoliceInfo.VolunteerId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["VolunteerId"] = new SelectList(_context.Volunteer, "VolunteerId", "Address", volunteerPoliceInfo.VolunteerId); return(View(volunteerPoliceInfo)); }
public async Task <IActionResult> Edit(int id, [Bind("MealTypeId,InstockAmount")] MealInstock mealInstock) { if (id != mealInstock.MealTypeId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(mealInstock); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MealInstockExists(mealInstock.MealTypeId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["MealTypeId"] = new SelectList(_context.MealType, "MealTypeId", "MealTypeName", mealInstock.MealTypeId); return(View(mealInstock)); }
public async Task <IActionResult> Edit(int id, [Bind("MealTypeId,MealTypeName,ShelfLocation")] MealType mealType) { if (id != mealType.MealTypeId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(mealType); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MealTypeExists(mealType.MealTypeId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(mealType)); }
public async Task <IActionResult> Edit(int id, [Bind("BatchId,AddAmount,ProductionDate,MealTypeId")] Batch batch) { if (id != batch.BatchId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(batch); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BatchExists(batch.BatchId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["MealTypeId"] = new SelectList(_context.MealType, "MealTypeId", "MealTypeName", batch.MealTypeId); return(View(batch)); }
public async Task <IActionResult> Edit(int id, [Bind("VolunteerId,FirstName,LastName,PhoneNumber,Relationship")] VolunteerEmergencyContact volunteerEmergencyContact) { if (id != volunteerEmergencyContact.VolunteerId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(volunteerEmergencyContact); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!VolunteerEmergencyContactExists(volunteerEmergencyContact.VolunteerId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["VolunteerId"] = new SelectList(_context.Volunteer, "VolunteerId", "Address", volunteerEmergencyContact.VolunteerId); return(View(volunteerEmergencyContact)); }
public async Task <IActionResult> Edit(int id, [Bind("RoleId,RoleName")] VolunteerRole volunteerRole) { if (id != volunteerRole.RoleId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(volunteerRole); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!VolunteerRoleExists(volunteerRole.RoleId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(volunteerRole)); }
public async Task <IActionResult> Edit(int id, [Bind("VolunteerId,FirstName,LastName,Dob,Email,PreferredPhone,AlternativePhone,Address,TownCity,PostCode,StatusId,BranchId,RoleId,IsAssignedUserAccount")] Volunteer volunteer) { if (id != volunteer.VolunteerId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(volunteer); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!VolunteerExists(volunteer.VolunteerId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["BranchId"] = new SelectList(_context.Branch, "BranchId", "Name", volunteer.BranchId); ViewData["RoleId"] = new SelectList(_context.VolunteerRole, "RoleId", "RoleName", volunteer.RoleId); ViewData["StatusId"] = new SelectList(_context.VolunteerStatus, "StatusId", "Content", volunteer.StatusId); return(View(volunteer)); }
public async Task <IActionResult> Edit(int id, [Bind("ReferrerId,FirstName,LastName,OrganisationName,PhoneNumber,Email,TownCity,RoleId")] Referrer referrer) { if (id != referrer.ReferrerId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(referrer); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ReferrerExists(referrer.ReferrerId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["RoleId"] = new SelectList(_context.ReferrerRole, "RoleId", "RoleName", referrer.RoleId); return(View(referrer)); }
public async Task <IActionResult> Edit(int id, [Bind("ReferralReasonId,Content")] ReferralReason referralReason) { if (id != referralReason.ReferralReasonId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(referralReason); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ReferralReasonExists(referralReason.ReferralReasonId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(referralReason)); }
public async Task <IActionResult> Edit(int id, [Bind("DietaryRequirementId,DietaryName,MatchedSetMeal,Description")] DietaryRequirement dietaryRequirement) { if (id != dietaryRequirement.DietaryRequirementId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(dietaryRequirement); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DietaryRequirementExists(dietaryRequirement.DietaryRequirementId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(dietaryRequirement)); }
public async Task <IActionResult> Edit(int id, [Bind("RecipientId,FirstName,LastName,AddressNumStreet,TownCity,Postcode,PhoneNumber,Email,DogOnProperty,BranchId,ReferralReasonId,OtherReferralInfo,AdultsNum,Under5ChildrenNum,_510ChildrenNum,_1117ChildrenNum,DietaryRequirementId,OtherAllergyInfo,AdditionalInfo,ReferrerId,CreatedDate")] Recipient recipient) { if (id != recipient.RecipientId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(recipient); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RecipientExists(recipient.RecipientId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["BranchId"] = new SelectList(_context.Branch, "BranchId", "Name", recipient.BranchId); ViewData["DietaryRequirementId"] = new SelectList(_context.DietaryRequirement, "DietaryRequirementId", "DietaryName", recipient.DietaryRequirementId); ViewData["ReferralReasonId"] = new SelectList(_context.ReferralReason, "ReferralReasonId", "ReferralReasonId", recipient.ReferralReasonId); ViewData["ReferrerId"] = new SelectList(_context.Referrer, "ReferrerId", "FirstName", recipient.ReferrerId); return(View(recipient)); }