Beispiel #1
0
        //
        // 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);
        }
Beispiel #2
0
        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);
        }