Пример #1
0
        public ActionResult Menu(string TypeMenu)
        {
            if (Session["isLoginAdmin"] != null && bool.Parse(Session["isLoginAdmin"].ToString()) == true)
            {
                switch (TypeMenu)
                {
                case "User":
                    ViewBag.DataList = UserAPIController.GetAllUser();
                    break;

                case "Category":
                    ViewBag.DataList = CategoryAPIController.getAllCategoryAdmin();
                    break;

                case "Product":
                    ViewBag.DataList = ProductAPIController.GetAllProduct();
                    break;
                }
                ViewBag.Type = TypeMenu;
                ViewBag.Size = ViewBag.DataList.Count;
                return(View());
            }
            else
            {
                return(Redirect("/Admin/Login"));
            }
        }