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}"; }
public RouteListJournalViewModel( RouteListJournalFilterViewModel filterViewModel, IRouteListRepository routeListRepository, IFuelRepository fuelRepository, ISubdivisionRepository subdivisionRepository, ICategoryRepository categoryRepository, ITrackRepository trackRepository, IUndeliveredOrdersRepository undeliveredOrdersRepository, IDeliveryShiftRepository deliveryShiftRepository, IUnitOfWorkFactory unitOfWorkFactory, IRouteListParametersProvider routeListParametersProvider, ICallTaskWorker callTaskWorker, IWarehouseRepository warehouseRepository, ICarJournalFactory carJournalFactory, IEmployeeJournalFactory employeeJournalFactory, IEmployeeRepository employeeRepository, IGtkTabsOpener gtkTabsOpener, IOrderSelectorFactory orderSelectorFactory, ICounterpartyJournalFactory counterpartyJournalFactory, IDeliveryPointJournalFactory deliveryPointJournalFactory, ISubdivisionJournalFactory subdivisionJournalFactory, IUndeliveredOrdersJournalOpener undeliveredOrdersJournalOpener, IStockRepository stockRepository, IReportPrinter reportPrinter, ITerminalNomenclatureProvider terminalNomenclatureProvider, IEmployeeSettings employeeSettings, ICommonServices commonServices) : base(filterViewModel, unitOfWorkFactory, commonServices) { _routeListRepository = routeListRepository ?? throw new ArgumentNullException(nameof(routeListRepository)); _fuelRepository = fuelRepository ?? throw new ArgumentNullException(nameof(fuelRepository)); _subdivisionRepository = subdivisionRepository ?? throw new ArgumentNullException(nameof(subdivisionRepository)); _categoryRepository = categoryRepository ?? throw new ArgumentNullException(nameof(categoryRepository)); _trackRepository = trackRepository ?? throw new ArgumentNullException(nameof(trackRepository)); _undeliveredOrdersRepository = undeliveredOrdersRepository ?? throw new ArgumentNullException(nameof(undeliveredOrdersRepository)); _deliveryShiftRepository = deliveryShiftRepository ?? throw new ArgumentNullException(nameof(deliveryShiftRepository)); _routeListParametersProvider = routeListParametersProvider ?? throw new ArgumentNullException(nameof(routeListParametersProvider)); _callTaskWorker = callTaskWorker ?? throw new ArgumentNullException(nameof(callTaskWorker)); _warehouseRepository = warehouseRepository ?? throw new ArgumentNullException(nameof(warehouseRepository)); _carJournalFactory = carJournalFactory ?? throw new ArgumentNullException(nameof(carJournalFactory)); _employeeJournalFactory = employeeJournalFactory ?? throw new ArgumentNullException(nameof(employeeJournalFactory)); _employeeRepository = employeeRepository ?? throw new ArgumentNullException(nameof(employeeRepository)); _gtkTabsOpener = gtkTabsOpener ?? throw new ArgumentNullException(nameof(gtkTabsOpener)); _orderSelectorFactory = orderSelectorFactory ?? throw new ArgumentNullException(nameof(orderSelectorFactory)); _counterpartyJournalFactory = counterpartyJournalFactory ?? throw new ArgumentNullException(nameof(counterpartyJournalFactory)); _deliveryPointJournalFactory = deliveryPointJournalFactory ?? throw new ArgumentNullException(nameof(deliveryPointJournalFactory)); _subdivisionJournalFactory = subdivisionJournalFactory ?? throw new ArgumentNullException(nameof(subdivisionJournalFactory)); _undeliveredOrdersJournalOpener = undeliveredOrdersJournalOpener ?? throw new ArgumentNullException(nameof(undeliveredOrdersJournalOpener)); _stockRepository = stockRepository ?? throw new ArgumentNullException(nameof(stockRepository)); _reportPrinter = reportPrinter ?? throw new ArgumentNullException(nameof(reportPrinter)); _terminalNomenclatureProvider = terminalNomenclatureProvider ?? throw new ArgumentNullException(nameof(terminalNomenclatureProvider)); _employeeSettings = employeeSettings ?? throw new ArgumentNullException(nameof(employeeSettings)); TabName = "Журнал МЛ"; NotifyConfiguration.Enable(); NotifyConfiguration.Instance.BatchSubscribeOnEntity <RouteList>(changeEvents => Refresh()); InitPopupActions(); }