Example #1
0
        public AddSupplierViewModel(
            ISuppliersService suppliersService)
        {
            this._suppliersService = suppliersService ?? throw new ArgumentNullException(nameof(suppliersService));

            this.SupplierEditorViewModel = new SupplierEditorViewModel();

            this.TrySaveAndClose = ReactiveCommand.CreateFromTask(
                async() =>
            {
                var changedValues = this.SupplierEditorViewModel.GetChanges();
                //this.SupplierEditorViewModel.Values.Where(x => x.Value.OldValue != x.Value.NewValue).ToDictionary(x => x.Key, x => x.Value.NewValue);

                // TODO: handle esceptions/response
                var addedSupplier = await this._suppliersService.CreateAndAddAsync(changedValues).ConfigureAwait(false);
                if (addedSupplier != null)
                {
                    await this.TryCloseAsync(true).ConfigureAwait(false);
                }
            });
            this.TrySaveAndClose.ThrownExceptions
            .Subscribe(ex => Debug.WriteLine(ex.Message))
            .DisposeWith(this._disposables);
            this.TrySaveAndClose.DisposeWith(this._disposables);

            this.DiscardAndClose = ReactiveCommand.CreateFromTask(
                async() => await this.TryCloseAsync(false).ConfigureAwait(false));
            this.DiscardAndClose.ThrownExceptions
            .Subscribe(ex => Debug.WriteLine(ex.Message))
            .DisposeWith(this._disposables);
            this.DiscardAndClose.DisposeWith(this._disposables);

            this.DisplayName = "Add " + nameof(Supplier);
        }
Example #2
0
 public ProductsController(IProductsService productsService, ICategoriesService categoriesService,
                           ISuppliersService suppliersService)
 {
     this.productsService   = productsService;
     this.suppliersService  = suppliersService;
     this.categoriesService = categoriesService;
 }
Example #3
0
 public LocalBillingService(
     ISuppliersService localSuppliersService
     , IBillsService localBillsService
     )
 {
     this.Suppliers = localSuppliersService ?? throw new ArgumentNullException(nameof(localSuppliersService));
     this.Bills     = localBillsService ?? throw new ArgumentNullException(nameof(localBillsService));
 }
 public SuppliersViewModel(SuppliersSearchViewModel supplierSearch, ISuppliersService supplierService, SuppliersAddEditViewModel suppliersAddEdit)
     : base(supplierSearch, suppliersAddEdit)
 {
     PostDataRetrievalDelegate = (list) =>
     {
         supplierService.UpdateCanSelect(list);
     };
 }
Example #5
0
 public ProductsController(IProductService _prodServ,
                           ICategoryService _cateServ,
                           ISuppliersService _suppServ)
 {
     prodServ = _prodServ;
     cateServ = _cateServ;
     suppServ = _suppServ;
 }
 public SuppliersController(UserManager <User> userManager,
                            ISuppliersService suppliers,
                            ILogService logs)
 {
     _userManager   = userManager;
     this.suppliers = suppliers;
     this.logs      = logs;
 }
Example #7
0
 public ProductsController(IProductsService productsService, ICategoriesService categoriesService, ISuppliersService suppliersService, ILogger <ProductsController> logger, IProductViewModelMapper productMapper)
 {
     _productsService   = productsService;
     _categoriesService = categoriesService;
     _suppliersService  = suppliersService;
     _logger            = logger;
     _productMapper     = productMapper;
 }
 public HazardousSubstanceViewModelFactory(IHazardousSubstancesService hazardousSubstancesService, ISuppliersService suppliersService, IPictogramService pictogramService, IRiskPhraseService riskPhraseService, ISafetyPhraseService safetyPhraseService)
 {
     _hazardousSubstancesService = hazardousSubstancesService;
     _suppliersService = suppliersService;
     _pictogramService = pictogramService;
     _riskPhraseService = riskPhraseService;
     _safetyPhraseService = safetyPhraseService;
 }
