Пример #1
0
 public PartsController(
     IPartService parts,
     ISupplierService suppliers)
 {
     this.parts     = parts;
     this.suppliers = suppliers;
 }
Пример #2
0
 public SnRegVm(IPartService service)
     : base(service)
 {
     _service = service;
     _context = _service.Context;
     InitializeVM();
 }
Пример #3
0
 public ProjectController(ILogger <ProjectController> logger, WebHostServiceConfiguration config, IPartService partService, IProjectService projectService)
 {
     _logger         = logger;
     _config         = config;
     _partService    = partService;
     _projectService = projectService;
 }
Пример #4
0
        public void obtain_proxy_from_service_factory()
        {
            IServiceFactory factory = new ServiceFactory();
            IPartService    proxy   = factory.CreateClient <IPartService>();

            Assert.IsTrue(proxy is PartClient);
        }
Пример #5
0
        public void obtain_proxy_from_container_using_service_contract()
        {
            IPartService proxy
                = ObjectBase.Container.GetExportedValue <IPartService>();

            Assert.IsTrue(proxy is PartClient);
        }
 public WebFrameworkServiceBinder(
     IDomainService domainService,
     IClientAssetConfigService clientAssetConfigService,
     IClientAssetService clientAssetService,
     IClientAssetTypeService clientAssetTypeService,
     IPageService pageService,
     IPageTemplateService pageTemplateService,
     IPageTemplateZoneMapService pageTemplateZoneMapService,
     IPageZoneService pageZoneService,
     IPartService partService,
     IPartTypeService partTypeService,
     ISeoDecoratorService seoDecoratorService,
     IUserService userService,
     IPartContainerService partContainerService)
 {
     this.domainService = domainService;
     this.clientAssetConfigService = clientAssetConfigService;
     this.clientAssetService = clientAssetService;
     this.clientAssetTypeService = clientAssetTypeService;
     this.pageService = pageService;
     this.pageTemplateService = pageTemplateService;
     this.pageTemplateZoneMapService = pageTemplateZoneMapService;
     this.pageZoneService = pageZoneService;
     this.partService = partService;
     this.partTypeService = partTypeService;
     this.seoDecoratorService = seoDecoratorService;
     this.userService = userService;
     this.partContainerService = partContainerService;
 }
        public async Task CreatePart_WithCorrectData_ShouldSuccessfullyCreatePart()
        {
            string errorMessagePrefix = "PartService CreatePart() method does not work properly.";

            var context = MdmsDbContextInMemoryFactory.InitializeContext();

            await SeedData(context);

            _partService = new PartService(context);

            PartServiceModel part = new PartServiceModel()
            {
                Id           = "P3",
                Name         = "Break Pad For Trailer",
                Price        = 140.15M,
                UsedCount    = 0,
                Stock        = 5,
                AcquiredFrom = new PartsProviderServiceModel()
                {
                    Name = "Brembo"
                }
            };

            bool actualResult = await _partService.Create(part);

            Assert.True(actualResult, errorMessagePrefix);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="WebFrameworkController"/> class.
 /// </summary>
 /// <param name="domainService">
 /// The domain service.
 /// </param>
 /// <param name="clientAssetTypeService"> </param>
 /// <param name="pageService">
 /// The page service.
 /// </param>
 /// <param name="pageTemplateService">
 /// The page template service.
 /// </param>
 /// <param name="pageTemplateZoneMapService">
 /// The page template zone map service.
 /// </param>
 /// <param name="pageZoneService">
 /// The page zone service.
 /// </param>
 /// <param name="partService">
 /// The part service.
 /// </param>
 /// <param name="partTypeService">
 /// The part type service.
 /// </param>
 /// <param name="seoDecoratorService">
 /// The seo decorator service.
 /// </param>
 /// <param name="userService">
 /// The user service.
 /// </param>
 /// <param name="clientAssetConfigService"> </param>
 /// <param name="clientAssetService"> </param>
 /// <param name="partContainerService"> </param>
 public WebFrameworkController(
     IDomainService domainService,
     IClientAssetConfigService clientAssetConfigService,
     IClientAssetService clientAssetService,
     IClientAssetTypeService clientAssetTypeService,
     IPageService pageService,
     IPageTemplateService pageTemplateService,
     IPageTemplateZoneMapService pageTemplateZoneMapService,
     IPageZoneService pageZoneService,
     IPartService partService,
     IPartTypeService partTypeService,
     ISeoDecoratorService seoDecoratorService,
     IUserService userService,
     IPartContainerService partContainerService)
 {
     this.modelBinder = new WebFrameworkServiceBinder(
         domainService,
         clientAssetConfigService,
         clientAssetService,
         clientAssetTypeService,
         pageService,
         pageTemplateService,
         pageTemplateZoneMapService,
         pageZoneService,
         partService,
         partTypeService,
         seoDecoratorService,
         userService,
         partContainerService);
 }
Пример #9
0
 public SupplierAccessController(IPoService poService, IPartService partService, IOptions <AppSettings> appSettings, ICompanyService companyService)
 {
     this._poService     = poService;
     this._partService   = partService;
     _appSettings        = appSettings.Value;
     this.companyService = companyService;
 }
Пример #10
0
        public PartDetailViewModel(IPartService partService, IPartRepository partRepository,
                                   IEventAggregator eventAggregator,
                                   IManufacturerLookupService manuLookup, ISupplierLookupDataService supplierLookupDataService, ILookupUnitsOfMeasure unitsOfMeasureLookup)
        {
            ///TODO  replace with single repository
            ///

            _partService     = partService;
            _partRepository  = partRepository;
            _eventAggregator = eventAggregator;
            _eventAggregator.GetEvent <OpenPartDetailEvent>().Subscribe(OnOpenPartDetailView);
            _manuLookup                = manuLookup;
            ManusList                  = new ObservableCollection <LookupItem>();
            SuppliersList              = new ObservableCollection <LookupItem>();
            UnitsOfMeasureList         = new ObservableCollection <LookupItem>();
            PartResources              = new ObservableCollection <Document>();
            PartOrders                 = new ObservableCollection <PurchaseOrderListDTO>();
            PartTransactions           = new ObservableCollection <InventoryTransactionsDTO>();
            _supplierLookupDataService = supplierLookupDataService;
            _unitOfMeasureLookup       = unitsOfMeasureLookup;
            //- Commands
            SaveCommand    = new DelegateCommand(OnSaveExecute, OnSaveCanExecute);
            OpenResource   = new DelegateCommand <object>(OnOpenResourceExecute, OnOpenResourceCanExecute);
            NewResource    = new DelegateCommand <object>(OnNewResourceExecute, OnNewResourceCanExecute);
            EditResource   = new DelegateCommand <object>(OnEditResourceExecute, OnEditResourceCanExecute);
            AttachResource = new DelegateCommand <object>(OnAttachResourceExecute, OnAttachResourceCanExecute);
            DetachResource = new DelegateCommand <object>(OnDetachResourceExecute, OnDetachResourceCanExecute);
        }
Пример #11
0
 public QueryMaintainCtrlVm(IPartService service)
     : base(service)
 {
     _service = service;
     _context = _service.Context;
     InitializeVM();
 }
Пример #12
0
 public QueryLifeMonitorVm(IPartService service)
     : base(service)
 {
     _service = service;
     _context = _service.Context;
     InitializeVM();
 }
Пример #13
0
        public SelectAircraftsVm(SelectAircrafts selectAircraftsWindow, IPartService service)
            : base(service)
        {
            SelectAircraftsWindow = selectAircraftsWindow;
            CommitCommand = new DelegateCommand<object>(OnCommitExecute, CanCommitExecute);
            CancelCommand = new DelegateCommand<object>(OnCancelExecute, CanCancelExecute);
            #region 飞机
            AircraftQueries = new QueryableDataServiceCollectionView<ContractAircraftDTO>(service.Context, service.Context.ContractAircrafts);
            AircraftQueries.FilterDescriptors.Add(_descriptor);
            AircraftQueries.LoadedData += (e, o) =>
            {
                AircraftList = new ObservableCollection<ContractAircraftDTO>();
                AircraftQueries.ToList().ForEach(AircraftList.Add);
                SelectAircraftList = new ObservableCollection<ContractAircraftDTO>();

                if (_scn != null)
                {
                    _scn.ApplicableAircrafts.ToList().ForEach(p => SelectAircraftList.Add(AircraftList.FirstOrDefault(t => t.Id == p.ContractAircraftId)));
                }
                else
                {
                    Aircrafts.ForEach(p => SelectAircraftList.Add(AircraftList.FirstOrDefault(t => t.Id == p.Id)));
                }
            };
            #endregion
        }
Пример #14
0
 public PartsController(
     IPartService partService,
     ISupplierService supplierService)
 {
     this.partService     = partService;
     this.supplierService = supplierService;
 }
Пример #15
0
 public ConfigCompareVm(IPartService service)
     : base(service)
 {
     _service = service;
     _context = _service.Context;
     InitializeVM();
 }
Пример #16
0
 public PartFacadeService(
     IRepository <Part, int> partRepository,
     IRepository <ParetoClass, string> paretoClassRepository,
     IQueryRepository <ProductAnalysisCode> productAnalysisCodeRepository,
     IQueryRepository <AccountingCompany> accountingCompanyRepository,
     IQueryRepository <NominalAccount> nominalAccountRepository,
     IRepository <AssemblyTechnology, string> assemblyTechnologyRepository,
     IRepository <DecrementRule, string> decrementRuleRepository,
     IQueryRepository <SernosSequence> sernosSequenceRepository,
     IQueryRepository <Supplier> supplierRepository,
     IRepository <Employee, int> employeeRepository,
     IPartService partService,
     IDatabaseService databaseService,
     ITransactionManager transactionManager)
     : base(partRepository, transactionManager)
 {
     this.partRepository                = partRepository;
     this.paretoClassRepository         = paretoClassRepository;
     this.productAnalysisCodeRepository = productAnalysisCodeRepository;
     this.accountingCompanyRepository   = accountingCompanyRepository;
     this.nominalAccountRepository      = nominalAccountRepository;
     this.decrementRuleRepository       = decrementRuleRepository;
     this.assemblyTechnologyRepository  = assemblyTechnologyRepository;
     this.sernosSequenceRepository      = sernosSequenceRepository;
     this.supplierRepository            = supplierRepository;
     this.employeeRepository            = employeeRepository;
     this.partService     = partService;
     this.databaseService = databaseService;
 }
Пример #17
0
 public PartTypeController(ILogger <PartTypeController> logger, WebHostServiceConfiguration config, IPartTypeService partTypeService, IPartService partService)
 {
     _logger          = logger;
     _config          = config;
     _partTypeService = partTypeService;
     _partService     = partService;
 }
Пример #18
0
 public PartServiceTests()
 {
     this.testPartList   = this.GetTestPartList();
     this.partRepository = this.GetConfiguredPartRepository(testPartList);
     this.carRepository  = this.GetConfiguredCarRepository();
     this.partService    = new PartService(partRepository.Object, carRepository.Object);
 }
Пример #19
0
 public InSeatAssemblyQueryVm(IPartService service)
     : base(service)
 {
     _service = service;
     _context = _service.Context;
     InitializeVM();
 }
Пример #20
0
 public MaintainScnVm(IPartService service)
     : base(service)
 {
     _service = service;
     _context = _service.Context;
     InitializeVm();
 }
 public CarsController(
     ICarService carService,
     IPartService partService)
 {
     this.carService  = carService;
     this.partService = partService;
 }
Пример #22
0
 public QueryAdSbVm(IPartService service)
     : base(service)
 {
     _service = service;
     _context = _service.Context;
     InitializeVm();
 }
Пример #23
0
 public BaseConfigurationVm(IPartService service)
     : base(service)
 {
     _service = service;
     _context = _service.Context;
     InitializeVm();
 }
        public async Task GetAllParts_WithDummyDataOrderByUsedCountDescending_ShouldReturnCorrectResults()
        {
            string errorMessagePrefix = "PartService GetAllParts() method does not work properly.";

            var context = MdmsDbContextInMemoryFactory.InitializeContext();

            await SeedData(context);

            _partService = new PartService(context);

            var criteria = "Used From Highest To Lowest";
            List <PartServiceModel> actualResults = await _partService.GetAllParts(criteria).ToListAsync();

            List <PartServiceModel> expectedResults = GetPartGetDummyData().To <PartServiceModel>().OrderByDescending(x => x.UsedCount).ToList();

            for (int i = 0; i < expectedResults.Count; i++)
            {
                var expectedEntry = expectedResults[i];
                var actualEntry   = actualResults[i];

                Assert.True(expectedEntry.Name == actualEntry.Name, errorMessagePrefix + " " + "Name is not returned properly.");
                Assert.True(expectedEntry.Price == actualEntry.Price, errorMessagePrefix + " " + "Price is not returned properly.");
                Assert.True(expectedEntry.UsedCount == actualEntry.UsedCount, errorMessagePrefix + " " + "UsedCount is not returned properly.");
                Assert.True(expectedEntry.Stock == actualEntry.Stock, errorMessagePrefix + " " + "Stock is not returned properly.");
                Assert.True(expectedEntry.AcquiredFrom.Name == actualEntry.AcquiredFrom.Name, errorMessagePrefix + " " + "AquiredFrom is not returned properly.");
            }
        }
Пример #25
0
 public CorrectAcDailyUtilizationVm(IPartService service)
     : base(service)
 {
     _service = service;
     _context = _service.Context;
     InitializeVm();
 }
Пример #26
0
 public CarsController(
     ICarService service,
     IPartService parts)
 {
     this.cars  = service;
     this.parts = parts;
 }
Пример #27
0
 public PrintController(ILogger <ProjectController> logger, WebHostServiceConfiguration config, IPartService partService, ILabelPrinter labelPrinter)
 {
     _logger       = logger;
     _config       = config;
     _partService  = partService;
     _labelPrinter = labelPrinter;
 }
Пример #28
0
 public MaintainAirStructureDamageVm(IPartService service)
     : base(service)
 {
     _service = service;
     _context = _service.Context;
     InitializeVm();
 }
Пример #29
0
 public ManageOnBoardSnVm(IPartService service)
     : base(service)
 {
     _service = service;
     _context = _service.Context;
     InitializeVM();
     InitializerCommand();
 }
Пример #30
0
 public ItemVm(IPartService service)
     : base(service)
 {
     _service = service;
     _context = _service.Context;
     InitializeVM();
     InitializerCommand();
 }
Пример #31
0
        public APUOilVM(IPartService service)
            : base(service)
        {
            _service = service;
            _context = service.Context;

            InitializeVM();
        }
Пример #32
0
 public PartController(ILogger <PartController> logger, IMemoryCache cache, WebHostServiceConfiguration config, IPartService partService, IProjectService projectService)
 {
     _logger         = logger;
     _cache          = cache;
     _config         = config;
     _partService    = partService;
     _projectService = projectService;
 }
Пример #33
0
 public PartViewModelFactory(IPartService partService, ICarService carService, IProviderService providerService, ICartService cartService, IAuthentificator authentificator)
 {
     _partService     = partService;
     _carService      = carService;
     _providerService = providerService;
     _cartService     = cartService;
     _authentificator = authentificator;
 }
Пример #34
0
 public ManageRemovalAndInstallationVm(IPartService service)
     : base(service)
 {
     _service = service;
     _context = _service.Context;
     InitializeVM();
     InitializerCommand();
 }
Пример #35
0
 public QuerySnHistoryVm(IRegionManager regionManager, IPartService service)
     : base(service)
 {
     _regionManager = regionManager;
     _service = service;
     _context = _service.Context;
     InitializeVm();
 }
Пример #36
0
 public AircraftConfigVm(IPartService service)
     : base(service)
 {
     _service = service;
     _context = _service.Context;
     InitializeVM();
     InitializerCommand();
 }
Пример #37
0
 public BasicConfigGroupVm(IPartService service)
     : base(service)
 {
     _service = service;
     _context = _service.Context;
     InitializeVM();
     InitializerCommand();
 }
 public OffersController(IOfferService offerService, ICarService carService, IPartService partService,
                         IUserService userService)
 {
     this.offerService = offerService;
     this.carService   = carService;
     this.partService  = partService;
     this.userService  = userService;
 }
Пример #39
0
 public PartsController(IPartService parts,
                        IPuzzleService puzzles,
                        UserManager <User> userManager)
 {
     this.parts       = parts;
     this.puzzles     = puzzles;
     this.userManager = userManager;
 }
 public PendingRepairTasksViewComponent(IRepairTaskService repairTaskService,
                                        IPartService partService,
                                        IMapper mapper)
 {
     this.repairTaskService = repairTaskService;
     this.partService       = partService;
     this.mapper            = mapper;
 }
Пример #41
0
 public ManageEngineMaintainPlanVm(IPartService service, IFleetPlanService fleetPlanService)
     : base(service)
 {
     _service = service;
     _fleetPlanService = fleetPlanService;
     _context = _service.Context;
     InitializeVm();
 }
Пример #42
0
 public frmAddExercise(Schedule schedule, Exercise exercise = null)
 {
     InitializeComponent();
     this.exercise   = exercise;
     this.schedule   = schedule;
     exerciseService = InstanceFactory.GetInstance <IExerciseService>();
     partService     = InstanceFactory.GetInstance <IPartService>();
 }
        public PartServiceTests()
        {
            var options = new DbContextOptionsBuilder <ApplicationDbContext>()
                          .UseInMemoryDatabase(databaseName: "TestDb").Options;

            this.connection     = new ApplicationDbContext(options);
            this.partRepository = new EfRepository <Part>(this.connection);
            this.partService    = new PartService(this.partRepository);
        }
Пример #44
0
 public PoService(IPoRepository poRepository, IPartRepository partRepository, IEntityTrackerRepository entityTrackerRepository,
                  IPartService partService, ICompanyRepository companyRepository)
 {
     _poRepository            = poRepository;
     _partRepository          = partRepository;
     _entityTrackerRepository = entityTrackerRepository;
     _partService             = partService;
     this.companyRepository   = companyRepository;
 }
Пример #45
0
 public CarsController(
     ICarService cars,
     IPartService parts,
     ILogService logs)
 {
     this.cars  = cars;
     this.parts = parts;
     this.logs  = logs;
 }
Пример #46
0
 public OrdersController(IOrderService orderService, IPartService partService, IOptions <AppSettings> appSettings,
                         ICompanyService companyService, ICustomerService customerService)
 {
     this._orderService    = orderService;
     this._partService     = partService;
     this._appSettings     = appSettings.Value;
     this._customerService = customerService;
     this._companyService  = companyService;
 }
Пример #47
0
 public PartsController(
     IPartService partService,
     ISupplierService supplierService,
     IMapper mapper)
 {
     this.partService     = partService;
     this.supplierService = supplierService;
     this.mapper          = mapper;
 }
Пример #48
0
 public CarsController(
     ICarService carService,
     IPartService partService,
     IMapper mapper)
 {
     this.carService  = carService;
     this.partService = partService;
     this.mapper      = mapper;
 }
 public InstructionPagesController(IInstructionPageService instructionPageService, IProductService productService,
                                   IInstructionService instructionService, IPartService partService)
 {
     this.instructionPageService = instructionPageService;
     this.productService         = productService;
     this.instructionService     = instructionService;
     this.partService            = partService;
     fileManager = new FileManager();
 }
Пример #50
0
 public PartsController(IPartService partService, IPoService poService, ISupplierInvoiceService supplierInvoiceService,
                        IOrderService orderService, IPackingSlipService packingSlipService)
 {
     this._partService            = partService;
     this._poService              = poService;
     this._supplierInvoiceService = supplierInvoiceService;
     this._orderService           = orderService;
     this._packingSlipService     = packingSlipService;
 }
 public SalesOrderParserService(IPdfParserService pdfParser, ICustomerService customers, ITricornService tricorn,
                                IPhotoService photos, IPartService parts)
 {
     _pdfParser = pdfParser;
     _customers = customers;
     _tricorn   = tricorn;
     _photos    = photos;
     _parts     = parts;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="PageDefinitionServiceBinder"/> class.
 /// </summary>
 /// <param name="pageService">
 /// The page service.
 /// </param>
 /// <param name="pageTemplateService">
 /// The page template service.
 /// </param>
 public PageDefinitionServiceBinder(
     IPageService pageService,
     IPageTemplateService pageTemplateService,
     IPageTemplateZoneMapService templateZoneMapService,
     IPartService partService,
     IPartTypeService partTypeService)
 {
     this.pageService = pageService;
     this.pageTemplateService = pageTemplateService;
     this.templateZoneMapService = templateZoneMapService;
     this.partService = partService;
     this.partTypeService = partTypeService;
 }
 /// <summary>
 /// The initialize services.
 /// </summary>
 private void InitializeServices()
 {
     this.pageService = new PageService(this.pageRepositoryMock.Object, new Mock<IUnitOfWork>().Object);
     this.pageTemplateService = new PageTemplateService(this.pageTemplateRepositoryMock.Object, new Mock<IUnitOfWork>().Object);
     this.pageControllerActionService = new PageControllerActionService(this.pageControllerRepositoryActionMock.Object, new Mock<IUnitOfWork>().Object);
     this.partTypeService = new PartTypeService(this.partTypeRepositoryMock.Object, new Mock<IUnitOfWork>().Object);
     this.partService = new PartService(this.partRepositoryMock.Object, new Mock<IUnitOfWork>().Object);
     this.seoDecoratorService = new SeoDecoratorService(this.seoDecoratorRepositoryMock.Object, new Mock<IUnitOfWork>().Object);
     this.rolePageRestrictionService = new RolePageRestrictionService(this.rolePageRestrictionRepositoryMock.Object, new Mock<IUnitOfWork>().Object);
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="CmsPageManagerController"/> class.
        /// </summary>
        /// <param name="pageService">
        /// The page service.
        /// </param>
        /// <param name="pageTemplateService">
        /// The page Template Service.
        /// </param>
        /// <param name="pageControllerActionService">
        /// The page Controller Action Service.
        /// </param>
        /// <param name="partTypeService">
        /// The part Type Service.
        /// </param>
        /// <param name="partService">
        /// The part Service.
        /// </param>
        /// <param name="seoDecoratorService">the seo decorator service</param>
        public CmsPageManagerController(
            IPageService pageService,
            IPageTemplateService pageTemplateService,
            IPageControllerActionService pageControllerActionService,
            IPartTypeService partTypeService,
            IPartService partService,
            ISeoDecoratorService seoDecoratorService,
            IRoleService roleService,
            IRolePageRestrictionService rolePageRestrictionService)
        {
            this.pageService = pageService;
            this.seoDecoratorService = seoDecoratorService;
            this.pageTemplateService = pageTemplateService;
            this.pageControllerActionService = pageControllerActionService;
            this.partTypeService = partTypeService;
            this.partService = partService;
            this.seoDecoratorService = seoDecoratorService;
            this.roleService = roleService;
            this.rolePageRestrictionService = rolePageRestrictionService;

            this.ViewBag.AddInfo = "AdditionalInfo";
        }