protected override void ConfigureWithUow()
        {
            enumcomboDocumentType.ItemsEnum   = typeof(DocumentType);
            enumcomboDocumentType.HiddenItems = new[] { DocumentType.DeliveryDocument as object };

            evmeWarehouse.SetEntityAutocompleteSelectorFactory(new WarehouseSelectorFactory());

            if (ServicesConfig.CommonServices.CurrentPermissionService.ValidatePresetPermission("user_have_access_only_to_warehouse_and_complaints") &&
                !ServicesConfig.CommonServices.UserService.GetCurrentUser(UoW).IsAdmin)
            {
                evmeWarehouse.Sensitive = evmeWarehouse.CanEditReference = false;
            }

            if (CurrentUserSettings.Settings.DefaultWarehouse != null)
            {
                evmeWarehouse.Subject = UoW.GetById <Warehouse>(CurrentUserSettings.Settings.DefaultWarehouse.Id);
            }

            var filter = new EmployeeFilterViewModel();

            filter.SetAndRefilterAtOnce(
                x => x.RestrictCategory = EmployeeCategory.driver,
                x => x.Status           = EmployeeStatus.IsWorking
                );
            var driverFactory = new EmployeeJournalFactory(filter);

            evmeDriver.SetEntityAutocompleteSelectorFactory(driverFactory.CreateEmployeeAutocompleteSelectorFactory());
            dateperiodDocs.StartDate = DateTime.Today.AddDays(-7);
            dateperiodDocs.EndDate   = DateTime.Today.AddDays(1);

            comboMovementStatus.ItemsEnum = typeof(MovementDocumentStatus);
            evmeDriver.Changed           += (sender, args) => OnRefiltered();
            evmeWarehouse.Changed        += (sender, args) => OnRefiltered();
        }
Пример #2
0
        public FuelReport()
        {
            this.Build();
            UoW = UnitOfWorkFactory.CreateWithoutRoot();
            var filterDriver = new EmployeeFilterViewModel();

            filterDriver.SetAndRefilterAtOnce(
                x => x.RestrictCategory = EmployeeCategory.driver,
                x => x.Status           = EmployeeStatus.IsWorking
                );
            var driverFactory = new EmployeeJournalFactory(filterDriver);

            evmeDriver.SetEntityAutocompleteSelectorFactory(driverFactory.CreateEmployeeAutocompleteSelectorFactory());
            entityviewmodelentryCar.SetEntityAutocompleteSelectorFactory(new CarJournalFactory(MainClass.MainWin.NavigationManager).CreateCarAutocompleteSelectorFactory());
            entityviewmodelentryCar.CompletionPopupSetWidth(false);

            var officeFilter = new EmployeeFilterViewModel();

            officeFilter.SetAndRefilterAtOnce(
                x => x.RestrictCategory = EmployeeCategory.office,
                x => x.Status           = EmployeeStatus.IsWorking
                );
            var officeFactory = new EmployeeJournalFactory(officeFilter);

            evmeAuthor.SetEntityAutocompleteSelectorFactory(officeFactory.CreateEmployeeAutocompleteSelectorFactory());
            dateperiodpicker.StartDate  = dateperiodpicker.EndDate = DateTime.Today;
            buttonCreateReport.Clicked += OnButtonCreateReportClicked;
        }
Пример #3
0
        public DriverWagesReport()
        {
            this.Build();
            UoW = UnitOfWorkFactory.CreateWithoutRoot();
            var driverFilter = new EmployeeFilterViewModel();

            driverFilter.SetAndRefilterAtOnce(
                x => x.Status           = EmployeeStatus.IsWorking,
                x => x.RestrictCategory = EmployeeCategory.driver);
            var employeeFactory = new EmployeeJournalFactory(driverFilter);

            evmeDriver.SetEntityAutocompleteSelectorFactory(employeeFactory.CreateEmployeeAutocompleteSelectorFactory());
            evmeDriver.Changed += (sender, args) =>
            {
                if (dateperiodpicker.StartDateOrNull.HasValue && evmeDriver.Subject is Employee)
                {
                    OnUpdate(true);
                }
            };

            dateperiodpicker.PeriodChanged += (sender, args) =>
            {
                if (evmeDriver.Subject is Employee && dateperiodpicker.StartDateOrNull.HasValue)
                {
                    OnUpdate(true);
                }
            };
            buttonCreateReport.Clicked += OnButtonCreateReportClicked;
        }
Пример #4
0
        private void ConfigureDlg()
        {
            if (!UoW.IsNew)
            {
                enumcomboOperation.Sensitive         = false;
                specialListCmbOrganisation.Sensitive = false;
            }

            accessfilteredsubdivisionselectorwidget.OnSelected += Accessfilteredsubdivisionselectorwidget_OnSelected;
            if (Entity.RelatedToSubdivision != null)
            {
                accessfilteredsubdivisionselectorwidget.SelectIfPossible(Entity.RelatedToSubdivision);
            }

            enumcomboOperation.ItemsEnum = typeof(ExpenseType);
            enumcomboOperation.Binding.AddBinding(Entity, s => s.TypeOperation, w => w.SelectedItem).InitializeFromSource();

            var employeeFactory = new EmployeeJournalFactory();

            evmeCashier.Binding.AddBinding(Entity, s => s.Casher, w => w.Subject).InitializeFromSource();
            evmeCashier.SetEntityAutocompleteSelectorFactory(employeeFactory.CreateEmployeeAutocompleteSelectorFactory());

            evmeEmployee.SetEntityAutocompleteSelectorFactory(employeeFactory.CreateWorkingEmployeeAutocompleteSelectorFactory());
            evmeEmployee.Binding.AddBinding(Entity, s => s.Employee, w => w.Subject).InitializeFromSource();
            evmeEmployee.ChangedByUser += (sender, e) => UpdateEmployeeBalaceInfo();

            ydateDocument.Binding.AddBinding(Entity, s => s.Date, w => w.Date).InitializeFromSource();
            ydateDocument.Sensitive = _canEditDate;

            var expenseFactory = new ExpenseCategorySelectorFactory();

            entityVMEntryExpenseCategory
            .SetEntityAutocompleteSelectorFactory(expenseFactory.CreateSimpleExpenseCategoryAutocompleteSelectorFactory());
            entityVMEntryExpenseCategory.Binding.AddBinding(Entity, e => e.ExpenseCategory, w => w.Subject).InitializeFromSource();

            specialListCmbOrganisation.ShowSpecialStateNot = true;
            specialListCmbOrganisation.ItemsList           = UoW.GetAll <Organization>();
            specialListCmbOrganisation.Binding.AddBinding(Entity, e => e.Organisation, w => w.SelectedItem).InitializeFromSource();

            yspinMoney.Binding.AddBinding(Entity, s => s.Money, w => w.ValueAsDecimal).InitializeFromSource();

            ytextviewDescription.Binding.AddBinding(Entity, s => s.Description, w => w.Buffer.Text).InitializeFromSource();

            UpdateEmployeeBalanceVisibility();
            UpdateEmployeeBalaceInfo();
            UpdateSubdivision();

            if (!CanEdit)
            {
                table1.Sensitive = false;
                accessfilteredsubdivisionselectorwidget.Sensitive = false;
                buttonSave.Sensitive          = false;
                ytextviewDescription.Editable = false;
            }
        }
