protected override void ConfigureWithUow() { enumcomboDocumentType.ItemsEnum = typeof(DocumentType); enumcomboDocumentType.HiddenItems = new[] { DocumentType.DeliveryDocument as object }; yentryrefWarehouse.ItemsQuery = StoreDocumentHelper.GetRestrictedWarehouseQuery(); if (ServicesConfig.CommonServices.CurrentPermissionService.ValidatePresetPermission("user_have_access_only_to_warehouse_and_complaints") && !ServicesConfig.CommonServices.UserService.GetCurrentUser(UoW).IsAdmin) { yentryrefWarehouse.Sensitive = yentryrefWarehouse.CanEditReference = false; } if (CurrentUserSettings.Settings.DefaultWarehouse != null) { yentryrefWarehouse.Subject = UoW.GetById <Warehouse>(CurrentUserSettings.Settings.DefaultWarehouse.Id); } var filter = new EmployeeRepresentationFilterViewModel(); filter.SetAndRefilterAtOnce( x => x.RestrictCategory = EmployeeCategory.driver, x => x.Status = EmployeeStatus.IsWorking ); yentryrefDriver.RepresentationModel = new EmployeesVM(filter); dateperiodDocs.StartDate = DateTime.Today.AddDays(-7); dateperiodDocs.EndDate = DateTime.Today.AddDays(1); comboMovementStatus.ItemsEnum = typeof(MovementDocumentStatus); }
private void ConfigureBindings() { ylabelCreationDate.Binding.AddFuncBinding(ViewModel.Entity, e => e.CreationDate.ToString("g"), w => w.LabelProp).InitializeFromSource(); ylabelAuthor.Binding.AddFuncBinding(ViewModel.Entity, e => e.Author != null ? e.Author.GetPersonNameWithInitials() : "", w => w.LabelProp).InitializeFromSource(); ylabelStatus.Binding.AddFuncBinding(ViewModel.Entity, e => e.Status.GetEnumTitle(), w => w.LabelProp).InitializeFromSource(); yspinMoney.Binding.AddBinding(ViewModel.Entity, e => e.TransferedSum, w => w.ValueAsDecimal).InitializeFromSource(); yspinMoney.Binding.AddBinding(ViewModel, e => e.CanEdit, w => w.Sensitive).InitializeFromSource(); var filterDriver = new EmployeeRepresentationFilterViewModel(); filterDriver.SetAndRefilterAtOnce( x => x.Status = EmployeeStatus.IsWorking ); entryDriver.RepresentationModel = new EmployeesVM(filterDriver); entryDriver.Binding.AddBinding(ViewModel.Entity, e => e.Driver, w => w.Subject).InitializeFromSource(); entryDriver.Binding.AddBinding(ViewModel, vm => vm.CanEdit, w => w.Sensitive).InitializeFromSource(); entityviewmodelentryCar.SetEntityAutocompleteSelectorFactory( new DefaultEntityAutocompleteSelectorFactory <Car, CarJournalViewModel, CarJournalFilterViewModel>(ServicesConfig.CommonServices)); entityviewmodelentryCar.Binding.AddBinding(ViewModel.Entity, x => x.Car, x => x.Subject).InitializeFromSource(); entityviewmodelentryCar.CompletionPopupSetWidth(false); comboboxCashSubdivisionFrom.SetRenderTextFunc <Subdivision>(s => s.Name); comboboxCashSubdivisionFrom.Binding.AddBinding(ViewModel, vm => vm.SubdivisionsFrom, w => w.ItemsList).InitializeFromSource(); comboboxCashSubdivisionFrom.Binding.AddBinding(ViewModel, vm => vm.CanEdit, w => w.Sensitive).InitializeFromSource(); comboboxCashSubdivisionFrom.Binding.AddBinding(ViewModel.Entity, e => e.CashSubdivisionFrom, w => w.SelectedItem).InitializeFromSource(); comboboxCashSubdivisionTo.SetRenderTextFunc <Subdivision>(s => s.Name); comboboxCashSubdivisionTo.Binding.AddBinding(ViewModel, vm => vm.SubdivisionsTo, w => w.ItemsList).InitializeFromSource(); comboboxCashSubdivisionTo.Binding.AddBinding(ViewModel, vm => vm.CanEdit, w => w.Sensitive).InitializeFromSource(); comboboxCashSubdivisionTo.Binding.AddBinding(ViewModel.Entity, e => e.CashSubdivisionTo, w => w.SelectedItem).InitializeFromSource(); comboExpenseCategory.SetRenderTextFunc <ExpenseCategory>(s => s.Name); comboExpenseCategory.Binding.AddBinding(ViewModel, vm => vm.ExpenseCategories, w => w.ItemsList).InitializeFromSource(); comboExpenseCategory.Binding.AddBinding(ViewModel.Entity, e => e.ExpenseCategory, w => w.SelectedItem).InitializeFromSource(); comboExpenseCategory.Binding.AddBinding(ViewModel, vm => vm.CanEdit, w => w.Sensitive).InitializeFromSource(); comboIncomeCategory.SetRenderTextFunc <IncomeCategory>(s => s.Name); comboIncomeCategory.Binding.AddBinding(ViewModel, vm => vm.IncomeCategories, w => w.ItemsList).InitializeFromSource(); comboIncomeCategory.Binding.AddBinding(ViewModel.Entity, e => e.IncomeCategory, w => w.SelectedItem).InitializeFromSource(); comboIncomeCategory.Binding.AddBinding(ViewModel, vm => vm.CanEdit, w => w.Sensitive).InitializeFromSource(); ylabelCashierSender.Binding.AddFuncBinding(ViewModel.Entity, e => e.CashierSender != null ? e.CashierSender.GetPersonNameWithInitials() : "", w => w.LabelProp).InitializeFromSource(); ylabelCashierReceiver.Binding.AddFuncBinding(ViewModel.Entity, e => e.CashierReceiver != null ? e.CashierReceiver.GetPersonNameWithInitials() : "", w => w.LabelProp).InitializeFromSource(); ylabelSendTime.Binding.AddFuncBinding(ViewModel.Entity, e => e.SendTime.HasValue ? e.SendTime.Value.ToString("g") : "", w => w.LabelProp).InitializeFromSource(); ylabelReceiveTime.Binding.AddFuncBinding(ViewModel.Entity, e => e.ReceiveTime.HasValue ? e.ReceiveTime.Value.ToString("g") : "", w => w.LabelProp).InitializeFromSource(); ytextviewComment.Binding.AddBinding(ViewModel.Entity, e => e.Comment, w => w.Buffer.Text).InitializeFromSource(); ytextviewComment.Binding.AddBinding(ViewModel, vm => vm.CanEdit, w => w.Sensitive).InitializeFromSource(); ViewModel.SendCommand.CanExecuteChanged += (sender, e) => { buttonSend.Sensitive = ViewModel.SendCommand.CanExecute(); }; ViewModel.ReceiveCommand.CanExecuteChanged += (sender, e) => { buttonReceive.Sensitive = ViewModel.ReceiveCommand.CanExecute(); }; buttonPrint.Sensitive = ViewModel.PrintCommand.CanExecute(); }
private void Configure() { ydateperiodpickerCreateEventDate.Binding.AddBinding(ViewModel, vm => vm.CreateEventDateFrom, w => w.StartDateOrNull).InitializeFromSource(); ydateperiodpickerCreateEventDate.Binding.AddBinding(ViewModel, vm => vm.CreateEventDateTo, w => w.EndDateOrNull).InitializeFromSource(); ydateperiodpickerStartEventDate.Binding.AddBinding(ViewModel, vm => vm.StartEventDateFrom, w => w.StartDateOrNull).InitializeFromSource(); ydateperiodpickerStartEventDate.Binding.AddBinding(ViewModel, vm => vm.StartEventDateTo, w => w.EndDateOrNull).InitializeFromSource(); ydateperiodpickerEndEventDate.Binding.AddBinding(ViewModel, vm => vm.EndEventDateFrom, w => w.StartDateOrNull).InitializeFromSource(); ydateperiodpickerEndEventDate.Binding.AddBinding(ViewModel, vm => vm.EndEventDateTo, w => w.EndDateOrNull).InitializeFromSource(); referenceAuthor.RepresentationModel = new EmployeesVM(new EmployeeRepresentationFilterViewModel()); referenceAuthor.Binding.AddBinding(ViewModel, vm => vm.Author, w => w.Subject).InitializeFromSource(); var filterDriver = new EmployeeRepresentationFilterViewModel(); filterDriver.SetAndRefilterAtOnce( x => x.RestrictCategory = EmployeeCategory.driver, x => x.Status = EmployeeStatus.IsWorking ); referenceDriver.RepresentationModel = new EmployeesVM(filterDriver); referenceDriver.Binding.AddBinding(ViewModel, vm => vm.Driver, w => w.Subject).InitializeFromSource(); entityviewmodelentryCar.SetEntityAutocompleteSelectorFactory(ViewModel.CarSelectorFactory); entityviewmodelentryCar.Binding.AddBinding(ViewModel, vm => vm.Car, w => w.Subject).InitializeFromSource(); entityviewmodelentryCarEventType.SetEntityAutocompleteSelectorFactory(ViewModel.CarEventTypeSelectorFactory); entityviewmodelentryCarEventType.Binding.AddBinding(ViewModel, vm => vm.CarEventType, e => e.Subject).InitializeFromSource(); }
public DriverWagesReport() { this.Build(); UoW = UnitOfWorkFactory.CreateWithoutRoot(); var filter = new EmployeeRepresentationFilterViewModel(); filter.SetAndRefilterAtOnce( x => x.RestrictCategory = EmployeeCategory.driver, x => x.Status = EmployeeStatus.IsWorking ); yentryreferenceDriver.RepresentationModel = new EmployeesVM(filter); yentryreferenceDriver.Changed += (sender, args) => { if (dateperiodpicker.StartDateOrNull.HasValue && yentryreferenceDriver.Subject is Employee) { OnUpdate(true); } }; dateperiodpicker.PeriodChanged += (sender, args) => { if (yentryreferenceDriver.Subject is Employee && dateperiodpicker.StartDateOrNull.HasValue) { OnUpdate(true); } }; }
private void Configure() { ylabelCreateDate.Binding.AddFuncBinding(ViewModel.Entity, e => e.CreateDate.ToString("g"), w => w.LabelProp).InitializeFromSource(); ylabelAuthor.Binding.AddFuncBinding(ViewModel.Entity, e => e.Author != null ? e.Author.GetPersonNameWithInitials() : "", w => w.LabelProp).InitializeFromSource(); entityviewmodelentryCarEventType.SetEntityAutocompleteSelectorFactory(ViewModel.CarEventTypeSelectorFactory); entityviewmodelentryCarEventType.Binding.AddBinding(ViewModel.Entity, e => e.CarEventType, e => e.Subject).InitializeFromSource(); entityviewmodelentryCar.SetEntityAutocompleteSelectorFactory(ViewModel.CarSelectorFactory); entityviewmodelentryCar.Binding.AddBinding(ViewModel.Entity, e => e.Car, w => w.Subject).InitializeFromSource(); entityviewmodelentryCar.ChangedByUser += (sender, e) => ViewModel.ChangeDriverCommand.Execute(); var filterDriver = new EmployeeRepresentationFilterViewModel(); filterDriver.SetAndRefilterAtOnce( x => x.RestrictCategory = EmployeeCategory.driver, x => x.Status = EmployeeStatus.IsWorking ); referenceDriver.RepresentationModel = new EmployeesVM(filterDriver); referenceDriver.Binding.AddBinding(ViewModel.Entity, e => e.Driver, w => w.Subject).InitializeFromSource(); ydatepickerStartEventDate.Binding.AddBinding(ViewModel.Entity, e => e.StartDate, w => w.Date).InitializeFromSource(); ydatepickerEndEventDate.Binding.AddBinding(ViewModel.Entity, e => e.EndDate, w => w.Date).InitializeFromSource(); ytextviewCommnet.Binding.AddBinding(ViewModel.Entity, e => e.Comment, w => w.Buffer.Text).InitializeFromSource(); buttonSave.Clicked += (sender, args) => ViewModel.SaveAndClose(); buttonCancel.Clicked += (sender, args) => ViewModel.Close(true, CloseSource.Cancel); }
void LstCmbPlanType_Changed(object sender, EventArgs e) { filter.SetAndRefilterAtOnce( x => x.RestrictCategory = EmployeeCategory.office, x => x.Status = EmployeeStatus.IsWorking, x => x.RestrictWageParameterItemType = lstCmbPlanType.SelectedItem as WageParameterItemTypes? ); }
public CashFlow( ISubdivisionRepository subdivisionRepository, ICommonServices commonServices, ICategoryRepository categoryRepository) { _subdivisionRepository = subdivisionRepository ?? throw new ArgumentNullException(nameof(subdivisionRepository)); _commonServices = commonServices ?? throw new ArgumentNullException(nameof(commonServices)); if (categoryRepository == null) { throw new ArgumentNullException(nameof(categoryRepository)); } Build(); UoW = UnitOfWorkFactory.CreateWithoutRoot(); comboPart.ItemsEnum = typeof(ReportParts); comboIncomeCategory.ItemsList = categoryRepository.IncomeCategories(UoW); comboExpenseCategory.Sensitive = comboIncomeCategory.Sensitive = false; var now = DateTime.Now; dateStart.Date = new DateTime(now.Year, now.Month, now.Day, 0, 0, 0); dateEnd.Date = new DateTime(now.Year, now.Month, now.Day, 23, 59, 59); var filterCasher = new EmployeeRepresentationFilterViewModel(); filterCasher.SetAndRefilterAtOnce(x => x.RestrictCategory = EmployeeCategory.office); filterCasher.Status = EmployeeStatus.IsWorking; yentryrefCasher.RepresentationModel = new EmployeesVM(filterCasher); yentryrefEmployee.RepresentationModel = new EmployeesVM(); var recurciveConfig = OrmMain.GetObjectDescription <ExpenseCategory>().TableView.RecursiveTreeConfig; var list = categoryRepository.ExpenseCategories(UoW); list.Insert(0, allItem); var model = recurciveConfig.CreateModel((IList)list); comboExpenseCategory.Model = model.Adapter; comboExpenseCategory.PackStart(new CellRendererText(), true); comboExpenseCategory.SetCellDataFunc(comboExpenseCategory.Cells[0], HandleCellLayoutDataFunc); comboExpenseCategory.SetActiveIter(model.IterFromNode(allItem)); UserSubdivisions = GetSubdivisionsForUser(); specialListCmbCashSubdivisions.SetRenderTextFunc <Subdivision>(s => s.Name); specialListCmbCashSubdivisions.ItemsList = UserSubdivisions; ylblOrganisations.Visible = specialListCmbOrganisations.Visible = false; Organisations = UoW.GetAll <Organization>(); specialListCmbOrganisations.SetRenderTextFunc <Organization>(s => s.Name); specialListCmbOrganisations.ItemsList = Organisations; int currentUserId = commonServices.UserService.CurrentUserId; bool canCreateCashReportsForOrganisations = commonServices.PermissionService.ValidateUserPresetPermission("can_create_cash_reports_for_organisations", currentUserId); checkOrganisations.Visible = canCreateCashReportsForOrganisations; checkOrganisations.Toggled += CheckOrganisationsToggled; }
protected override void ConfigureWithUow() { yentryExpense.ItemsQuery = new CategoryRepository(new ParametersProvider()).ExpenseCategoriesQuery(); var filter = new EmployeeRepresentationFilterViewModel(); filter.SetAndRefilterAtOnce(x => x.Status = EmployeeStatus.IsWorking); repEntryAccountable.RepresentationModel = new EmployeesVM(filter); }
public MastersReport() { this.Build(); UoW = UnitOfWorkFactory.CreateWithoutRoot(); var filter = new EmployeeRepresentationFilterViewModel(); filter.SetAndRefilterAtOnce( x => x.RestrictCategory = EmployeeCategory.driver, x => x.Status = EmployeeStatus.IsWorking ); yentryreferenceDriver.RepresentationModel = new EmployeesVM(filter); }
public OrderCreationDateReport() { this.Build(); UoW = UnitOfWorkFactory.CreateWithoutRoot(); var filter = new EmployeeRepresentationFilterViewModel(); filter.SetAndRefilterAtOnce( x => x.RestrictCategory = EmployeeCategory.office, x => x.Status = EmployeeStatus.IsWorking ); yEntRefEmployee.RepresentationModel = new EmployeesVM(filter); }
protected void OnRadioCatAllToggled(object sender, EventArgs e) { var filter = new EmployeeRepresentationFilterViewModel(); filter.Status = EmployeeStatus.IsWorking; if (radioCatDriver.Active) { filter.SetAndRefilterAtOnce(x => x.RestrictCategory = EmployeeCategory.driver); } if (radioCatForwarder.Active) { filter.SetAndRefilterAtOnce(x => x.RestrictCategory = EmployeeCategory.forwarder); } if (radioCatOffice.Active) { filter.SetAndRefilterAtOnce(x => x.RestrictCategory = EmployeeCategory.office); } yentryDriver.RepresentationModel = new EmployeesVM(filter); }
private void ConfigureDlg() { var filterDriver = new EmployeeRepresentationFilterViewModel(); filterDriver.SetAndRefilterAtOnce( x => x.Status = EmployeeStatus.IsWorking ); entryDriver.RepresentationModel = new EmployeesVM(filterDriver); datePickerFrom.IsEditable = true; datePickerTo.IsEditable = true; buttonRecalculate.Clicked += ButtonRecalculate_Clicked; buttonRecalculateForwarder.Clicked += ButtonRecalculateForwarder_Clicked;; }
public ShortfallBattlesReport() { this.Build(); ydatepicker.Date = DateTime.Now.Date; comboboxDriver.ItemsEnum = typeof(Drivers); UoW = UnitOfWorkFactory.CreateWithoutRoot(); var filter = new EmployeeRepresentationFilterViewModel(); filter.SetAndRefilterAtOnce( x => x.RestrictCategory = EmployeeCategory.driver, x => x.Status = EmployeeStatus.IsWorking ); yentryDriver.RepresentationModel = new EmployeesVM(filter); ySpecCmbNonReturnReason.ItemsList = UoW.Session.QueryOver <NonReturnReason>().List(); }
void ConfigureDlg() { if (Entity.EmployeeDocument == null && Entity.Driver != null) { GetDocument(); } ylabelNumber.Binding.AddBinding(Entity, x => x.Title, x => x.LabelProp).InitializeFromSource(); yentryOrganization.SubjectType = typeof(Organization); yentryOrganization.Binding.AddBinding(Entity, x => x.Organization, x => x.Subject).InitializeFromSource(); yentryOrganization.Changed += (sender, e) => { UpdateStates(); }; var filterDefaultForwarder = new EmployeeRepresentationFilterViewModel(); filterDefaultForwarder.Status = EmployeeStatus.IsWorking; filterDefaultForwarder.SetAndRefilterAtOnce(x => x.RestrictCategory = EmployeeCategory.driver); yentryDriver.RepresentationModel = new EmployeesVM(filterDefaultForwarder); yentryDriver.Binding.AddBinding(Entity, x => x.Driver, x => x.Subject).InitializeFromSource(); yentryDriver.Changed += (sender, e) => { UpdateStates(); }; entityviewmodelentryCar.SetEntityAutocompleteSelectorFactory( new DefaultEntityAutocompleteSelectorFactory <Car, CarJournalViewModel, CarJournalFilterViewModel>(ServicesConfig.CommonServices)); 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(); }
public FuelReport() { this.Build(); UoW = UnitOfWorkFactory.CreateWithoutRoot(); var filterDriver = new EmployeeRepresentationFilterViewModel(); filterDriver.SetAndRefilterAtOnce( x => x.RestrictCategory = EmployeeCategory.driver, x => x.Status = EmployeeStatus.IsWorking ); yentryreferenceDriver.RepresentationModel = new EmployeesVM(filterDriver); entityviewmodelentryCar.SetEntityAutocompleteSelectorFactory( new DefaultEntityAutocompleteSelectorFactory <Car, CarJournalViewModel, CarJournalFilterViewModel>(ServicesConfig.CommonServices)); entityviewmodelentryCar.CompletionPopupSetWidth(false); var filter = new EmployeeRepresentationFilterViewModel(); filter.SetAndRefilterAtOnce( x => x.RestrictCategory = EmployeeCategory.office, x => x.Status = EmployeeStatus.IsWorking ); yentryAuthor.RepresentationModel = new EmployeesVM(filter); dateperiodpicker.StartDate = dateperiodpicker.EndDate = DateTime.Today; }
public void ConfigureDlg() { Entity.ObservableAddresses.ElementAdded += ObservableAddresses_ElementAdded; Entity.ObservableAddresses.ElementRemoved += ObservableAddresses_ElementRemoved; Entity.ObservableAddresses.ElementChanged += ObservableAddresses_ElementChanged;; entityviewmodelentryCar.SetEntityAutocompleteSelectorFactory( new DefaultEntityAutocompleteSelectorFactory <Car, CarJournalViewModel, CarJournalFilterViewModel>(ServicesConfig.CommonServices)); entityviewmodelentryCar.Binding.AddBinding(Entity, e => e.Car, w => w.Subject).InitializeFromSource(); entityviewmodelentryCar.CompletionPopupSetWidth(false); entityviewmodelentryCar.Sensitive = logisticanEditing; var filterDriver = new EmployeeRepresentationFilterViewModel(); filterDriver.SetAndRefilterAtOnce( x => x.RestrictCategory = EmployeeCategory.driver, x => x.Status = EmployeeStatus.IsWorking ); referenceDriver.RepresentationModel = new EmployeesVM(filterDriver); referenceDriver.Binding.AddBinding(Entity, rl => rl.Driver, widget => widget.Subject).InitializeFromSource(); referenceDriver.Sensitive = logisticanEditing; var filterForwarder = new EmployeeRepresentationFilterViewModel(); filterForwarder.SetAndRefilterAtOnce( x => x.RestrictCategory = EmployeeCategory.forwarder, x => x.Status = EmployeeStatus.IsWorking ); referenceForwarder.RepresentationModel = new EmployeesVM(filterForwarder); referenceForwarder.Binding.AddBinding(Entity, rl => rl.Forwarder, widget => widget.Subject).InitializeFromSource(); referenceForwarder.Sensitive = logisticanEditing; referenceForwarder.Changed += ReferenceForwarder_Changed; referenceLogistican.RepresentationModel = new EmployeesVM(); referenceLogistican.Binding.AddBinding(Entity, rl => rl.Logistician, widget => widget.Subject).InitializeFromSource(); referenceLogistican.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"); 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("Статус изменен") .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(); }