Ejemplo n.º 1
0
        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;
            }
        }
Ejemplo n.º 2
0
        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()
                                    )
                                );
        }