Пример #5
0
        public EmployeesFines()
        {
            this.Build();
            UoW = UnitOfWorkFactory.CreateWithoutRoot();
            var employeeFactory = new EmployeeJournalFactory(_employeeFilter);

            evmeDriver.SetEntityAutocompleteSelectorFactory(employeeFactory.CreateEmployeeAutocompleteSelectorFactory());
            buttonRun.Clicked += (sender, e) => OnUpdate(true);
            dateperiodpicker1.PeriodChanged += (sender, e) => ValidateParameters();
            evmeDriver.Changed += (sender, e) => ValidateParameters();
        }
        void ConfigureDlg()
        {
            TabName = "Приходный кассовый ордер самовывоза";

            Entity.TypeDocument = IncomeInvoiceDocumentType.IncomeInvoiceSelfDelivery;

            permissioncommentview.UoW             = UoW;
            permissioncommentview.Title           = "Комментарий по проверке закрытия МЛ: ";
            permissioncommentview.Comment         = Entity.CashierReviewComment;
            permissioncommentview.PermissionName  = "can_edit_cashier_review_comment";
            permissioncommentview.Comment         = Entity.CashierReviewComment;
            permissioncommentview.CommentChanged += (comment) => Entity.CashierReviewComment = comment;

            enumcomboOperation.ItemsEnum = typeof(IncomeType);
            enumcomboOperation.Binding.AddBinding(Entity, s => s.TypeOperation, w => w.SelectedItem).InitializeFromSource();
            enumcomboOperation.Sensitive = false;
            Entity.TypeOperation         = IncomeType.Payment;

            var employeeFactory = new EmployeeJournalFactory();

            evmeCashier.SetEntityAutocompleteSelectorFactory(employeeFactory.CreateEmployeeAutocompleteSelectorFactory());
            evmeCashier.Binding.AddBinding(Entity, s => s.Casher, w => w.Subject).InitializeFromSource();
            evmeCashier.Sensitive = false;

            var orderFactory = new OrderSelectorFactory();

            evmeOrder.SetEntityAutocompleteSelectorFactory(orderFactory.CreateCashSelfDeliveryOrderAutocompleteSelector());
            evmeOrder.Binding.AddBinding(Entity, x => x.Order, x => x.Subject).InitializeFromSource();
            evmeOrder.Changed += OnYentryOrderChanged;

            ydateDocument.Binding.AddBinding(Entity, s => s.Date, w => w.Date).InitializeFromSource();

            NotifyConfiguration.Instance.BatchSubscribeOnEntity <IncomeCategory>(
                s => comboCategory.ItemsList = _categoryRepository.SelfDeliveryIncomeCategories(UoW)
                );
            comboCategory.ItemsList = incomeCategoryList;
            comboCategory.Binding.AddBinding(Entity, s => s.IncomeCategory, w => w.SelectedItem).InitializeFromSource();

            yspinMoney.Binding.AddBinding(Entity, s => s.Money, w => w.ValueAsDecimal).InitializeFromSource();

            ytextviewDescription.Binding.AddBinding(Entity, s => s.Description, w => w.Buffer.Text).InitializeFromSource();

            if (!CanEdit)
            {
                table1.Sensitive = false;
                ytextviewDescription.Editable = false;
                buttonSave.Sensitive          = false;
                accessfilteredsubdivisionselectorwidget.Sensitive = false;
            }

            UpdateSubdivision();
        }
Пример #7
0
        void ConfigureDlg()
        {
            accessfilteredsubdivisionselectorwidget.OnSelected += Accessfilteredsubdivisionselectorwidget_OnSelected;
            if (Entity.RelatedToSubdivision != null)
            {
                accessfilteredsubdivisionselectorwidget.SelectIfPossible(Entity.RelatedToSubdivision);
            }

            var employeeFactory = new EmployeeJournalFactory();

            evmeEmployee.SetEntityAutocompleteSelectorFactory(employeeFactory.CreateWorkingEmployeeAutocompleteSelectorFactory());
            evmeEmployee.Binding.AddBinding(Entity, e => e.Accountable, w => w.Subject).InitializeFromSource();
            evmeEmployee.Changed += (sender, e) => FillDebt();

            evmeCashier.Binding.AddBinding(Entity, e => e.Casher, w => w.Subject).InitializeFromSource();
            evmeCashier.SetEntityAutocompleteSelectorFactory(employeeFactory.CreateEmployeeAutocompleteSelectorFactory());

            ydateDocument.Binding.AddBinding(Entity, s => s.Date, w => w.Date).InitializeFromSource();

            NotifyConfiguration.Instance.BatchSubscribeOnEntity <ExpenseCategory>(HandleBatchEntityChangeHandler);
            UpdateExpenseCategories();

            comboExpense.Binding.AddBinding(Entity, s => s.ExpenseCategory, w => w.SelectedItem).InitializeFromSource();

            yspinMoney.Binding.AddBinding(Entity, s => s.Money, w => w.ValueAsDecimal).InitializeFromSource();

            specialListCmbOrganisation.ShowSpecialStateNot = true;
            specialListCmbOrganisation.ItemsList           = UoW.GetAll <Organization>();
            specialListCmbOrganisation.Binding.AddBinding(Entity, e => e.Organisation, w => w.SelectedItem).InitializeFromSource();

            ytextviewDescription.Binding.AddBinding(Entity, s => s.Description, w => w.Buffer.Text).InitializeFromSource();

            ytreeviewDebts.ColumnsConfig = ColumnsConfigFactory.Create <RecivedAdvance>()
                                           .AddColumn("Закрыть").AddToggleRenderer(a => a.Selected).Editing()
                                           .AddColumn("Дата").AddTextRenderer(a => a.Advance.Date.ToString())
                                           .AddColumn("Получено").AddTextRenderer(a => a.Advance.Money.ToString("C"))
                                           .AddColumn("Непогашено").AddTextRenderer(a => a.Advance.UnclosedMoney.ToString("C"))
                                           .AddColumn("Статья").AddTextRenderer(a => a.Advance.ExpenseCategory.Name)
                                           .AddColumn("Основание").AddTextRenderer(a => a.Advance.Description)
                                           .Finish();
            UpdateSubdivision();

            if (!CanEdit)
            {
                table1.Sensitive = false;
                accessfilteredsubdivisionselectorwidget.Sensitive = false;
                buttonSave.Sensitive          = false;
                ytreeviewDebts.Sensitive      = false;
                ytextviewDescription.Editable = false;
            }
        }
        public OrderCreationDateReport()
        {
            this.Build();
            UoW = UnitOfWorkFactory.CreateWithoutRoot();
            var officeFilter = new EmployeeFilterViewModel();

            officeFilter.SetAndRefilterAtOnce(
                x => x.RestrictCategory = EmployeeCategory.office,
                x => x.Status           = EmployeeStatus.IsWorking);
            var employeeFactory = new EmployeeJournalFactory(officeFilter);

            evmeEmployee.SetEntityAutocompleteSelectorFactory(employeeFactory.CreateEmployeeAutocompleteSelectorFactory());
            datePeriodPicker.PeriodChanged += (sender, e) => CanRun();
            buttonCreateReport.Clicked     += (sender, e) => OnUpdate(true);
        }
