Пример #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);
 }
Пример #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"));
        }
Пример #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"));
        }
Пример #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;
 }
Пример #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;
 }
Пример #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");
        }