Beispiel #1
0
        public async Task Delete_Return_InventoryId_Zero_Error()
        {
            var actual = await _service.Delete(0);

            Assert.AreEqual(actual.IsSucceeded, false);
            Assert.AreEqual("Inventory Id should be greater than zero", actual.GetErrorString());
        }
Beispiel #2
0
        public void Delete(int id)
        {
            _inventoryService.Delete(id);
            var unitOfWork = new UnitOfWork(_inventoryRepository.SCMSContext);

            unitOfWork.Complete();
        }
        public void Delete(InventoryDTO ret)
        {
            IWindowManager manager = new WindowManager();

            InventoryService.Delete(ret);
            Reload();
        }
Beispiel #4
0
 private void button6_Click(object sender, EventArgs e) //delete
 {
     if (this.inventory != null)
     {
         inventoryService.Delete(this.inventory);
         RefreshInventoryDataBinding();
     }
     ClearInventoryControlForm();
     this.product   = null;
     this.inventory = null;
 }
Beispiel #5
0
        public void InventoryServiceDelete_UnitOfWorkDeleteAndComplete_ReturnsUnitOfWorkDeleteAndComplete()
        {
            var inventory = new Inventory()
            {
                Name = "Test"
            };

            _uow.Inventories.Get(1).Returns(inventory);

            _inventoryService.Delete(1);

            _uow.Received().Inventories.Update(inventory);
            _uow.Received().Complete();
            Assert.That(inventory.IsDeleted, Is.EqualTo(true));
        }
 public void Delete(Inventory entity)
 => inventoryService.Delete(entity);
        public ActionResult ImportPackage(DeploymentViewModel.ImportViewModel importForm)
        {
            var           model         = _deploymentViewModelBuilder.Build(ShowExport());
            StructureInfo structureInfo = null;
            PackageInfo   packageInfo   = null;

            if (!ValidateImportForm(importForm))
            {
                return(View(nameof(Index), model));
            }
            _package.Type = importForm.PackageName;

            try
            {
                structureInfo = _package.GetStructureInfo();
                structureInfo.CreateExampleProducts = importForm.CreateExampleProducts;

                packageInfo      = _package.CreatePackageInfo(structureInfo, importForm.Name, importForm.DomainName);
                model.ShowImport = true;
                model.CanImport  = true;

                Solution.Instance.SearchService.IndexJobConsumer.Stop();

                _packageService.Import(structureInfo, packageInfo);
                _structureInfoService.UpdatePropertyReferences(structureInfo, packageInfo);
                model.ImportMessage = "accelerator.deployment.import.success".AsAngularResourceString();
            }
            catch (Exception e)
            {
                _logger.LogError(e, "Package installation error.");
                model.ImportMessage = "accelerator.deployment.error".AsAngularResourceString();
                try
                {
                    foreach (var variant in structureInfo.ProductCatalog.Variants)
                    {
                        var newVariant = _variantService.Get(structureInfo.Id(variant.SystemId));
                        if (newVariant != null)
                        {
                            _variantService.Delete(newVariant);
                        }
                    }

                    foreach (var product in structureInfo.ProductCatalog.BaseProducts)
                    {
                        var newProduct = _baseProductService.Get(structureInfo.Id(product.SystemId));
                        if (newProduct != null)
                        {
                            _baseProductService.Delete(newProduct);
                        }
                    }

                    foreach (var category in structureInfo.ProductCatalog.Categories)
                    {
                        var newCategory = _categoryService.Get(structureInfo.Id(category.SystemId));
                        if (newCategory != null)
                        {
                            _categoryService.Delete(newCategory);
                        }
                    }

                    _channelService.Delete(packageInfo.Channel);
                    _marketService.Delete(packageInfo.Market);
                    _websiteService.Delete(packageInfo.Website);
                    _assortmentService.Delete(packageInfo.Assortment);
                    _folderService.Delete(packageInfo.Folder);
                    _inventoryService.Delete(packageInfo.Inventory);
                    _priceListService.Delete(packageInfo.PriceList);
                }
                catch (Exception ee)
                {
                    _logger.LogError(ee, "Package installation cleanup error.");
                }
            }
            finally
            {
                Solution.Instance.SearchService.IndexJobConsumer.Start();
            }

            return(View(nameof(Index), model));
        }
 public bool DeleteInventoryItem(int id)
 {
     //return _fixedService.Delete(id);
     return(_service.Delete(id));
 }