Esempio n. 1
0
 public PartsReturnController()
 {
     _partsReturnService = new PartsReturnService();
     _supplierService    = new SupplierService();
     _warehouseService   = new WarehouseService();
     _partsService       = new PartsService();
 }
Esempio n. 2
0
 public SeedService(ISeedRepository seedRepository, IWarehouseService warehouseService, IGenericRepository genericRepository, IMapper mapper)
 {
     _seedRepository    = seedRepository;
     _warehouseService  = warehouseService;
     _genericRepository = genericRepository;
     _mapper            = mapper;
 }
 public CashSalesInvoiceDetail ConfirmObject(CashSalesInvoiceDetail cashSalesInvoiceDetail, ICashSalesInvoiceService _cashSalesInvoiceService, IWarehouseItemService _warehouseItemService,
                                             IWarehouseService _warehouseService, IItemService _itemService, IBarringService _barringService, IStockMutationService _stockMutationService)
 {
     if (_validator.ValidConfirmObject(cashSalesInvoiceDetail, _cashSalesInvoiceService, _warehouseItemService))
     {
         CashSalesInvoice cashSalesInvoice = _cashSalesInvoiceService.GetObjectById(cashSalesInvoiceDetail.CashSalesInvoiceId);
         WarehouseItem    warehouseItem    = _warehouseItemService.FindOrCreateObject(cashSalesInvoice.WarehouseId, cashSalesInvoiceDetail.ItemId);
         Item             item             = _itemService.GetObjectById(cashSalesInvoiceDetail.ItemId);
         StockMutation    stockMutation    = new StockMutation()
         {
             ItemId                   = cashSalesInvoiceDetail.ItemId,
             ItemCase                 = Core.Constants.Constant.ItemCase.Ready,
             Status                   = Core.Constants.Constant.MutationStatus.Deduction,
             Quantity                 = cashSalesInvoiceDetail.Quantity,
             SourceDocumentCode       = cashSalesInvoice.Code,
             SourceDocumentId         = cashSalesInvoice.Id,
             SourceDocumentType       = Core.Constants.Constant.SourceDocumentType.CashSalesInvoice,
             SourceDocumentDetailCode = cashSalesInvoiceDetail.Code,
             SourceDocumentDetailId   = cashSalesInvoiceDetail.Id,
             SourceDocumentDetailType = Core.Constants.Constant.SourceDocumentDetailType.CashSalesInvoiceDetail,
             WarehouseId              = cashSalesInvoice.WarehouseId,
             WarehouseItemId          = warehouseItem.Id
         };
         stockMutation           = _stockMutationService.CreateObject(stockMutation, _warehouseService, _warehouseItemService, _itemService, _barringService);
         stockMutation.CreatedAt = (DateTime)cashSalesInvoice.ConfirmationDate.GetValueOrDefault();
         _stockMutationService.UpdateObject(stockMutation, _warehouseService, _warehouseItemService, _itemService, _barringService);
         _stockMutationService.StockMutateObject(stockMutation, _itemService, _barringService, _warehouseItemService);
         cashSalesInvoiceDetail.CoGS = cashSalesInvoiceDetail.Quantity * item.AvgPrice;
         cashSalesInvoiceDetail      = _repository.ConfirmObject(cashSalesInvoiceDetail);
     }
     return(cashSalesInvoiceDetail);
 }
 public ShoppingCartValidator(
     IWorkContext workContext,
     ICurrencyService currencyService,
     IProductService productService,
     ITranslationService translationService,
     IProductAttributeParser productAttributeParser,
     ICheckoutAttributeService checkoutAttributeService,
     ICheckoutAttributeParser checkoutAttributeParser,
     IPriceFormatter priceFormatter,
     IMediator mediator,
     IPermissionService permissionService,
     IAclService aclService,
     IProductAttributeService productAttributeService,
     IProductReservationService productReservationService,
     IStockQuantityService stockQuantityService,
     IWarehouseService warehouseService,
     ShoppingCartSettings shoppingCartSettings)
 {
     _workContext              = workContext;
     _currencyService          = currencyService;
     _productService           = productService;
     _translationService       = translationService;
     _productAttributeParser   = productAttributeParser;
     _checkoutAttributeService = checkoutAttributeService;
     _checkoutAttributeParser  = checkoutAttributeParser;
     _priceFormatter           = priceFormatter;
     _mediator                  = mediator;
     _permissionService         = permissionService;
     _aclService                = aclService;
     _productAttributeService   = productAttributeService;
     _productReservationService = productReservationService;
     _stockQuantityService      = stockQuantityService;
     _warehouseService          = warehouseService;
     _shoppingCartSettings      = shoppingCartSettings;
 }
