コード例 #1
0
        public ActionResult ManageTypeAndBrand(bool IsBrand)
        {
            int NidCategory = int.Parse(TempData["NidEditcategory"].ToString());

            dbTransfer = new DbTransfer();
            CategoryAndBrandViewModel cbvm = new CategoryAndBrandViewModel();

            if (NidCategory != -1)
            {
                Category category = dbTransfer.GetCategoryByNidCategory(NidCategory);
                if (IsBrand)
                {
                    cbvm.category_Brand = category.Category_Brands.ToList();
                    cbvm.IsBrand        = true;
                }
                else
                {
                    cbvm.category_Type = category.Category_Types.ToList();
                    cbvm.IsBrand       = false;
                }
                cbvm.NidCategory  = category.NidCategory;
                cbvm.CategoryName = category.CategoryName;
            }

            return(View(cbvm));
        }
コード例 #2
0
        public ActionResult SyncBnTTable(bool IsBrand, int NidCategory)
        {
            CategoryAndBrandViewModel cbvm = new CategoryAndBrandViewModel();

            if (NidCategory != -1)
            {
                dbTransfer = new DbTransfer();
                if (IsBrand)
                {
                    cbvm.category_Brand = dbTransfer.GetCategoryByNidCategory(NidCategory).Category_Brands.ToList();
                    cbvm.IsBrand        = true;
                }
                else
                {
                    cbvm.category_Type = dbTransfer.GetCategoryByNidCategory(NidCategory).Category_Types.ToList();
                    cbvm.IsBrand       = false;
                }
            }
            else
            {
                cbvm.IsBrand = true;
            }
            return(Json(new JsonResults()
            {
                HasValue = true, Html = RenderViewToString(this.ControllerContext, "_BnTTable", cbvm)
            }));
        }
コード例 #3
0
        public IViewComponentResult Invoke()
        {
            var CategoryBrandViewModel = new CategoryAndBrandViewModel
            {
                Categories = _categoryRepository.AllCategories.OrderBy(c => c.Cat_Name),
                Brands     = _brandRepository.AllBrands.OrderBy(c => c.Brand_Name)
            };

            return(View(CategoryBrandViewModel));
        }
コード例 #4
0
        public IViewComponentResult Invoke()
        {
            var categoryAndBrandViewModel = new CategoryAndBrandViewModel
            {
                Categories = categoryRepository.AllCategories.OrderBy(c => c.CategoryName).ToList(),
                Brands     = brandRepository.AllBrands.OrderBy(b => b.BrandName).ToList()
            };

            return(View(categoryAndBrandViewModel));
        }
コード例 #5
0
        public ActionResult GetBnTOptions(int NidCategory, bool IsBrand)
        {
            dbTransfer = new DbTransfer();
            CategoryAndBrandViewModel cbvm = new CategoryAndBrandViewModel();

            if (IsBrand)
            {
                cbvm.category_Brand = dbTransfer.GetCategoryBrandsByNidCategory(NidCategory);
            }
            else
            {
                cbvm.category_Type = dbTransfer.GetCategoryTypesByNidCategory(NidCategory);
            }
            cbvm.IsBrand = IsBrand;
            return(Json(new JsonResults()
            {
                HasValue = true, Html = RenderViewToString(this.ControllerContext, "_BnTOptions", cbvm)
            }));
        }