public DeliveryPointsManagementView()
        {
            this.Build();

            treeDeliveryPoints.ColumnsConfig = FluentColumnsConfig <DeliveryPoint> .Create()
                                               .AddColumn("Адрес").AddTextRenderer(node => node.CompiledAddress).WrapMode(Pango.WrapMode.WordChar).WrapWidth(1000)
                                               .AddColumn("Номер").AddTextRenderer(x => x.Id.ToString())
                                               .AddColumn("")
                                               .RowCells().AddSetter <CellRendererText>((c, n) => c.Foreground = n.IsActive ? "black" : "red")
                                               .Finish();

            _canDeleteByPresetPermission =
                ServicesConfig.CommonServices.CurrentPermissionService.ValidatePresetPermission("can_delete_counterparty_and_deliverypoint");
            _permissionResult = ServicesConfig.CommonServices.CurrentPermissionService.ValidateEntityPermission(typeof(DeliveryPoint));

            buttonAdd.Sensitive = _permissionResult.CanCreate;

            if (_permissionResult.CanRead)
            {
                treeDeliveryPoints.RowActivated += (o, args) => buttonEdit.Click();
            }
            treeDeliveryPoints.Selection.Changed += OnSelectionChanged;

            IParametersProvider        parametersProvider        = new ParametersProvider();
            IFiasApiParametersProvider fiasApiParametersProvider = new FiasApiParametersProvider(parametersProvider);
            IFiasApiClient             fiasApiClient             = new FiasApiClient(fiasApiParametersProvider.FiasApiBaseUrl, fiasApiParametersProvider.FiasApiToken);

            _deliveryPointViewModelFactory = new DeliveryPointViewModelFactory(fiasApiClient);
        }
        public FixedPricesDialogOpener()
        {
            IParametersProvider        parametersProvider        = new ParametersProvider();
            IFiasApiParametersProvider fiasApiParametersProvider = new FiasApiParametersProvider(parametersProvider);
            IFiasApiClient             fiasApiClient             = new FiasApiClient(fiasApiParametersProvider.FiasApiBaseUrl, fiasApiParametersProvider.FiasApiToken);

            _deliveryPointViewModelFactory = new DeliveryPointViewModelFactory(fiasApiClient);
        }
Beispiel #3
0
        public DeliveryPointJournalFactory(DeliveryPointJournalFilterViewModel deliveryPointJournalFilter = null)
        {
            _deliveryPointJournalFilter = deliveryPointJournalFilter;
            IParametersProvider        parametersProvider        = new ParametersProvider();
            IFiasApiParametersProvider fiasApiParametersProvider = new FiasApiParametersProvider(parametersProvider);
            IFiasApiClient             fiasApiClient             = new FiasApiClient(fiasApiParametersProvider.FiasApiBaseUrl, fiasApiParametersProvider.FiasApiToken);

            _deliveryPointViewModelFactory = new DeliveryPointViewModelFactory(fiasApiClient);
        }
Beispiel #4
0
        public DeliveryPointPanelView(ICommonServices commonServices)
        {
            if (commonServices == null)
            {
                throw new ArgumentNullException(nameof(commonServices));
            }
            Build();
            _deliveryPointPermissionResult = commonServices.CurrentPermissionService.ValidateEntityPermission(typeof(DeliveryPoint));
            _orderPermissionResult         = commonServices.CurrentPermissionService.ValidateEntityPermission(typeof(Order));
            IParametersProvider        parametersProvider        = new ParametersProvider();
            IFiasApiParametersProvider fiasApiParametersProvider = new FiasApiParametersProvider(parametersProvider);
            IFiasApiClient             fiasApiClient             = new FiasApiClient(fiasApiParametersProvider.FiasApiBaseUrl, fiasApiParametersProvider.FiasApiToken);

            _deliveryPointViewModelFactory = new DeliveryPointViewModelFactory(fiasApiClient);
            Configure();
        }