Esempio n. 5
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="merchelloContext"></param>
 public ProductVariantApiController(MerchelloContext merchelloContext)
     : base(merchelloContext)
 {
     _productService        = MerchelloContext.Services.ProductService;
     _productVariantService = MerchelloContext.Services.ProductVariantService;
     _warehouseService      = MerchelloContext.Services.WarehouseService;
 }
Esempio n. 6
0
 /// <summary>
 /// This is a helper contructor for unit testing
 /// </summary>
 internal ProductVariantApiController(MerchelloContext merchelloContext, UmbracoContext umbracoContext)
     : base(merchelloContext, umbracoContext)
 {
     _productService        = MerchelloContext.Services.ProductService;
     _productVariantService = MerchelloContext.Services.ProductVariantService;
     _warehouseService      = MerchelloContext.Services.WarehouseService;
 }
Esempio n. 7
0
 public ArticlesController(IArticleService service, ICategoryService categoryService, IWarehouseService warehouseService, IMapper mapper)
 {
     _service          = service;
     _categoryService  = categoryService;
     _warehouseService = warehouseService;
     _mapper           = mapper;
 }
 public CustomPurchaseInvoiceController()
 {
     _contactService                     = new ContactService(new ContactRepository(), new ContactValidator());
     _itemService                        = new ItemService(new ItemRepository(), new ItemValidator());
     _itemTypeService                    = new ItemTypeService(new ItemTypeRepository(), new ItemTypeValidator());
     _uoMService                         = new UoMService(new UoMRepository(), new UoMValidator());
     _warehouseItemService               = new WarehouseItemService(new WarehouseItemRepository(), new WarehouseItemValidator());
     _warehouseService                   = new WarehouseService(new WarehouseRepository(), new WarehouseValidator());
     _stockMutationService               = new StockMutationService(new StockMutationRepository(), new StockMutationValidator());
     _barringService                     = new BarringService(new BarringRepository(), new BarringValidator());
     _priceMutationService               = new PriceMutationService(new PriceMutationRepository(), new PriceMutationValidator());
     _contactGroupService                = new ContactGroupService(new ContactGroupRepository(), new ContactGroupValidator());
     _purchaseOrderDetailService         = new PurchaseOrderDetailService(new PurchaseOrderDetailRepository(), new PurchaseOrderDetailValidator());
     _salesOrderDetailService            = new SalesOrderDetailService(new SalesOrderDetailRepository(), new SalesOrderDetailValidator());
     _stockAdjustmentDetailService       = new StockAdjustmentDetailService(new StockAdjustmentDetailRepository(), new StockAdjustmentDetailValidator());
     _cashBankService                    = new CashBankService(new CashBankRepository(), new CashBankValidator());
     _cashMutationService                = new CashMutationService(new CashMutationRepository(), new CashMutationValidator());
     _customPurchaseInvoiceService       = new CustomPurchaseInvoiceService(new CustomPurchaseInvoiceRepository(), new CustomPurchaseInvoiceValidator());
     _customPurchaseInvoiceDetailService = new CustomPurchaseInvoiceDetailService(new CustomPurchaseInvoiceDetailRepository(), new CustomPurchaseInvoiceDetailValidator());
     _cashSalesReturnService             = new CashSalesReturnService(new CashSalesReturnRepository(), new CashSalesReturnValidator());
     _quantityPricingService             = new QuantityPricingService(new QuantityPricingRepository(), new QuantityPricingValidator());
     _payableService                     = new PayableService(new PayableRepository(), new PayableValidator());
     _paymentVoucherService              = new PaymentVoucherService(new PaymentVoucherRepository(), new PaymentVoucherValidator());
     _paymentVoucherDetailService        = new PaymentVoucherDetailService(new PaymentVoucherDetailRepository(), new PaymentVoucherDetailValidator());
     _receivableService                  = new ReceivableService(new ReceivableRepository(), new ReceivableValidator());
     _accountService                     = new AccountService(new AccountRepository(), new AccountValidator());
     _generalLedgerJournalService        = new GeneralLedgerJournalService(new GeneralLedgerJournalRepository(), new GeneralLedgerJournalValidator());
     _closingService                     = new ClosingService(new ClosingRepository(), new ClosingValidator());
     _validCombService                   = new ValidCombService(new ValidCombRepository(), new ValidCombValidator());
 }
Esempio n. 9
0
 public Barring UpdateObject(Barring barring, IBarringService _barringService, IUoMService _uomService, IItemService _itemService, IItemTypeService _itemTypeService,
                             IContactService _contactService, IMachineService _machineService,
                             IWarehouseItemService _warehouseItemService, IWarehouseService _warehouseService)
 {
     return(barring = _validator.ValidUpdateObject(barring, _barringService, _uomService, _itemService, _itemTypeService, _contactService, _machineService) ?
                      _repository.UpdateObject(barring) : barring);
 }
