public async Task <IActionResult> Edit(int id, [Bind("PolicyID,PolicyLocationID,LocationNumber,LocationDescription,LocationAddress,LocationCity,LocationState,LocationZip")] PolicyLocation policyLocation) { if (id != policyLocation.PolicyLocationID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(policyLocation); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PolicyLocationExists(policyLocation.PolicyLocationID)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } return(View(policyLocation)); }
public async Task <IActionResult> Edit(int id, [Bind("OutageID,StartDate,EndDate,Application,Description")] Outage outage) { if (id != outage.OutageID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(outage); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!OutageExists(outage.OutageID)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } return(View(outage)); }
public async Task <IActionResult> Edit(int id, [Bind("PolicyID,PolicyNumber,EffectiveDate,ExpirationDate,PremiumAmount,InsuredName")] Policy policy) { if (id != policy.PolicyID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(policy); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PolicyExists(policy.PolicyID)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } return(View(policy)); }