// // GET: /Admin/Category/ public ActionResult Index() { if (Session["UserId"] == null) { return Redirect("/admin/login"); } CategoryModel model = new CategoryModel(); CategoryService categoryService = new CategoryService(); model.Categories = categoryService.GetCategories(null); return View(model); }
public ActionResult Edit(string id) { if (Session["UserId"] == null) { return Redirect("/admin/login"); } CategoryModel model = new CategoryModel(); CategoryService categoryService = new CategoryService(); model.Category = categoryService.GetCategoryById(id); return View(model); }