Exemple #1
0
 public void Modify(Report report, AdditionalLocationViewModel viewModel)
 {
     if (report.Location == null)
     {
         report.Location = new Location();
     }
     report.Location.Description = viewModel.AdditionalLocation;
 }
Exemple #2
0
 public void Modify(Report report, AdditionalLocationViewModel viewModel)
 {
     if (report.Location == null)
     {
         report.Location = new Location();
     }
     report.Location.Description = viewModel.AdditionalLocation;
 }
        public async Task <ActionResult> AdditionalLocation(AdditionalLocationViewModel viewModel)
        {
            var report = await GetCurrentReport();

            if (!ModelState.IsValid)
            {
                ViewBag.Building    = Resources.Buildings.ResourceManager.GetString(report.Location.Building);
                ViewBag.Preposition = Resources.Buildings.ResourceManager.GetString(report.Location.Building + "_Preposition");
                return(View(viewModel));
            }
            _modelFactory.Modify(report, viewModel);
            report = await _reportProxy.PatchAsync(GetCurrentReportId(), report);

            return(report.Category != "FirstAid" ? RedirectToAction("Details") : RedirectToAction("FirstAid"));
        }
        public async Task<ActionResult> AdditionalLocation(AdditionalLocationViewModel viewModel)
        {
            var report = await GetCurrentReport();
            if (!ModelState.IsValid)
            {
                ViewBag.Building = Resources.Buildings.ResourceManager.GetString(report.Location.Building);
                ViewBag.Preposition = Resources.Buildings.ResourceManager.GetString(report.Location.Building + "_Preposition");
                return View(viewModel);
            }
            _modelFactory.Modify(report, viewModel);
            report = await _reportProxy.PatchAsync(GetCurrentReportId(), report);

            return RedirectToAction(report.Category);
        }