Example #1
0
        public async Task <IActionResult> CreateSchool(SchoolCreateInputModel inputModel)
        {
            if (!ModelState.IsValid)
            {
                return(View(inputModel));
            }

            try
            {
                var confirmViewModel = await _usersService.CreatePrincipal <ConfirmCreatedViewModel>(inputModel.Principal);

                await _schoolsServices.Create(inputModel.School, confirmViewModel.UniqueId);

                return(RedirectToAction(nameof(ConfirmCreated), confirmViewModel));
            }
            catch (Exception e)
            {
                _logger.LogError(e, "An exception occured during new school/principal record creation.");
                return(RedirectToAction("Error", "Home"));
            }
        }
Example #2
0
        public IActionResult CreateSchool()
        {
            var inputModel = new SchoolCreateInputModel();

            return(View(inputModel));
        }