示例#1
0
        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);
        }
示例#2
0
        public ActionResult ManageSubCategories()
        {
            CategoryModel  objlist = new CategoryModel();

            objlist.Categories   = _adminRepository.GetAllCategory();

            return View(objlist);
        }
示例#3
0
        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);
        }
示例#4
0
 public ActionResult EditCategory(int id)
 {
     CategoryModel vm = new CategoryModel();
     vm.objcategory = _adminRepository.GetCategorybyId(id);
     return View("NewCategory", vm);
 }