Example #1
0
 public void Modify(Report report, TheftViewModel viewModel)
 {
     report.StolenObject = viewModel.StolenObject;
     report.DateOfTheft  = viewModel.DateOfTheft;
     report.Description  = viewModel.Description;
     report.Vehicles     = GetVehicles(viewModel.Vehicles);
     report.Perpetrators = GetPerpetrators(viewModel.Perpetrators);
 }
Example #2
0
        public async Task <ActionResult> Theft(TheftViewModel viewModel)
        {
            if (!ModelState.IsValid)
            {
                return(View(viewModel));
            }

            var report = new Report();

            _modelFactory.Modify(report, viewModel);
            await _reportProxy.PatchAsync(GetCurrentReportId(), report);

            return(RedirectToAction("ContactRequired"));
        }
Example #3
0
        public async Task <ActionResult> Theft(TheftViewModel viewModel)
        {
            if (!ModelState.IsValid)
            {
                return(View(viewModel));
            }

            var report = await GetCurrentReport();

            _modelFactory.Modify(report, viewModel);
            await _reportProxy.PatchAsync(report.Id, report);

            return(RedirectToAction("Vehicle"));
        }
Example #4
0
 public void Modify(Report report, TheftViewModel viewModel)
 {
     report.StolenObject = viewModel.StolenObject ;
     report.DateOfTheft = viewModel.DateOfTheft.Add(viewModel.TimeOfTheft.TimeOfDay);
     report.Description = viewModel.Description;
 }
Example #5
0
 public void Modify(Report report, TheftViewModel viewModel)
 {
     report.StolenObject = viewModel.StolenObject;
     report.DateOfTheft  = viewModel.DateOfTheft.Add(viewModel.TimeOfTheft.TimeOfDay);
     report.Description  = viewModel.Description;
 }
Example #6
0
        public async Task<ActionResult> Theft(TheftViewModel viewModel)
        {
            if (!ModelState.IsValid)
            {
                return View(viewModel);
            }

            var report = new Report();

            _modelFactory.Modify(report, viewModel);
            await _reportProxy.PatchAsync(GetCurrentReportId(), report);

            return RedirectToAction("Vehicle");
        }