public async Task <ActionResult> Bullying(BullyingViewModel viewModel) { if (!ModelState.IsValid) { return(View(viewModel)); } var report = await GetCurrentReport(); _modelFactory.Modify(report, viewModel); await _reportProxy.PatchAsync(report.Id, report); if (viewModel.HasPerpetrator && !viewModel.HasVictim) { return(RedirectToAction("Perpetrator")); } else if (!viewModel.HasPerpetrator && viewModel.HasVictim) { return(RedirectToAction("Victim")); } else if (viewModel.HasPerpetrator && viewModel.HasVictim) { return(RedirectToAction("Perpetrator", routeValues: new { hasVictim = viewModel.HasVictim })); } return(RedirectToAction("Vehicle")); }
public async Task <ActionResult> Bullying(BullyingViewModel viewModel) { if (!ModelState.IsValid) { return(View(viewModel)); } var report = new Report(); _modelFactory.Modify(report, viewModel); await _reportProxy.PatchAsync(GetCurrentReportId(), report); return(RedirectToAction("Contact")); }
public void Modify(Report report, BullyingViewModel viewModel) { report.Description = viewModel.Description; report.VictimName = viewModel.VictimName; report.Perpetrators = GetPerpetrators(viewModel.Perpetrators); }
public void Modify(Report report, BullyingViewModel viewModel) { report.Description = viewModel.Description; report.VictimName = viewModel.VictimName; }
public async Task<ActionResult> Bullying(BullyingViewModel viewModel) { if (!ModelState.IsValid) { return View(viewModel); } var report = new Report(); _modelFactory.Modify(report, viewModel); report = await _reportProxy.PatchAsync(GetCurrentReportId(), report); if (viewModel.HasPerpetrator && !viewModel.HasVictim) { return RedirectToAction("Perpetrator"); } else if (!viewModel.HasPerpetrator && viewModel.HasVictim) { return RedirectToAction("Victim"); } else if (viewModel.HasPerpetrator && viewModel.HasVictim) { return RedirectToAction("Perpetrator", routeValues: new { hasVictim = viewModel.HasVictim }); } return RedirectToAction("Vehicle"); }