终端一体化运控平台
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

AdminstratorsViewModel.cs 1.7 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using BPASmartClient.Helper;
  2. using Microsoft.Toolkit.Mvvm.ComponentModel;
  3. using Microsoft.Toolkit.Mvvm.Input;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Collections.ObjectModel;
  10. namespace BPASmartClient.DosingSystem.ViewModel
  11. {
  12. public class AdminstratorsViewModel : ObservableObject
  13. {
  14. public string Admin { get { return _admin; } set { _admin = value; OnPropertyChanged(); } }
  15. private string _admin;
  16. public string Password { get { return _password; } set { _password = value; OnPropertyChanged(); } }
  17. private string _password;
  18. public string ErrorMessage { get { return _errorMessage; } set { _errorMessage = value; OnPropertyChanged(); } }
  19. private string _errorMessage;
  20. public string SelectText { get { return _mSelectText; } set { _mSelectText = value; OnPropertyChanged(); } }
  21. private string _mSelectText;
  22. public RelayCommand AdminLoginCommand { get; set; }
  23. public ObservableCollection<string> permission { get; set; } = new ObservableCollection<string>();
  24. public AdminstratorsViewModel()
  25. {
  26. AdminLoginCommand = new RelayCommand(() =>
  27. {
  28. var rest = ActionManage.GetInstance.SendResult("LoginBPASmartClient.DosingSystem", $"{Admin}-={Password}-={SelectText}");
  29. if (rest != null && rest is string str)
  30. {
  31. ErrorMessage = str;
  32. }
  33. });
  34. permission.Add("管理员");
  35. permission.Add("操作员");
  36. permission.Add("观察员");
  37. permission.Add("技术员");
  38. SelectText = permission[0];
  39. }
  40. }
  41. }