예제 #1
0
        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"));
        }
예제 #2
0
        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"));
        }
예제 #3
0
 public void Modify(Report report, BullyingViewModel viewModel)
 {
     report.Description  = viewModel.Description;
     report.VictimName   = viewModel.VictimName;
     report.Perpetrators = GetPerpetrators(viewModel.Perpetrators);
 }
예제 #4
0
 public void Modify(Report report, BullyingViewModel viewModel)
 {
     report.Description = viewModel.Description;
     report.VictimName = viewModel.VictimName;
 }
예제 #5
0
 public void Modify(Report report, BullyingViewModel viewModel)
 {
     report.Description = viewModel.Description;
     report.VictimName  = viewModel.VictimName;
 }
예제 #6
0
        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");
        }