终端一体化运控平台
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 

57 righe
1.6 KiB

  1. using BPA.Message;
  2. using BPASmartClient.CustomResource.Pages.Enums;
  3. using BPASmartClient.CustomResource.Pages.Model;
  4. using FryPot_DosingSystem.ViewModel;
  5. using Newtonsoft.Json;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.IO;
  9. using System.Linq;
  10. using System.Text;
  11. using System.Threading.Tasks;
  12. using System.Windows;
  13. using System.Windows.Controls;
  14. using System.Windows.Data;
  15. using System.Windows.Documents;
  16. using System.Windows.Input;
  17. using System.Windows.Media;
  18. using System.Windows.Media.Imaging;
  19. using System.Windows.Navigation;
  20. using System.Windows.Shapes;
  21. namespace FryPot_DosingSystem.View
  22. {
  23. /// <summary>
  24. /// UserManageView.xaml 的交互逻辑
  25. /// </summary>
  26. public partial class UserManageView : UserControl
  27. {
  28. public UserManageView()
  29. {
  30. InitializeComponent();
  31. this.DataContext = UserManageViewModel.GetInstance;
  32. }
  33. private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
  34. {
  35. ComboBox cbo = sender as ComboBox;
  36. var id = cbo.Tag;
  37. var per = cbo.SelectedItem;
  38. if (id != null)
  39. {
  40. var a = UserManageViewModel.GetInstance.usersInfo.FirstOrDefault(p => p.Id == id.ToString());
  41. if (a != null && per != null)
  42. {
  43. a.permission = (Permission)Enum.Parse(typeof(Permission), per.ToString());
  44. }
  45. }
  46. else
  47. {
  48. UserManageViewModel.GetInstance.usersInfo.Last().permission = (Permission)Enum.Parse(typeof(Permission), per.ToString());
  49. }
  50. }
  51. }
  52. }