Пример #1
0
        public IActionResult OnPostCreate(CreateAccount command)
        {
            var result = new OperationResult();

            if (ModelState.IsValid)
            {
                result = _accountApplication.Register(command);
            }
            return(new JsonResult(result));
        }
Пример #2
0
        public IActionResult OnPostRegister(RegisterAccount command)
        {
            var result = _accountApplication.Register(command);

            if (result.IsSuccedded)
            {
                return(RedirectToPage("/Account"));
            }
            RegisterMessage = result.Message;
            return(RedirectToPage("/Account"));
        }
Пример #3
0
        public IActionResult OnPostRegister()
        {
            var operationResult = new OperationResult();

            var createAccount = new CreateAccount()
            {
                Username = RegisterAccount.Username,
                Password = RegisterAccount.Password,
                RoleId   = 2,
                Mobile   = RegisterAccount.Mobile,
                Fullname = RegisterAccount.Fullname,
            };

            operationResult = _accountApplication.Register(createAccount);
            if (!operationResult.IsSucceeded)
            {
                RegisterMessage = operationResult.Message;
            }


            return(Page());
        }
        public JsonResult OnPostCreate(RegisterAccount command)
        {
            var result = _accountApplication.Register(command);

            return(new JsonResult(result));
        }
Пример #5
0
        public IActionResult Register(RegisterAccount command)
        {
            var result = _accountApplication.Register(command);

            return(Ok(result.IsSuccedded));
        }