Esempio n. 1
0
        private void btnAddAdmin_Click(object sender, RoutedEventArgs e)
        {
            EditAdminWindow win = new EditAdminWindow(true, null);

            if (win.ShowDialog() == true)
            {
                AdminController.Instance.GetAllAdmin();
            }
        }
Esempio n. 2
0
        private void OpenEditWindow(PermissionsEuiState.AdminData?data)
        {
            var window = new EditAdminWindow(this, data);

            window.SaveButton.OnPressed += _ => SaveAdminPressed(window);
            window.OpenCentered();
            window.OnClose += () => _subWindows.Remove(window);
            if (data != null)
            {
                window.RemoveButton !.OnPressed += _ => RemoveButtonPressed(window);
            }

            _subWindows.Add(window);
        }
Esempio n. 3
0
        private void btnEditAdmin_Click(object sender, RoutedEventArgs e)
        {
            if (this.datagridAdmin.SelectedItem is AdminUIModel)
            {
                MessageBox.Show("abc行修改。");
            }
            if (AdminController.Instance.GetCheckedItemsCount() != 1)
            {
                MessageBox.Show("请选择一个管理员进行修改。");
                return;
            }

            var admin = AdminController.Instance.GetFirstCheckedAdmin();

            if (admin != null)
            {
                EditAdminWindow win = new EditAdminWindow(false, admin);
                if (win.ShowDialog() == true)
                {
                    AdminController.Instance.GetAllAdmin();
                }
            }
        }
Esempio n. 4
0
 private void RemoveButtonPressed(EditAdminWindow window)
 {
     SendMessage(new RemoveAdmin {
         UserId = window.SourceData !.Value.UserId
     });