Esempio n. 10
0
        private async void Border_MouseDownAsync(object sender, MouseButtonEventArgs e)
        {
            Border b = sender as Border;

            switch (b.Name)
            {
            case "SilBorder":
                if (UrunDataGrid.SelectedItems.Count == 1)
                {
                    IWarehouseService warehouseService = IocUtil.Resolve <IWarehouseService>();
                    Product           product          = UrunDataGrid.SelectedItem as Product;
                    warehouseService.DeleteProduct(product);
                    this.NavigationService.Navigate(new UrunSilPage());
                }
                return;

            case "GeriBorder":
                await this.AnimateOut();

                this.NavigationService.Navigate(new StokIslemleriPage());
                return;

            default:
                break;
            }
        }
 public OrdersController(IDatabaseService databaseService, IWarehouseService warehouseService, IEmailService emailService, IMapper mapper)
 {
     _databaseService  = databaseService;
     _warehouseService = warehouseService;
     _emailService     = emailService;
     _mapper           = mapper;
 }
Esempio n. 12
0
 public ShipmentViewModelService(
     IOrderService orderService,
     IWorkContext workContext,
     IProductService productService,
     IShipmentService shipmentService,
     IWarehouseService warehouseService,
     IMeasureService measureService,
     IDateTimeHelper dateTimeHelper,
     IProductAttributeParser productAttributeParser,
     ICountryService countryService,
     ICustomerActivityService customerActivityService,
     ILocalizationService localizationService,
     IDownloadService downloadService,
     IServiceProvider serviceProvider,
     MeasureSettings measureSettings,
     ShippingSettings shippingSettings)
 {
     _orderService            = orderService;
     _workContext             = workContext;
     _productService          = productService;
     _shipmentService         = shipmentService;
     _warehouseService        = warehouseService;
     _measureService          = measureService;
     _dateTimeHelper          = dateTimeHelper;
     _productAttributeParser  = productAttributeParser;
     _countryService          = countryService;
     _customerActivityService = customerActivityService;
     _localizationService     = localizationService;
     _downloadService         = downloadService;
     _serviceProvider         = serviceProvider;
     _measureSettings         = measureSettings;
     _shippingSettings        = shippingSettings;
 }
Esempio n. 13
0
 /// <summary>
 /// Ctor
 /// </summary>
 public ShippingService(
     IWarehouseService warehouseService,
     ILogger logger,
     IProductService productService,
     IProductAttributeParser productAttributeParser,
     ICheckoutAttributeParser checkoutAttributeParser,
     ILocalizationService localizationService,
     IAddressService addressService,
     ICountryService countryService,
     IStateProvinceService stateProvinceService,
     IPluginFinder pluginFinder,
     ICurrencyService currencyService,
     ShoppingCartSettings shoppingCartSettings,
     ShippingSettings shippingSettings)
 {
     _warehouseService        = warehouseService;
     _logger                  = logger;
     _productService          = productService;
     _productAttributeParser  = productAttributeParser;
     _checkoutAttributeParser = checkoutAttributeParser;
     _localizationService     = localizationService;
     _addressService          = addressService;
     _countryService          = countryService;
     _stateProvinceService    = stateProvinceService;
     _pluginFinder            = pluginFinder;
     _currencyService         = currencyService;
     _shoppingCartSettings    = shoppingCartSettings;
     _shippingSettings        = shippingSettings;
 }
 public RoutesController(IRouteService service, IMapper mapper, IErrorHandler errorHandler, IWarehouseService warehouseService)
 {
     _service          = service;
     _mapper           = mapper;
     _errorHandler     = errorHandler;
     _warehouseService = warehouseService;
 }
