private void ConfigureEntries() { entityviewmodelentryCounterparty.SetEntityAutocompleteSelectorFactory(new DefaultEntityAutocompleteSelectorFactory <Counterparty, CounterpartyJournalViewModel, CounterpartyJournalFilterViewModel>(ServicesConfig.CommonServices)); entityviewmodelentrySellManager.SetEntityAutocompleteSelectorFactory( _employeeJournalFactory.CreateWorkingOfficeEmployeeAutocompleteSelectorFactory()); entityviewmodelentryOrderAuthor.SetEntityAutocompleteSelectorFactory( _employeeJournalFactory.CreateWorkingOfficeEmployeeAutocompleteSelectorFactory()); }
public UndeliveredOrdersFilterViewModel(ICommonServices commonServices, IOrderSelectorFactory orderSelectorFactory, IEmployeeJournalFactory employeeJournalFactory, ICounterpartyJournalFactory counterpartyJournalFactory, IDeliveryPointJournalFactory deliveryPointJournalFactory, ISubdivisionJournalFactory subdivisionJournalFactory) { OrderSelectorFactory = (orderSelectorFactory ?? throw new ArgumentNullException(nameof(orderSelectorFactory))) .CreateOrderAutocompleteSelectorFactory(); DriverEmployeeSelectorFactory = (employeeJournalFactory ?? throw new ArgumentNullException(nameof(employeeJournalFactory))) .CreateWorkingDriverEmployeeAutocompleteSelectorFactory(); OfficeEmployeeSelectorFactory = employeeJournalFactory.CreateWorkingOfficeEmployeeAutocompleteSelectorFactory(); CounterpartySelectorFactory = (counterpartyJournalFactory ?? throw new ArgumentNullException(nameof(counterpartyJournalFactory))) .CreateCounterpartyAutocompleteSelectorFactory(); DeliveryPointSelectorFactory = (deliveryPointJournalFactory ?? throw new ArgumentNullException(nameof(deliveryPointJournalFactory))) .CreateDeliveryPointAutocompleteSelectorFactory(); AuthorSubdivisionSelectorFactory = (subdivisionJournalFactory ?? throw new ArgumentNullException(nameof(subdivisionJournalFactory))) .CreateDefaultSubdivisionAutocompleteSelectorFactory(employeeJournalFactory.CreateEmployeeAutocompleteSelectorFactory()); Subdivisions = UoW.GetAll <Subdivision>(); RestrictOldOrderStartDate = DateTime.Today.AddMonths(-1); RestrictOldOrderEndDate = DateTime.Today.AddMonths(1); }
public RouteListAnalysisViewModel( IEntityUoWBuilder uowBuilder, IUnitOfWorkFactory unitOfWorkFactory, ICommonServices commonServices, IOrderSelectorFactory orderSelectorFactory, IEmployeeJournalFactory employeeJournalFactory, ICounterpartyJournalFactory counterpartyJournalFactory, IDeliveryPointJournalFactory deliveryPointJournalFactory, ISubdivisionJournalFactory subdivisionJournalFactory, IGtkTabsOpener gtkDialogsOpener, IUndeliveredOrdersJournalOpener undeliveredOrdersJournalOpener, IDeliveryShiftRepository deliveryShiftRepository, IEmployeeSettings employeeSettings, IUndeliveredOrdersRepository undeliveredOrdersRepository) : base(uowBuilder, unitOfWorkFactory, commonServices) { _orderSelectorFactory = orderSelectorFactory ?? throw new ArgumentNullException(nameof(orderSelectorFactory)); _employeeJournalFactory = employeeJournalFactory ?? throw new ArgumentNullException(nameof(employeeJournalFactory)); _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)); _employeeSettings = employeeSettings ?? throw new ArgumentNullException(nameof(employeeSettings)); UndeliveredOrdersRepository = undeliveredOrdersRepository ?? throw new ArgumentNullException(nameof(undeliveredOrdersRepository)); _commonServices = commonServices ?? throw new ArgumentNullException(nameof(commonServices)); if (deliveryShiftRepository == null) { throw new ArgumentNullException(nameof(deliveryShiftRepository)); } DeliveryShifts = deliveryShiftRepository.ActiveShifts(UoW); Entity.ObservableAddresses.PropertyOfElementChanged += ObservableAddressesOnPropertyOfElementChanged; undeliveryViewOpener = new UndeliveredOrdersJournalOpener(); employeeService = VodovozGtkServicesConfig.EmployeeService; CurrentEmployee = employeeService.GetEmployeeForUser(UoW, CurrentUser.Id); if (CurrentEmployee == null) { AbortOpening("Ваш пользователь не привязан к действующему сотруднику, вы не можете открыть " + "диалог разбора МЛ, так как некого указывать в качестве логиста.", "Невозможно открыть разбор МЛ"); } LogisticanSelectorFactory = _employeeJournalFactory.CreateWorkingOfficeEmployeeAutocompleteSelectorFactory(); DriverSelectorFactory = _employeeJournalFactory.CreateWorkingDriverEmployeeAutocompleteSelectorFactory(); ForwarderSelectorFactory = _employeeJournalFactory.CreateWorkingForwarderEmployeeAutocompleteSelectorFactory(); TabName = $"Диалог разбора {Entity.Title}"; }