|
- using BPASmart.Model;
- using BPASmart.UserManagement.View;
- using BPASmartClient.Helper;
- using System;
- using System.Collections.Generic;
- using System.Collections.ObjectModel;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
-
- namespace BPASmart.UserManagement.ViewModel
- {
- partial class UserListViewModel:ObservableObject
- {
- /// <summary>
- /// 用户列表
- /// </summary>
- public ObservableCollection<UserManager> userManagers { get; set; } = Json<LocalUser>.Data.UserManagers;
-
- /// <summary>
- /// 注册新用户
- /// </summary>
- [RelayCommand]
- private void RegisterNewUser()
- {
- ActionManage.GetInstance.Send("ChangeMianContent", "AddNewUser");
- }
- /// <summary>
- /// 修改密码
- /// </summary>
- [RelayCommand]
- private void ChangePassword(object o)
- {
- if (o == null) return;
- if (o is UserManager user)
- {
- if(userManagers.Contains(user))
- {
- Globle.GlobleData.ChangeUser = user;
- ActionManage.GetInstance.Send("ChangeMianContent", "ChangeUser");
- }
-
- }
-
- }
- /// <summary>
- /// 编辑权限
- /// </summary>
- [RelayCommand]
- private void EditUsetPower(object o)
- {
- if (o == null) return;
- if (o is UserManager user)
- {
- if (userManagers.Contains(user))
- {
- Globle.GlobleData.EditUser = null;
- Globle.GlobleData.EditUser = user;
- ActionManage.GetInstance.Send("ChangeMianContent", "EditPower");
- }
-
- }
- }
- /// <summary>
- /// 删除用户
- /// </summary>
- [RelayCommand]
- private void DeleteUser(object o)
- {
- if (o == null) return;
- if (o is UserManager user)
- {
- if (userManagers.Contains(user))
- {
- userManagers.Remove(user);
- }
- }
- Json<LocalUser>.Save();
-
- }
-
- public UserListViewModel()
- {
-
- }
- }
- }
|