protected override void CreateNodeActions() { NodeActionsList.Clear(); _canEdit = CurrentPermissionService.ValidateEntityPermission(typeof(Payment)).CanUpdate; var editAction = new JournalAction("Изменить", (selected) => _canEdit && selected.Any(), (selected) => VisibleEditAction, (selected) => selected.OfType <UnallocatedBalancesJournalNode>().ToList().ForEach(EditEntityDialog) ); NodeActionsList.Add(editAction); if (SelectionMode == JournalSelectionMode.None) { RowActivatedAction = editAction; } }
protected override void CreateNodeActions() { _paymentPermissionResult = CurrentPermissionService.ValidateEntityPermission(typeof(Payment)); NodeActionsList.Clear(); CreateAddNewPaymentAction(); var addAction = new JournalAction("Добавить", (selected) => _paymentPermissionResult.CanCreate, (selected) => VisibleCreateAction, (selected) => CreateEntityDialog(), "Insert" ); NodeActionsList.Add(addAction); var editAction = new JournalAction("Изменить", (selected) => _paymentPermissionResult.CanUpdate && selected.Any(), (selected) => VisibleEditAction, (selected) => selected.OfType <PaymentJournalNode>().ToList().ForEach(EditEntityDialog) ); NodeActionsList.Add(editAction); if (SelectionMode == JournalSelectionMode.None) { RowActivatedAction = editAction; } NodeActionsList.Add(new JournalAction( "Завершить распределение", x => true, x => true, selectedItems => CompleteAllocation() ) ); }