Esempio n. 1
0
        public async Task<JsonResult> ReduceInventory(InventoryUpdateMessage message) {
            var hubContext = GlobalHost.ConnectionManager.GetHubContext<MicroHub>();
            var notifierService = new NotifierService(hubContext);
            var auditService = new AuditService(_db);
            var productService = new ProductService(_db);
            var inventoryService = new InventoryService(_db, notifierService, auditService, productService);

            await inventoryService.AllocateInventoryItem(message.SerialId);

            return Json(true);
        }
Esempio n. 2
0
        public ActionResult testView()
        {
            var hubContext = GlobalHost.ConnectionManager.GetHubContext<MicroHub>();
            var notifierService = new NotifierService(hubContext);
            var auditService = new AuditService(_db);
            var productService = new ProductService(_db);
            var inventoryService = new InventoryService(_db, notifierService, auditService, productService);

            

            //inventoryService.AllocateInventoryItem(message.SerialId);

            return View();
        }
Esempio n. 3
0
        public JsonResult Product()
        {

            var hubContext = GlobalHost.ConnectionManager.GetHubContext<MicroHub>();
            var notifierService = new NotifierService(hubContext);
            var auditService = new AuditService(_db);
            var productService = new ProductService(_db);
            var inventoryService = new InventoryService(_db, notifierService, auditService, productService);

            var products = this.ProductService.GetProducts().Select(p => new
            {
                Id = p.Id,
                Name = p.Name,
                Count = inventoryService.GetProductCount(p.Id),
                CategoryId = p.CategoryId,
                Description = p.Description,
                Price = p.Price,
                WebAvailable = p.WebAvailable,
            }
                );

            return Json(products, JsonRequestBehavior.AllowGet);

        }
Esempio n. 4
0
        public async Task DispatchSerial(InventoryUpdateMessage message) {
            var hubContext = GlobalHost.ConnectionManager.GetHubContext<MicroHub>();
            var notifierService = new NotifierService(hubContext);

            await notifierService.SendDispatchMessage(message);
        }