Пример #9
0
        public MastersReport()
        {
            this.Build();
            UoW = UnitOfWorkFactory.CreateWithoutRoot();
            var driverFilter = new EmployeeFilterViewModel();

            driverFilter.SetAndRefilterAtOnce(
                x => x.Status           = EmployeeStatus.IsWorking,
                x => x.RestrictCategory = EmployeeCategory.driver);
            var employeeFactory = new EmployeeJournalFactory(driverFilter);

            evmeDriver.SetEntityAutocompleteSelectorFactory(employeeFactory.CreateEmployeeAutocompleteSelectorFactory());
            evmeDriver.Changed             += (sender, e) => CanRun();
            dateperiodpicker.PeriodChanged += (sender, e) => CanRun();
            buttonCreateReport.Clicked     += (sender, e) => OnUpdate(true);
        }
Пример #10
0
        void ConfigureDlg()
        {
            TabName = "Расходный кассовый ордер самовывоза";

            Entity.TypeDocument = ExpenseInvoiceDocumentType.ExpenseInvoiceSelfDelivery;

            enumcomboOperation.ItemsEnum = typeof(ExpenseType);
            enumcomboOperation.Binding.AddBinding(Entity, s => s.TypeOperation, w => w.SelectedItem).InitializeFromSource();
            enumcomboOperation.Sensitive = false;
            Entity.TypeOperation         = ExpenseType.ExpenseSelfDelivery;

            var orderFactory = new OrderSelectorFactory();

            evmeOrder.SetEntityAutocompleteSelectorFactory(orderFactory.CreateCashSelfDeliveryOrderAutocompleteSelector());
            evmeOrder.Binding.AddBinding(Entity, x => x.Order, x => x.Subject).InitializeFromSource();
            evmeOrder.Changed += OnYentryOrderChanged;

            var employeeFactory = new EmployeeJournalFactory();

            evmeCashier.SetEntityAutocompleteSelectorFactory(employeeFactory.CreateEmployeeAutocompleteSelectorFactory());
            evmeCashier.Binding.AddBinding(Entity, s => s.Casher, w => w.Subject).InitializeFromSource();
            evmeCashier.Sensitive = false;

            ydateDocument.Binding.AddBinding(Entity, s => s.Date, w => w.Date).InitializeFromSource();

            NotifyConfiguration.Instance.BatchSubscribeOnEntity <ExpenseCategory>(
                s => comboExpense.ItemsList = _categoryRepository.ExpenseSelfDeliveryCategories(UoW)
                );
            comboExpense.ItemsList = expenseCategoryList;
            comboExpense.Binding.AddBinding(Entity, s => s.ExpenseCategory, w => w.SelectedItem).InitializeFromSource();

            yspinMoney.Binding.AddBinding(Entity, s => s.Money, w => w.ValueAsDecimal).InitializeFromSource();

            ytextviewDescription.Binding.AddBinding(Entity, s => s.Description, w => w.Buffer.Text).InitializeFromSource();

            UpdateSubdivision();

            if (!CanEdit)
            {
                table1.Sensitive = false;
                accessfilteredsubdivisionselectorwidget.Sensitive = false;
                buttonSave.Sensitive          = false;
                ytextviewDescription.Editable = false;
            }
        }
Пример #11
0
        public ShortfallBattlesReport()
        {
            this.Build();
            ydatepicker.Date         = DateTime.Now.Date;
            comboboxDriver.ItemsEnum = typeof(Drivers);
            UoW = UnitOfWorkFactory.CreateWithoutRoot();
            var filter = new EmployeeFilterViewModel();

            filter.SetAndRefilterAtOnce(
                x => x.RestrictCategory = EmployeeCategory.driver,
                x => x.Status           = EmployeeStatus.IsWorking
                );
            var driverFactory = new EmployeeJournalFactory(filter);

            evmeDriver.SetEntityAutocompleteSelectorFactory(driverFactory.CreateEmployeeAutocompleteSelectorFactory());
            ySpecCmbNonReturnReason.ItemsList = UoW.Session.QueryOver <NonReturnReason>().List();
            buttonCreateRepot.Clicked        += (s, a) => OnUpdate(true);
            checkOneDriver.Toggled           += OnCheckOneDriverToggled;
        }
        public DefectiveItemsReport()
        {
            this.Build();
            UoW = UnitOfWorkFactory.CreateWithoutRoot();

            yEnumCmbSource.ItemsEnum = typeof(DefectSource);
            yEnumCmbSource.AddEnumToHideList(new Enum[] { DefectSource.None });

            var driverFilter = new EmployeeFilterViewModel();

            driverFilter.SetAndRefilterAtOnce(
                x => x.Status           = EmployeeStatus.IsWorking,
                x => x.RestrictCategory = EmployeeCategory.driver);
            var employeeFactory = new EmployeeJournalFactory(driverFilter);

            evmeDriver.SetEntityAutocompleteSelectorFactory(employeeFactory.CreateEmployeeAutocompleteSelectorFactory());

            datePeriod.StartDate      = datePeriod.EndDate = DateTime.Today;
            buttonRun.Clicked        += (sender, e) => OnUpdate(true);
            datePeriod.PeriodChanged += (sender, e) => ValidateParameters();
        }
Пример #13
0
        void ConfigureDlg()
        {
            if (Entity.EmployeeDocument == null && Entity.Driver != null)
            {
                GetDocument();
            }

            ylabelNumber.Binding.AddBinding(Entity, x => x.Title, x => x.LabelProp).InitializeFromSource();

            var orgFactory = new OrganizationJournalFactory();

            evmeOrganisation.SetEntityAutocompleteSelectorFactory(orgFactory.CreateOrganizationAutocompleteSelectorFactory());
            evmeOrganisation.Binding.AddBinding(Entity, x => x.Organization, x => x.Subject).InitializeFromSource();
            evmeOrganisation.Changed += (sender, e) => UpdateStates();

            var driverFilter = new EmployeeFilterViewModel();

            driverFilter.SetAndRefilterAtOnce(
                x => x.Status           = EmployeeStatus.IsWorking,
                x => x.RestrictCategory = EmployeeCategory.driver);
            var employeeFactory = new EmployeeJournalFactory(driverFilter);

            evmeDriver.SetEntityAutocompleteSelectorFactory(employeeFactory.CreateEmployeeAutocompleteSelectorFactory());
            evmeDriver.Binding.AddBinding(Entity, x => x.Driver, x => x.Subject).InitializeFromSource();
            evmeDriver.Changed += (sender, e) => UpdateStates();

            entityviewmodelentryCar.SetEntityAutocompleteSelectorFactory(new CarJournalFactory(MainClass.MainWin.NavigationManager).CreateCarAutocompleteSelectorFactory());
            entityviewmodelentryCar.Binding.AddBinding(Entity, x => x.Car, x => x.Subject).InitializeFromSource();
            entityviewmodelentryCar.CompletionPopupSetWidth(false);
            entityviewmodelentryCar.Changed += (sender, e) => UpdateStates();

            RefreshParserRootObject();

            templatewidget.CanRevertCommon = ServicesConfig.CommonServices.CurrentPermissionService.ValidatePresetPermission("can_set_common_additionalagreement");
            templatewidget.Binding.AddBinding(Entity, e => e.DocumentTemplate, w => w.Template).InitializeFromSource();
            templatewidget.Binding.AddBinding(Entity, e => e.ChangedTemplateFile, w => w.ChangedDoc).InitializeFromSource();
            templatewidget.BeforeOpen += Templatewidget_BeforeOpen;

            UpdateStates();
        }
