using BPASmartClient.Helper; using Microsoft.Toolkit.Mvvm.ComponentModel; using Microsoft.Toolkit.Mvvm.Input; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Collections.ObjectModel; namespace BPASmartClient.DosingSystem.ViewModel { public class AdminstratorsViewModel : ObservableObject { public string Admin { get { return _admin; } set { _admin = value; OnPropertyChanged(); } } private string _admin; public string Password { get { return _password; } set { _password = value; OnPropertyChanged(); } } private string _password; public string ErrorMessage { get { return _errorMessage; } set { _errorMessage = value; OnPropertyChanged(); } } private string _errorMessage; public string SelectText { get { return _mSelectText; } set { _mSelectText = value; OnPropertyChanged(); } } private string _mSelectText; public RelayCommand AdminLoginCommand { get; set; } public ObservableCollection permission { get; set; } = new ObservableCollection(); public AdminstratorsViewModel() { AdminLoginCommand = new RelayCommand(() => { var rest = ActionManage.GetInstance.SendResult("LoginBPASmartClient.DosingSystem", $"{Admin}-={Password}-={SelectText}"); if (rest != null && rest is string str) { ErrorMessage = str; } }); permission.Add("管理员"); permission.Add("操作员"); permission.Add("观察员"); permission.Add("技术员"); SelectText = permission[0]; } } }