Example #9
0
 public ProductsController(IConfigurationProvider config, ILoggerAdapter <ProductsController> logger,
                           IProductsService productsService, ICategoriesService categoriesService, ISuppliersService suppliersService)
 {
     _config            = config ?? throw new ArgumentNullException(nameof(config));
     _logger            = logger ?? throw new ArgumentNullException(nameof(logger));
     _productsService   = productsService ?? throw new ArgumentNullException(nameof(productsService));
     _categoriesService = categoriesService ?? throw new ArgumentNullException(nameof(categoriesService));
     _suppliersService  = suppliersService ?? throw new ArgumentNullException(nameof(suppliersService));
 }
 public SupplierChangesController(
     IUserContext userContext,
     ISuppliersService suppliersService,
     ISupplierChangesService supplierChangesService)
     : base(userContext)
 {
     _suppliersService       = suppliersService;
     _supplierChangesService = supplierChangesService;
 }
 public CompanyDefaultsTaskFactory(ICompanyDefaultService companyDefaultService, ISuppliersService suppliersService, IDoesCompanyDefaultAlreadyExistGuard companyDefaultAlreadyExistGuard, IHazardRepository hazardRepository, IPeopleAtRiskRepository peopleAtRiskRepository, ISupplierRepository supplierRepository)
 {
     _companyDefaultService = companyDefaultService;
     _companyDefaultAlreadyExistGuard = companyDefaultAlreadyExistGuard;
     _hazardRepository = hazardRepository;
     _peopleAtRiskRepository = peopleAtRiskRepository;
     _supplierRepository = supplierRepository;
     _suppliersService = suppliersService;
 }
Example #12
0
 public OrdersService(UniShopDbContext context, IUniShopUsersService uniShopUsersService,
                      IShoppingCartsService shoppingCartsService, ISuppliersService suppliersService, IProductsService productsService)
 {
     this.context              = context;
     this.uniShopUsersService  = uniShopUsersService;
     this.shoppingCartsService = shoppingCartsService;
     this.suppliersService     = suppliersService;
     this.productsService      = productsService;
 }
 public SupplierCommentsController(
     IUserContext userContext,
     ISuppliersService suppliersService,
     ISupplierCommentsService supplierCommentsService)
     : base(userContext)
 {
     _userContext             = userContext;
     _suppliersService        = suppliersService;
     _supplierCommentsService = supplierCommentsService;
 }
        public OrderManager(BadgerDataModel context)
        {
            InitializeComponent();
            ctx = context;

            ordersService   = new OrdersService(ctx);
            supplierService = new SuppliersService(ctx);
            jobsService     = new JobsService(ctx);
            dgOrders.AutoGenerateColumns = false;
        }
Example #15
0
 public OrdersController(ISuppliersService suppliersService,
                         IAddressesService addressesService, IShoppingCartsService shoppingCartsService
                         , IUniShopUsersService uniShopUsersService, IOrderService orderService)
 {
     this.suppliersService     = suppliersService;
     this.addressesService     = addressesService;
     this.shoppingCartsService = shoppingCartsService;
     this.uniShopUsersService  = uniShopUsersService;
     this.orderService         = orderService;
 }
 public ShoppingCartController(IShoppingCartsService shoppingCartService,
                               IProductsService productSevice,
                               ISuppliersService suppliersService,
                               IMapper mapper)
 {
     this.shoppingCartService = shoppingCartService;
     this.productSevice       = productSevice;
     this.suppliersService    = suppliersService;
     this.mapper = mapper;
 }
Example #17
0
 public OrdersController(IUserServices userServices, IAddressesServices addressesServices, IProductServices productServices, BookStoreDbContext db,
                         ISuppliersService suppliersService, IOrderServices orderServices, IIncomeMoneyService incomeMoneyService)
 {
     _userServices      = userServices;
     _addressesServices = addressesServices;
     _productServices   = productServices;
     _db = db;
     _suppliersService   = suppliersService;
     _orderServices      = orderServices;
     _incomeMoneyService = incomeMoneyService;
 }