Esempio n. 15
0
 internal GatewayProviderService(
     IDatabaseUnitOfWorkProvider provider,
     RepositoryFactory repositoryFactory,
     ILogger logger,
     IShipMethodService shipMethodService,
     IShipRateTierService shipRateTierService,
     IShipCountryService shipCountryService,
     IInvoiceService invoiceService,
     IOrderService orderService,
     ITaxMethodService taxMethodService,
     IPaymentService paymentService,
     IPaymentMethodService paymentMethodService,
     INotificationMethodService notificationMethodService,
     INotificationMessageService notificationMessageService,
     IWarehouseService warehouseService)
     : this(
         provider,
         repositoryFactory,
         logger,
         new TransientMessageFactory(),
         shipMethodService,
         shipRateTierService,
         shipCountryService,
         invoiceService,
         orderService,
         taxMethodService,
         paymentService,
         paymentMethodService,
         notificationMethodService,
         notificationMessageService,
         warehouseService)
 {
 }
        public CargoValidator(ICargoService cargoService, IContactService contactService, IWarehouseService warehouseService) : base(cargoService)
        {
            _contactService   = contactService;
            _warehouseService = warehouseService;

            RuleFor(x => x.Weight)
            .NotNull().WithMessage("Enter cargo weight")
            .GreaterThan(Zero).WithMessage($"Cargo weigt must be greater than {Zero}");

            RuleFor(x => x.Volume)
            .NotNull().WithMessage("Enter cargo volume")
            .GreaterThan(Zero).WithMessage($"Cargo volume must be greater than {Zero}");

            RuleFor(x => x.SenderContactId)
            .NotNull().WithMessage("Enter sender id")
            .GreaterThan(Zero).WithMessage($"Sender id must be greater than {Zero}")
            .MustAsync(IsContactExistAsync).WithMessage(model => $"Sender with id '{model.SenderContactId}' doesn't exist");

            RuleFor(x => x.RecipientContactId)
            .NotNull().WithMessage("Enter recipient id")
            .GreaterThan(Zero).WithMessage($"Recipient id must be greater than {Zero}")
            .MustAsync(IsContactExistAsync).WithMessage(model => $"Recipient with id '{model.RecipientContactId}' doesn't exist");

            RuleFor(x => x.OriginWarehouseId)
            .NotNull().WithMessage("Enter origin warehouse id")
            .GreaterThan(Zero).WithMessage($"Warehouse id must be greater than {Zero}")
            .MustAsync(IsWarehouseExistAsync).WithMessage(model => $"Warehouse with id '{model.OriginWarehouseId}' doesn't exist");

            RuleFor(x => x.DestinationWarehouseId)
            .NotNull().WithMessage("Enter destination warehouse id")
            .GreaterThan(Zero).WithMessage($"Warehouse id must be greater than {Zero}")
            .MustAsync(IsWarehouseExistAsync).WithMessage(model => $"Warehouse with id '{model.DestinationWarehouseId}' doesn't exist");
        }
 public ProductsController(ILogger <ProductsController> logger, ISalesService salesService, IWarehouseService warehouseService, IMapper mapper)
 {
     _logger           = logger;
     _salesService     = salesService;
     _warehouseService = warehouseService;
     _mapper           = mapper;
 }
 public ShippingByWeightController(
     IWarehouseService warehouseService,
     IShippingMethodService shippingMethodService,
     IStoreService storeService,
     ICountryService countryService,
     ByWeightShippingSettings shippingByWeightSettings,
     IShippingByWeightService shippingByWeightService,
     ISettingService settingService,
     ITranslationService translationService,
     ICurrencyService currencyService,
     CurrencySettings currencySettings,
     IMeasureService measureService,
     MeasureSettings measureSettings)
 {
     _warehouseService         = warehouseService;
     _shippingMethodService    = shippingMethodService;
     _storeService             = storeService;
     _countryService           = countryService;
     _shippingByWeightSettings = shippingByWeightSettings;
     _shippingByWeightService  = shippingByWeightService;
     _settingService           = settingService;
     _translationService       = translationService;
     _currencyService          = currencyService;
     _currencySettings         = currencySettings;
     _measureService           = measureService;
     _measureSettings          = measureSettings;
 }
        public CustomPurchaseInvoiceDetail UnconfirmObject(CustomPurchaseInvoiceDetail customPurchaseInvoiceDetail, IWarehouseItemService _warehouseItemService,
                                                           IWarehouseService _warehouseService, IItemService _itemService, IBarringService _barringService, IStockMutationService _stockMutationService, IPriceMutationService _priceMutationService)
        {
            if (_validator.ValidUnconfirmObject(customPurchaseInvoiceDetail))
            {
                Item item = _itemService.GetObjectById(customPurchaseInvoiceDetail.ItemId);
                //CustomPurchaseInvoiceDetail hiCustomPurchaseInvoiceDetail = GetAll().Where(x => x.ItemId == item.Id).OrderByDescending(x => x.Price).FirstOrDefault();
                decimal hiPrice  = GetHighestPrice(/*customPurchaseInvoiceDetail.CustomPurchaseInvoiceId,*/ customPurchaseInvoiceDetail.ItemId);
                decimal newPrice = hiPrice * (100 + item.Margin) / 100;
                if (newPrice > item.SellingPrice)
                {
                    item.SellingPrice = newPrice;
                    PriceMutation priceMutation = _priceMutationService.CreateObject(item.Id, item.SellingPrice, DateTime.Now);
                    item.PriceMutationId = priceMutation.Id;
                }
                decimal itemPrice = customPurchaseInvoiceDetail.Amount / customPurchaseInvoiceDetail.Quantity;
                item.AvgPrice = _itemService.CalculateAndUpdateAvgPrice(item, customPurchaseInvoiceDetail.Quantity * (-1), itemPrice);

                IList <StockMutation> stockMutations = _stockMutationService.GetObjectsBySourceDocumentDetailForItem(customPurchaseInvoiceDetail.ItemId, Core.Constants.Constant.SourceDocumentDetailType.CustomPurchaseInvoiceDetail, customPurchaseInvoiceDetail.Id);
                foreach (var stockMutation in stockMutations)
                {
                    stockMutation.Errors = new Dictionary <string, string>();
                    _stockMutationService.ReverseStockMutateObject(stockMutation, _itemService, _barringService, _warehouseItemService);
                    _stockMutationService.SoftDeleteObject(stockMutation, _warehouseService, _warehouseItemService, _itemService, _barringService);
                }
                customPurchaseInvoiceDetail.CoGS = 0;
                customPurchaseInvoiceDetail      = _repository.UnconfirmObject(customPurchaseInvoiceDetail);
            }
            return(customPurchaseInvoiceDetail);
        }
