|
@@ -46,6 +46,11 @@ namespace UniformMaterialManagementSystem.ViewModels
|
|
[CustomValidation(typeof(RegisterPageViewModel), nameof(ValidateUserName))]
|
|
[CustomValidation(typeof(RegisterPageViewModel), nameof(ValidateUserName))]
|
|
private string _userName = string.Empty;
|
|
private string _userName = string.Empty;
|
|
|
|
|
|
|
|
+ [ObservableProperty]
|
|
|
|
+ [Required(ErrorMessage = "登录名不能为空")]
|
|
|
|
+ [CustomValidation(typeof(RegisterPageViewModel), nameof(ValidateUserName))]
|
|
|
|
+ private string _loginName = string.Empty;
|
|
|
|
+
|
|
[ObservableProperty]
|
|
[ObservableProperty]
|
|
[Required(ErrorMessage = "密码不能为空")]
|
|
[Required(ErrorMessage = "密码不能为空")]
|
|
[CustomValidation(typeof(RegisterPageViewModel), nameof(ValidatePassword))]
|
|
[CustomValidation(typeof(RegisterPageViewModel), nameof(ValidatePassword))]
|
|
@@ -74,7 +79,7 @@ namespace UniformMaterialManagementSystem.ViewModels
|
|
}
|
|
}
|
|
|
|
|
|
[RelayCommand]
|
|
[RelayCommand]
|
|
- private async void CreateUser(Window window)
|
|
|
|
|
|
+ private async Task CreateUser(Window window)
|
|
{
|
|
{
|
|
ValidateAllProperties();
|
|
ValidateAllProperties();
|
|
|
|
|
|
@@ -86,7 +91,7 @@ namespace UniformMaterialManagementSystem.ViewModels
|
|
Salt = salt,
|
|
Salt = salt,
|
|
Password = PasswordHashing.GenerateSaltedHash(Password, salt),
|
|
Password = PasswordHashing.GenerateSaltedHash(Password, salt),
|
|
UserName = UserName,
|
|
UserName = UserName,
|
|
- LoginName = UserName,
|
|
|
|
|
|
+ LoginName = LoginName,
|
|
CompanyGuid = SelectedCompany?.Guid,
|
|
CompanyGuid = SelectedCompany?.Guid,
|
|
Company = SelectedCompany,
|
|
Company = SelectedCompany,
|
|
CompanyName = SelectedCompany?.Name,
|
|
CompanyName = SelectedCompany?.Name,
|