public ActionResult SaveSubCategory(SubCategory subCategory) { if (Request.Form["SubCategoryId"] == "0") { _adminRepository.AddSubCategory(subCategory); } else { _adminRepository.UpdateSubCategory_1(subCategory); } CategoryModel objlist = new CategoryModel(); objlist.Categories = _adminRepository.GetAllCategory(); return View("ManageSubCategories", objlist); }
public ActionResult ManageSubCategories() { CategoryModel objlist = new CategoryModel(); objlist.Categories = _adminRepository.GetAllCategory(); return View(objlist); }
public ActionResult SaveCategory(Category Category) { if (Request.Form["CategoryId"] == "0") { _adminRepository.AddCategory(Category); } else { _adminRepository.UpdateCategory_1 (Category); } CategoryModel vm = new CategoryModel(); vm.Categories = _adminRepository.GetAllCategory (); return View("ManageCategories", vm); }
public ActionResult EditCategory(int id) { CategoryModel vm = new CategoryModel(); vm.objcategory = _adminRepository.GetCategorybyId(id); return View("NewCategory", vm); }