Esempio n. 20
0
 public CustomPurchaseInvoice ConfirmObject(CustomPurchaseInvoice customPurchaseInvoice, DateTime ConfirmationDate, ICustomPurchaseInvoiceDetailService _customPurchaseInvoiceDetailService,
                                            IContactService _contactService, IPriceMutationService _priceMutationService, IPayableService _payableService,
                                            ICustomPurchaseInvoiceService _customPurchaseInvoiceService, IWarehouseItemService _warehouseItemService,
                                            IWarehouseService _warehouseService, IItemService _itemService, IBarringService _barringService, IStockMutationService _stockMutationService,
                                            IGeneralLedgerJournalService _generalLedgerJournalService, IAccountService _accountService, IClosingService _closingService)
 {
     customPurchaseInvoice.ConfirmationDate = ConfirmationDate;
     if (_validator.ValidConfirmObject(customPurchaseInvoice, _customPurchaseInvoiceDetailService, _customPurchaseInvoiceService, _warehouseItemService, _contactService, _closingService))
     {
         IList <CustomPurchaseInvoiceDetail> customPurchaseInvoiceDetails = _customPurchaseInvoiceDetailService.GetObjectsByCustomPurchaseInvoiceId(customPurchaseInvoice.Id);
         customPurchaseInvoice.Total = 0;
         customPurchaseInvoice.CoGS  = 0;
         foreach (var customPurchaseInvoiceDetail in customPurchaseInvoiceDetails)
         {
             customPurchaseInvoiceDetail.Errors = new Dictionary <string, string>();
             _customPurchaseInvoiceDetailService.ConfirmObject(customPurchaseInvoiceDetail, _customPurchaseInvoiceService, _warehouseItemService,
                                                               _warehouseService, _itemService, _barringService, _stockMutationService, _priceMutationService);
             customPurchaseInvoice.Total += customPurchaseInvoiceDetail.Amount;
             customPurchaseInvoice.CoGS  += customPurchaseInvoiceDetail.CoGS;
         }
         // Tax dihitung setelah discount
         //customPurchaseInvoice.Total = (customPurchaseInvoice.Total * (100 - customPurchaseInvoice.Discount) / 100) * (100 - customPurchaseInvoice.Tax) / 100;
         customPurchaseInvoice.Total = CalculateTotalAmountAfterDiscountAndTax(customPurchaseInvoice);
         Payable payable = _payableService.CreateObject(customPurchaseInvoice.ContactId, Core.Constants.Constant.PayableSource.CustomPurchaseInvoice, customPurchaseInvoice.Id, customPurchaseInvoice.Code, customPurchaseInvoice.Total, (DateTime)customPurchaseInvoice.DueDate.GetValueOrDefault());
         _generalLedgerJournalService.CreateConfirmationJournalForCustomPurchaseInvoice(customPurchaseInvoice, _accountService);
         customPurchaseInvoice = _repository.ConfirmObject(customPurchaseInvoice);
     }
     else
     {
         customPurchaseInvoice.ConfirmationDate = null;
     }
     return(customPurchaseInvoice);
 }
Esempio n. 21
0
 public WarehouseViewModel()
 {
     CleanUp();
     _warehouseService = new WarehouseService();
     CheckRoles();
     GetLiveWarehouses();
 }
Esempio n. 22
0
 public MovementController()
 {
     _productService      = new ProductServiceSQL();
     _movementService     = new MovementServiceSQL();
     _movementTypeService = new MovementTypeServiceSQL();
     _warehouseService    = new WarehouseServiceSQL();
 }
 public SpotInventoryService(ISpotInventoryRepository spotInventoryRepository, IProductService productService, IWarehouseService warehouseService, IUnitOfWork uow)
 {
     this._spotInventoryRepository = spotInventoryRepository;
     this._productService          = productService;
     this._warehouseService        = warehouseService;
     this._uow = uow;
 }
Esempio n. 24
0
 public PartsBuyController()
 {
     _partsBuyService        = new PartsBuyService();
     _partsDictionaryService = new PartsDictionaryService();
     _warehouseService       = new WarehouseService();
     _supplierService        = new SupplierService();
 }