Пример #14
0
        void ConfigureDlg()
        {
            if (!UoW.IsNew)
            {
                enumcomboOperation.Sensitive         = false;
                specialListCmbOrganisation.Sensitive = false;
            }

            accessfilteredsubdivisionselectorwidget.OnSelected += Accessfilteredsubdivisionselectorwidget_OnSelected;
            if (Entity.RelatedToSubdivision != null)
            {
                accessfilteredsubdivisionselectorwidget.SelectIfPossible(Entity.RelatedToSubdivision);
            }

            enumcomboOperation.ItemsEnum = typeof(IncomeType);
            enumcomboOperation.Binding.AddBinding(Entity, s => s.TypeOperation, w => w.SelectedItem).InitializeFromSource();

            var employeeFactory = new EmployeeJournalFactory();

            evmeCashier.SetEntityAutocompleteSelectorFactory(employeeFactory.CreateEmployeeAutocompleteSelectorFactory());
            evmeCashier.Binding.AddBinding(Entity, s => s.Casher, w => w.Subject).InitializeFromSource();

            evmeEmployee.SetEntityAutocompleteSelectorFactory(employeeFactory.CreateWorkingEmployeeAutocompleteSelectorFactory());
            evmeEmployee.Binding.AddBinding(Entity, s => s.Employee, w => w.Subject).InitializeFromSource();
            evmeEmployee.Changed += (sender, e) => FillDebts();

            var filterRL = new RouteListsFilter(UoW)
            {
                OnlyStatuses = new[] { RouteListStatus.EnRoute, RouteListStatus.OnClosing }
            };

            yEntryRouteList.RepresentationModel = new ViewModel.RouteListsVM(filterRL);
            yEntryRouteList.Binding.AddBinding(Entity, s => s.RouteListClosing, w => w.Subject).InitializeFromSource();
            yEntryRouteList.CanEditReference = ServicesConfig.CommonServices.CurrentPermissionService.ValidatePresetPermission("can_delete");

            yEntryRouteList.Hidden        += YEntryRouteList_ValueOrVisibilityChanged;
            yEntryRouteList.Shown         += YEntryRouteList_ValueOrVisibilityChanged;
            yEntryRouteList.ChangedByUser += YEntryRouteList_ValueOrVisibilityChanged;

            yentryClient.ItemsQuery = _counterpartyRepository.ActiveClientsQuery();
            yentryClient.Binding.AddBinding(Entity, s => s.Customer, w => w.Subject).InitializeFromSource();

            ydateDocument.Binding.AddBinding(Entity, s => s.Date, w => w.Date).InitializeFromSource();
            ydateDocument.Sensitive = canEditDate;

            NotifyConfiguration.Instance.BatchSubscribeOnEntity <ExpenseCategory>(
                s =>
                comboExpense.ItemsList = _categoryRepository.ExpenseCategories(UoW).Where(x =>
                                                                                          x.ExpenseDocumentType != ExpenseInvoiceDocumentType.ExpenseInvoiceSelfDelivery)
                );
            comboExpense.ItemsList =
                _categoryRepository.ExpenseCategories(UoW).Where(x =>
                                                                 x.ExpenseDocumentType != ExpenseInvoiceDocumentType.ExpenseInvoiceSelfDelivery);
            comboExpense.Binding.AddBinding(Entity, s => s.ExpenseCategory, w => w.SelectedItem).InitializeFromSource();

            NotifyConfiguration.Instance.BatchSubscribeOnEntity <IncomeCategory>(
                s =>
                comboCategory.ItemsList = _categoryRepository.IncomeCategories(UoW).Where(x =>
                                                                                          x.IncomeDocumentType != IncomeInvoiceDocumentType.IncomeInvoiceSelfDelivery && x.Id != excludeIncomeCategoryId)
                );
            comboCategory.ItemsList = _categoryRepository.IncomeCategories(UoW).Where(x =>
                                                                                      x.IncomeDocumentType != IncomeInvoiceDocumentType.IncomeInvoiceSelfDelivery && x.Id != excludeIncomeCategoryId);
            comboCategory.Binding.AddBinding(Entity, s => s.IncomeCategory, w => w.SelectedItem).InitializeFromSource();

            specialListCmbOrganisation.ShowSpecialStateNot = true;
            specialListCmbOrganisation.ItemsList           = UoW.GetAll <Organization>();
            specialListCmbOrganisation.Binding.AddBinding(Entity, e => e.Organisation, w => w.SelectedItem).InitializeFromSource();
            specialListCmbOrganisation.ItemSelected += SpecialListCmbOrganisationOnItemSelected;

            checkNoClose.Binding.AddBinding(Entity, e => e.NoFullCloseMode, w => w.Active);

            yspinMoney.Binding.AddBinding(Entity, s => s.Money, w => w.ValueAsDecimal).InitializeFromSource();

            ytextviewDescription.Binding.AddBinding(Entity, s => s.Description, w => w.Buffer.Text).InitializeFromSource();

            ytreeviewDebts.ColumnsConfig = ColumnsConfigFactory.Create <Selectable <Expense> > ()
                                           .AddColumn("Закрыть").AddToggleRenderer(a => a.Selected).Editing()
                                           .AddColumn("Дата").AddTextRenderer(a => a.Value.Date.ToString())
                                           .AddColumn("Получено").AddTextRenderer(a => a.Value.Money.ToString("C"))
                                           .AddColumn("Непогашено").AddTextRenderer(a => a.Value.UnclosedMoney.ToString("C"))
                                           .AddColumn("Статья").AddTextRenderer(a => a.Value.ExpenseCategory.Name)
                                           .AddColumn("Основание").AddTextRenderer(a => a.Value.Description)
                                           .Finish();
            UpdateSubdivision();

            if (!CanEdit)
            {
                table1.Sensitive               = false;
                ytreeviewDebts.Sensitive       = false;
                ytextviewDescription.Sensitive = false;
                buttonSave.Sensitive           = false;
                accessfilteredsubdivisionselectorwidget.Sensitive = false;
            }
        }
 private void ConfigureEntries()
 {
     EmployeeAutocompleteSelectorFactory = EmployeeJournalFactory.CreateEmployeeAutocompleteSelectorFactory();
 }
