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)); }
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) })); }
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)); }
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)); }
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) })); }