Beispiel #1
0
        public void Delete(int id)
        {
            CategoryDetailRepository categoryDetailRepository;
            BlobFileBO     blobFileBO;
            CategoryDetail categoryDetail;

            try
            {
                if (id == 0)
                {
                    throw new Exception("ID inválido");
                }
                else
                {
                    categoryDetailRepository = new CategoryDetailRepository(_loggerFactory, _config);
                    blobFileBO = new BlobFileBO(_loggerFactory, _config);

                    categoryDetail = Get(id);
                    if (categoryDetail != null)
                    {
                        if (!string.IsNullOrEmpty(categoryDetail.TitleIconID))
                        {
                            blobFileBO.Delete(categoryDetail.TitleIconID);
                        }
                        categoryDetailRepository.Delete(id);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public void Delete(long id)
        {
            ProductRepository productRepository;
            BlobFileBO        blobFileBO;
            Product           product;

            try
            {
                if (id == 0)
                {
                    throw new Exception("ID inválido");
                }
                else
                {
                    productRepository = new ProductRepository(_loggerFactory, _config);
                    blobFileBO        = new BlobFileBO(_loggerFactory, _config);

                    product = Get(id);
                    if (product != null)
                    {
                        if (!string.IsNullOrEmpty(product.ImageID))
                        {
                            blobFileBO.Delete(product.ImageID);
                        }
                        productRepository.Delete(id);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #3
0
        public void Delete(int id)
        {
            BrandRepository brandRepository;
            BlobFileBO      blobFileBO;
            Brand           brand;

            try
            {
                if (id == 0)
                {
                    throw new Exception("ID inválido");
                }
                else
                {
                    brandRepository = new BrandRepository(_loggerFactory, _config);
                    blobFileBO      = new BlobFileBO(_loggerFactory, _config);

                    brand = Get(id);
                    if (brand != null)
                    {
                        if (!string.IsNullOrEmpty(brand.DesktopSpotlightImageID))
                        {
                            blobFileBO.Delete(brand.DesktopSpotlightImageID);
                        }
                        if (!string.IsNullOrEmpty(brand.MobileSpotlightImageID))
                        {
                            blobFileBO.Delete(brand.MobileSpotlightImageID);
                        }

                        brandRepository.Delete(id);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #4
0
        public void Delete(int id)
        {
            CategoryRepository categoryRepository;
            BlobFileBO         blobFileBO;
            Category           category;

            try
            {
                if (id == 0)
                {
                    throw new Exception("ID inválido");
                }
                else
                {
                    categoryRepository = new CategoryRepository(_loggerFactory, _config);
                    blobFileBO         = new BlobFileBO(_loggerFactory, _config);

                    category = Get(id);
                    if (category != null)
                    {
                        if (!string.IsNullOrEmpty(category.DesktopSpotlightImageID))
                        {
                            blobFileBO.Delete(category.DesktopSpotlightImageID);
                        }
                        if (!string.IsNullOrEmpty(category.MobileSpotlightImageID))
                        {
                            blobFileBO.Delete(category.MobileSpotlightImageID);
                        }

                        categoryRepository.Delete(id);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #5
0
        public void Delete(string id)
        {
            BlobFileBO blobFileBO;

            try
            {
                if (!string.IsNullOrEmpty(id))
                {
                    throw new Exception("ID inválido");
                }
                else
                {
                    blobFileBO = new BlobFileBO(_loggerFactory, _config);

                    blobFileBO.Delete(id);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }