コード例 #1
0
ファイル: ModelFactory.cs プロジェクト: leerbedrijflisa/kiwi
 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;
 }
コード例 #2
0
ファイル: ModelFactory.cs プロジェクト: AndreasFurster/kiwi
 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;
 }
コード例 #3
0
        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"));
        }
コード例 #4
0
        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");
        }