Beispiel #1
0
        public int InsertFeaturedBrandInCategory(int brandId, int categoryId)
        {
            CategoryFeaturedBrand newRow = new CategoryFeaturedBrand();

            newRow.CategoryId = categoryId;
            newRow.BrandId    = brandId;
            newRow.Priority   = 0;
            int id = _categoryFeaturedBrandRepository.Create(newRow);

            return(id);
        }
Beispiel #2
0
        public void DeleteFeaturedBrandListInCategory(int categoryId, IList <int> brandIdList)
        {
            for (int i = 0; i < brandIdList.Count; i++)
            {
                int brandId = brandIdList[i];
                CategoryFeaturedBrand fb = _categoryFeaturedBrandRepository.Table.FirstOrDefault(s => s.CategoryId == categoryId && s.BrandId == brandId);

                if (fb != null)
                {
                    _categoryFeaturedBrandRepository.Delete(fb);
                }
            }
        }