Пример #16
0
        private void ConfigureDlg()
        {
            var orderOrganizationProviderFactory = new OrderOrganizationProviderFactory();

            _organizationProvider           = orderOrganizationProviderFactory.CreateOrderOrganizationProvider();
            _counterpartyContractRepository = new CounterpartyContractRepository(_organizationProvider);
            _counterpartyContractFactory    = new CounterpartyContractFactory(_organizationProvider, _counterpartyContractRepository);

            buttonReportByClient.Sensitive = Entity.Counterparty != null;
            buttonReportByDP.Sensitive     = Entity.DeliveryPoint != null;

            comboboxImpotanceType.ItemsEnum = typeof(ImportanceDegreeType);
            comboboxImpotanceType.Binding.AddBinding(Entity, s => s.ImportanceDegree, w => w.SelectedItemOrNull).InitializeFromSource();
            TaskStateComboBox.ItemsEnum = typeof(CallTaskStatus);
            TaskStateComboBox.Binding.AddBinding(Entity, s => s.TaskState, w => w.SelectedItemOrNull).InitializeFromSource();
            IsTaskCompleteButton.Binding.AddBinding(Entity, s => s.IsTaskComplete, w => w.Active).InitializeFromSource();
            IsTaskCompleteButton.Label += Entity.CompleteDate?.ToString("dd / MM / yyyy  HH:mm");
            deadlineYdatepicker.Binding.AddBinding(Entity, s => s.EndActivePeriod, w => w.Date).InitializeFromSource();
            ytextviewComments.Binding.AddBinding(Entity, s => s.Comment, w => w.Buffer.Text).InitializeFromSource();
            yentryTareReturn.ValidationMode = ValidationType.numeric;
            yentryTareReturn.Binding.AddBinding(Entity, s => s.TareReturn, w => w.Text, new IntToStringConverter()).InitializeFromSource();

            textViewCommentAboutClient.Binding
            .AddFuncBinding(Entity, e => e.Counterparty != null ? e.Counterparty.Comment : "",
                            w => w.Buffer.Text).InitializeFromSource();
            vboxOldComments.Visible = true;

            var employeeFilterViewModel = new EmployeeFilterViewModel {
                RestrictCategory = EmployeeCategory.office
            };
            var employeeJournalFactory = new EmployeeJournalFactory(employeeFilterViewModel);

            entryAttachedEmployee.SetEntityAutocompleteSelectorFactory(employeeJournalFactory.CreateEmployeeAutocompleteSelectorFactory());
            entryAttachedEmployee.Binding.AddBinding(Entity, e => e.AssignedEmployee, w => w.Subject).InitializeFromSource();

            var deliveryPointJournalFactory = new DeliveryPointJournalFactory(_deliveryPointJournalFilterViewModel);

            entityVMEntryDeliveryPoint
            .SetEntityAutocompleteSelectorFactory(deliveryPointJournalFactory.CreateDeliveryPointAutocompleteSelectorFactory());
            entityVMEntryDeliveryPoint.Binding.AddBinding(Entity, s => s.DeliveryPoint, w => w.Subject).InitializeFromSource();

            var counterpartyJournalFactory = new CounterpartyJournalFactory();

            entityVMEntryCounterparty
            .SetEntityAutocompleteSelectorFactory(counterpartyJournalFactory.CreateCounterpartyAutocompleteSelectorFactory());
            entityVMEntryCounterparty.Binding.AddBinding(Entity, s => s.Counterparty, w => w.Subject).InitializeFromSource();

            ClientPhonesView.ViewModel          = new PhonesViewModel(_phoneRepository, UoW, ContactParametersProvider.Instance);
            ClientPhonesView.ViewModel.ReadOnly = true;

            DeliveryPointPhonesView.ViewModel          = new PhonesViewModel(_phoneRepository, UoW, ContactParametersProvider.Instance);
            DeliveryPointPhonesView.ViewModel.ReadOnly = true;

            if (Entity.Counterparty != null)
            {
                if (_deliveryPointJournalFilterViewModel != null)
                {
                    _deliveryPointJournalFilterViewModel.Counterparty = Entity.Counterparty;
                }
            }

            UpdateAddressFields();
        }
Пример #17
0
        public ComplaintViewModel(
            IEntityUoWBuilder uowBuilder,
            IUnitOfWorkFactory uowFactory,
            ICommonServices commonServices,
            IUndeliveredOrdersJournalOpener undeliveryViewOpener,
            IEmployeeService employeeService,
            IEntityAutocompleteSelectorFactory counterpartySelectorFactory,
            IFilePickerService filePickerService,
            ISubdivisionRepository subdivisionRepository,
            INomenclatureRepository nomenclatureRepository,
            IUserRepository userRepository,
            IOrderSelectorFactory orderSelectorFactory,
            IEmployeeJournalFactory driverJournalFactory,
            ICounterpartyJournalFactory counterpartyJournalFactory,
            IDeliveryPointJournalFactory deliveryPointJournalFactory,
            ISubdivisionJournalFactory subdivisionJournalFactory,
            IGtkTabsOpener gtkDialogsOpener,
            IUndeliveredOrdersJournalOpener undeliveredOrdersJournalOpener,
            ISalesPlanJournalFactory salesPlanJournalFactory,
            INomenclatureSelectorFactory nomenclatureSelector,
            IUndeliveredOrdersRepository undeliveredOrdersRepository) : base(uowBuilder, uowFactory, commonServices)
        {
            _filePickerService          = filePickerService ?? throw new ArgumentNullException(nameof(filePickerService));
            _subdivisionRepository      = subdivisionRepository ?? throw new ArgumentNullException(nameof(subdivisionRepository));
            CounterpartySelectorFactory = counterpartySelectorFactory ?? throw new ArgumentNullException(nameof(counterpartySelectorFactory));
            _undeliveryViewOpener       = undeliveryViewOpener ?? throw new ArgumentNullException(nameof(undeliveryViewOpener));
            EmployeeService             = employeeService ?? throw new ArgumentNullException(nameof(employeeService));
            NomenclatureRepository      = nomenclatureRepository ?? throw new ArgumentNullException(nameof(nomenclatureRepository));
            UserRepository              = userRepository ?? throw new ArgumentNullException(nameof(userRepository));
            _salesPlanJournalFactory    = salesPlanJournalFactory ?? throw new ArgumentNullException(nameof(salesPlanJournalFactory));
            NomenclatureSelector        = nomenclatureSelector ?? throw new ArgumentNullException(nameof(nomenclatureSelector));
            UndeliveredOrdersRepository =
                undeliveredOrdersRepository ?? throw new ArgumentNullException(nameof(undeliveredOrdersRepository));

            OrderSelectorFactory           = orderSelectorFactory ?? throw new ArgumentNullException(nameof(orderSelectorFactory));
            EmployeeJournalFactory         = driverJournalFactory ?? throw new ArgumentNullException(nameof(driverJournalFactory));
            _employeeSelectorFactory       = EmployeeJournalFactory.CreateEmployeeAutocompleteSelectorFactory();
            CounterpartyJournalFactory     = counterpartyJournalFactory ?? throw new ArgumentNullException(nameof(counterpartyJournalFactory));
            DeliveryPointJournalFactory    = deliveryPointJournalFactory ?? throw new ArgumentNullException(nameof(deliveryPointJournalFactory));
            SubdivisionJournalFactory      = subdivisionJournalFactory ?? throw new ArgumentNullException(nameof(subdivisionJournalFactory));
            GtkDialogsOpener               = gtkDialogsOpener ?? throw new ArgumentNullException(nameof(gtkDialogsOpener));
            UndeliveredOrdersJournalOpener = undeliveredOrdersJournalOpener ?? throw new ArgumentNullException(nameof(undeliveredOrdersJournalOpener));

            Entity.ObservableComplaintDiscussions.ElementChanged     += ObservableComplaintDiscussions_ElementChanged;
            Entity.ObservableComplaintDiscussions.ListContentChanged += ObservableComplaintDiscussions_ListContentChanged;
            Entity.ObservableFines.ListContentChanged += ObservableFines_ListContentChanged;

            if (uowBuilder.IsNewEntity)
            {
                AbortOpening("Невозможно создать новую рекламацию из текущего диалога, необходимо использовать диалоги создания");
            }

            if (CurrentEmployee == null)
            {
                AbortOpening("Невозможно открыть рекламацию так как к вашему пользователю не привязан сотрудник");
            }

            ConfigureEntityChangingRelations();

            CreateCommands();

            _complaintKinds = complaintKindSource = UoW.GetAll <ComplaintKind>().Where(k => !k.IsArchive).ToList();

            ComplaintObject = Entity.ComplaintKind?.ComplaintObject;

            TabName = $"Рекламация №{Entity.Id} от {Entity.CreationDate.ToShortDateString()}";
        }
        private void ConfigureDlg()
        {
            btnCancel.Clicked                   += OnCancelClicked;
            printTimeButton.Clicked             += OnPrintTimeButtonClicked;
            ybuttonAddAdditionalLoad.Clicked    += OnButtonAddAdditionalLoadClicked;
            ybuttonRemoveAdditionalLoad.Clicked += OnButtonRemoveAdditionalLoadClicked;

            datepickerDate.Binding.AddBinding(Entity, e => e.Date, w => w.Date).InitializeFromSource();
            _previousSelectedDate             = Entity.Date;
            datepickerDate.DateChangedByUser += OnDatepickerDateDateChangedByUser;

            entityviewmodelentryCar.SetEntityAutocompleteSelectorFactory(new CarJournalFactory(MainClass.MainWin.NavigationManager).CreateCarAutocompleteSelectorFactory());
            entityviewmodelentryCar.Binding.AddBinding(Entity, e => e.Car, w => w.Subject).InitializeFromSource();
            entityviewmodelentryCar.CompletionPopupSetWidth(false);
            entityviewmodelentryCar.ChangedByUser += (sender, e) =>
            {
                if (Entity.Car == null || Entity.Date == default)
                {
                    evmeForwarder.IsEditable           = true;
                    ybuttonAddAdditionalLoad.Sensitive = false;
                    return;
                }

                ybuttonAddAdditionalLoad.Sensitive = true;
                var isCompanyCar = Entity.GetCarVersion.IsCompanyCar;

                Entity.Driver = Entity.Car.Driver != null && Entity.Car.Driver.Status != EmployeeStatus.IsFired
                                        ? Entity.Car.Driver
                                        : null;
                evmeDriver.Sensitive = Entity.Driver == null || isCompanyCar;

                if (!isCompanyCar || Entity.Car.CarModel.CarTypeOfUse == CarTypeOfUse.Largus && Entity.CanAddForwarder)
                {
                    Entity.Forwarder         = Entity.Forwarder;
                    evmeForwarder.IsEditable = true;
                }
                else
                {
                    Entity.Forwarder         = null;
                    evmeForwarder.IsEditable = false;
                }
            };

            var driverFilter = new EmployeeFilterViewModel();

            driverFilter.SetAndRefilterAtOnce(
                x => x.Status           = EmployeeStatus.IsWorking,
                x => x.RestrictCategory = EmployeeCategory.driver,
                x => x.CanChangeStatus  = false);
            var driverFactory = new EmployeeJournalFactory(driverFilter);

            evmeDriver.Changed += (sender, args) => lblDriverComment.Text = Entity.Driver?.Comment;
            evmeDriver.SetEntityAutocompleteSelectorFactory(driverFactory.CreateEmployeeAutocompleteSelectorFactory());
            evmeDriver.Binding.AddBinding(Entity, e => e.Driver, w => w.Subject).InitializeFromSource();

            hboxDriverComment.Binding
            .AddFuncBinding(Entity, e => e.Driver != null && !string.IsNullOrWhiteSpace(e.Driver.Comment), w => w.Visible)
            .InitializeFromSource();

            var forwarderFilter = new EmployeeFilterViewModel();

            forwarderFilter.SetAndRefilterAtOnce(
                x => x.Status           = EmployeeStatus.IsWorking,
                x => x.RestrictCategory = EmployeeCategory.forwarder,
                x => x.CanChangeStatus  = false);
            var forwarderFactory = new EmployeeJournalFactory(forwarderFilter);

            evmeForwarder.SetEntityAutocompleteSelectorFactory(forwarderFactory.CreateEmployeeAutocompleteSelectorFactory());
            evmeForwarder.Binding.AddBinding(Entity, e => e.Forwarder, w => w.Subject).InitializeFromSource();
            evmeForwarder.Changed += (sender, args) =>
            {
                createroutelistitemsview1.OnForwarderChanged();
                lblForwarderComment.Text = Entity.Forwarder?.Comment;
            };

            hboxForwarderComment.Binding
            .AddFuncBinding(Entity, e => e.Forwarder != null && !string.IsNullOrWhiteSpace(e.Forwarder.Comment), w => w.Visible)
            .InitializeFromSource();
            lblForwarderComment.Text = Entity.Forwarder?.Comment;

            var employeeFactory = new EmployeeJournalFactory();

            evmeLogistician.SetEntityAutocompleteSelectorFactory(employeeFactory.CreateEmployeeAutocompleteSelectorFactory());
            evmeLogistician.Sensitive = false;
            evmeLogistician.Binding.AddBinding(Entity, e => e.Logistician, w => w.Subject).InitializeFromSource();

            speccomboShift.ItemsList = _deliveryShiftRepository.ActiveShifts(UoW);
            speccomboShift.Binding.AddBinding(Entity, e => e.Shift, w => w.SelectedItem).InitializeFromSource();

            labelStatus.Binding.AddFuncBinding(Entity, e => e.Status.GetEnumTitle(), w => w.LabelProp).InitializeFromSource();

            evmeDriver.Sensitive = false;
            enumPrint.Sensitive  = Entity.Status != RouteListStatus.New;

            if (Entity.Id > 0)
            {
                //Нужно только для быстрой загрузки данных диалога. Проверено на МЛ из 200 заказов. Разница в скорости в несколько раз.
                var orders = UoW.Session.QueryOver <RouteListItem>()
                             .Where(x => x.RouteList == Entity)
                             .Fetch(x => x.Order).Eager
                             .Fetch(x => x.Order.OrderItems).Eager
                             .List();
            }

            _isLogistican = ServicesConfig.CommonServices.CurrentPermissionService.ValidatePresetPermission("logistican");
            createroutelistitemsview1.RouteListUoW = UoWGeneric;
            createroutelistitemsview1.SetPermissionParameters(permissionResult, _isLogistican);

            var additionalLoadingItemsViewModel =
                new AdditionalLoadingItemsViewModel(UoW, this, new NomenclatureJournalFactory(), ServicesConfig.InteractiveService);

            additionalLoadingItemsViewModel.BindWithSource(Entity, e => e.AdditionalLoadingDocument);
            additionalLoadingItemsViewModel.CanEdit  = Entity.Status == RouteListStatus.New;
            _additionalLoadingItemsView              = new AdditionalLoadingItemsView(additionalLoadingItemsViewModel);
            _additionalLoadingItemsView.WidthRequest = 300;
            _additionalLoadingItemsView.ShowAll();
            hboxAdditionalLoading.PackStart(_additionalLoadingItemsView, false, false, 0);

            buttonAccept.Visible = ybuttonAddAdditionalLoad.Visible = ybuttonRemoveAdditionalLoad.Visible =
                NotLoadedRouteListStatuses.Contains(Entity.Status);

            if (Entity.Status == RouteListStatus.InLoading || Entity.Status == RouteListStatus.Confirmed)
            {
                var icon = new Image
                {
                    Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-edit", IconSize.Menu)
                };
                buttonAccept.Image = icon;
                buttonAccept.Label = "Редактировать";
            }

            ggToStringWidget.UoW   = UoW;
            ggToStringWidget.Label = "Район города:";
            ggToStringWidget.Binding.AddBinding(Entity, x => x.ObservableGeographicGroups, x => x.Items).InitializeFromSource();

            enumPrint.ItemsEnum = typeof(RouteListPrintableDocuments);
            enumPrint.SetVisibility(RouteListPrintableDocuments.TimeList, false);
            enumPrint.SetVisibility(RouteListPrintableDocuments.OrderOfAddresses, false);
            bool IsLoadDocumentPrintable = ServicesConfig.CommonServices.CurrentPermissionService
                                           .ValidatePresetPermission("can_print_car_load_document");

            enumPrint.SetVisibility(RouteListPrintableDocuments.LoadDocument, IsLoadDocumentPrintable &&
                                    !(Entity.Status == RouteListStatus.Confirmed));
            enumPrint.EnumItemClicked += (sender, e) => PrintSelectedDocument((RouteListPrintableDocuments)e.ItemEnum);

            //Телефон
            phoneLogistican.MangoManager = phoneDriver.MangoManager = phoneForwarder.MangoManager = MainClass.MainWin.MangoManager;
            phoneLogistican.Binding.AddBinding(Entity, e => e.Logistician, w => w.Employee).InitializeFromSource();
            phoneDriver.Binding.AddBinding(Entity, e => e.Driver, w => w.Employee).InitializeFromSource();
            phoneForwarder.Binding.AddBinding(Entity, e => e.Forwarder, w => w.Employee).InitializeFromSource();

            var hasAccessToDriverTerminal = _isLogistican ||
                                            ServicesConfig.CommonServices.CurrentPermissionService.ValidatePresetPermission("role_сashier");
            var baseDoc = _routeListRepository.GetLastTerminalDocumentForEmployee(UoW, Entity.Driver);

            labelTerminalCondition.Visible = hasAccessToDriverTerminal &&
                                             baseDoc is DriverAttachedTerminalGiveoutDocument &&
                                             baseDoc.CreationDate.Date <= Entity?.Date;
            if (labelTerminalCondition.Visible)
            {
                labelTerminalCondition.LabelProp += $"{Entity.DriverTerminalCondition?.GetEnumTitle() ?? "неизвестно"}";
            }

            _canСreateRoutelistInPastPeriod = ServicesConfig.CommonServices.CurrentPermissionService.ValidatePresetPermission("can_create_routelist_in_past_period");

            _oldDriver = Entity.Driver;
            UpdateDlg(_isLogistican);

            Entity.PropertyChanged += OnRouteListPropertyChanged;
        }
        private void ConfigureDlg()
        {
            buttonSave.Sensitive = _allEditing;

            Entity.ObservableAddresses.ElementAdded   += ObservableAddresses_ElementAdded;
            Entity.ObservableAddresses.ElementRemoved += ObservableAddresses_ElementRemoved;
            Entity.ObservableAddresses.ElementChanged += ObservableAddresses_ElementChanged;

            entityviewmodelentryCar.SetEntityAutocompleteSelectorFactory(new CarJournalFactory(MainClass.MainWin.NavigationManager).CreateCarAutocompleteSelectorFactory());
            entityviewmodelentryCar.Binding.AddBinding(Entity, e => e.Car, w => w.Subject).InitializeFromSource();
            entityviewmodelentryCar.CompletionPopupSetWidth(false);
            entityviewmodelentryCar.Sensitive = _logisticanEditing;

            additionalloadingtextview.Binding
            .AddBinding(Entity, e => e.AdditionalLoadingDocument, w => w.AdditionalLoadingDocument)
            .InitializeFromSource();
            additionalloadingtextview.Visible = Entity.AdditionalLoadingDocument != null;

            var driverFilter = new EmployeeFilterViewModel();

            driverFilter.SetAndRefilterAtOnce(
                x => x.Status           = EmployeeStatus.IsWorking,
                x => x.RestrictCategory = EmployeeCategory.driver);
            var driverFactory = new EmployeeJournalFactory(driverFilter);

            evmeDriver.SetEntityAutocompleteSelectorFactory(driverFactory.CreateEmployeeAutocompleteSelectorFactory());
            evmeDriver.Binding.AddBinding(Entity, rl => rl.Driver, widget => widget.Subject).InitializeFromSource();
            evmeDriver.Sensitive = _logisticanEditing;

            var forwarderFilter = new EmployeeFilterViewModel();

            forwarderFilter.SetAndRefilterAtOnce(
                x => x.Status           = EmployeeStatus.IsWorking,
                x => x.RestrictCategory = EmployeeCategory.forwarder);
            var forwarderFactory = new EmployeeJournalFactory(forwarderFilter);

            evmeForwarder.SetEntityAutocompleteSelectorFactory(forwarderFactory.CreateEmployeeAutocompleteSelectorFactory());
            evmeForwarder.Binding.AddSource(Entity)
            .AddBinding(rl => rl.Forwarder, widget => widget.Subject)
            .AddFuncBinding(rl => _logisticanEditing && rl.CanAddForwarder, widget => widget.Sensitive)
            .InitializeFromSource();

            evmeForwarder.Changed += ReferenceForwarder_Changed;

            var employeeFactory = new EmployeeJournalFactory();

            evmeLogistician.SetEntityAutocompleteSelectorFactory(employeeFactory.CreateWorkingEmployeeAutocompleteSelectorFactory());
            evmeLogistician.Binding.AddBinding(Entity, rl => rl.Logistician, widget => widget.Subject).InitializeFromSource();
            evmeLogistician.Sensitive = _logisticanEditing;

            speccomboShift.ItemsList = _deliveryShiftRepository.ActiveShifts(UoW);
            speccomboShift.Binding.AddBinding(Entity, rl => rl.Shift, widget => widget.SelectedItem).InitializeFromSource();
            speccomboShift.Sensitive = _logisticanEditing;

            datePickerDate.Binding.AddBinding(Entity, rl => rl.Date, widget => widget.Date).InitializeFromSource();
            datePickerDate.Sensitive = _logisticanEditing;

            ylabelLastTimeCall.Binding.AddFuncBinding(Entity, e => GetLastCallTime(e.LastCallTime), w => w.LabelProp).InitializeFromSource();
            yspinActualDistance.Sensitive = _allEditing;

            buttonMadeCall.Sensitive = _allEditing;

            buttonRetriveEnRoute.Sensitive = Entity.Status == RouteListStatus.OnClosing && _isUserLogist &&
                                             ServicesConfig.CommonServices.CurrentPermissionService.ValidatePresetPermission("can_retrieve_routelist_en_route");

            btnReDeliver.Binding.AddBinding(Entity, e => e.CanChangeStatusToDeliveredWithIgnoringAdditionalLoadingDocument, w => w.Sensitive).InitializeFromSource();

            buttonNewFine.Sensitive = _allEditing;

            buttonRefresh.Sensitive = _allEditing;

            //Заполняем иконки
            var ass = Assembly.GetAssembly(typeof(MainClass));

            statusIcons.Add(RouteListItemStatus.EnRoute, new Gdk.Pixbuf(ass, "Vodovoz.icons.status.car.png"));
            statusIcons.Add(RouteListItemStatus.Completed, new Gdk.Pixbuf(ass, "Vodovoz.icons.status.face-smile-grin.png"));
            statusIcons.Add(RouteListItemStatus.Overdue, new Gdk.Pixbuf(ass, "Vodovoz.icons.status.face-angry.png"));
            statusIcons.Add(RouteListItemStatus.Canceled, new Gdk.Pixbuf(ass, "Vodovoz.icons.status.face-crying.png"));
            statusIcons.Add(RouteListItemStatus.Transfered, new Gdk.Pixbuf(ass, "Vodovoz.icons.status.face-uncertain.png"));

            ytreeviewAddresses.ColumnsConfig = ColumnsConfigFactory.Create <RouteListKeepingItemNode>()
                                               .AddColumn("№ п/п").AddNumericRenderer(x => x.RouteListItem.IndexInRoute + 1)
                                               .AddColumn("Заказ")
                                               .AddTextRenderer(node => node.RouteListItem.Order.Id.ToString())
                                               .AddColumn("Адрес")
                                               .AddTextRenderer(node => node.RouteListItem.Order.DeliveryPoint == null ? "Требуется точка доставки" : node.RouteListItem.Order.DeliveryPoint.ShortAddress)
                                               .AddColumn("Время")
                                               .AddTextRenderer(node => node.RouteListItem.Order.DeliverySchedule == null ? "" : node.RouteListItem.Order.DeliverySchedule.Name)
                                               .AddColumn("Статус")
                                               .AddPixbufRenderer(x => statusIcons[x.Status])
                                               .AddEnumRenderer(node => node.Status, excludeItems: new Enum[] { RouteListItemStatus.Transfered })
                                               .AddSetter((c, n) => c.Editable = _allEditing && n.Status != RouteListItemStatus.Transfered)
                                               .AddColumn("Отгрузка")
                                               .AddNumericRenderer(node => node.RouteListItem.Order.OrderItems
                                                                   .Where(b => b.Nomenclature.Category == NomenclatureCategory.water && b.Nomenclature.TareVolume == TareVolume.Vol19L)
                                                                   .Sum(b => b.Count))
                                               .AddColumn("Возврат тары")
                                               .AddNumericRenderer(node => node.RouteListItem.Order.BottlesReturn)
                                               .AddColumn("Сдали по факту")
                                               .AddNumericRenderer(node => node.RouteListItem.DriverBottlesReturned)
                                               .AddColumn("Доставка за час")
                                               .AddToggleRenderer(x => x.RouteListItem.Order.IsFastDelivery).Editing(false)
                                               .AddColumn("Статус изменен")
                                               .AddTextRenderer(node => node.LastUpdate)
                                               .AddColumn("Комментарий")
                                               .AddTextRenderer(node => node.Comment)
                                               .Editable(_allEditing)
                                               .AddColumn("Переносы")
                                               .AddTextRenderer(node => node.Transferred)
                                               .RowCells()
                                               .AddSetter <CellRenderer>((cell, node) => cell.CellBackgroundGdk = node.RowColor)
                                               .Finish();
            ytreeviewAddresses.Selection.Mode     = SelectionMode.Multiple;
            ytreeviewAddresses.Selection.Changed += OnSelectionChanged;
            ytreeviewAddresses.Sensitive          = _allEditing;
            ytreeviewAddresses.RowActivated      += YtreeviewAddresses_RowActivated;

            //Point!
            //Заполняем телефоны

            if (Entity.Driver != null && Entity.Driver.Phones.Count > 0)
            {
                uint rows = Convert.ToUInt32(Entity.Driver.Phones.Count + 1);
                PhonesTable1.Resize(rows, 2);
                Label label = new Label();
                label.LabelProp = $"{Entity.Driver.FullName}";
                PhonesTable1.Attach(label, 0, 2, 0, 1);

                for (uint i = 1; i < rows; i++)
                {
                    Label l = new Label();
                    l.LabelProp  = "+7 " + Entity.Driver.Phones[Convert.ToInt32(i - 1)].Number;
                    l.Selectable = true;
                    PhonesTable1.Attach(l, 0, 1, i, i + 1);

                    HandsetView h = new HandsetView(Entity.Driver.Phones[Convert.ToInt32(i - 1)].DigitsNumber);
                    PhonesTable1.Attach(h, 1, 2, i, i + 1);
                }
            }
            if (Entity.Forwarder != null && Entity.Forwarder.Phones.Count > 0)
            {
                uint rows = Convert.ToUInt32(Entity.Forwarder.Phones.Count + 1);
                PhonesTable2.Resize(rows, 2);
                Label label = new Label();
                label.LabelProp = $"{Entity.Forwarder.FullName}";
                PhonesTable2.Attach(label, 0, 2, 0, 1);

                for (uint i = 1; i < rows; i++)
                {
                    Label l = new Label();
                    l.LabelProp  = "+7 " + Entity.Forwarder.Phones[Convert.ToInt32(i - 1)].Number;
                    l.Selectable = true;
                    PhonesTable2.Attach(l, 0, 1, i, i + 1);

                    HandsetView h = new HandsetView(Entity.Forwarder.Phones[Convert.ToInt32(i - 1)].DigitsNumber);
                    PhonesTable2.Attach(h, 1, 2, i, i + 1);
                }
            }

            //Телефон
            PhonesTable1.ShowAll();
            PhonesTable2.ShowAll();

            phoneLogistican.MangoManager = phoneDriver.MangoManager = phoneForwarder.MangoManager = MainClass.MainWin.MangoManager;
            phoneLogistican.Binding.AddBinding(Entity, e => e.Logistician, w => w.Employee).InitializeFromSource();
            phoneDriver.Binding.AddBinding(Entity, e => e.Driver, w => w.Employee).InitializeFromSource();
            phoneForwarder.Binding.AddBinding(Entity, e => e.Forwarder, w => w.Employee).InitializeFromSource();

            //Заполняем информацию о бутылях
            UpdateBottlesSummaryInfo();

            UpdateNodes();
        }