public async Task <IHttpActionResult> Register(Register register) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var process = new AccountProcess(unitOfWork); Result result = await process.Register(register.Name, register.Email, register.Password, register.RoleType); return(GetErrorResult(result) ?? Ok(result)); }
private void RegisterAccountBtnClick(object sender, RoutedEventArgs e) { Console.WriteLine(passwordText.Password); if (accountText.Text == "" | passwordText.Password == "" | passwordConfirmText.Password == "" | emailText.Text == "") { DialogShow.ShowOkDialog("warning", "Have item empty!"); return; } else if (passwordText.Password != passwordConfirmText.Password) { DialogShow.ShowOkDialog("warning", "Password and Confirm Password not same!"); return; } AccountProcess account = new AccountProcess(); bool result = account.Register(accountText.Text, passwordText.Password, emailText.Text); if (result == false) { DialogShow.ShowOkDialog("warning", "Account has already exist!"); return; } }