Example #18
0
 public ProductsController(
     IProductsService productsService,
     ICategoriesService categoriesService,
     ISuppliersService suppliersService,
     IMapper mapper)
 {
     _productsService   = productsService;
     _categoriesService = categoriesService;
     _suppliersService  = suppliersService;
     _mapper            = mapper;
 }
        public void GetAllSuppliers_WithZeroData_ShouldReturnEmptyResults()
        {
            var context = UniShopDbContextInMemoryFactory.InitializeContext();

            this.suppliersService = new SuppliersService(context);

            List <SupplierServiceModel> actualResults = this.suppliersService.GetAllSuppliers().ToList();
            int expectedResults = 0;

            Assert.Equal(expectedResults, actualResults.Count());
        }
 public OffersController(
     IOffersService offersService,
     ISuppliersService suppliersService,
     ICategoriesService categoriesService,
     IMedicinesService medicinesService)
 {
     this.offersService     = offersService;
     this.suppliersService  = suppliersService;
     this.categoriesService = categoriesService;
     this.medicinesService  = medicinesService;
 }
Example #21
0
 public ProductsController(
     IOptions <ApplicationSettings> settingsOptions,
     IProductsService productsService,
     ISuppliersService suppliersService,
     ICategoriesService categoriesService)
 {
     _productsService   = productsService;
     _suppliersService  = suppliersService;
     _categoriesService = categoriesService;
     _settings          = settingsOptions.Value;
 }
Example #22
0
        public SuppliersController(ISuppliersService suppliersService, ICategoriesService categoriesService)
        {
            this.service           = suppliersService;
            this.categoriesService = categoriesService;
            MapperConfiguration config = new MapperConfiguration(con =>
            {
                con.CreateMap <SuppliersView, SuppliersDTM>();
                con.CreateMap <SuppliersDTM, SuppliersView>();
            });

            mapper = config.CreateMapper();
        }
Example #23
0
 public ProductsController(
     ICategoriesService categoriesService,
     IProductsService productsService,
     ISuppliersService suppliersService,
     IConfiguration configuration,
     IMapper mapper)
 {
     _categoriesService = categoriesService;
     _productsService   = productsService;
     _suppliersService  = suppliersService;
     _configuration     = configuration;
     _mapper            = mapper;
 }
 public CompanyDefaultsController(
     INonEmployeeService nonEmployeeService, 
     ICompanyDefaultService companyDefaultService, 
     ICompanyDefaultsTaskFactory companyDefaultsTaskFactory, 
     ISuppliersService suppliersService,
     ISiteService siteService)
 {
     _nonEmployeeService = nonEmployeeService;
     _companyDefaultService = companyDefaultService;
     _companyDefaultsTaskFactory = companyDefaultsTaskFactory;
     _suppliersService = suppliersService;
     _siteService = siteService;
 }
Example #25
0
        public SuppliersController(ISuppliersService service)
        {
            suppliersService = service;

            var config = new MapperConfiguration(cfg =>
            {
                cfg.CreateMap <ProductDTO, ProductView>();
                cfg.CreateMap <SupplierDTO, SupplierView>();
                cfg.CreateMap <SupplierView, SupplierDTO>();
            });

            mapper = config.CreateMapper();
        }
Example #26
0
        public OrderReceiptsControl(BadgerDataModel Context)
        {
            InitializeComponent();
            dgRecieptItems.AutoGenerateColumns = false;

            context          = Context;
            ordersService    = new OrderRecieptService(context);
            suppliersService = new SuppliersService(context);
            jobsService      = new JobsService(context);
            inventoryService = new InventoryService(context);
            poService        = new OrdersService(context);
            empService       = new EmployeeService(context);
        }
Example #27
0
 public OrdersController(IAdressesService adressesService, IUsersService usersService,
                         IOrdersService orderService, IShoppingCartsService shoppingCartService,
                         ISuppliersService suppliersService, IMapper mapper, IEmailSender emailSender, IViewRender viewRender)
 {
     this.usersService        = usersService;
     this.adressesService     = adressesService;
     this.orderService        = orderService;
     this.shoppingCartService = shoppingCartService;
     this.suppliersService    = suppliersService;
     this.mapper      = mapper;
     this.emailSender = emailSender;
     this.viewRender  = viewRender;
 }