Esempio n. 25
0
 public ShippingController(
     IShippingService shippingService,
     IShippingMethodService shippingMethodService,
     IPickupPointService pickupPointService,
     IDeliveryDateService deliveryDateService,
     IWarehouseService warehouseService,
     ShippingSettings shippingSettings,
     ISettingService settingService,
     IAddressService addressService,
     ICountryService countryService,
     IStateProvinceService stateProvinceService,
     ILocalizationService localizationService,
     ILanguageService languageService,
     IPluginFinder pluginFinder,
     IWebHelper webHelper,
     IStoreService storeService,
     ICustomerService customerService)
 {
     _shippingService       = shippingService;
     _shippingMethodService = shippingMethodService;
     _pickupPointService    = pickupPointService;
     _deliveryDateService   = deliveryDateService;
     _warehouseService      = warehouseService;
     _shippingSettings      = shippingSettings;
     _settingService        = settingService;
     _addressService        = addressService;
     _countryService        = countryService;
     _stateProvinceService  = stateProvinceService;
     _localizationService   = localizationService;
     _languageService       = languageService;
     _pluginFinder          = pluginFinder;
     _webHelper             = webHelper;
     _storeService          = storeService;
     _customerService       = customerService;
 }
Esempio n. 26
0
 public void Init()
 {
     _repositoryMock = new Mock <IRepository <Warehouse> >();
     _mediatorMock   = new Mock <IMediator>();
     _cacheMock      = new Mock <ICacheBase>();
     _service        = new WarehouseService(_repositoryMock.Object, _mediatorMock.Object, _cacheMock.Object);
 }
        public WarehouseServiceTests(TestFixture <Startup> fixture)
        {
            var entity = new List <Warehouse>
            {
                new Warehouse
                {
                    Id   = 1,
                    Name = "Warehouse"
                }
            };

            Repository = new Mock <INodeRepository <Warehouse> >();

            Repository.Setup(x => x.GetAll())
            .Returns(entity);

            Repository.Setup(x => x.GetById(It.IsAny <int>()))
            .Returns((int id) => entity.Find(s => s.Id == id));

            Repository.Setup(x => x.Insert(It.IsAny <Warehouse>()))
            .Callback((Warehouse label) => entity.Add(label));

            Repository.Setup(x => x.Update(It.IsAny <Warehouse>()))
            .Callback((Warehouse label) => entity[entity.FindIndex(x => x.Id == label.Id)] = label);

            Repository.Setup(x => x.Delete(It.IsAny <int>()))
            .Callback((int id) => entity.RemoveAt(entity.FindIndex(x => x.Id == id)));

            var mapper      = (IMapper)fixture.Server.Host.Services.GetService(typeof(IMapper));
            var baseService = new NodeService <Warehouse>(Repository.Object);

            Service = new WarehouseService(baseService, mapper);
        }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="merchelloContext"></param>
 public ProductVariantApiController(MerchelloContext merchelloContext)
     : base(merchelloContext)
 {
     _productService = MerchelloContext.Services.ProductService;
     _productVariantService = MerchelloContext.Services.ProductVariantService;
     _warehouseService = MerchelloContext.Services.WarehouseService;
 }
Esempio n. 29
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GatewayProviderService"/> class.
 /// </summary>
 /// <param name="logger">
 /// The logger.
 /// </param>
 /// <param name="repositoryFactory">
 /// The repository factory.
 /// </param>
 /// <param name="shipMethodService">
 /// The ship method service.
 /// </param>
 /// <param name="shipRateTierService">
 /// The ship rate tier service.
 /// </param>
 /// <param name="shipCountryService">
 /// The ship country service.
 /// </param>
 /// <param name="invoiceService">
 /// The invoice service.
 /// </param>
 /// <param name="orderService">
 /// The order service.
 /// </param>
 /// <param name="taxMethodService">
 /// The tax method service.
 /// </param>
 /// <param name="paymentService">
 /// The payment service.
 /// </param>
 /// <param name="paymentMethodService">
 /// The payment method service.
 /// </param>
 /// <param name="notificationMethodService">
 /// The notification method service.
 /// </param>
 /// <param name="notificationMessageService">
 /// The notification message service.
 /// </param>
 /// <param name="warehouseService">
 /// The warehouse service.
 /// </param>
 internal GatewayProviderService(
     ILogger logger,
     RepositoryFactory repositoryFactory,
     IShipMethodService shipMethodService,
     IShipRateTierService shipRateTierService,
     IShipCountryService shipCountryService,
     IInvoiceService invoiceService,
     IOrderService orderService,
     ITaxMethodService taxMethodService,
     IPaymentService paymentService,
     IPaymentMethodService paymentMethodService,
     INotificationMethodService notificationMethodService,
     INotificationMessageService notificationMessageService,
     IWarehouseService warehouseService)
     : this(
         new PetaPocoUnitOfWorkProvider(logger),
         repositoryFactory,
         logger,
         shipMethodService,
         shipRateTierService,
         shipCountryService,
         invoiceService,
         orderService,
         taxMethodService,
         paymentService,
         paymentMethodService,
         notificationMethodService,
         notificationMessageService,
         warehouseService)
 {
 }
 /// <summary>
 /// This is a helper contructor for unit testing
 /// </summary>
 internal ProductVariantApiController(MerchelloContext merchelloContext, UmbracoContext umbracoContext)
     : base(merchelloContext, umbracoContext)
 {
     _productService = MerchelloContext.Services.ProductService;
     _productVariantService = MerchelloContext.Services.ProductVariantService;
     _warehouseService = MerchelloContext.Services.WarehouseService;
 }
