|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- 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()
- {
-
- }
- }
- }
|