Esempio n. 1
0
 public async Task <ActionResult <AdministratorDTO> > Post(AdministratorDTO AdministratorDTO)
 {
     try
     {
         await userService.CreateUser(AdministratorDTO);
     }
     catch (Exception ex)
     {
         var er = new { error = ex.Message };
         return(Ok(er));
     }
     return(Ok());
 }
Esempio n. 2
0
        public async Task <ActionResult> Register(RegisterViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }
            var userCreateSuccess = await _userRegistrationService.CreateUser(model.Email, model.Password);

            if (userCreateSuccess)
            {
                await _userRegistrationService.SendEmailConfirmationLink(Request, model.Email);

                ViewBag.Message = Act.EmailConfirmationLinkSentMessage;
                return(View("Info"));
            }
            ModelState.AddModelError("", Act.UserRegistrationError);
            return(View(model));
        }
Esempio n. 3
0
        public async Task <ActionResult <CreateUserDTO> > CreateUser(CreateUserDTO CreateUserDTO)
        {
            await userService.CreateUser(CreateUserDTO);

            return(Ok(CreateUserDTO));
        }