Beispiel #1
0
        public async Task <IActionResult> Create([Bind("Name,GroupLeader,PagerNumber,OperationId,AreaSeeker,DebrisSearcher,WaterLocators,Mantrailer,Helpers")] Unit unit)
        {
            if (ModelState.IsValid)
            {
                _context.Add(unit);
                await _context.SaveChangesAsync();

                OperationActionsController operationActionsController = new OperationActionsController(_context);
                await operationActionsController.Create(unit.OperationId, "Einheit eingetroffen / erfasst", unit.Name); // TODO: I18n

                return(RedirectToAction(nameof(Index), new { id = unit.OperationId }));
            }
            return(View(unit));
        }
Beispiel #2
0
        public async Task <IActionResult> Create([Bind("Ailments,Clothes,DateOfBirth,EyesColour,FurtherInformation,Gender,HairColor,KnownPlaces,Medications,MissingSince,Name,OperationId,Size,SkinType,SpecialCharacteristics,Weight")] MissingPerson missingPerson)
        {
            if (ModelState.IsValid)
            {
                _context.Add(missingPerson);
                await _context.SaveChangesAsync();

                OperationActionsController operationActionsController = new OperationActionsController(_context);
                await operationActionsController.Create(missingPerson.OperationId,
                                                        "Vermisstendaten erfasst",
                                                        string.Empty,
                                                        $"{missingPerson.Name}, vermisst seit {missingPerson.MissingSince}"); // TODO: I18n

                return(RedirectToAction(nameof(Index), new { id = missingPerson.OperationId }));
            }
            return(View(missingPerson));
        }