Example #28
0
        public ProductsController(IProductsService productsService, ICategoriesService categoriesService, ISuppliersService suppliersService)
        {
            this.service           = productsService;
            this.categoriesService = categoriesService;
            this.suppliersService  = suppliersService;
            MapperConfiguration config = new MapperConfiguration(con =>
            {
                con.CreateMap <ProductsView, ProductsDTM>();
                con.CreateMap <ProductsDTM, ProductsView>();
            });

            mapper = config.CreateMapper();
        }
        public void Edit_WithCorrectData_ShouldPassSuccessfully()
        {
            string errorMessagePrefix = "SuppliersService Edit() method does not work properly.";

            var context = UniShopDbContextInMemoryFactory.InitializeContext();

            SeedData(context);
            this.suppliersService = new SuppliersService(context);

            SupplierServiceModel expectedData = context.Suppliers.First().To <SupplierServiceModel>();

            bool actualData = this.suppliersService.Edit(expectedData);

            Assert.True(actualData, errorMessagePrefix);
        }
        public void GetSupplierById_WithNonExistentId_ShouldReturnNull()
        {
            string errorMessagePrefix = "SuppliersService GetSupplierById() method does not work properly.";

            var context = UniShopDbContextInMemoryFactory.InitializeContext();

            SeedData(context);
            this.suppliersService = new SuppliersService(context);

            int nonExistentId = 5;

            SupplierServiceModel actualResult = this.suppliersService.GetSupplierById(nonExistentId);

            Assert.True(actualResult == null, errorMessagePrefix);
        }
        public void Delete_WithNonExistentSupplierId_ShouldReturnFalse()
        {
            string errorMessagePrefix = "SuppliersService Delete() method does not work properly.";

            var context = UniShopDbContextInMemoryFactory.InitializeContext();

            SeedData(context);
            this.suppliersService = new SuppliersService(context);

            int nonExistentId = 5;

            bool actualResult = this.suppliersService.Delete(nonExistentId);

            Assert.False(actualResult, errorMessagePrefix);
        }
        public void Delete_WithCorrectData_ShouldPassSuccessfully()
        {
            string errorMessagePrefix = "SuppliersService Delete() method does not work properly.";

            var context = UniShopDbContextInMemoryFactory.InitializeContext();

            SeedData(context);
            this.suppliersService = new SuppliersService(context);

            int testId = context.Suppliers.First().Id;

            bool actualData = this.suppliersService.Delete(testId);

            Assert.True(actualData, errorMessagePrefix);
        }
Example #33
0
 public OrdersService(
     IDeletableEntityRepository <Order> ordersRepository,
     IRepository <OrderProduct> orderProductsRepository,
     IProductsService productsService,
     ISuppliersService suppliersService,
     IShoppingCartService shoppingCartService,
     IEmailSender emailSender,
     IViewRenderService viewRenderService)
 {
     this.ordersRepository        = ordersRepository;
     this.orderProductsRepository = orderProductsRepository;
     this.productsService         = productsService;
     this.suppliersService        = suppliersService;
     this.shoppingCartService     = shoppingCartService;
     this.emailSender             = emailSender;
     this.viewRenderService       = viewRenderService;
 }
 public InventoryViewModelFactory(IHazardousSubstancesService inventoryService, ISuppliersService suppliersService)
 {
     _inventoryService = inventoryService;
     _suppliersService = suppliersService;
 }
 public SupplierController(ISuppliersService suppliersService, IHazardousSubstancesService hazardousSubstancesService)
 {
     _suppliersService = suppliersService;
     _hazardousSubstancesService = hazardousSubstancesService;
 }
 public SuppliersMarkAsDeletedTask(ISuppliersService suppliersService)
 {
     _suppliersService = suppliersService;
 }
 public SuppliersSaveTask(ISuppliersService suppliersService, ISupplierRepository supplierRepository, IDoesCompanyDefaultAlreadyExistGuard companyDefaultAlreadyExistGuard) : base(companyDefaultAlreadyExistGuard)
 {
     _suppliersService = suppliersService;
     _supplierRepository = supplierRepository;
 }