public void Modify(Report report, WeaponViewModel viewModel) { report.WeaponType = viewModel.Type; if (viewModel.Type == "Anders") { report.WeaponType = viewModel.OtherType; } report.WeaponLocation = viewModel.Location; report.Description = viewModel.Description; }
public async Task <ActionResult> Weapons(WeaponViewModel viewModel) { if (!ModelState.IsValid) { return(View(viewModel)); } var report = new Report(); _modelFactory.Modify(report, viewModel); await _reportProxy.PatchAsync(GetCurrentReportId(), report); return(RedirectToAction("Contact")); }
public async Task<ActionResult> Weapons(WeaponViewModel viewModel) { if (!ModelState.IsValid) { return View(viewModel); } var report = new Report(); _modelFactory.Modify(report, viewModel); report = await _reportProxy.PatchAsync(GetCurrentReportId(), report); if (report.Category == "Fight") { return RedirectToAction("Contact"); } return RedirectToAction("Perpetrator"); }