Esempio n. 31
0
        internal GatewayProviderService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory, ILogger logger, IEventMessagesFactory eventMessagesFactory,
                                        IShipMethodService shipMethodService,
                                        IShipRateTierService shipRateTierService, IShipCountryService shipCountryService,
                                        IInvoiceService invoiceService, IOrderService orderService,
                                        ITaxMethodService taxMethodService, IPaymentService paymentService, IPaymentMethodService paymentMethodService,
                                        INotificationMethodService notificationMethodService, INotificationMessageService notificationMessageService, IWarehouseService warehouseService)
            : base(provider, repositoryFactory, logger, eventMessagesFactory)
        {
            Mandate.ParameterNotNull(shipMethodService, "shipMethodService");
            Mandate.ParameterNotNull(shipRateTierService, "shipRateTierService");
            Mandate.ParameterNotNull(shipCountryService, "shipCountryService");
            Mandate.ParameterNotNull(taxMethodService, "countryTaxRateService");
            Mandate.ParameterNotNull(paymentService, "paymentService");
            Mandate.ParameterNotNull(paymentMethodService, "paymentMethodService");
            Mandate.ParameterNotNull(invoiceService, "invoiceService");
            Mandate.ParameterNotNull(orderService, "orderService");
            Mandate.ParameterNotNull(notificationMethodService, "notificationMethodService");
            Mandate.ParameterNotNull(notificationMessageService, "notificationMessageService");
            Mandate.ParameterNotNull(warehouseService, "warehouseService");

            _shipMethodService          = shipMethodService;
            _shipRateTierService        = shipRateTierService;
            _shipCountryService         = shipCountryService;
            _invoiceService             = invoiceService;
            _orderService               = orderService;
            _taxMethodService           = taxMethodService;
            _paymentService             = paymentService;
            _paymentMethodService       = paymentMethodService;
            _notificationMethodService  = notificationMethodService;
            _notificationMessageService = notificationMessageService;
            _warehouseService           = warehouseService;
        }
Esempio n. 32
0
 public InOutBoundController(IInOutBoundService inOutBoundService, IProductService productService, IWarehouseService warehouseService, IWarehouseShelfService warehouseShelfService)
 {
     this._inOutBoundService     = inOutBoundService;
     this._productService        = productService;
     this._warehouseService      = warehouseService;
     this._warehouseShelfService = warehouseShelfService;
 }
Esempio n. 33
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ProductApiController"/> class. 
        /// Constructor
        /// </summary>
        /// <param name="merchelloContext">
        /// The <see cref="IMerchelloContext"/>
        /// </param>
        public ProductApiController(IMerchelloContext merchelloContext)
            : base(merchelloContext)
        {
            _productService = MerchelloContext.Services.ProductService;
            _productVariantService = MerchelloContext.Services.ProductVariantService;
            _warehouseService = MerchelloContext.Services.WarehouseService;

            _merchello = new MerchelloHelper(MerchelloContext.Services, false, DetachedValuesConversionType.Editor);
        }
Esempio n. 34
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ProductApiController"/> class. 
        /// Constructor
        /// </summary>
        /// <param name="merchelloContext">
        /// The <see cref="IMerchelloContext"/>
        /// </param>
        public ProductApiController(IMerchelloContext merchelloContext)
            : base(merchelloContext)
        {
            _productService = MerchelloContext.Services.ProductService;
            _productVariantService = MerchelloContext.Services.ProductVariantService;
            _warehouseService = MerchelloContext.Services.WarehouseService;

            _merchello = new MerchelloHelper(MerchelloContext.Services, false);
        }
