|
- using BPA.Message;
- using BPASmartClient.CustomResource.Pages.Enums;
- using BPASmartClient.CustomResource.Pages.Model;
- using FryPot_DosingSystem.ViewModel;
- using Newtonsoft.Json;
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Navigation;
- using System.Windows.Shapes;
-
- namespace FryPot_DosingSystem.View
- {
- /// <summary>
- /// UserManageView.xaml 的交互逻辑
- /// </summary>
- public partial class UserManageView : UserControl
- {
- public UserManageView()
- {
- InitializeComponent();
- this.DataContext = UserManageViewModel.GetInstance;
- }
-
- private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
- {
- ComboBox cbo = sender as ComboBox;
- var id = cbo.Tag;
- var per = cbo.SelectedItem;
- if (id != null)
- {
- var a = UserManageViewModel.GetInstance.usersInfo.FirstOrDefault(p => p.Id == id.ToString());
-
- if (a != null && per != null)
- {
- a.permission = (Permission)Enum.Parse(typeof(Permission), per.ToString());
-
- }
- }
- else
- {
- UserManageViewModel.GetInstance.usersInfo.Last().permission = (Permission)Enum.Parse(typeof(Permission), per.ToString());
- }
- }
- }
- }
|