public async Task <IActionResult> Edit(Guid id, [Bind("guid")] OutcomeAssessmentViewModel outcomeAssessmentViewModel) { if (!IsLoggedIn()) { return(RedirectToAction("Index", "Account")); } ViewBag.Admin = User.Claims.ToList()[2].Value; if (id != outcomeAssessmentViewModel.guid) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(outcomeAssessmentViewModel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!OutcomeAssessmentViewModelExists(outcomeAssessmentViewModel.guid)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(outcomeAssessmentViewModel)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Company_id,Assessment_date,Vision_agreement,Core_values_agreement,Mission_statement_agreement,Vision_outcome_agreement,Competitive_strategy_agreement,Company_composite_score,Strat_people_score,Strat_resources_score,Strat_processes_score,Strat_culture_score,Strat_composite_score,Stake_people_score,Stake_resources_score,Stake_processes_score,Stake_culture_score,Stake_composite_score,Oper_people_score,Oper_resources_score,Oper_processes_score,Oper_culture_score,Oper_composite_score,Risk_people_score,Risk_resources_score,Risk_processes_score,Risk_culture_score,Risk_composite_score")] Assessment assessment) { if (!IsLoggedIn()) { return(RedirectToAction("Index", "Account")); } ViewBag.Admin = User.Claims.ToList()[2].Value; if (id != assessment.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(assessment); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AssessmentExists(assessment.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(assessment)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Company_id,Assessment_date,strat_fo_outcome_val_1,strat_fo_outcome_desc_1,strat_fo_outcome_val_2,strat_fo_outcome_desc_2,strat_fo_outcome_val_3,strat_fo_outcome_desc_3,strat_fo_outcome_val_4,strat_fo_outcome_desc_4,strat_fo_outcome_val_5,strat_fo_outcome_desc_5,strat_ro_outcome_val_1,strat_ro_outcome_desc_1,strat_ro_outcome_val_2,strat_ro_outcome_desc_2,strat_ro_outcome_val_3,strat_ro_outcome_desc_3,strat_ro_outcome_val_4,strat_ro_outcome_desc_4,strat_ro_outcome_val_5,strat_ro_outcome_desc_5,stake_fo_outcome_val_1,stake_fo_outcome_desc_1,stake_fo_outcome_val_2,stake_fo_outcome_desc_2,stake_fo_outcome_val_3,stake_fo_outcome_desc_3,stake_fo_outcome_val_4,stake_fo_outcome_desc_4,stake_fo_outcome_val_5,stake_fo_outcome_desc_5,stake_ro_outcome_val_1,stake_ro_outcome_desc_1,stake_ro_outcome_val_2,stake_ro_outcome_desc_2,stake_ro_outcome_val_3,stake_ro_outcome_desc_3,stake_ro_outcome_val_4,stake_ro_outcome_desc_4,stake_ro_outcome_val_5,stake_ro_outcome_desc_5,oper_fo_outcome_val_1,oper_fo_outcome_desc_1,oper_fo_outcome_val_2,oper_fo_outcome_desc_2,oper_fo_outcome_val_3,oper_fo_outcome_desc_3,oper_fo_outcome_val_4,oper_fo_outcome_desc_4,oper_fo_outcome_val_5,oper_fo_outcome_desc_5,oper_ro_outcome_val_1,oper_ro_outcome_desc_1,oper_ro_outcome_val_2,oper_ro_outcome_desc_2,oper_ro_outcome_val_3,oper_ro_outcome_desc_3,oper_ro_outcome_val_4,oper_ro_outcome_desc_4,oper_ro_outcome_val_5,oper_ro_outcome_desc_5,risk_fo_outcome_val_1,risk_fo_outcome_desc_1,risk_fo_outcome_val_2,risk_fo_outcome_desc_2,risk_fo_outcome_val_3,risk_fo_outcome_desc_3,risk_fo_outcome_val_4,risk_fo_outcome_desc_4,risk_fo_outcome_val_5,risk_fo_outcome_desc_5,risk_ro_outcome_val_1,risk_ro_outcome_desc_1,risk_ro_outcome_val_2,risk_ro_outcome_desc_2,risk_ro_outcome_val_3,risk_ro_outcome_desc_3,risk_ro_outcome_val_4,risk_ro_outcome_desc_4,risk_ro_outcome_val_5,risk_ro_outcome_desc_5")] Outcome outcome) { if (!IsLoggedIn()) { return(RedirectToAction("Index", "Account")); } ViewBag.Admin = User.Claims.ToList()[2].Value; if (id != outcome.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(outcome); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!OutcomeExists(outcome.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(outcome)); }