public ConsumerBackgroundService(Serilog.ILogger logger, CategorysService categoryService,
                                  SpecificationsService specificationService,
                                  SpecificationsGroupService specificationGroupService,
                                  BrandsService brandsService,
                                  ProductsService productService,
                                  SKUService SKUService,
                                  SpecificationValuesService specificationValuesService,
                                  ProductSpecificationsService productSpecificationsService,
                                  SKUSpecificationsService SKUSpecificationsService,
                                  SKUFilesService SKUFilesService,
                                  InventoryService inventoryService,
                                  PricesService pricesService,
                                  MotosService motosService,
                                  FeedService feedService,
                                  OrderService ordersService)
 {
     _logger                       = logger;
     _categoryService              = categoryService;
     _specificationService         = specificationService;
     _specificationGroupService    = specificationGroupService;
     _brandsService                = brandsService;
     _productService               = productService;
     _SKUService                   = SKUService;
     _specificationValuesService   = specificationValuesService;
     _productSpecificationsService = productSpecificationsService;
     _SKUSpecificationsService     = SKUSpecificationsService;
     _SKUFilesService              = SKUFilesService;
     _inventoryService             = inventoryService;
     _pricesService                = pricesService;
     _motosService                 = motosService;
     _feedService                  = feedService;
     _ordersService                = ordersService;
 }
Beispiel #2
0
        public void ScenarioA()
        {
            SKUService sKUService = new SKUService();
            ISku       sku        = sKUService;

            List <SKU> skuScenarioA = new List <SKU>
            {
                new SKU {
                    Id = "a"
                },
                new SKU {
                    Id = "b"
                },
                new SKU {
                    Id = "c"
                }
            };

            foreach (SKU pr in skuScenarioA)
            {
                sku.GetPriceByType(pr);
            }

            int output = sku.GetTotalPrice(skuScenarioA);

            Assert.AreEqual(100, output);
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            SKUService sKUService = new SKUService();
            ISku       sku        = sKUService;
            List <SKU> skus       = new List <SKU>();

            Console.WriteLine("Total number of orders");
            int a = Convert.ToInt32(Console.ReadLine());

            for (int i = 0; i < a; i++)
            {
                Console.WriteLine("Enter the type of product:A,B,C or D");
                string type = Console.ReadLine();
                SKU    p    = new SKU(type);
                skus.Add(p);
                sku.GetPriceByType(p);
            }

            int totalPrice = sku.GetTotalPrice(skus);

            Console.WriteLine(totalPrice);
            Console.ReadLine();
        }
Beispiel #4
0
    /// <summary>
    /// 
    /// </summary>
    /// <param name="ds"></param>
    /// <param name="appSettings"></param>
    /// <param name="connString"></param>
    private void UploadProductRetailPrice(ZNode.Libraries.Framework.Business.ZNodeGenericCollection<ProductSKUEntity> ProdSKUList, string connString)
    {
        #region Local Variable Declaration
        SqlConnection conn = new SqlConnection(connString);
        ZNode.Libraries.DataAccess.Service.ProductService ProductServ = new ProductService();
        ZNode.Libraries.DataAccess.Service.SKUService ProductSKUServ = new SKUService();
        ZNode.Libraries.DataAccess.Service.AddOnValueService ProductAddOnValueServ = new AddOnValueService();
        #endregion

        foreach (ProductSKUEntity entity in ProdSKUList)
        {
            SKU _sku = new SKU();

            //Update Prodcut table
            int ProductID = GetProductBySKU(entity.SKU, connString);

            if (ProductID > 0)
            {
                Product _productObject = ProductServ.GetByProductID(ProductID);
                _productObject.RetailPrice = entity.RetailPrice;
                _productObject.SalePrice = entity.SalePrice;
                _productObject.WholesalePrice = entity.WholesalePrice;
                _productObject.UpdateDte = System.DateTime.Now;

                ProductServ.Update(_productObject);
            }

            //Update SKU table
            int SkuId = GetSkuID(entity.SKU, connString);

            if (SkuId > 0)
            {
                _sku = ProductSKUServ.GetBySKUID(SkuId);
                //Set Quantity available value
                _sku.RetailPriceOverride = entity.RetailPrice;
                _sku.SalePriceOverride = entity.SalePrice;
                _sku.WholesalePriceOverride = entity.WholesalePrice;

                _sku.UpdateDte = System.DateTime.Now;

                //Upate SKU
                ProductSKUServ.Update(_sku);
            }

            //Update Add-On table
            AddOnValue _addOnvalue = new AddOnValue();

            int AddOnValueId = GetSkuIDByAddOnValueSKU(entity.SKU, connString);

            if (AddOnValueId > 0)
            {
                _addOnvalue = ProductAddOnValueServ.GetByAddOnValueID(AddOnValueId);

                _addOnvalue.RetailPrice = entity.RetailPrice;
                _addOnvalue.SalePrice = entity.SalePrice;
                _addOnvalue.WholesalePrice = entity.WholesalePrice;

                _addOnvalue.UpdateDte = System.DateTime.Now;

                ProductAddOnValueServ.Update(_addOnvalue);
            }
        }
    }
Beispiel #5
0
    /// <summary>
    /// 
    /// </summary>
    /// <param name="ProductList"></param>
    private void InsertDefaultSKU(TList<SKUEntity> SKUList)
    {
        string ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["ZNodeECommerceDB"].ConnectionString;
        ZNode.Libraries.DataAccess.Service.SKUService ProductSKUServ = new SKUService();

        foreach (SKUEntity entity in SKUList)
        {
            SKU _sku = new SKU();

            int Productid = GetProductID(entity.ProductNum, ConnectionString);
            int SkuId = GetSkuID(entity.SKU, ConnectionString);

            if (Productid == 0)
            {
                break;
            }

            //Set Properties
            _sku.QuantityOnHand = entity.QuantityOnHand;
            _sku.ProductID = Productid;

            if (entity.RetailPriceOverride.HasValue)
            {
                _sku.RetailPriceOverride = entity.RetailPriceOverride.Value;
            }
            _sku.SKU = entity.SKU;

            if (SkuId > 0)
            {
                _sku.UpdateDte = System.DateTime.Now;
                ProductSKUServ.Update(_sku);
            }
            else
            {
                ProductSKUServ.Insert(_sku);
            }

        }
    }