Esempio n. 35
0
  internal GatewayProviderService(RepositoryFactory repositoryFactory, IShipMethodService shipMethodService, 
      IShipRateTierService shipRateTierService, IShipCountryService shipCountryService, 
      IInvoiceService invoiceService, IOrderService orderService,
      ITaxMethodService taxMethodService, IPaymentService paymentService, IPaymentMethodService paymentMethodService,
      INotificationMethodService notificationMethodService, INotificationMessageService notificationMessageService, IWarehouseService warehouseService)
     : this(new PetaPocoUnitOfWorkProvider(), repositoryFactory, shipMethodService, 
      shipRateTierService, shipCountryService, invoiceService, orderService, taxMethodService,
      paymentService, paymentMethodService,
      notificationMethodService, notificationMessageService, warehouseService)
 { }
Esempio n. 36
0
        internal GatewayProviderService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory, 
            IShipMethodService shipMethodService, IShipRateTierService shipRateTierService, 
            IShipCountryService shipCountryService, 
            IInvoiceService invoiceService, 
            IOrderService orderService, 
            ITaxMethodService taxMethodService, 
            IPaymentService paymentService, 
            IPaymentMethodService paymentMethodService, 
            INotificationMethodService notificationMethodService, 
            INotificationMessageService notificationMessageService,
            IWarehouseService warehouseService)
        {
            Mandate.ParameterNotNull(provider, "provider");
            Mandate.ParameterNotNull(repositoryFactory, "repositoryFactory");
            Mandate.ParameterNotNull(shipMethodService, "shipMethodService");
            Mandate.ParameterNotNull(shipRateTierService, "shipRateTierService");
            Mandate.ParameterNotNull(shipCountryService, "shipCountryService");
            Mandate.ParameterNotNull(taxMethodService, "countryTaxRateService");
            Mandate.ParameterNotNull(paymentService, "paymentService");
            Mandate.ParameterNotNull(paymentMethodService, "paymentMethodService");
            Mandate.ParameterNotNull(invoiceService, "invoiceService");
            Mandate.ParameterNotNull(orderService, "orderService");
            Mandate.ParameterNotNull(notificationMethodService, "notificationMethodService");
            Mandate.ParameterNotNull(notificationMessageService, "notificationMessageService");
            Mandate.ParameterNotNull(warehouseService, "warehouseService");

            _uowProvider = provider;
            _repositoryFactory = repositoryFactory;
            _shipMethodService = shipMethodService;
            _shipRateTierService = shipRateTierService;
            _shipCountryService = shipCountryService;
            _invoiceService = invoiceService;
            _orderService = orderService;
            _taxMethodService = taxMethodService;
            _paymentService = paymentService;
            _paymentMethodService = paymentMethodService;
            _notificationMethodService = notificationMethodService;
            _notificationMessageService = notificationMessageService;
            _warehouseService = warehouseService;
        }
Esempio n. 37
0
 public void Init()
 {
     _warehouseService = PreTestDataWorker.WarehouseService;
 }
Esempio n. 38
0
		public SearchHelper(IWarehouseService service)
		{
			_warehouseBusinessService = service;
		}
Esempio n. 39
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="merchelloContext"></param>
 public WarehouseApiController(MerchelloContext merchelloContext)
     : base(merchelloContext)
 {
     _warehouseService = MerchelloContext.Services.WarehouseService;
 }
Esempio n. 40
0
 /// <summary>
 /// This is a helper contructor for unit testing
 /// </summary>
 internal WarehouseApiController(MerchelloContext merchelloContext, UmbracoContext umbracoContext)
     : base(merchelloContext, umbracoContext)
 {
     _warehouseService = MerchelloContext.Services.WarehouseService;
 }
Esempio n. 41
0
 public WarehouseController(IWarehouseService warehouseService)
 {
     _warehouseService = warehouseService;
 }
 static WarehouseHelper()
 {
     service = IoC.Resolve<IWarehouseService>("WarehouseService");
 }
Esempio n. 43
0
 public WeathersController(IWarehouseService service)
 {
     _service = service;
 }
Esempio n. 44
0
 internal GatewayProviderService(
     IDatabaseUnitOfWorkProvider provider, 
     RepositoryFactory repositoryFactory, 
     ILogger logger, 
     IShipMethodService shipMethodService, 
     IShipRateTierService shipRateTierService, 
     IShipCountryService shipCountryService, 
     IInvoiceService invoiceService, 
     IOrderService orderService, 
     ITaxMethodService taxMethodService, 
     IPaymentService paymentService, 
     IPaymentMethodService paymentMethodService, 
     INotificationMethodService notificationMethodService, 
     INotificationMessageService notificationMessageService,
     IWarehouseService warehouseService)
     : this(provider,
         repositoryFactory,
         logger,
         new TransientMessageFactory(),
         shipMethodService,
         shipRateTierService,
         shipCountryService,
         invoiceService,
         orderService,
         taxMethodService,
         paymentService,
         paymentMethodService,
         notificationMethodService,
         notificationMessageService,
         warehouseService)
 {
 }