2023-04-13 11:51:03 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Windows;
|
|
|
|
|
using System.Windows.Controls;
|
2023-09-20 17:25:51 +08:00
|
|
|
|
using System.Windows.Forms.VisualStyles;
|
2023-04-13 11:51:03 +08:00
|
|
|
|
using System.Windows.Input;
|
|
|
|
|
using Aitex.Core.RT.Log;
|
2023-09-05 00:12:08 +08:00
|
|
|
|
using MECF.Framework.Common.Account;
|
2023-09-20 17:25:51 +08:00
|
|
|
|
using MECF.Framework.Common.Account.Extends;
|
|
|
|
|
using MECF.Framework.Common.Account.Permissions;
|
2023-04-13 11:51:03 +08:00
|
|
|
|
using MECF.Framework.UI.Client.ClientBase;
|
|
|
|
|
using OpenSEMI.ClientBase;
|
|
|
|
|
using OpenSEMI.ClientBase.Command;
|
|
|
|
|
|
|
|
|
|
namespace MECF.Framework.UI.Client.CenterViews.Configs.Roles
|
|
|
|
|
{
|
|
|
|
|
public class RoleViewModel : BaseModel
|
|
|
|
|
{
|
2023-09-02 23:46:13 +08:00
|
|
|
|
#region Variables
|
2023-04-13 11:51:03 +08:00
|
|
|
|
|
2023-09-02 23:46:13 +08:00
|
|
|
|
private bool _isEnabledRoleName;
|
|
|
|
|
private RoleItem _treeSelectedRole;
|
|
|
|
|
private CtrlMode _controlMode = CtrlMode.VIEW;
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Constructors
|
|
|
|
|
|
|
|
|
|
public RoleViewModel()
|
2023-04-13 11:51:03 +08:00
|
|
|
|
{
|
2023-09-02 23:46:13 +08:00
|
|
|
|
DisplayName = "Role";
|
2023-04-13 11:51:03 +08:00
|
|
|
|
}
|
2023-09-02 23:46:13 +08:00
|
|
|
|
|
|
|
|
|
#endregion
|
2023-04-13 11:51:03 +08:00
|
|
|
|
|
2023-09-02 23:46:13 +08:00
|
|
|
|
#region Properties
|
|
|
|
|
|
|
|
|
|
public bool IsEnabledRoleName
|
2023-04-13 11:51:03 +08:00
|
|
|
|
{
|
2023-09-02 23:46:13 +08:00
|
|
|
|
get => _isEnabledRoleName;
|
2023-09-04 11:51:05 +08:00
|
|
|
|
set { _isEnabledRoleName = value; NotifyOfPropertyChange(); }
|
2023-04-13 11:51:03 +08:00
|
|
|
|
}
|
2023-09-02 23:46:13 +08:00
|
|
|
|
|
2023-09-20 17:25:51 +08:00
|
|
|
|
public ObservableCollection<PermissionMappedType> PermissionDictionary => RolePermissionMapper.Instance.PermissionDictionary;
|
|
|
|
|
public ObservableCollection<PermissionMappedType> PermissionTrueFalseDictionary => RolePermissionTrueFalseMapper.Instance.PermissionDictionary;
|
2023-09-02 23:46:13 +08:00
|
|
|
|
|
|
|
|
|
public ObservableCollection<RoleItem> RoleList { get; } = new();
|
2023-04-13 11:51:03 +08:00
|
|
|
|
|
2023-09-02 23:46:13 +08:00
|
|
|
|
public RoleItem TreeSelectedRole
|
2023-04-13 11:51:03 +08:00
|
|
|
|
{
|
2023-09-02 23:46:13 +08:00
|
|
|
|
get => _treeSelectedRole;
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
_treeSelectedRole = value;
|
2023-09-04 11:51:05 +08:00
|
|
|
|
NotifyOfPropertyChange();
|
2023-09-02 23:46:13 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public CtrlMode ControlMode
|
|
|
|
|
{
|
|
|
|
|
get => _controlMode;
|
2023-09-04 11:51:05 +08:00
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
_controlMode = value;
|
|
|
|
|
NotifyOfPropertyChange();
|
|
|
|
|
}
|
2023-04-13 11:51:03 +08:00
|
|
|
|
}
|
2023-09-02 23:46:13 +08:00
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Methods
|
|
|
|
|
|
2023-09-20 17:25:51 +08:00
|
|
|
|
protected override void OnInitialize()
|
|
|
|
|
{
|
|
|
|
|
base.OnInitialize();
|
|
|
|
|
RoleManagerClient.Instance.Initialize();
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-13 11:51:03 +08:00
|
|
|
|
protected override void OnActivate()
|
|
|
|
|
{
|
2023-09-02 23:46:13 +08:00
|
|
|
|
RoleList.Clear();
|
|
|
|
|
_treeSelectedRole = null;
|
2023-04-13 11:51:03 +08:00
|
|
|
|
LoadRoleList();
|
|
|
|
|
|
|
|
|
|
base.OnActivate();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnDeactivate(bool close)
|
|
|
|
|
{
|
|
|
|
|
if (ControlMode == CtrlMode.EDIT && IsPermission)
|
|
|
|
|
{
|
|
|
|
|
if (DialogBox.Confirm("The data has been modified. Do you want to save the change(s)?"))
|
|
|
|
|
{
|
2023-09-20 17:25:51 +08:00
|
|
|
|
if (SaveChanges(out var reason))
|
2023-04-13 11:51:03 +08:00
|
|
|
|
{
|
|
|
|
|
ControlMode = CtrlMode.VIEW;
|
|
|
|
|
DialogBox.ShowInfo("Operated successfully.");
|
|
|
|
|
}
|
2023-09-20 17:25:51 +08:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
DialogBox.ShowError($"Operated failed, {reason}");
|
|
|
|
|
}
|
2023-04-13 11:51:03 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
base.OnDeactivate(close);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void OnRoleChanged()
|
|
|
|
|
{
|
2023-09-02 23:46:13 +08:00
|
|
|
|
var roleNameList = new[] { "管理员", "设备工程师", "工艺工程师", "操作员" };
|
|
|
|
|
var roleName = roleNameList.Contains(TreeSelectedRole.DisplayRoleName) ? TreeSelectedRole.DisplayRoleName : "";
|
2023-04-13 11:51:03 +08:00
|
|
|
|
IsEnabledRoleName = true;
|
2023-09-02 23:46:13 +08:00
|
|
|
|
if (!string.IsNullOrEmpty(roleName))
|
2023-04-13 11:51:03 +08:00
|
|
|
|
IsEnabledRoleName = false;
|
|
|
|
|
|
|
|
|
|
if (ControlMode == CtrlMode.EDIT)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrEmpty(TreeSelectedRole.DisplayRoleName) && TreeSelectedRole.DisplayRoleName.Length > 18)
|
|
|
|
|
TreeSelectedRole.DisplayRoleName = TreeSelectedRole.DisplayRoleName.Substring(0, 18);
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//check role to set the mode from view to edit
|
2023-09-02 23:46:13 +08:00
|
|
|
|
if (_treeSelectedRole != null && _treeSelectedRole.IsRoleChanged())
|
2023-04-13 11:51:03 +08:00
|
|
|
|
ControlMode = CtrlMode.EDIT;
|
|
|
|
|
}
|
2023-09-02 23:46:13 +08:00
|
|
|
|
|
2023-04-13 11:51:03 +08:00
|
|
|
|
public bool OnAutoLogoutTimeChecked(object sender)
|
|
|
|
|
{
|
|
|
|
|
ControlMode = CtrlMode.EDIT;
|
|
|
|
|
return ((CheckBox)(sender)).IsChecked.Value;
|
|
|
|
|
}
|
2023-09-02 23:46:13 +08:00
|
|
|
|
|
2023-09-20 17:25:51 +08:00
|
|
|
|
private bool SaveChanges(out string reason)
|
2023-04-13 11:51:03 +08:00
|
|
|
|
{
|
2023-09-20 17:25:51 +08:00
|
|
|
|
reason = "";
|
2023-09-04 11:51:05 +08:00
|
|
|
|
if (string.IsNullOrWhiteSpace(TreeSelectedRole.DisplayRoleName))
|
2023-04-13 11:51:03 +08:00
|
|
|
|
{
|
|
|
|
|
DialogBox.ShowWarning("{0} cannot be empty.", "Role name");
|
|
|
|
|
//TreeSelectedRole.DisplayRoleName = "No Name";
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (IsRoleExists(TreeSelectedRole))
|
|
|
|
|
{
|
|
|
|
|
DialogBox.ShowWarning("{0} already exists.", "Role");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TreeSelectedRole.RoleName = TreeSelectedRole.DisplayRoleName;
|
|
|
|
|
TreeSelectedRole.IsAutoLogout = TreeSelectedRole.DisplayIsAutoLogout;
|
|
|
|
|
TreeSelectedRole.AutoLogoutTime = TreeSelectedRole.DisplayAutoLogoutTime;
|
|
|
|
|
TreeSelectedRole.RoleNameTextSaved = TreeSelectedRole.TimeTextSaved = true;
|
|
|
|
|
TreeSelectedRole.Description = TreeSelectedRole.DisplayDescription;
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
2023-09-20 17:25:51 +08:00
|
|
|
|
return RoleManagerClient.Instance.SaveRole(TreeSelectedRole, out reason);
|
2023-04-13 11:51:03 +08:00
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
2023-09-20 17:25:51 +08:00
|
|
|
|
reason = ex.Message;
|
|
|
|
|
LOG.Error(ex.Message, ex);
|
2023-04-13 11:51:03 +08:00
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-09-02 23:46:13 +08:00
|
|
|
|
|
|
|
|
|
private bool IsRoleExists(RoleItem role)
|
2023-04-13 11:51:03 +08:00
|
|
|
|
{
|
|
|
|
|
if (RoleList == null || RoleList.Count == 0)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
var sameNameList = RoleList.Where(t => t.DisplayRoleName == role.DisplayRoleName);
|
2023-09-20 17:25:51 +08:00
|
|
|
|
if (sameNameList.Count() <= 1)
|
2023-04-13 11:51:03 +08:00
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2023-09-02 23:46:13 +08:00
|
|
|
|
|
2023-09-20 17:25:51 +08:00
|
|
|
|
private void LoadRoleList(string defaultSelectedRoleName = "")
|
2023-04-13 11:51:03 +08:00
|
|
|
|
{
|
2023-09-02 23:46:13 +08:00
|
|
|
|
RoleList.Clear();
|
2023-09-20 17:25:51 +08:00
|
|
|
|
var roles = RoleManagerClient.Instance.GetAllRoles();
|
2023-04-13 11:51:03 +08:00
|
|
|
|
if (roles == null || roles.Count == 0)
|
|
|
|
|
return;
|
|
|
|
|
|
2023-09-04 17:22:01 +08:00
|
|
|
|
foreach (var ri in roles)
|
|
|
|
|
RoleList.Add(ri);
|
|
|
|
|
|
2023-09-20 17:25:51 +08:00
|
|
|
|
if (string.IsNullOrEmpty(defaultSelectedRoleName))
|
|
|
|
|
{
|
|
|
|
|
TreeSelectedRole = RoleList.FirstOrDefault();
|
|
|
|
|
if (TreeSelectedRole != null)
|
|
|
|
|
TreeSelectedRole.IsSelected = true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var roleToSelect = RoleList.FirstOrDefault(x => x.RoleName == defaultSelectedRoleName);
|
|
|
|
|
if (roleToSelect != null)
|
|
|
|
|
roleToSelect.IsSelected = true;
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-13 11:51:03 +08:00
|
|
|
|
ControlMode = CtrlMode.VIEW;
|
|
|
|
|
}
|
2023-09-02 23:46:13 +08:00
|
|
|
|
|
2023-04-13 11:51:03 +08:00
|
|
|
|
private void OnRoleTreeSelectedChanged(EventCommandParameter<object, RoutedEventArgs> arg)
|
|
|
|
|
{
|
2023-09-02 23:46:13 +08:00
|
|
|
|
var roleItem = arg.CustomParameter as RoleItem;
|
2023-04-13 11:51:03 +08:00
|
|
|
|
if (roleItem == null)
|
|
|
|
|
return;
|
|
|
|
|
TreeSelectedRole = roleItem;
|
|
|
|
|
}
|
2023-09-02 23:46:13 +08:00
|
|
|
|
|
2023-09-04 11:51:05 +08:00
|
|
|
|
private void OnBtnAddRoleCommand(object arg)
|
2023-04-13 11:51:03 +08:00
|
|
|
|
{
|
2023-09-20 17:25:51 +08:00
|
|
|
|
try
|
2023-04-13 11:51:03 +08:00
|
|
|
|
{
|
2023-09-20 17:25:51 +08:00
|
|
|
|
var newRole = RoleManagerClient.Instance.Create();
|
|
|
|
|
if (newRole != null)
|
|
|
|
|
{
|
|
|
|
|
RoleList.Add(newRole);
|
|
|
|
|
TreeSelectedRole = newRole;
|
|
|
|
|
TreeSelectedRole.IsSelected = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ControlMode = CtrlMode.EDIT;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
DialogBox.ShowError($"Unable to add role, {ex.Message}");
|
2023-04-13 11:51:03 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2023-09-02 23:46:13 +08:00
|
|
|
|
|
2023-09-04 11:51:05 +08:00
|
|
|
|
private void OnBtnDeleteRoleCommand(object arg)
|
2023-04-13 11:51:03 +08:00
|
|
|
|
{
|
2023-09-04 16:28:14 +08:00
|
|
|
|
if (TreeSelectedRole == null)
|
|
|
|
|
return;
|
2023-04-13 11:51:03 +08:00
|
|
|
|
|
2023-09-04 16:28:14 +08:00
|
|
|
|
if (TreeSelectedRole.IsBuildIn)
|
2023-04-13 11:51:03 +08:00
|
|
|
|
{
|
2023-09-04 16:28:14 +08:00
|
|
|
|
DialogBox.ShowWarning("Can not delete a build-in role");
|
2023-04-13 11:51:03 +08:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!DialogBox.Confirm("Are you sure that you want to delete this role?"))
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-02 23:01:20 +08:00
|
|
|
|
if (BaseApp.Instance.UserContext.Role.RoleId == TreeSelectedRole.RoleId)
|
2023-04-13 11:51:03 +08:00
|
|
|
|
{
|
|
|
|
|
DialogBox.ShowWarning("The action cannot be completed because {0} is currently in use.", "the role");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-04 17:22:01 +08:00
|
|
|
|
|
2023-04-13 11:51:03 +08:00
|
|
|
|
try
|
|
|
|
|
{
|
2023-09-02 23:46:13 +08:00
|
|
|
|
var index = RoleList.IndexOf(TreeSelectedRole);
|
|
|
|
|
RoleList.Remove(TreeSelectedRole);
|
2023-09-20 17:25:51 +08:00
|
|
|
|
RoleManagerClient.Instance.DeleteRole(TreeSelectedRole.RoleId);
|
2023-04-13 11:51:03 +08:00
|
|
|
|
index = index > 1 ? index - 1 : 0;
|
2023-09-02 23:46:13 +08:00
|
|
|
|
TreeSelectedRole = RoleList == null ? null : RoleList[index];
|
2023-04-13 11:51:03 +08:00
|
|
|
|
TreeSelectedRole.IsSelected = true;
|
2023-09-04 17:22:01 +08:00
|
|
|
|
// DialogBox.ShowInfo("Operated successfully.");
|
2023-04-13 11:51:03 +08:00
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
LOG.Error(ex.StackTrace);
|
|
|
|
|
DialogBox.ShowInfo("Operation failed.");
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-09-02 23:46:13 +08:00
|
|
|
|
|
2023-09-04 11:51:05 +08:00
|
|
|
|
private void OnBtnCloneRoleCommand(object arg)
|
2023-04-13 11:51:03 +08:00
|
|
|
|
{
|
2023-09-02 23:46:13 +08:00
|
|
|
|
if (_treeSelectedRole != null)
|
2023-04-13 11:51:03 +08:00
|
|
|
|
{
|
2023-09-20 17:25:51 +08:00
|
|
|
|
var newRole = RoleManagerClient.Instance.Clone(_treeSelectedRole);
|
2023-04-13 11:51:03 +08:00
|
|
|
|
if (newRole != null)
|
|
|
|
|
{
|
|
|
|
|
newRole.DisplayRoleName = newRole.RoleName = "Copy of " + newRole.DisplayRoleName;
|
2023-09-02 23:46:13 +08:00
|
|
|
|
RoleList.Add(newRole);
|
2023-04-13 11:51:03 +08:00
|
|
|
|
TreeSelectedRole = newRole;
|
|
|
|
|
TreeSelectedRole.IsSelected = true;
|
|
|
|
|
ControlMode = CtrlMode.EDIT;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-09-02 23:46:13 +08:00
|
|
|
|
|
2023-09-04 11:51:05 +08:00
|
|
|
|
private void OnBtnSaveCommand(object arg)
|
2023-04-13 11:51:03 +08:00
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
2023-09-20 17:25:51 +08:00
|
|
|
|
if (SaveChanges(out var reason))
|
2023-04-13 11:51:03 +08:00
|
|
|
|
{
|
2023-09-20 17:25:51 +08:00
|
|
|
|
var lastSelectedRoleName = TreeSelectedRole?.RoleName ?? "";
|
|
|
|
|
LoadRoleList(lastSelectedRoleName);
|
2023-09-04 11:51:05 +08:00
|
|
|
|
ControlMode = CtrlMode.VIEW;
|
2023-04-13 11:51:03 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
2023-09-20 17:25:51 +08:00
|
|
|
|
DialogBox.ShowInfo($"Operation failed, {reason}");
|
2023-04-13 11:51:03 +08:00
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
LOG.Error(ex.StackTrace);
|
2023-09-05 11:33:11 +08:00
|
|
|
|
DialogBox.ShowInfo($"Operation failed, {ex.Message}");
|
2023-04-13 11:51:03 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2023-09-02 23:46:13 +08:00
|
|
|
|
|
2023-09-04 11:51:05 +08:00
|
|
|
|
private void OnBtnCancelRoleCommand(object arg)
|
2023-04-13 11:51:03 +08:00
|
|
|
|
{
|
2023-09-20 17:25:51 +08:00
|
|
|
|
var lastSelectedRoleName = TreeSelectedRole.RoleName;
|
|
|
|
|
LoadRoleList(lastSelectedRoleName);
|
2023-04-13 11:51:03 +08:00
|
|
|
|
ControlMode = CtrlMode.VIEW;
|
|
|
|
|
}
|
2023-09-02 23:46:13 +08:00
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
2023-04-13 11:51:03 +08:00
|
|
|
|
#region commands
|
2023-09-02 23:46:13 +08:00
|
|
|
|
|
|
|
|
|
private ICommand _roleTreeSelectChangedCmd;
|
2023-04-13 11:51:03 +08:00
|
|
|
|
public ICommand RoleTreeSelectChangedCommand
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2023-09-02 23:46:13 +08:00
|
|
|
|
if (_roleTreeSelectChangedCmd == null)
|
|
|
|
|
_roleTreeSelectChangedCmd = new BaseCommand<EventCommandParameter<object, RoutedEventArgs>>((EventCommandParameter<object, RoutedEventArgs> arg) => OnRoleTreeSelectedChanged(arg));
|
|
|
|
|
return _roleTreeSelectChangedCmd;
|
2023-04-13 11:51:03 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-02 23:46:13 +08:00
|
|
|
|
private ICommand _btnSaveCommand;
|
|
|
|
|
public ICommand BtnSaveCommand
|
2023-04-13 11:51:03 +08:00
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2023-09-02 23:46:13 +08:00
|
|
|
|
if (_btnSaveCommand == null)
|
2023-09-04 17:22:01 +08:00
|
|
|
|
_btnSaveCommand = new BaseCommand<object>(OnBtnSaveCommand);
|
2023-09-02 23:46:13 +08:00
|
|
|
|
return _btnSaveCommand;
|
2023-04-13 11:51:03 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-02 23:46:13 +08:00
|
|
|
|
private ICommand _btnAddRoleCommand;
|
|
|
|
|
public ICommand BtnAddRoleCommand
|
2023-04-13 11:51:03 +08:00
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2023-09-02 23:46:13 +08:00
|
|
|
|
if (_btnAddRoleCommand == null)
|
2023-09-04 16:28:14 +08:00
|
|
|
|
_btnAddRoleCommand = new BaseCommand<object>(OnBtnAddRoleCommand);
|
2023-09-02 23:46:13 +08:00
|
|
|
|
return _btnAddRoleCommand;
|
2023-04-13 11:51:03 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-02 23:46:13 +08:00
|
|
|
|
private ICommand _btnDeleteRoleCommand;
|
|
|
|
|
public ICommand BtnDeleteRoleCommand
|
2023-04-13 11:51:03 +08:00
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2023-09-02 23:46:13 +08:00
|
|
|
|
if (_btnDeleteRoleCommand == null)
|
2023-09-04 16:28:14 +08:00
|
|
|
|
_btnDeleteRoleCommand = new BaseCommand<object>(OnBtnDeleteRoleCommand);
|
2023-09-02 23:46:13 +08:00
|
|
|
|
return _btnDeleteRoleCommand;
|
2023-04-13 11:51:03 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-02 23:46:13 +08:00
|
|
|
|
private ICommand _btnCloneRoleCommand;
|
|
|
|
|
public ICommand BtnCloneRoleCommand
|
2023-04-13 11:51:03 +08:00
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2023-09-02 23:46:13 +08:00
|
|
|
|
if (_btnCloneRoleCommand == null)
|
2023-09-04 16:28:14 +08:00
|
|
|
|
_btnCloneRoleCommand = new BaseCommand<object>(OnBtnCloneRoleCommand);
|
2023-09-02 23:46:13 +08:00
|
|
|
|
return _btnCloneRoleCommand;
|
2023-04-13 11:51:03 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2023-09-02 23:46:13 +08:00
|
|
|
|
private ICommand _btnCancelRoleCommand;
|
2023-04-13 11:51:03 +08:00
|
|
|
|
public ICommand BtnCancelRoleCommand
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2023-09-02 23:46:13 +08:00
|
|
|
|
if (_btnCancelRoleCommand == null)
|
2023-09-04 16:28:14 +08:00
|
|
|
|
_btnCancelRoleCommand = new BaseCommand<object>(OnBtnCancelRoleCommand);
|
2023-09-02 23:46:13 +08:00
|
|
|
|
return _btnCancelRoleCommand;
|
2023-04-13 11:51:03 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2023-09-02 23:46:13 +08:00
|
|
|
|
|
2023-04-13 11:51:03 +08:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|